SICOPOLIS V3.1
 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-2013 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 
40 implicit none
41 integer(i2b) :: mask_update
42 integer(i4b), intent(in) :: i, j
43 real(dp), intent(in) :: z_sl
44 
45 real(dp) :: rhosw_rho_ratio, h_ice, h_sea
46 
47 rhosw_rho_ratio = rho_sw/rho
48 
49 !-------- Previously ice-free land point or sea point --------
50 
51 if ( (maske(j,i) == 1_i2b).or.(maske(j,i) == 2_i2b) ) then
52 
53  if (zl(j,i) > z_sl) then
54  mask_update = 1_i2b ! now ice-free land
55  return
56  else
57  mask_update = 2_i2b ! now sea point
58  return
59  end if
60 
61 !-------- Previously glaciated land point or floating-ice point!
62 
63 else ! (maske(j,i) == 0_i2b, 3_i2b)
64 
65  if (zl(j,i) > z_sl) then
66 
67  mask_update = 0_i2b ! now grounded ice
68  return
69 
70  else
71 
72  h_ice = zs(j,i)-zb(j,i) ! ice thickness
73  h_sea = z_sl -zl(j,i) ! sea depth
74 
75  if ( h_ice < (rhosw_rho_ratio*h_sea) ) then
76 
77 #if ( MARGIN==1 || ( MARGIN==2 && MARINE_ICE_FORMATION==1 ) )
78  mask_update = 2_i2b ! ice becomes floating, therefore
79  ! now sea point (ice cut off)
80 #elif ( MARGIN==2 && MARINE_ICE_FORMATION==2 )
81  mask_update = 0_i2b ! now "underwater ice"
82 #elif ( MARGIN==3 )
83  mask_update = 3_i2b ! now floating ice
84 #endif
85  return
86 
87  else
88 
89  mask_update = 0_i2b ! now grounded ice
90  return
91 
92  end if
93 
94  end if
95 
96 end if
97 
98 end function mask_update
99 !