46 real(dp),
intent(out) :: dxi, deta
48 integer(i4b) :: i, j, n
49 integer(i4b) :: ios, n_dummy
52 real(dp) :: h_ice, freeboard_ratio
55 character(len= 8) :: ch_imax
56 character(len=128) :: fmt4
58 write(ch_imax, fmt=
'(i8)') imax
59 write(fmt4, fmt=
'(a)')
'('//trim(adjustl(ch_imax))//
'(i1),i1)'
63 open(21, iostat=ios, &
64 file=inpath//
'/ant/'//zs_present_file, &
65 recl=8192, status=
'old')
67 if (ios /= 0) stop
' topography1: Error when opening the zs file!'
69 open(25, iostat=ios, &
70 file=inpath//
'/ant/'//zb_present_file, &
71 recl=8192, status=
'old')
73 if (ios /= 0) stop
' topography1: Error when opening the zb file!'
75 open(22, iostat=ios, &
76 file=inpath//
'/ant/'//zl_present_file, &
77 recl=8192, status=
'old')
79 if (ios /= 0) stop
' topography1: Error when opening the zl file!'
81 open(23, iostat=ios, &
82 file=inpath//
'/ant/'//zl0_file, &
83 recl=8192, status=
'old')
85 if (ios /= 0) stop
' topography1: Error when opening the zl0 file!'
87 open(24, iostat=ios, &
88 file=inpath//
'/ant/'//mask_present_file, &
89 recl=1024, status=
'old')
91 if (ios /= 0) stop
' topography1: Error when opening the mask file!'
93 do n=1, 6;
read(21, fmt=
'(a)') ch_dummy;
end do
94 do n=1, 6;
read(25, fmt=
'(a)') ch_dummy;
end do
95 do n=1, 6;
read(22, fmt=
'(a)') ch_dummy;
end do
96 do n=1, 6;
read(23, fmt=
'(a)') ch_dummy;
end do
97 do n=1, 6;
read(24, fmt=
'(a)') ch_dummy;
end do
100 read(21, fmt=*) (zs(j,i), i=0,imax)
101 read(25, fmt=*) (zb(j,i), i=0,imax)
102 read(22, fmt=*) (zl(j,i), i=0,imax)
103 read(23, fmt=*) (zl0(j,i), i=0,imax)
104 read(24, fmt=trim(fmt4)) (maske(j,i), i=0,imax)
107 close(21, status=
'keep')
108 close(25, status=
'keep')
109 close(22, status=
'keep')
110 close(23, status=
'keep')
111 close(24, status=
'keep')
121 freeboard_ratio = (rho_sw-rho)/rho_sw
126 if (maske(j,i) <= 1 )
then
130 else if (maske(j,i) == 2 )
then
132 #if ( MARGIN==1 || MARGIN==2 )
140 else if (maske(j,i) == 3 )
then
142 #if ( MARGIN==1 || ( MARGIN==2 && MARINE_ICE_FORMATION==1 ) )
146 #elif ( MARGIN==2 && MARINE_ICE_FORMATION==2 )
148 h_ice = zs(j,i)-zb(j,i)
149 zs(j,i) = zl(j,i)+h_ice
152 h_ice = zs(j,i)-zb(j,i)
153 zs(j,i) = freeboard_ratio*h_ice
154 zb(j,i) = zs(j,i)-h_ice
159 xi(i) = xi0 +
real(i,dp)*dxi
160 eta(j) = eta0 +
real(j,dp)*deta
162 call
geo_coord(phi(j,i), lambda(j,i), xi(i), eta(j))
167 h_c(j,i) = zs(j,i)-zm(j,i)
170 dzs_dtau(j,i) = 0.0_dp
171 dzm_dtau(j,i) = 0.0_dp
172 dzb_dtau(j,i) = 0.0_dp
173 dzl_dtau(j,i) = 0.0_dp
174 dh_c_dtau(j,i) = 0.0_dp
175 dh_t_dtau(j,i) = 0.0_dp
194 area(j,i) = sq_g11_g(j,i)*sq_g22_g(j,i)*dxi*deta