7 !! Definition of the initial surface and bedrock topography
8 !! (including gradients) and of the horizontal grid spacings dxi, deta.
9 !! For present-day initial topography.
13 !! Copyright 2009-2013 Ralf Greve
17 !! This file is part of SICOPOLIS.
19 !! SICOPOLIS is free software: you can redistribute it and/or modify
20 !! it under the terms of the GNU General Public License as published by
21 !! the Free Software Foundation, either version 3 of the License, or
22 !! (at your option) any later version.
24 !! SICOPOLIS is distributed in the hope that it will be useful,
25 !! but WITHOUT ANY WARRANTY; without even the implied warranty of
26 !! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 !! GNU General Public License for more details.
29 !! You should have received a copy of the GNU General Public License
30 !! along with SICOPOLIS. If not, see <http://www.gnu.org/licenses/>.
32 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
35 !> Definition of the initial surface and bedrock topography
36 !! (including gradients) and of the horizontal grid spacings dxi, deta.
37 !! For present-day initial topography.
38 !<------------------------------------------------------------------------------
45 integer(i4b) :: i, j, n
46 integer(i4b) :: ios, n_dummy
50 real(dp) :: h_ice, freeboard_ratio
55 open(21, iostat=ios, &
56 file=inpath//
'/grl/'//zs_present_file, &
57 recl=8192, status=
'old')
59 if (ios.ne.0) stop
' topography1: Error when opening the zs file!'
61 open(22, iostat=ios, &
62 file=inpath//
'/grl/'//zl_present_file, &
63 recl=8192, status=
'old')
65 if (ios.ne.0) stop
' topography1: Error when opening the zl file!'
67 open(23, iostat=ios, &
68 file=inpath//
'/grl/'//zl0_file, &
69 recl=8192, status=
'old')
71 if (ios.ne.0) stop
' topography1: Error when opening the zl0 file!'
73 open(24, iostat=ios, &
74 file=inpath//
'/grl/'//mask_present_file, &
75 recl=1024, status=
'old')
77 if (ios.ne.0) stop
' topography1: Error when opening the mask file!'
79 do n=1, 6;
read(21,
'(a)') ch_dummy;
end do
80 do n=1, 6;
read(22,
'(a)') ch_dummy;
end do
81 do n=1, 6;
read(23,
'(a)') ch_dummy;
end do
82 do n=1, 6;
read(24,
'(a)') ch_dummy;
end do
85 read(21,*) (zs(j,i), i=0,imax)
86 read(22,*) (zl(j,i), i=0,imax)
87 read(23,*) (zl0(j,i), i=0,imax)
88 read(24,2300) (maske(j,i), i=0,imax)
91 close(21, status=
'keep')
92 close(22, status=
'keep')
93 close(23, status=
'keep')
94 close(24, status=
'keep')
96 2300 format(imax(i1),i1)
106 freeboard_ratio = (rho_sw-rho)/rho_sw
111 if (maske(j,i) <= 1 )
then
115 else if (maske(j,i) == 2 )
then
117 #if ( MARGIN==1 || MARGIN==2 )
125 else if (maske(j,i) == 3 )
then
127 #if ( MARGIN==1 || ( MARGIN==2 && MARINE_ICE_FORMATION==1 ) )
131 #elif ( MARGIN==2 && MARINE_ICE_FORMATION==2 )
133 h_ice = zs(j,i)-zb(j,i)
134 zs(j,i) = zl(j,i)+h_ice
137 h_ice = zs(j,i)-zb(j,i)
138 zs(j,i) = freeboard_ratio*h_ice
139 zb(j,i) = zs(j,i)-h_ice
144 xi(i) = xi0 +
real(i,dp)*dxi
145 eta(j) = eta0 +
real(j,dp)*deta
147 call
geo_coord(phi(j,i), lambda(j,i), xi(i), eta(j))
152 h_c(j,i) = zs(j,i)-zm(j,i)
155 dzs_dtau(j,i) = 0.0_dp
156 dzm_dtau(j,i) = 0.0_dp
157 dzb_dtau(j,i) = 0.0_dp
158 dzl_dtau(j,i) = 0.0_dp
159 dh_c_dtau(j,i) = 0.0_dp
160 dh_t_dtau(j,i) = 0.0_dp
181 area(j,i) = sq_g11_g(j,i)*sq_g22_g(j,i)*dxi*deta