SICOPOLIS V3.2
 All Classes Files Functions Variables Macros
viscosity.F90
Go to the documentation of this file.
1 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 !
3 ! Function : v i s c o s i t y
4 !
5 !> @file
6 !!
7 !! Ice viscosity as a function of the effective strain rate and the temperature
8 !! (in cold ice) or the water content (in temperate ice) or both (for the
9 !! enthalpy method).
10 !!
11 !! @section Copyright
12 !!
13 !! Copyright 2009-2016 Ralf Greve
14 !!
15 !! @section License
16 !!
17 !! This file is part of SICOPOLIS.
18 !!
19 !! SICOPOLIS is free software: you can redistribute it and/or modify
20 !! it under the terms of the GNU General Public License as published by
21 !! the Free Software Foundation, either version 3 of the License, or
22 !! (at your option) any later version.
23 !!
24 !! SICOPOLIS is distributed in the hope that it will be useful,
25 !! but WITHOUT ANY WARRANTY; without even the implied warranty of
26 !! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 !! GNU General Public License for more details.
28 !!
29 !! You should have received a copy of the GNU General Public License
30 !! along with SICOPOLIS. If not, see <http://www.gnu.org/licenses/>.
31 !<
32 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
33 
34 !-------------------------------------------------------------------------------
35 !> Ice viscosity as a function of the effective strain rate and the temperature
36 !! (in cold ice) or the water content (in temperate ice) or both (for the
37 !! enthalpy method).
38 !<------------------------------------------------------------------------------
39 function viscosity(de_val, temp_val, temp_m_val, omega_val, enh_val, &
40  i_flag_cold_temp)
41 
42 use sico_types
44 use sico_vars
46 
47 implicit none
48 
49 real(dp) :: viscosity
50 real(dp) , intent(in) :: de_val
51 real(dp) , intent(in) :: temp_val, temp_m_val
52 real(dp) , intent(in) :: omega_val
53 real(dp) , intent(in) :: enh_val
54 integer(i2b), intent(in) :: i_flag_cold_temp
55 
56 real(dp) :: ratefac_val
57 real(dp) :: de_val_m
58 
59 real(dp) :: n_power_law, inv_n_power_law, n_grain_size
60 
61 real(dp), parameter :: de_min = 1.0e-30_dp ! minimum value for the
62  ! effective strain rate
63 
64 #if (FLOW_LAW==4)
65 real(dp), parameter :: sm_coeff_1 = 8.5112e-15_dp, & ! s^-1 Pa^-1
66  sm_coeff_2 = 8.1643e-25_dp, & ! s^-1 Pa^-3
67  sm_coeff_3 = 9.2594e-12_dp ! Pa^-2
68 #endif
69 
70 !-------- Rate factor and effective strain rate --------
71 
72 if (i_flag_cold_temp == 0_i2b) then ! cold ice
73  ratefac_val = ratefac_c(temp_val, temp_m_val)
74 else if (i_flag_cold_temp == 1_i2b) then ! temperate ice
75  ratefac_val = ratefac_t(omega_val)
76 else ! enthalpy method
77  ratefac_val = ratefac_c_t(temp_val, omega_val, temp_m_val)
78 end if
79 
80 de_val_m = max(de_val, de_min)
81 
82 #if (FIN_VISC==1)
83 
84 #if (FLOW_LAW==1)
85 
86 !-------- Glen's flow law (n=3) --------
87 
88 inv_n_power_law = 0.333333333333333_dp ! 1/3
89 
90 viscosity = 0.5_dp * de_val_m**(inv_n_power_law-1.0_dp) &
91  * (enh_val*ratefac_val)**(-inv_n_power_law)
92 
93 #elif (FLOW_LAW==2)
94 
95 !-------- Goldsby-Kohlstedt flow law (n=1.8, d=1.4) --------
96 
97 inv_n_power_law = 0.555555555555555_dp ! 1/1.8
98 n_grain_size = 1.4_dp
99 
100 viscosity = 0.5_dp * de_val_m**(inv_n_power_law-1.0_dp) &
101  * gr_size**(n_grain_size*inv_n_power_law) &
102  * (enh_val*ratefac_val)**(-inv_n_power_law)
103 
104 #elif (FLOW_LAW==3)
105 
106 !-------- Durham's flow law (n=4) --------
107 
108 inv_n_power_law = 0.25_dp ! 1/4
109 
110 viscosity = 0.5_dp * de_val_m**(inv_n_power_law-1.0_dp) &
111  * (enh_val*ratefac_val)**(-inv_n_power_law)
112 
113 #endif
114 
115 #elif (FIN_VISC==2)
116 
117 #if (FLOW_LAW==1)
118 
119 !-------- Glen's flow (n=3) with additional finite viscosity --------
120 
121 n_power_law = 3.0_dp
122 
123 viscosity = visc_iter(de_val_m, ratefac_val, enh_val, n_power_law, sigma_res)
124 
125 #elif (FLOW_LAW==2)
126 
127 !-------- Goldsby-Kohlstedt flow law (n=1.8, d=1.4)
128 ! with additional finite viscosity --------
129 
130 n_power_law = 1.8_dp
131 n_grain_size = 1.4_dp
132 
133 write(6,'(a)') ' viscosity: Computation of the viscosity as a function'
134 write(6,'(a)') ' of the effective strain rate not yet implemented'
135 write(6,'(a)') ' for grain-size-dependent finite viscosity flow laws!'
136 stop
137 
138 #elif (FLOW_LAW==3)
139 
140 !-------- Durham's flow law (n=4) with additional finite viscosity --------
141 
142 n_power_law = 4.0_dp
143 
144 viscosity = visc_iter(de_val_m, ratefac_val, enh_val, n_power_law, sigma_res)
145 
146 #endif
147 
148 #endif
149 
150 #if (FLOW_LAW==4)
151 
152 !-------- Smith-Morland (polynomial) flow law --------
153 
154 viscosity = visc_iter_sm(de_val_m, ratefac_val, enh_val, &
155  sm_coeff_1, sm_coeff_2, sm_coeff_3)
156 
157 #endif
158 
159 end function viscosity
160 
161 #if (FIN_VISC==2)
162 
163 !-------------------------------------------------------------------------------
164 !> Iterative computation of the viscosity by solving equation (4.28)
165 !! by Greve and Blatter (Springer, 2009).
166 !<------------------------------------------------------------------------------
167 function visc_iter(de_val_m, ratefac_val, enh_val, n_power_law, sigma_res)
168 
169 use sico_types
170 
171 implicit none
172 
173 real(dp) :: visc_iter
174 real(dp), intent(in) :: de_val_m
175 real(dp), intent(in) :: ratefac_val, enh_val
176 real(dp), intent(in) :: n_power_law, sigma_res
177 
178 real(dp) :: visc_val, res
179 
180 real(dp), parameter :: eps = 1.0e-05_dp ! convergence parameter
181 
182 !-------- Determination of the order of magnitude --------
183 
184 visc_val = 1.0e+10_dp ! initial guess (very low value)
185 
186 do
187 
188  res = fct_visc(de_val_m, ratefac_val, enh_val, visc_val, &
189  n_power_law, sigma_res)
190 
191  if (res < 0.0_dp) then
192  visc_val = 10.0_dp*visc_val
193  else
194  exit
195  end if
196 
197 end do
198 
199 !-------- Newton's method --------
200 
201 do
202 
203  visc_val = visc_val &
204  - res &
205  /fct_visc_deriv(de_val_m, ratefac_val, enh_val, visc_val, &
206  n_power_law, sigma_res)
207 
208  res = fct_visc(de_val_m, ratefac_val, enh_val, visc_val, &
209  n_power_law, sigma_res)
210 
211  if (abs(res) < eps) exit
212 
213 end do
214 
215 visc_iter = visc_val
216 
217 end function visc_iter
218 
219 !-------------------------------------------------------------------------------
220 !> Viscosity polynomial
221 !! [equation (4.28) by Greve and Blatter (Springer, 2009)].
222 !<------------------------------------------------------------------------------
223 function fct_visc(de_val_m, ratefac_val, enh_val, visc_val, &
224  n_power_law, sigma_res)
225 
226 use sico_types
227 
228 implicit none
229 
230 real(dp) :: fct_visc
231 real(dp), intent(in) :: de_val_m
232 real(dp), intent(in) :: ratefac_val, enh_val
233 real(dp), intent(in) :: visc_val
234 real(dp), intent(in) :: n_power_law, sigma_res
235 
236 fct_visc = 2.0_dp**n_power_law &
237  *enh_val*ratefac_val &
238  *de_val_m**(n_power_law-1.0_dp) &
239  *visc_val**n_power_law &
240  + 2.0_dp*enh_val*ratefac_val &
241  *sigma_res**(n_power_law-1.0_dp) &
242  *visc_val &
243  - 1.0_dp
244 
245 end function fct_visc
246 
247 !-------------------------------------------------------------------------------
248 !> Derivative of the viscosity polynomial
249 !! [equation (4.28) by Greve and Blatter (Springer, 2009)].
250 !<------------------------------------------------------------------------------
251 function fct_visc_deriv(de_val_m, ratefac_val, enh_val, visc_val, &
252  n_power_law, sigma_res)
253 
254 use sico_types
255 
256 implicit none
257 
258 real(dp) :: fct_visc_deriv
259 real(dp), intent(in) :: de_val_m
260 real(dp), intent(in) :: ratefac_val, enh_val
261 real(dp), intent(in) :: visc_val
262 real(dp), intent(in) :: n_power_law, sigma_res
263 
264 fct_visc_deriv = 2.0_dp**n_power_law*n_power_law &
265  *enh_val*ratefac_val &
266  *de_val_m**(n_power_law-1.0_dp) &
267  *visc_val**(n_power_law-1.0_dp) &
268  + 2.0_dp*enh_val*ratefac_val &
269  *sigma_res**(n_power_law-1.0_dp)
270 
271 end function fct_visc_deriv
272 
273 #endif
274 
275 #if (FLOW_LAW==4)
276 
277 !-------------------------------------------------------------------------------
278 !> Iterative computation of the viscosity by solving equation (4.33)
279 !! [analogous to (4.28)] by Greve and Blatter (Springer, 2009).
280 !<------------------------------------------------------------------------------
281 function visc_iter_sm(de_val_m, ratefac_val, enh_val, &
282  sm_coeff_1, sm_coeff_2, sm_coeff_3)
283 
284 use sico_types
285 
286 implicit none
287 
288 real(dp) :: visc_iter_sm
289 real(dp), intent(in) :: de_val_m
290 real(dp), intent(in) :: ratefac_val, enh_val
291 real(dp), intent(in) :: sm_coeff_1, sm_coeff_2, sm_coeff_3
292 
293 real(dp) :: visc_val, res
294 
295 real(dp), parameter :: eps = 1.0e-05_dp ! convergence parameter
296 
297 !-------- Determination of the order of magnitude --------
298 
299 visc_val = 1.0e+10_dp ! initial guess (very low value)
300 
301 do
302 
303  res = fct_visc_sm(de_val_m, ratefac_val, enh_val, visc_val, &
304  sm_coeff_1, sm_coeff_2, sm_coeff_3)
305 
306  if (res < 0.0_dp) then
307  visc_val = 10.0_dp*visc_val
308  else
309  exit
310  end if
311 
312 end do
313 
314 !-------- Newton's method --------
315 
316 do
317 
318  visc_val = visc_val &
319  - res &
320  /fct_visc_sm_deriv(de_val_m, ratefac_val, enh_val, visc_val, &
321  sm_coeff_1, sm_coeff_2, sm_coeff_3)
322 
323  res = fct_visc_sm(de_val_m, ratefac_val, enh_val, visc_val, &
324  sm_coeff_1, sm_coeff_2, sm_coeff_3)
325 
326  if (abs(res) < eps) exit
327 
328 end do
329 
330 visc_iter_sm = visc_val
331 
332 end function visc_iter_sm
333 
334 !-------------------------------------------------------------------------------
335 !> Viscosity polynomial
336 !! [equation (4.33) by Greve and Blatter (Springer, 2009)].
337 !<------------------------------------------------------------------------------
338 function fct_visc_sm(de_val_m, ratefac_val, enh_val, visc_val, &
339  sm_coeff_1, sm_coeff_2, sm_coeff_3)
340 
341 use sico_types
342 
343 implicit none
344 
345 real(dp) :: fct_visc_sm
346 real(dp), intent(in) :: de_val_m
347 real(dp), intent(in) :: ratefac_val, enh_val
348 real(dp), intent(in) :: visc_val
349 real(dp), intent(in) :: sm_coeff_1, sm_coeff_2, sm_coeff_3
350 
351 real(dp) :: de_visc_factor
352 
353 de_visc_factor = de_val_m*de_val_m*visc_val*visc_val
354 
355 fct_visc_sm = 2.0_dp*enh_val*ratefac_val*visc_val &
356  * ( sm_coeff_1 &
357  + 4.0_dp*sm_coeff_2*de_visc_factor &
358  * ( 1.0_dp + 4.0_dp*sm_coeff_3*de_visc_factor ) ) &
359  - 1.0_dp
360 
361 end function fct_visc_sm
362 
363 !-------------------------------------------------------------------------------
364 !> Derivative of the viscosity polynomial
365 !! [equation (4.33) by Greve and Blatter (Springer, 2009)].
366 !<------------------------------------------------------------------------------
367 function fct_visc_sm_deriv(de_val_m, ratefac_val, enh_val, visc_val, &
368  sm_coeff_1, sm_coeff_2, sm_coeff_3)
369 
370 use sico_types
371 
372 implicit none
373 
374 real(dp) :: fct_visc_sm_deriv
375 real(dp), intent(in) :: de_val_m
376 real(dp), intent(in) :: ratefac_val, enh_val
377 real(dp), intent(in) :: visc_val
378 real(dp), intent(in) :: sm_coeff_1, sm_coeff_2, sm_coeff_3
379 
380 real(dp) :: de_visc_factor
381 
382 real(dp), parameter :: twenty_over_three = 6.666666666666667_dp
383 
384 de_visc_factor = de_val_m*de_val_m*visc_val*visc_val
385 
386 fct_visc_sm_deriv = 2.0_dp*sm_coeff_1*enh_val*ratefac_val &
387  + 24.0_dp*sm_coeff_2*enh_val*ratefac_val*de_visc_factor &
388  * ( 1.0_dp + twenty_over_three*sm_coeff_3*de_visc_factor )
389 
390 end function fct_visc_sm_deriv
391 
392 #endif
393 !
real(dp) function, public ratefac_t(omega_val)
Rate factor for temperate ice.
Declarations of kind types for SICOPOLIS.
Definition: sico_types.F90:35
real(dp) function viscosity(de_val, temp_val, temp_m_val, omega_val, enh_val, i_flag_cold_temp)
Ice viscosity as a function of the effective strain rate and the temperature (in cold ice) or the wat...
Definition: viscosity.F90:39
real(dp) function, public ratefac_c_t(temp_val, omega_val, temp_m_val)
Rate factor for cold and temperate ice: Combination of ratefac_c and ratefac_t (only for the enthalpy...
Declarations of global variables for SICOPOLIS (for the ANT domain).
Definition: sico_vars.F90:35
real(dp) function, public ratefac_c(temp_val, temp_m_val)
Rate factor for cold ice: Linear interpolation of tabulated values in RF(.).
Material quantities of ice: Rate factor, heat conductivity, specific heat (heat capacity).
Declarations of global variables for SICOPOLIS.