SICOPOLIS V3.2
 All Classes Files Functions Variables Macros
calc_vxy_sia.F90
Go to the documentation of this file.
1 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 !
3 ! Subroutine : c a l c _ v x y _ s i a
4 !
5 !> @file
6 !!
7 !! Computation of the shear stresses txz, tyz, the effective shear stress
8 !! sigma, the depth-averaged fluidity flui_ave_sia, the horizontal
9 !! velocity vx, vy and the horizontal volume flux qx, qy in the shallow ice
10 !! approximation.
11 !!
12 !! @section Copyright
13 !!
14 !! Copyright 2009-2016 Ralf Greve
15 !!
16 !! @section License
17 !!
18 !! This file is part of SICOPOLIS.
19 !!
20 !! SICOPOLIS is free software: you can redistribute it and/or modify
21 !! it under the terms of the GNU General Public License as published by
22 !! the Free Software Foundation, either version 3 of the License, or
23 !! (at your option) any later version.
24 !!
25 !! SICOPOLIS is distributed in the hope that it will be useful,
26 !! but WITHOUT ANY WARRANTY; without even the implied warranty of
27 !! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 !! GNU General Public License for more details.
29 !!
30 !! You should have received a copy of the GNU General Public License
31 !! along with SICOPOLIS. If not, see <http://www.gnu.org/licenses/>.
32 !<
33 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
34 
35 !-------------------------------------------------------------------------------
36 !> Computation of the shear stresses txz, tyz, the effective shear stress
37 !! sigma, the depth-averaged fluidity flui_ave_sia, the horizontal
38 !! velocity vx, vy and the horizontal volume flux qx, qy in the shallow ice
39 !! approximation.
40 !<------------------------------------------------------------------------------
41 subroutine calc_vxy_sia(dzeta_c, dzeta_t)
42 
43 use sico_types
45 use sico_vars
47 
48 implicit none
49 
50 real(dp), intent(in) :: dzeta_c, dzeta_t
51 
52 integer(i4b) :: i, j, kc, kt
53 real(dp) :: avxy3(0:kcmax), aqxy1(0:kcmax)
54 real(dp) :: ctxyz1(0:kcmax,0:jmax,0:imax), &
55  ctxyz2(0:ktmax,0:jmax,0:imax)
56 real(dp) :: flui_t(0:ktmax), flui_c(0:kcmax)
57 real(dp) :: cflui0(0:ktmax), cflui1(0:kcmax)
58 real(dp) :: cvxy2(0:ktmax), cvxy3(0:kcmax)
59 real(dp) :: cqxy0(0:ktmax), cqxy1(0:kcmax)
60 real(dp) :: vh_max
61 real(dp) :: ratio_sl_threshold
62 
63 !-------- Term abbreviations --------
64 
65 do kc=0, kcmax
66  if (flag_aa_nonzero) then
67  avxy3(kc) = aa*eaz_c(kc)/(ea-1.0_dp)*dzeta_c
68  aqxy1(kc) = aa/(ea-1.0_dp)*eaz_c(kc)*dzeta_c
69  else
70  avxy3(kc) = dzeta_c
71  aqxy1(kc) = dzeta_c
72  end if
73 end do
74 
75 !-------- Computation of stresses --------
76 
77 ! ------ Term abbreviations
78 
79 do i=0, imax
80 do j=0, jmax
81 
82  if ((maske(j,i) == 0).or.flag_grounding_line_2(j,i)) then
83  ! grounded ice, or floating ice at the grounding line
84 
85  do kc=0, kcmax
86  ctxyz1(kc,j,i) = rho*g*h_c(j,i)*(1.0_dp-eaz_c_quotient(kc))
87  end do
88 
89  if (n_cts(j,i) == 1) then ! temperate layer
90 
91  do kt=0, ktmax
92  ctxyz2(kt,j,i) = rho*g*h_t(j,i)*(1.0_dp-zeta_t(kt))
93  end do
94 
95  else ! cold base (-1), temperate base (0)
96 
97  do kt=0, ktmax
98  ctxyz2(kt,j,i) = 0.0_dp
99  end do
100 
101  end if
102 
103  else ! maske(j,i) == 1, 2 or 3 away from the grounding line
104 
105  do kc=0, kcmax
106  ctxyz1(kc,j,i) = 0.0_dp
107  end do
108 
109  do kt=0, ktmax
110  ctxyz2(kt,j,i) = 0.0_dp
111  end do
112 
113  end if
114 
115 end do
116 end do
117 
118 ! ------ Shear stress txz (defined at (i+1/2,j,kc/t))
119 
120 do i=0, imax-1
121 do j=0, jmax
122 
123  do kc=0, kcmax
124  txz_c(kc,j,i) = -0.5_dp*(ctxyz1(kc,j,i)+ctxyz1(kc,j,i+1)) &
125  *dzs_dxi(j,i)
126  end do
127 
128  do kt=0, ktmax
129  txz_t(kt,j,i) = txz_c(0,j,i) &
130  -0.5_dp*(ctxyz2(kt,j,i)+ctxyz2(kt,j,i+1)) &
131  *dzs_dxi(j,i)
132  end do
133 
134 end do
135 end do
136 
137 ! ------ Shear stress tyz (defined at (i,j+1/2,kc/t))
138 
139 do i=0, imax
140 do j=0, jmax-1
141 
142  do kc=0, kcmax
143  tyz_c(kc,j,i) = -0.5_dp*(ctxyz1(kc,j,i)+ctxyz1(kc,j+1,i)) &
144  *dzs_deta(j,i)
145  end do
146 
147  do kt=0, ktmax
148  tyz_t(kt,j,i) = tyz_c(0,j,i) &
149  -0.5_dp*(ctxyz2(kt,j,i)+ctxyz2(kt,j+1,i)) &
150  *dzs_deta(j,i)
151  end do
152 
153 end do
154 end do
155 
156 ! ------ Effective shear stress sigma (defined at (i,j,kc/t))
157 
158 do i=0, imax
159 do j=0, jmax
160 
161  do kc=0, kcmax
162  sigma_c(kc,j,i) = ctxyz1(kc,j,i) &
163  *(dzs_dxi_g(j,i)**2+dzs_deta_g(j,i)**2)**0.5_dp
164  end do
165 
166  do kt=0, ktmax
167  sigma_t(kt,j,i) = sigma_c(0,j,i) &
168  + ctxyz2(kt,j,i) &
169  *(dzs_dxi_g(j,i)**2+dzs_deta_g(j,i)**2)**0.5_dp
170  end do
171 
172 end do
173 end do
174 
175 !-------- Computation of the depth-averaged fluidity
176 ! (defined on the grid points (i,j)) --------
177 
178 do i=0, imax
179 do j=0, jmax
180 
181  if ((maske(j,i) == 0).or.flag_grounding_line_2(j,i)) then
182  ! grounded ice, or floating ice at the grounding line
183 
184 ! ------ Fluidity, abbreviations
185 
186  do kt=0, ktmax
187  flui_t(kt) = 2.0_dp &
188  *enh_t(kt,j,i) &
189  *ratefac_t(omega_t(kt,j,i)) &
190  *creep(sigma_t(kt,j,i))
191  cflui0(kt) = h_t(j,i)*flui_t(kt)*dzeta_t
192  end do
193 
194  do kc=0, kcmax
195  flui_c(kc) = 2.0_dp &
196  *enh_c(kc,j,i) &
197 #if (CALCMOD==0 || CALCMOD==1 || CALCMOD==-1)
198  *ratefac_c(temp_c(kc,j,i), temp_c_m(kc,j,i)) &
199 #elif (CALCMOD==2 || CALCMOD==3)
200  *ratefac_c_t(temp_c(kc,j,i), omega_c(kc,j,i), &
201  temp_c_m(kc,j,i)) &
202 #endif
203  *creep(sigma_c(kc,j,i))
204  cflui1(kc) = aqxy1(kc)*h_c(j,i)*flui_c(kc)
205  end do
206 
207 ! ------ Depth average
208 
209  flui_ave_sia(j,i) = 0.0_dp
210 
211  if (n_cts(j,i) == 1) then
212 
213  do kt=0, ktmax-1
214  flui_ave_sia(j,i) = flui_ave_sia(j,i)+0.5_dp*(cflui0(kt+1)+cflui0(kt))
215  end do
216 
217  end if
218 
219  do kc=0, kcmax-1
220  flui_ave_sia(j,i) = flui_ave_sia(j,i)+0.5_dp*(cflui1(kc+1)+cflui1(kc))
221  end do
222 
223  flui_ave_sia(j,i) = flui_ave_sia(j,i)/(h_c(j,i)+h_t(j,i))
224 
225  else ! maske(j,i) == 1, 2 or 3 away from the grounding line
226 
227  flui_ave_sia(j,i) = 0.0_dp
228 
229  end if
230 
231 end do
232 end do
233 
234 !-------- Computation of d_help_c/t
235 ! (defined on the grid points (i,j,kc/t)) --------
236 
237 do i=0, imax
238 do j=0, jmax
239 
240  if ((maske(j,i) == 0).or.flag_grounding_line_2(j,i)) then
241  ! grounded ice, or floating ice at the grounding line
242 
243 ! ------ Abbreviations
244 
245  do kt=0, ktmax
246  cvxy2(kt) = 2.0_dp*h_t(j,i) &
247  *enh_t(kt,j,i) &
248  *ratefac_t(omega_t(kt,j,i)) &
249  *creep(sigma_t(kt,j,i)) &
250  *(ctxyz1(0,j,i)+ctxyz2(kt,j,i)) &
251  *dzeta_t
252  end do
253 
254  do kc=0, kcmax
255  cvxy3(kc) = 2.0_dp*avxy3(kc)*h_c(j,i) &
256  *enh_c(kc,j,i) &
257 #if (CALCMOD==0 || CALCMOD==1 || CALCMOD==-1)
258  *ratefac_c(temp_c(kc,j,i), temp_c_m(kc,j,i)) &
259 #elif (CALCMOD==2 || CALCMOD==3)
260  *ratefac_c_t(temp_c(kc,j,i), omega_c(kc,j,i), &
261  temp_c_m(kc,j,i)) &
262 #endif
263  *creep(sigma_c(kc,j,i)) &
264  *ctxyz1(kc,j,i)
265  end do
266 
267 ! ------ d_help_c, d_help_t
268 
269  if (n_cts(j,i) == -1) then ! cold ice base
270 
271  do kt=0, ktmax
272  d_help_t(kt,j,i) = d_help_b(j,i)
273  end do
274 
275  d_help_c(0,j,i) = d_help_t(ktmax,j,i)
276 
277  do kc=0, kcmax-1
278  d_help_c(kc+1,j,i) = d_help_c(kc,j,i) &
279  +0.5_dp*(cvxy3(kc+1)+cvxy3(kc))
280  end do
281 
282  else if (n_cts(j,i) == 0) then ! temperate ice base
283 
284  do kt=0, ktmax
285  d_help_t(kt,j,i) = d_help_b(j,i)
286  end do
287 
288  d_help_c(0,j,i) = d_help_t(ktmax,j,i)
289 
290  do kc=0, kcmax-1
291  d_help_c(kc+1,j,i) = d_help_c(kc,j,i) &
292  +0.5_dp*(cvxy3(kc+1)+cvxy3(kc))
293  end do
294 
295  else ! n_cts(j,i) == 1, temperate ice layer
296 
297  d_help_t(0,j,i) = d_help_b(j,i)
298 
299  do kt=0, ktmax-1
300  d_help_t(kt+1,j,i) = d_help_t(kt,j,i) &
301  +0.5_dp*(cvxy2(kt+1)+cvxy2(kt))
302  end do
303 
304  d_help_c(0,j,i) = d_help_t(ktmax,j,i)
305 
306  do kc=0, kcmax-1
307  d_help_c(kc+1,j,i) = d_help_c(kc,j,i) &
308  +0.5_dp*(cvxy3(kc+1)+cvxy3(kc))
309  end do
310 
311  end if
312 
313  else ! maske(j,i) == 1, 2 or 3 away from the grounding line
314 
315  do kt=0, ktmax
316  d_help_t(kt,j,i) = 0.0_dp
317  end do
318 
319  do kc=0, kcmax
320  d_help_c(kc,j,i) = 0.0_dp
321  end do
322 
323  end if
324 
325 end do
326 end do
327 
328 !-------- Computation of vx_c/t (defined at (i+1/2,j,kc/t)) --------
329 
330 do i=0, imax-1
331 do j=1, jmax-1
332 
333  do kt=0, ktmax
334  vx_t(kt,j,i) = -0.5_dp*(d_help_t(kt,j,i)+d_help_t(kt,j,i+1)) &
335  *dzs_dxi(j,i)
336  end do
337 
338  do kc=0, kcmax
339  vx_c(kc,j,i) = -0.5_dp*(d_help_c(kc,j,i)+d_help_c(kc,j,i+1)) &
340  *dzs_dxi(j,i)
341  end do
342 
343 end do
344 end do
345 
346 !-------- Computation of vy_c/t (defined at (i,j+1/2,kc/t)) --------
347 
348 do i=1, imax-1
349 do j=0, jmax-1
350 
351  do kt=0, ktmax
352  vy_t(kt,j,i) = -0.5_dp*(d_help_t(kt,j,i)+d_help_t(kt,j+1,i)) &
353  *dzs_deta(j,i)
354  end do
355 
356  do kc=0, kcmax
357  vy_c(kc,j,i) = -0.5_dp*(d_help_c(kc,j,i)+d_help_c(kc,j+1,i)) &
358  *dzs_deta(j,i)
359  end do
360 
361 end do
362 end do
363 
364 !-------- Computation of the surface velocities vx_s_g and vy_s_g
365 ! (defined at (i,j)) --------
366 
367 do i=0, imax
368 do j=0, jmax
369  vx_s_g(j,i) = -d_help_c(kcmax,j,i)*dzs_dxi_g(j,i)
370  vy_s_g(j,i) = -d_help_c(kcmax,j,i)*dzs_deta_g(j,i)
371 end do
372 end do
373 
374 !-------- Limitation of computed vx_c/t, vy_c/t, vx_s_g, vy_s_g
375 ! to the interval [-VH_MAX, VH_MAX] --------
376 
377 vh_max = vh_max/year_sec
378 
379 do i=0, imax
380 do j=0, jmax
381  vx_s_g(j,i) = max(vx_s_g(j,i), -vh_max)
382  vx_s_g(j,i) = min(vx_s_g(j,i), vh_max)
383  vy_s_g(j,i) = max(vy_s_g(j,i), -vh_max)
384  vy_s_g(j,i) = min(vy_s_g(j,i), vh_max)
385  do kt=0, ktmax
386  vx_t(kt,j,i) = max(vx_t(kt,j,i), -vh_max)
387  vx_t(kt,j,i) = min(vx_t(kt,j,i), vh_max)
388  vy_t(kt,j,i) = max(vy_t(kt,j,i), -vh_max)
389  vy_t(kt,j,i) = min(vy_t(kt,j,i), vh_max)
390  end do
391  do kc=0, kcmax
392  vx_c(kc,j,i) = max(vx_c(kc,j,i), -vh_max)
393  vx_c(kc,j,i) = min(vx_c(kc,j,i), vh_max)
394  vy_c(kc,j,i) = max(vy_c(kc,j,i), -vh_max)
395  vy_c(kc,j,i) = min(vy_c(kc,j,i), vh_max)
396  end do
397 end do
398 end do
399 
400 !-------- Computation of h_diff
401 ! (defined on the grid points (i,j)) --------
402 
403 do i=0, imax
404 do j=0, jmax
405 
406  if ((maske(j,i) == 0).or.flag_grounding_line_2(j,i)) then
407  ! grounded ice, or floating ice at the grounding line
408 
409 ! ------ Abbreviations
410 
411  do kt=0, ktmax
412  cqxy0(kt) = h_t(j,i)*d_help_t(kt,j,i)*dzeta_t
413  end do
414 
415  do kc=0, kcmax
416  cqxy1(kc) = aqxy1(kc)*h_c(j,i)*d_help_c(kc,j,i)
417  end do
418 
419 ! ------ h_diff
420 
421  h_diff(j,i) = 0.0_dp
422 
423  if (n_cts(j,i) == 1) then
424 
425  do kt=0, ktmax-1
426  h_diff(j,i) = h_diff(j,i)+0.5_dp*(cqxy0(kt+1)+cqxy0(kt))
427  end do
428 
429  end if
430 
431  do kc=0, kcmax-1
432  h_diff(j,i) = h_diff(j,i)+0.5_dp*(cqxy1(kc+1)+cqxy1(kc))
433  end do
434 
435 ! ------ Limitation of h_diff
436 
437  if (h_diff(j,i) < hd_min) h_diff(j,i) = 0.0_dp
438  if (h_diff(j,i) > hd_max) h_diff(j,i) = hd_max
439 
440  else ! maske(j,i) == 1, 2 or 3 away from the grounding line
441 
442  h_diff(j,i) = 0.0_dp
443 
444  end if
445 
446 end do
447 end do
448 
449 !-------- Computation of the horizontal volume flux
450 ! and the depth-averaged velocity --------
451 
452 do i=0, imax-1
453 do j=0, jmax
454 
455  qx(j,i) = -0.5_dp*(h_diff(j,i)+h_diff(j,i+1))*dzs_dxi(j,i)
456 
457  if ( (maske(j,i)==0).or.(maske(j,i+1)==0) ) then ! at least one neighbour
458  ! point is grounded ice
459 
460  vx_m(j,i) = qx(j,i) &
461  / ( 0.5_dp*(h_c(j,i)+h_t(j,i)+h_c(j,i+1)+h_t(j,i+1)) )
462 
463  vx_m(j,i) = max(vx_m(j,i), -vh_max) ! Limitation
464  vx_m(j,i) = min(vx_m(j,i), vh_max) ! to the interval [-VH_MAX, VH_MAX]
465 
466  ratio_sl_x(j,i) = abs(vx_t(0,j,i)) / max(abs(vx_c(kcmax,j,i)), epsi)
467 
468  else
469 
470  vx_m(j,i) = 0.0_dp
471  ratio_sl_x(j,i) = 0.0_dp
472 
473  end if
474 
475 end do
476 end do
477 
478 do i=0, imax
479 do j=0, jmax-1
480 
481  qy(j,i) = -0.5_dp*(h_diff(j,i)+h_diff(j+1,i))*dzs_deta(j,i)
482 
483  if ( (maske(j,i)==0).or.(maske(j+1,i)==0) ) then ! at least one neighbour
484  ! point is grounded ice
485 
486  vy_m(j,i) = qy(j,i) &
487  / ( 0.5_dp*(h_c(j,i)+h_t(j,i)+h_c(j+1,i)+h_t(j+1,i)) )
488 
489  vy_m(j,i) = max(vy_m(j,i), -vh_max) ! Limitation
490  vy_m(j,i) = min(vy_m(j,i), vh_max) ! to the interval [-VH_MAX, VH_MAX]
491 
492  ratio_sl_y(j,i) = abs(vy_t(0,j,i)) / max(abs(vy_c(kcmax,j,i)), epsi)
493 
494  else
495 
496  vy_m(j,i) = 0.0_dp
497  ratio_sl_y(j,i) = 0.0_dp
498 
499  end if
500 
501 end do
502 end do
503 
504 !-------- Detection of shelfy stream points --------
505 
506 flag_shelfy_stream_x = .false.
507 flag_shelfy_stream_y = .false.
508 flag_shelfy_stream = .false.
509 
510 #if (DYNAMICS==0 || DYNAMICS==1)
511 
512 ratio_sl_threshold = 1.11e+11_dp ! dummy value
513 
514 #elif (DYNAMICS==2)
515 
516 #if ( defined(RATIO_SL_THRESH) )
517 ratio_sl_threshold = ratio_sl_thresh
518 #else
519 ratio_sl_threshold = 0.5_dp ! default value
520 #endif
521 
522 do i=0, imax-1
523 do j=0, jmax
524  if (ratio_sl_x(j,i) > ratio_sl_threshold) flag_shelfy_stream_x(j,i) = .true.
525 end do
526 end do
527 
528 do i=0, imax
529 do j=0, jmax-1
530  if (ratio_sl_y(j,i) > ratio_sl_threshold) flag_shelfy_stream_y(j,i) = .true.
531 end do
532 end do
533 
534 do i=1, imax-1
535 do j=1, jmax-1
536 
537  if ( (maske(j,i) == 0) & ! grounded ice
538  .and. &
539  ( flag_shelfy_stream_x(j,i-1) & ! at least
540  .or.flag_shelfy_stream_x(j,i) & ! one neighbour
541  .or.flag_shelfy_stream_y(j-1,i) & ! on the staggered grid
542  .or.flag_shelfy_stream_y(j,i) ) & ! is a shelfy stream point
543  ) then
544 
545  flag_shelfy_stream(j,i) = .true.
546 
547  end if
548 
549 end do
550 end do
551 
552 #else
553 stop ' calc_vxy_sia: DYNAMICS must be either 0, 1 or 2!'
554 #endif
555 
556 !-------- Initialisation of the variable q_gl_g
557 ! (volume flux across the grounding line, to be
558 ! computed in the routine calc_vxy_ssa
559 ! if ice shelves are present)
560 
561 q_gl_g = 0.0_dp
562 
563 end subroutine calc_vxy_sia
564 !
subroutine calc_vxy_sia(dzeta_c, dzeta_t)
Computation of the shear stresses txz, tyz, the effective shear stress sigma, the depth-averaged flui...
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, 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.
real(dp) function creep(sigma_val)
Creep response function for ice.
Definition: creep.F90:35