SICOPOLIS V3.2
 All Classes Files Functions Variables Macros
mask_update.F90
Go to the documentation of this file.
1 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 !
3 ! Function : m a s k _ u p d a t e
4 !
5 !> @file
6 !!
7 !! Update of the topography mask due to changes of the sea level.
8 !!
9 !! @section Copyright
10 !!
11 !! Copyright 2009-2016 Ralf Greve
12 !!
13 !! @section License
14 !!
15 !! This file is part of SICOPOLIS.
16 !!
17 !! SICOPOLIS is free software: you can redistribute it and/or modify
18 !! it under the terms of the GNU General Public License as published by
19 !! the Free Software Foundation, either version 3 of the License, or
20 !! (at your option) any later version.
21 !!
22 !! SICOPOLIS is distributed in the hope that it will be useful,
23 !! but WITHOUT ANY WARRANTY; without even the implied warranty of
24 !! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 !! GNU General Public License for more details.
26 !!
27 !! You should have received a copy of the GNU General Public License
28 !! along with SICOPOLIS. If not, see <http://www.gnu.org/licenses/>.
29 !<
30 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
31 
32 !-------------------------------------------------------------------------------
33 !> Update of the topography mask due to changes of the sea level.
34 !<------------------------------------------------------------------------------
35 function mask_update(z_sl, i, j)
36 
37 use sico_types
39 use sico_vars
40 
41 implicit none
42 integer(i2b) :: mask_update
43 integer(i4b), intent(in) :: i, j
44 real(dp), intent(in) :: z_sl
45 
46 real(dp) :: rhosw_rho_ratio, h_ice, h_sea
47 
48 rhosw_rho_ratio = rho_sw/rho
49 
50 !-------- Previously ice-free land point or sea point --------
51 
52 if ( (maske(j,i) == 1_i2b).or.(maske(j,i) == 2_i2b) ) then
53 
54  if (zl(j,i) > z_sl) then
55  mask_update = 1_i2b ! now ice-free land
56  return
57  else
58  mask_update = 2_i2b ! now sea point
59  return
60  end if
61 
62 !-------- Previously glaciated land point or floating-ice point!
63 
64 else ! (maske(j,i) == 0_i2b, 3_i2b)
65 
66  if (zl(j,i) > z_sl) then
67 
68  mask_update = 0_i2b ! now grounded ice
69  return
70 
71  else
72 
73  h_ice = zs(j,i)-zb(j,i) ! ice thickness
74  h_sea = z_sl -zl(j,i) ! sea depth
75 
76  if ( h_ice < (rhosw_rho_ratio*h_sea) ) then
77 
78 #if ( MARGIN==1 || ( MARGIN==2 && MARINE_ICE_FORMATION==1 ) )
79  mask_update = 2_i2b ! ice becomes floating, therefore
80  ! now sea point (ice cut off)
81 #elif ( MARGIN==2 && MARINE_ICE_FORMATION==2 )
82  mask_update = 0_i2b ! now "underwater ice"
83 #elif ( MARGIN==3 )
84  mask_update = 3_i2b ! now floating ice
85 #endif
86  return
87 
88  else
89 
90  mask_update = 0_i2b ! now grounded ice
91  return
92 
93  end if
94 
95  end if
96 
97 end if
98 
99 end function mask_update
100 !
integer(i2b) function mask_update(z_sl, i, j)
Update of the topography mask due to changes of the sea level.
Definition: mask_update.F90:35
Declarations of kind types for SICOPOLIS.
Definition: sico_types.F90:35
Declarations of global variables for SICOPOLIS (for the ANT domain).
Definition: sico_vars.F90:35
Declarations of global variables for SICOPOLIS.