SICOPOLIS V3.2
 All Classes Files Functions Variables Macros
topography1.F90
Go to the documentation of this file.
1 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 !
3 ! Subroutine : t o p o g r a p h y 1
4 !
5 !> @file
6 !!
7 !! Definition of the initial surface and bedrock topography
8 !! (including gradients) and of the horizontal grid spacings dxi, deta.
9 !! For an initial topography with a thin ice layer (thickness 2*H_MIN)
10 !! everywhere on the land area.
11 !!
12 !! @section Copyright
13 !!
14 !! Copyright 2009-2016 Ralf Greve
15 !!
16 !! @section License
17 !!
18 !! This file is part of SICOPOLIS.
19 !!
20 !! SICOPOLIS is free software: you can redistribute it and/or modify
21 !! it under the terms of the GNU General Public License as published by
22 !! the Free Software Foundation, either version 3 of the License, or
23 !! (at your option) any later version.
24 !!
25 !! SICOPOLIS is distributed in the hope that it will be useful,
26 !! but WITHOUT ANY WARRANTY; without even the implied warranty of
27 !! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 !! GNU General Public License for more details.
29 !!
30 !! You should have received a copy of the GNU General Public License
31 !! along with SICOPOLIS. If not, see <http://www.gnu.org/licenses/>.
32 !<
33 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
34 
35 !-------------------------------------------------------------------------------
36 !> Definition of the initial surface and bedrock topography
37 !! (including gradients) and of the horizontal grid spacings dxi, deta.
38 !! For an initial topography with a thin ice layer (thickness 2*H_MIN)
39 !! everywhere on the land area.
40 !<------------------------------------------------------------------------------
41 subroutine topography1(dxi, deta)
42 
43 use sico_types
45 use sico_vars
46 
47 implicit none
48 
49 real(dp), intent(out) :: dxi, deta
50 
51 integer(i4b) :: i, j, n
52 integer(i4b) :: ios, n_dummy
53 real(dp) :: d_dummy
54 real(dp) :: xi0, eta0
55 character :: ch_dummy
56 
57 character(len= 8) :: ch_imax
58 character(len=128) :: fmt4
59 
60 write(ch_imax, fmt='(i8)') imax
61 write(fmt4, fmt='(a)') '('//trim(adjustl(ch_imax))//'(i1),i1)'
62 
63 !-------- Set topography --------
64 
65 zl0 = 0.0_dp
66 
67 open(24, iostat=ios, &
68  file=inpath//'/'//trim(ch_domain_short)//'/'//mask_present_file, &
69  recl=1024, status='old')
70 
71 if (ios /= 0) stop ' topography1: Error when opening the mask file!'
72 
73 do n=1, 6; read(24, fmt='(a)') ch_dummy; end do
74 
75 do j=jmax, 0, -1
76  read(24, fmt=trim(fmt4)) (maske(j,i), i=0,imax)
77 end do
78 
79 close(24, status='keep')
80 
81 !-------- Further stuff --------
82 
83 #if (GRID==0 || GRID==1)
84 
85 dxi = dx *1000.0_dp ! km -> m
86 deta = dx *1000.0_dp ! km -> m
87 
88 xi0 = x0 *1000.0_dp ! km -> m
89 eta0 = y0 *1000.0_dp ! km -> m
90 
91 #elif (GRID==2)
92 
93 stop ' topography1: GRID==2 not allowed for this application!'
94 
95 #endif
96 
97 do i=0, imax
98 do j=0, jmax
99 
100  zs(j,i) = zl0(j,i)
101  zb(j,i) = zl0(j,i)
102  zl(j,i) = zl0(j,i)
103 
104  if (maske(j,i) <= 1) then
105  maske(j,i) = 0
106  zs(j,i) = zs(j,i) + 2.0_dp*h_min
107  end if
108 
109  xi(i) = xi0 + real(i,dp)*dxi
110  eta(j) = eta0 + real(j,dp)*deta
111 
112  call geo_coord(phi(j,i), lambda(j,i), xi(i), eta(j))
113 
114  zm(j,i) = zb(j,i)
115  n_cts(j,i) = -1
116  kc_cts(j,i) = 0
117 
118  h_c(j,i) = zs(j,i)-zm(j,i)
119  h_t(j,i) = 0.0_dp
120 
121  dzs_dtau(j,i) = 0.0_dp
122  dzm_dtau(j,i) = 0.0_dp
123  dzb_dtau(j,i) = 0.0_dp
124  dzl_dtau(j,i) = 0.0_dp
125  dh_c_dtau(j,i) = 0.0_dp
126  dh_t_dtau(j,i) = 0.0_dp
127 
128 end do
129 end do
130 
131 !-------- Metric tensor, gradients of the topography --------
132 
133 call metric()
134 
135 #if (TOPOGRAD==0)
136 call topograd_1(dxi, deta, 1)
137 #elif (TOPOGRAD==1)
138 call topograd_2(dxi, deta, 1)
139 #endif
140 
141 !-------- Corresponding area of grid points --------
142 
143 do i=0, imax
144 do j=0, jmax
145  area(j,i) = sq_g11_g(j,i)*sq_g22_g(j,i)*dxi*deta
146 end do
147 end do
148 
149 end subroutine topography1
150 !
subroutine topograd_2(dxi, deta, n_switch)
Calculation of topography gradients on the staggered grid and on the grid points (the latter by fourt...
Definition: topograd_2.F90:41
subroutine topography1(dxi, deta)
Definition of the initial surface and bedrock topography (including gradients) and of the horizontal ...
Definition: topography1.F90:39
Declarations of kind types for SICOPOLIS.
Definition: sico_types.F90:35
subroutine topograd_1(dxi, deta, n_switch)
Calculation of topography gradients on the staggered grid and on the grid points (the latter by secon...
Definition: topograd_1.F90:41
Declarations of global variables for SICOPOLIS (for the ANT domain).
Definition: sico_vars.F90:35
subroutine geo_coord(phi_val, lambda_val, x_val, y_val)
Computation of longitude lambda and latitude phi for position (x,y) in the numerical domain...
Definition: geo_coord.F90:37
subroutine metric()
Definition of the components g11 and g22 of the metric tensor of the applied coordinates.
Definition: metric.F90:37
Declarations of global variables for SICOPOLIS.