SICOPOLIS V3.2
 All Classes Files Functions Variables Macros
shift_cts_upward.F90
Go to the documentation of this file.
1 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 !
3 ! Subroutine : s h i f t _ c t s _ u p w a r d
4 !
5 !> @file
6 !!
7 !! Upward shifting of the CTS.
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 !> Upward shifting of the CTS.
34 !<------------------------------------------------------------------------------
35 subroutine shift_cts_upward(at1, at2_1, at2_2, at3_1, at3_2, &
36  at4_1, at4_2, at5, at6, at7, atr1, am1, am2, alb1, &
37  aw1, aw2, aw3, aw4, aw5, aw7, aw8, aw9, aqtld, &
38  ai1, ai2, ai3, dzeta_t, &
39  dtime_temp, dtt_2dxi, dtt_2deta, dtime_temp_inv, &
40  i, j)
41 
42 use sico_types
44 use sico_vars
45 
46 implicit none
47 
48 integer(i4b), intent(in) :: i, j
49 real(dp), intent(in) :: at1(0:kcmax), at2_1(0:kcmax), at2_2(0:kcmax), &
50  at3_1(0:kcmax), at3_2(0:kcmax), at4_1(0:kcmax), &
51  at4_2(0:kcmax), at5(0:kcmax), at6(0:kcmax), at7, &
52  ai1(0:kcmax), ai2(0:kcmax), ai3, &
53  atr1, am1, am2, alb1
54 real(dp), intent(in) :: aw1, aw2, aw3, aw4, aw5, aw7, aw8, aw9, aqtld
55 real(dp), intent(in) :: dzeta_t
56 real(dp), intent(in) :: dtime_temp, dtime_temp_inv, dtt_2dxi, dtt_2deta
57 
58 real(dp) :: zm_shift
59 real(dp) :: difftemp_a, difftemp_b, interpol
60 
61 zm_shift = 1.0_dp ! CTS shift in intervals of 1 m
62 
63 !-------- Temperature discrepancy from the computation of the main
64 ! program --------
65 
66 difftemp_a = temp_c_neu(0,j,i)-(-beta*h_c_neu(j,i))
67 if (difftemp_a <= 0.0_dp) return
68 
69 !-------- Shift CTS upward until it is too high --------
70 
71  10 continue
72 
73  zm_neu(j,i) = zm_neu(j,i) + zm_shift
74  if (zm_neu(j,i) >= zs(j,i)) then
75  zm_neu(j,i) = zm_neu(j,i) - zm_shift
76  return
77  end if
78  h_c_neu(j,i) = h_c_neu(j,i) - zm_shift
79  h_t_neu(j,i) = h_t_neu(j,i) + zm_shift
80 
81  dh_t_dtau(j,i) = (zm_neu(j,i)-zm(j,i))*dtime_temp_inv
82  dzm_dtau(j,i) = dzb_dtau(j,i)+dh_t_dtau(j,i)
83  dh_c_dtau(j,i) = dzs_dtau(j,i)-dzm_dtau(j,i)
84 
85  am_perp(j,i) = am_perp_st(j,i) + dzm_dtau(j,i)
86 
87  call calc_temp3(at1, at2_1, at2_2, at3_1, at3_2, &
88  at4_1, at4_2, at5, at6, at7, atr1, &
89  am1, am2, alb1, &
90  aw1, aw2, aw3, aw4, aw5, aw7, aw8, aw9, aqtld, &
91  ai1, ai2, ai3, dzeta_t, &
92  dtime_temp, dtt_2dxi, dtt_2deta, i, j)
93 
94  difftemp_b = difftemp_a
95  difftemp_a = temp_c_neu(0,j,i)-(-beta*h_c_neu(j,i))
96 
97 if (difftemp_a > 0.0_dp) go to 10
98 
99 !-------- Interpolate the CTS position from the last (_a) and the
100 ! last but one (_b) value, weighed with the temperature
101 ! discrepancies at the CTS --------
102 
103 interpol = difftemp_a/(difftemp_b-difftemp_a)*zm_shift
104 
105 zm_neu(j,i) = zm_neu(j,i) + interpol
106 h_c_neu(j,i) = h_c_neu(j,i) - interpol
107 h_t_neu(j,i) = h_t_neu(j,i) + interpol
108 
109 dh_t_dtau(j,i) = (zm_neu(j,i)-zm(j,i))*dtime_temp_inv
110 dzm_dtau(j,i) = dzb_dtau(j,i)+dh_t_dtau(j,i)
111 dh_c_dtau(j,i) = dzs_dtau(j,i)-dzm_dtau(j,i)
112 
113 am_perp(j,i) = am_perp_st(j,i) + dzm_dtau(j,i)
114 
115 call calc_temp3(at1, at2_1, at2_2, at3_1, at3_2, &
116  at4_1, at4_2, at5, at6, at7, atr1, &
117  am1, am2, alb1, &
118  aw1, aw2, aw3, aw4, aw5, aw7, aw8, aw9, aqtld, &
119  ai1, ai2, ai3, dzeta_t, &
120  dtime_temp, dtt_2dxi, dtt_2deta, i, j)
121 
122 end subroutine shift_cts_upward
123 !
subroutine calc_temp3(at1, at2_1, at2_2, at3_1, at3_2, at4_1, at4_2, at5, at6, at7, atr1, am1, am2, alb1, aw1, aw2, aw3, aw4, aw5, aw7, aw8, aw9, aqtld, ai1, ai2, ai3, dzeta_t, dtime_temp, dtt_2dxi, dtt_2deta, i, j)
Computation of temperature, water content and age for an ice column with a temperate base overlain by...
Definition: calc_temp3.F90:37
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
subroutine shift_cts_upward(at1, at2_1, at2_2, at3_1, at3_2, at4_1, at4_2, at5, at6, at7, atr1, am1, am2, alb1, aw1, aw2, aw3, aw4, aw5, aw7, aw8, aw9, aqtld, ai1, ai2, ai3, dzeta_t, dtime_temp, dtt_2dxi, dtt_2deta, dtime_temp_inv, i, j)
Upward shifting of the CTS.
Declarations of global variables for SICOPOLIS.