38 delta_ts, glac_index, z_sl, dzsl_dtau, z_mar)
45 real(dp),
intent(in) :: time, dtime, dxi, deta
47 real(dp),
intent(out) :: delta_ts, glac_index, dzsl_dtau, z_mar
48 real(dp),
intent(inout) :: z_sl
55 integer(i4b) :: i, j, n
56 integer(i4b) :: i_gr, i_kl
58 real(dp) :: z_sl_min, t1, t2, t3, t4, t5, t6
59 real(dp) :: time_gr, time_kl
60 real(dp) :: z_sle_present, z_sle_help
61 real(dp),
dimension(0:JMAX,0:IMAX,0:12) :: precip
62 real(dp),
dimension(0:JMAX,0:IMAX) :: &
67 real(dp),
dimension(0:JMAX,0:IMAX,12) :: temp_mm
68 real(dp),
dimension(0:JMAX,0:IMAX) :: temp_ma
69 real(dp),
dimension(12) :: temp_mm_help
70 real(dp) :: temp_jja_help
71 real(dp),
dimension(0:JMAX,0:IMAX) :: et
72 real(dp) :: gamma_t, temp_diff
73 real(dp) :: gamma_p, zs_thresh, &
74 temp_rain, temp_snow, &
75 inv_delta_temp_rain_snow, coeff(0:5), inv_sqrt2_s_stat, &
76 precip_fact, frac_solid
77 real(dp) :: s_stat, beta1, beta2, pmax, mu, lambda_lti, temp_lti
78 logical,
dimension(0:JMAX,0:IMAX) :: check_point
80 real(dp),
parameter :: &
81 inv_twelve = 1.0_dp/12.0_dp, one_third = 1.0_dp/3.0_dp
102 delta_ts = sine_amplit &
103 *cos(2.0_dp*pi*time/(sine_period*year_sec)) &
110 if (time/year_sec.lt.
real(grip_time_min,dp)) then
111 delta_ts = griptemp(0)
112 else if (time/year_sec.lt.
real(grip_time_max,dp)) then
114 i_kl = floor(((time/year_sec)-
real(grip_time_min,dp))/
real(grip_time_stp,dp))
117 i_gr = ceiling(((time/year_sec)-
real(grip_time_min,dp))/
real(grip_time_stp,dp))
118 i_gr = min(i_gr, ndata_grip)
120 if (i_kl.eq.i_gr)
then
122 delta_ts = griptemp(i_kl)
126 time_kl = (grip_time_min + i_kl*grip_time_stp) *year_sec
127 time_gr = (grip_time_min + i_gr*grip_time_stp) *year_sec
129 delta_ts = griptemp(i_kl) &
130 +(griptemp(i_gr)-griptemp(i_kl)) &
131 *(time-time_kl)/(time_gr-time_kl)
137 delta_ts = griptemp(ndata_grip)
140 delta_ts = delta_ts * grip_temp_fact
147 if (time/year_sec <
real(gi_time_min,dp)) then
148 glac_index = glacial_index(0)
149 else if (time/year_sec <
real(gi_time_max,dp)) then
151 i_kl = floor(((time/year_sec)-
real(gi_time_min,dp))/
real(gi_time_stp,dp))
154 i_gr = ceiling(((time/year_sec)-
real(gi_time_min,dp))/
real(gi_time_stp,dp))
155 i_gr = min(i_gr, ndata_gi)
157 if (i_kl == i_gr)
then
159 glac_index = glacial_index(i_kl)
163 time_kl = (gi_time_min + i_kl*gi_time_stp) *year_sec
164 time_gr = (gi_time_min + i_gr*gi_time_stp) *year_sec
166 glac_index = glacial_index(i_kl) &
167 +(glacial_index(i_gr)-glacial_index(i_kl)) &
168 *(time-time_kl)/(time_gr-time_kl)
174 glac_index = glacial_index(ndata_gi)
190 t1 = -250000.0_dp *year_sec
191 t2 = -140000.0_dp *year_sec
192 t3 = -125000.0_dp *year_sec
193 t4 = -21000.0_dp *year_sec
194 t5 = -8000.0_dp *year_sec
195 t6 = 0.0_dp *year_sec
199 else if (time.lt.t2)
then
200 z_sl = z_sl_min*(time-t1)/(t2-t1)
201 else if (time.lt.t3)
then
202 z_sl = -z_sl_min*(time-t3)/(t3-t2)
203 else if (time.lt.t4)
then
204 z_sl = z_sl_min*(time-t3)/(t4-t3)
205 else if (time.lt.t5)
then
206 z_sl = -z_sl_min*(time-t5)/(t5-t4)
207 else if (time.lt.t6)
then
217 if (time/year_sec.lt.
real(specmap_time_min,dp)) then
218 z_sl = specmap_zsl(0)
219 else if (time/year_sec.lt.
real(specmap_time_max,dp)) then
221 i_kl = floor(((time/year_sec)-
real(specmap_time_min,dp))/
real(specmap_time_stp,dp))
224 i_gr = ceiling(((time/year_sec)-
real(specmap_time_min,dp))/
real(specmap_time_stp,dp))
225 i_gr = min(i_gr, ndata_specmap)
227 if (i_kl.eq.i_gr)
then
229 z_sl = specmap_zsl(i_kl)
233 time_kl = (specmap_time_min + i_kl*specmap_time_stp) *year_sec
234 time_gr = (specmap_time_min + i_gr*specmap_time_stp) *year_sec
236 z_sl = specmap_zsl(i_kl) &
237 +(specmap_zsl(i_gr)-specmap_zsl(i_kl)) &
238 *(time-time_kl)/(time_gr-time_kl)
244 z_sl = specmap_zsl(ndata_specmap)
251 if ( z_sl_old > -999999.9_dp )
then
252 dzsl_dtau = (z_sl-z_sl_old)/dtime
261 #if ( MARINE_ICE_CALVING==2 || MARINE_ICE_CALVING==3 )
263 #elif ( MARINE_ICE_CALVING==4 || MARINE_ICE_CALVING==5 )
264 z_mar = fact_z_mar*z_sl
265 #elif ( MARINE_ICE_CALVING==6 || MARINE_ICE_CALVING==7 )
266 if (z_sl >= -80.0_dp)
then
269 z_mar = 10.25_dp*(z_sl+80.0_dp)-200.0_dp
271 z_mar = fact_z_mar*z_mar
283 check_point(j,i) = .false.
289 if (maske(j,i).ge.2)
then
290 check_point(j ,i ) = .true.
291 check_point(j ,i+1) = .true.
292 check_point(j ,i-1) = .true.
293 check_point(j+1,i ) = .true.
294 check_point(j-1,i ) = .true.
301 if (check_point(j,i))
then
311 if (check_point(j,i))
then
312 maske(j,i) = maske_neu(j,i)
319 gamma_t = -4.5e-03_dp
329 temp_diff = gamma_t*(zs(j,i)-zs_ref(j,i)) + delta_ts
332 temp_mm(j,i,n) = temp_mm_present(j,i,n) + temp_diff
335 #elif (TSURFACE == 5)
340 temp_diff = gamma_t*(zs(j,i)-zs_ref(j,i))
343 temp_mm(j,i,n) = temp_mm_present(j,i,n) &
344 + glac_index*temp_mm_lgm_anom(j,i,n) &
352 temp_ma(j,i) = 0.0_dp
355 temp_ma(j,i) = temp_ma(j,i) + temp_mm(j,i,n)*inv_twelve
363 #if (ELEV_DESERT == 1)
365 gamma_p = gamma_p*1.0e-03_dp
367 zs_thresh = zs_thresh
371 #if (SOLID_PRECIP == 1) /* Marsiat (1994) */
378 inv_delta_temp_rain_snow = 1.0_dp/(temp_rain-temp_snow)
380 #elif (SOLID_PRECIP == 2) /* Bales et al. (2009) */
387 coeff(0) = 5.4714e-01_dp
388 coeff(1) = -9.1603e-02_dp
389 coeff(2) = -3.314e-03_dp
390 coeff(3) = 4.66e-04_dp
391 coeff(4) = 3.8e-05_dp
392 coeff(5) = 6.0e-07_dp
394 #elif (SOLID_PRECIP == 3) /* Huybrechts and de Wolde (1999) */
398 temp_snow = temp_rain
404 inv_sqrt2_s_stat = 1.0_dp/(sqrt(2.0_dp)*s_stat)
408 #if (ABLSURFACE==1 || ABLSURFACE==2)
411 beta1 = beta1_0 *(0.001_dp/86400.0_dp)*(rho_w/rho)
413 beta2 = beta2_0 *(0.001_dp/86400.0_dp)*(rho_w/rho)
417 mu = mu_0 *(1000.0_dp*86400.0_dp)*(rho/rho_w)
420 #elif (ABLSURFACE==3)
422 lambda_lti = lambda_lti *(0.001_dp/year_sec)*(rho_w/rho)
434 #if (ACCSURFACE <= 3)
438 #if (ELEV_DESERT == 0)
442 #elif (ELEV_DESERT == 1)
444 if (zs_ref(j,i) < zs_thresh)
then
446 = exp(gamma_p*(max(zs(j,i),zs_thresh)-zs_thresh))
449 = exp(gamma_p*(max(zs(j,i),zs_thresh)-zs_ref(j,i)))
453 stop
' boundary: Parameter ELEV_DESERT must be either 0 or 1!'
457 precip(j,i,n) = precip_present(j,i,n)*precip_fact
465 precip_fact = accfact
467 precip_fact = 1.0_dp + gamma_s*delta_ts
469 precip_fact = exp(gamma_s*delta_ts)
472 #if (ACCSURFACE <= 3)
474 precip(j,i,0) = 0.0_dp
477 precip(j,i,n) = precip(j,i,n)*precip_fact
478 precip(j,i,0) = precip(j,i,0) + precip(j,i,n)*inv_twelve
482 #elif (ACCSURFACE == 5)
484 precip(j,i,0) = 0.0_dp
488 #if (PRECIP_ANOM_INTERPOL==1)
489 precip_fact = 1.0_dp-glac_index+glac_index*precip_lgm_anom(j,i,n)
491 #elif (PRECIP_ANOM_INTERPOL==2)
492 precip_fact = exp(-glac_index*gamma_precip_lgm_anom(j,i,n))
496 precip(j,i,n) = precip_present(j,i,n)*precip_fact
497 precip(j,i,0) = precip(j,i,0) + precip(j,i,n)*inv_twelve
505 accum(j,i) = precip(j,i,0)
507 snowfall(j,i) = 0.0_dp
511 #if (SOLID_PRECIP == 1) /* Marsiat (1994) */
513 if (temp_mm(j,i,n) >= temp_rain)
then
515 else if (temp_mm(j,i,n) <= temp_snow)
then
518 frac_solid = (temp_rain-temp_mm(j,i,n))*inv_delta_temp_rain_snow
521 #elif (SOLID_PRECIP == 2) /* Bales et al. (2009) */
523 if (temp_mm(j,i,n) >= temp_rain)
then
525 else if (temp_mm(j,i,n) <= temp_snow)
then
528 frac_solid = coeff(0) + temp_mm(j,i,n) * ( coeff(1) &
529 + temp_mm(j,i,n) * ( coeff(2) &
530 + temp_mm(j,i,n) * ( coeff(3) &
531 + temp_mm(j,i,n) * ( coeff(4) &
532 + temp_mm(j,i,n) * coeff(5) ) ) ) )
536 #elif (SOLID_PRECIP == 3) /* Huybrechts and de Wolde (1999) */
538 frac_solid = 1.0_dp &
539 - 0.5_dp*
erfcc((temp_rain-temp_mm(j,i,n))*inv_sqrt2_s_stat)
543 snowfall(j,i) = snowfall(j,i) + precip(j,i,n)*frac_solid*inv_twelve
547 rainfall(j,i) = precip(j,i,0) - snowfall(j,i)
549 if (snowfall(j,i) < 0.0_dp) snowfall(j,i) = 0.0_dp
550 if (rainfall(j,i) < 0.0_dp) rainfall(j,i) = 0.0_dp
556 #if (ABLSURFACE==1 || ABLSURFACE==2)
561 temp_mm_help(n) = temp_mm(j,i,n)
564 call
pdd(temp_mm_help, s_stat, et(j,i))
572 if ((beta1*et(j,i)) <= (pmax*snowfall(j,i)))
then
573 melt_star(j,i) = beta1*et(j,i)
575 runoff(j,i) = melt(j,i)+rainfall(j,i)
577 melt_star(j,i) = pmax*snowfall(j,i)
578 melt(j,i) = beta2*(et(j,i)-melt_star(j,i)/beta1)
579 runoff(j,i) = melt(j,i)+rainfall(j,i)
582 #elif (ABLSURFACE==2)
584 if ( rainfall(j,i) <= (pmax*snowfall(j,i)) )
then
586 if ( (rainfall(j,i)+beta1*et(j,i)) <= (pmax*snowfall(j,i)) )
then
587 melt_star(j,i) = rainfall(j,i)+beta1*et(j,i)
589 runoff(j,i) = melt(j,i)
591 melt_star(j,i) = pmax*snowfall(j,i)
593 *(et(j,i)-(melt_star(j,i)-rainfall(j,i))/beta1)
594 runoff(j,i) = melt(j,i)
599 melt_star(j,i) = pmax*snowfall(j,i)
600 melt(j,i) = beta2*et(j,i)
601 runoff(j,i) = melt(j,i) + rainfall(j,i)-pmax*snowfall(j,i)
607 #elif (ABLSURFACE==3)
609 temp_jja_help = one_third*(temp_mm(j,i,6)+temp_mm(j,i,7)+temp_mm(j,i,8))
611 melt_star(j,i) = 0.0_dp
612 melt(j,i) = lambda_lti*max((temp_jja_help-temp_lti), 0.0_dp)
613 runoff(j,i) = melt(j,i) + rainfall(j,i)
624 as_perp(j,i) = accum(j,i) - evap(j,i) - runoff(j,i)
634 if (melt_star(j,i).ge.melt(j,i))
then
635 temp_s(j,i) = temp_ma(j,i) &
636 +mu*(melt_star(j,i)-melt(j,i))
638 temp_s(j,i) = temp_ma(j,i)
641 if (temp_s(j,i) > -0.001_dp) temp_s(j,i) = -0.001_dp