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