46 real(dp),
intent(out) :: dxi, deta
48 integer(i4b) :: i, j, n
51 real(dp) :: h_ice, freeboard_ratio
54 character(len= 8) :: ch_imax
55 character(len=128) :: fmt4
57 write(ch_imax, fmt=
'(i8)') imax
58 write(fmt4, fmt=
'(a)')
'('//trim(adjustl(ch_imax))//
'(i1),i1)'
62 open(21, iostat=ios, &
63 file=inpath//
'/nhem/'//zs_present_file, &
64 recl=16384, status=
'old')
66 if (ios.ne.0) stop
' topography1: Error when opening the zs file!'
68 open(22, iostat=ios, &
69 file=inpath//
'/nhem/'//zl_present_file, &
70 recl=16384, status=
'old')
72 if (ios.ne.0) stop
' topography1: Error when opening the zl file!'
74 open(23, iostat=ios, &
75 file=inpath//
'/nhem/'//zl0_file, &
76 recl=16384, status=
'old')
78 if (ios.ne.0) stop
' topography1: Error when opening the zl0 file!'
80 open(24, iostat=ios, &
81 file=inpath//
'/nhem/'//mask_present_file, &
82 recl=1024, status=
'old')
84 if (ios.ne.0) stop
' topography1: Error when opening the mask file!'
86 do n=1, 6;
read(21, fmt=
'(a)') ch_dummy;
end do
87 do n=1, 6;
read(22, fmt=
'(a)') ch_dummy;
end do
88 do n=1, 6;
read(23, fmt=
'(a)') ch_dummy;
end do
89 do n=1, 6;
read(24, fmt=
'(a)') ch_dummy;
end do
92 read(21, fmt=*) (zs(j,i), i=0,imax)
93 read(22, fmt=*) (zl(j,i), i=0,imax)
94 read(23, fmt=*) (zl0(j,i), i=0,imax)
95 read(24, fmt=trim(fmt4)) (maske(j,i), i=0,imax)
98 close(21, status=
'keep')
99 close(22, status=
'keep')
100 close(23, status=
'keep')
101 close(24, status=
'keep')
111 freeboard_ratio = (rho_sw-rho)/rho_sw
116 if (maske(j,i) <= 1 )
then
120 else if (maske(j,i) == 2 )
then
122 #if ( MARGIN==1 || MARGIN==2 )
130 else if (maske(j,i) == 3 )
then
132 #if ( MARGIN==1 || ( MARGIN==2 && MARINE_ICE_FORMATION==1 ) )
136 #elif ( MARGIN==2 && MARINE_ICE_FORMATION==2 )
138 h_ice = zs(j,i)-zb(j,i)
139 zs(j,i) = zl(j,i)+h_ice
142 h_ice = zs(j,i)-zb(j,i)
143 zs(j,i) = freeboard_ratio*h_ice
144 zb(j,i) = zs(j,i)-h_ice
149 xi(i) = xi0 +
real(i,dp)*dxi
150 eta(j) = eta0 +
real(j,dp)*deta
152 call
geo_coord(phi(j,i), lambda(j,i), xi(i), eta(j))
157 h_c(j,i) = zs(j,i)-zm(j,i)
160 dzs_dtau(j,i) = 0.0_dp
161 dzm_dtau(j,i) = 0.0_dp
162 dzb_dtau(j,i) = 0.0_dp
163 dzl_dtau(j,i) = 0.0_dp
164 dh_c_dtau(j,i) = 0.0_dp
165 dh_t_dtau(j,i) = 0.0_dp
184 area(j,i) = sq_g11_g(j,i)*sq_g22_g(j,i)*dxi*deta