7 !! Computation of the basal melting rate Q_bm.
8 !! Summation of Q_bm and Q_tld.
12 !! Copyright 2009-2013 Ralf Greve
16 !! This file is part of SICOPOLIS.
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.
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.
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/>.
31 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
34 !> Computation of the basal melting rate Q_bm.
35 !! Summation of Q_bm and Q_tld.
36 !<------------------------------------------------------------------------------
37 subroutine calc_qbm(time, z_sl, dzeta_c, dzeta_r)
44 real(dp),
intent(in) :: time, z_sl
45 real(dp),
intent(in) :: dzeta_c, dzeta_r
48 integer(i4b) :: n_ocean, n_float
50 real(dp) :: aqbm1, aqbm2, aqbm3, aqbm4
51 real(dp) :: year_sec_inv, rhow_rho_ratio
52 real(dp) :: q_bm_grounded, q_bm_marine, q_bm_floating
53 real(dp) :: qbm_min, qbm_max
57 year_sec_inv = 1.0_dp/year_sec
58 rhow_rho_ratio = rho_w/rho
60 aqbm1 = (ea-1.0_dp)/(rho*l*deform*dzeta_c)
61 aqbm2 = kappa_r/(rho*l*h_r*dzeta_r)
72 if (maske(j,i)==0)
then
74 if (n_cts(j,i)==-1)
then
76 else if (n_cts(j,i)==0)
then
77 q_bm(j,i) = aqbm1*(temp_c(1,j,i)-temp_c(0,j,i))/h_c(j,i) &
79 -aqbm2*(temp_r(krmax,j,i)-temp_r(krmax-1,j,i)) &
80 -aqbm3*h_c(j,i)*0.5_dp*(vx_t(0,j,i)+vx_t(0,j,i-1)) &
82 -aqbm3*h_c(j,i)*0.5_dp*(vy_t(0,j,i)+vy_t(0,j-1,i)) &
87 -aqbm2*(temp_r(krmax,j,i)-temp_r(krmax-1,j,i)) &
88 -aqbm3*(h_c(j,i)+h_t(j,i)) &
89 *0.5_dp*(vx_t(0,j,i)+vx_t(0,j,i-1)) &
91 -aqbm3*(h_c(j,i)+h_t(j,i)) &
92 *0.5_dp*(vy_t(0,j,i)+vy_t(0,j-1,i)) &
96 #if ( MARGIN==1 || MARGIN==2 )
98 #if ( !defined(MARINE_ICE_BASAL_MELTING) || MARINE_ICE_BASAL_MELTING==1 )
102 #elif MARINE_ICE_BASAL_MELTING==2
104 if ( (zb(j,i) < z_sl) &
106 ( (maske(j,i+1)==2) &
107 .or.(maske(j,i-1)==2) &
108 .or.(maske(j+1,i)==2) &
109 .or.(maske(j-1,i)==2) &
113 q_bm(j,i) = qbm_marine *year_sec_inv*rhow_rho_ratio
118 #elif MARINE_ICE_BASAL_MELTING==3
120 if ( (zb(j,i) < z_sl) &
122 ( (maske(j,i+1)==2) &
123 .or.(maske(j,i-1)==2) &
124 .or.(maske(j+1,i)==2) &
125 .or.(maske(j-1,i)==2) &
130 if (maske(j,i+1)==2) n_ocean = n_ocean+1
131 if (maske(j,i-1)==2) n_ocean = n_ocean+1
132 if (maske(j+1,i)==2) n_ocean = n_ocean+1
133 if (maske(j-1,i)==2) n_ocean = n_ocean+1
135 if ( n_ocean > 0 )
then
137 q_bm_grounded = q_bm(j,i)
138 q_bm_marine = qbm_marine *year_sec_inv*rhow_rho_ratio
141 q_bm(j,i) = (1.0_dp-0.25_dp*
real(n_ocean,dp)) * q_bm_grounded &
142 +0.25_dp*
real(n_ocean,dp) * q_bm_marine
146 write(6,
'(a)')
' calc_qbm: Marine ice margin point does not have'
147 write(6,
'(a)')
' an ocean neighbour!'
154 stop
' calc_qbm: MARINE_ICE_BASAL_MELTING must be either 1, 2 or 3!'
159 if ( flag_grounding_line(j,i) )
then
161 #if FLOATING_ICE_BASAL_MELTING==1
165 #elif FLOATING_ICE_BASAL_MELTING==2
167 q_bm(j,i) = qbm_float_1 *year_sec_inv*rhow_rho_ratio
170 #elif FLOATING_ICE_BASAL_MELTING==3
173 if (maske(j,i+1)>=2) n_float = n_float+1
174 if (maske(j,i-1)>=2) n_float = n_float+1
175 if (maske(j+1,i)>=2) n_float = n_float+1
176 if (maske(j-1,i)>=2) n_float = n_float+1
178 if ( n_float > 0 )
then
180 q_bm_grounded = q_bm(j,i)
181 q_bm_floating = qbm_float_1 *year_sec_inv*rhow_rho_ratio
184 q_bm(j,i) = (1.0_dp-0.25_dp*
real(n_float,dp)) * q_bm_grounded &
185 +0.25_dp*
real(n_float,dp) * q_bm_floating
188 write(6,
'(a)')
' calc_qbm: Grounding line point does not have'
189 write(6,
'(a)')
' a floating ice or ocean neighbour!'
194 stop
' calc_qbm: FLOATING_ICE_BASAL_MELTING must be either 1, 2 or 3!'
197 else if ( (zb(j,i) < z_sl) &
199 ( (maske(j,i+1)>=2) &
200 .or.(maske(j,i-1)>=2) &
201 .or.(maske(j+1,i)>=2) &
202 .or.(maske(j-1,i)>=2) &
206 #if MARINE_ICE_BASAL_MELTING==1
210 #elif MARINE_ICE_BASAL_MELTING==2
212 q_bm(j,i) = qbm_marine *year_sec_inv*rhow_rho_ratio
215 #elif MARINE_ICE_BASAL_MELTING==3
218 if (maske(j,i+1)>=2) n_ocean = n_ocean+1
219 if (maske(j,i-1)>=2) n_ocean = n_ocean+1
220 if (maske(j+1,i)>=2) n_ocean = n_ocean+1
221 if (maske(j-1,i)>=2) n_ocean = n_ocean+1
223 if ( n_ocean > 0 )
then
225 q_bm_grounded = q_bm(j,i)
226 q_bm_marine = qbm_marine *year_sec_inv*rhow_rho_ratio
229 q_bm(j,i) = (1.0_dp-0.25_dp*
real(n_ocean,dp)) * q_bm_grounded &
230 +0.25_dp*
real(n_ocean,dp) * q_bm_marine
234 write(6,
'(a)')
' calc_qbm: Marine ice margin point does not have'
235 write(6,
'(a)')
' a floating ice or ocean neighbour!'
240 stop
' calc_qbm: MARINE_ICE_BASAL_MELTING must be either 1, 2 or 3!'
245 else if ( (maske(j,i)==2).or.(maske(j,i)==3) )
then
247 if ( flag_grounding_line(j,i+1) &
248 .or.flag_grounding_line(j,i-1) &
249 .or.flag_grounding_line(j+1,i) &
250 .or.flag_grounding_line(j-1,i) )
then
252 q_bm(j,i) = qbm_float_1 *year_sec_inv*rhow_rho_ratio
255 else if ( zl(j,i) > z_abyss )
then
257 q_bm(j,i) = qbm_float_2 *year_sec_inv*rhow_rho_ratio
262 q_bm(j,i) = qbm_float_3 *year_sec_inv*rhow_rho_ratio
268 stop
' calc_qbm: MARGIN must be either 1, 2 or 3!'
278 q_b_tot = q_bm + q_tld
284 qbm_min = qbm_min *year_sec_inv*rhow_rho_ratio
286 #elif defined(QB_MIN) /* obsolete */
289 stop
' calc_qbm: Limiter QBM_MIN is undefined!'
293 qbm_max = qbm_max *year_sec_inv*rhow_rho_ratio
295 #elif defined(QB_MAX) /* obsolete */
298 stop
' calc_qbm: Limiter QBM_MAX is undefined!'
301 #if ( defined(MARINE_ICE_BASAL_MELTING) \
302 && ( marine_ice_basal_melting==2 || marine_ice_basal_melting==3 ) )
304 if (qbm_marine*year_sec_inv*rhow_rho_ratio > qbm_max)
then
305 write (6,
'(a)')
' calc_qbm: QBM_MARINE (basal melting rate at the marine'
306 write (6,
'(a)')
' ice front) is larger than the limiter qbm_max!'
313 && defined(floating_ice_basal_melting) \
314 && floating_ice_basal_melting<=3 )
316 if (qbm_float_1*year_sec_inv*rhow_rho_ratio > qbm_max)
then
317 write (6,
'(a)')
' calc_qbm: QBM_FLOAT_1 (basal melting rate in the grounding'
318 write (6,
'(a)')
' line zone) is larger than the limiter qbm_max!'
326 if (maske(j,i)==0)
then
327 if (q_bm(j,i) < qbm_min) q_bm(j,i) = 0.0_dp
328 if (q_bm(j,i) > qbm_max) q_bm(j,i) = qbm_max
329 if (q_tld(j,i) < qbm_min) q_tld(j,i) = 0.0_dp
330 if (q_tld(j,i) > qbm_max) q_tld(j,i) = qbm_max
331 if (q_b_tot(j,i) < qbm_min) q_b_tot(j,i) = 0.0_dp
332 if (q_b_tot(j,i) > qbm_max) q_b_tot(j,i) = qbm_max