SICOPOLIS V3.2
 All Classes Files Functions Variables Macros
calc_temp_r.F90
Go to the documentation of this file.
1 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 !
3 ! Subroutine : c a l c _ t e m p _ r
4 !
5 !> @file
6 !!
7 !! Computation of temperature for an ice-free column.
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 !> Computation of temperature for an ice-free column.
34 !<------------------------------------------------------------------------------
35 subroutine calc_temp_r(atr1, alb1, i, j)
36 
37 use sico_types
39 use sico_vars
40 use sico_sle_solvers, only : tri_sle
41 
42 #if (CALCMOD==2 || CALCMOD==3)
44 #endif
45 
46 implicit none
47 
48 integer(i4b), intent(in) :: i, j
49 real(dp), intent(in) :: atr1, alb1
50 
51 integer(i4b) :: kc, kt, kr
52 real(dp) :: ctr1, clb1
53 real(dp) :: lgs_a0(0:kcmax+ktmax+krmax+imax+jmax), &
54  lgs_a1(0:kcmax+ktmax+krmax+imax+jmax), &
55  lgs_a2(0:kcmax+ktmax+krmax+imax+jmax), &
56  lgs_x(0:kcmax+ktmax+krmax+imax+jmax), &
57  lgs_b(0:kcmax+ktmax+krmax+imax+jmax)
58 real(dp) :: enth_val
59 
60 !-------- Abbreviations --------
61 
62 ctr1 = atr1
63 clb1 = alb1*q_geo(j,i)
64 
65 !-------- Set up the equations for the bedrock temperature --------
66 
67 kr=0
68 lgs_a1(kr) = 1.0_dp
69 lgs_a2(kr) = -1.0_dp
70 lgs_b(kr) = clb1
71 
72 #if Q_LITHO==1
73 ! (coupled heat-conducting bedrock)
74 
75 do kr=1, krmax-1
76  lgs_a0(kr) = - ctr1
77  lgs_a1(kr) = 1.0_dp + 2.0_dp*ctr1
78  lgs_a2(kr) = - ctr1
79  lgs_b(kr) = temp_r(kr,j,i)
80 end do
81 
82 #elif Q_LITHO==0
83 ! (no coupled heat-conducting bedrock)
84 
85 do kr=1, krmax-1
86  lgs_a0(kr) = 1.0_dp
87  lgs_a1(kr) = 0.0_dp
88  lgs_a2(kr) = -1.0_dp
89  lgs_b(kr) = 2.0_dp*clb1
90 end do
91 
92 #endif
93 
94 kr=krmax
95 lgs_a0(kr) = 0.0_dp
96 lgs_a1(kr) = 1.0_dp
97 lgs_b(kr) = temp_s(j,i)
98 
99 !-------- Solve system of linear equations --------
100 
101 call tri_sle(lgs_a0, lgs_a1, lgs_a2, lgs_x, lgs_b, krmax)
102 
103 !-------- Assign the result --------
104 
105 do kr=0, krmax
106  temp_r_neu(kr,j,i) = lgs_x(kr)
107 end do
108 
109 !-------- Water content and age (enthalpy method: also enthalpy)
110 ! in the non-existing lower (kt) ice layer --------
111 
112 #if (CALCMOD==2 || CALCMOD==3)
113 enth_val = enth_fct_temp_omega(temp_s(j,i), 0.0_dp)
114 #endif
115 
116 do kt=0, ktmax
117  omega_t_neu(kt,j,i) = 0.0_dp
118  age_t_neu(kt,j,i) = 0.0_dp
119 #if (CALCMOD==2 || CALCMOD==3)
120  enth_t_neu(kt,j,i) = enth_val
121 #endif
122 end do
123 
124 !-------- Temperature and age
125 ! (enthalpy method: also water content and enthalpy)
126 ! in the non-existing upper (kc) ice layer --------
127 
128 do kc=0, kcmax
129  temp_c_neu(kc,j,i) = temp_s(j,i)
130  age_c_neu(kc,j,i) = 0.0_dp
131 #if (CALCMOD==2 || CALCMOD==3)
132  omega_c_neu(kc,j,i) = 0.0_dp
133  enth_c_neu(kc,j,i) = enth_val
134 #endif
135 end do
136 
137 end subroutine calc_temp_r
138 !
subroutine tri_sle(a0, a1, a2, x, b, nrows)
Solution of a system of linear equations Ax=b with tridiagonal matrix A.
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
Solvers for systems of linear equations used by SICOPOLIS.
Declarations of global variables for SICOPOLIS.
Conversion from temperature (temp) and water content (omega) to enthalpy (enth) and vice versa...
subroutine calc_temp_r(atr1, alb1, i, j)
Computation of temperature for an ice-free column.
Definition: calc_temp_r.F90:35
real(dp) function, public enth_fct_temp_omega(temp_val, omega_val)
Enthalpy as a function of temperature and water content.