7 !! Computation of the surface temperature (must be less than 0 deg C!)
8 !! and of the accumulation-ablation function.
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 surface temperature (must be less than 0 deg C!)
35 !! and of the accumulation-ablation function.
36 !<------------------------------------------------------------------------------
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
56 integer(i4b) :: i, j, n
57 integer(i4b) :: i_gr, i_kl
59 real(dp) :: z_sl_min, t1, t2, t3, t4, t5, t6
60 real(dp) :: time_gr, time_kl
61 real(dp) :: z_sle_present, z_sle_help
62 real(dp),
dimension(0:JMAX,0:IMAX,0:12) :: precip
63 real(dp),
dimension(0:JMAX,0:IMAX) :: &
68 real(dp),
dimension(0:JMAX,0:IMAX,12) :: temp_mm
69 real(dp),
dimension(0:JMAX,0:IMAX) :: temp_ma
70 real(dp),
dimension(12) :: temp_mm_help
71 real(dp) :: temp_jja_help
72 real(dp),
dimension(0:JMAX,0:IMAX) :: et
73 real(dp) :: gamma_t, temp_diff
74 real(dp) :: gamma_p, zs_thresh, &
75 temp_rain, temp_snow, &
76 inv_delta_temp_rain_snow, coeff(0:5), inv_sqrt2_s_stat, &
77 precip_fact, frac_solid
78 real(dp) :: s_stat, beta1, beta2, pmax, mu, lambda_lti, temp_lti
80 logical,
dimension(0:JMAX,0:IMAX) :: check_point
82 real(dp),
parameter :: &
83 inv_twelve = 1.0_dp/12.0_dp, one_third = 1.0_dp/3.0_dp
104 delta_ts = sine_amplit &
105 *cos(2.0_dp*pi*time/(sine_period*year_sec)) &
112 if (time/year_sec.lt.
real(grip_time_min,dp)) then
113 delta_ts = griptemp(0)
114 else if (time/year_sec.lt.
real(grip_time_max,dp)) then
116 i_kl = floor(((time/year_sec)-
real(grip_time_min,dp))/
real(grip_time_stp,dp))
119 i_gr = ceiling(((time/year_sec)-
real(grip_time_min,dp))/
real(grip_time_stp,dp))
120 i_gr = min(i_gr, ndata_grip)
122 if (i_kl.eq.i_gr)
then
124 delta_ts = griptemp(i_kl)
128 time_kl = (grip_time_min + i_kl*grip_time_stp) *year_sec
129 time_gr = (grip_time_min + i_gr*grip_time_stp) *year_sec
131 delta_ts = griptemp(i_kl) &
132 +(griptemp(i_gr)-griptemp(i_kl)) &
133 *(time-time_kl)/(time_gr-time_kl)
139 delta_ts = griptemp(ndata_grip)
142 delta_ts = delta_ts * grip_temp_fact
149 if (time/year_sec <
real(gi_time_min,dp)) then
150 glac_index = glacial_index(0)
151 else if (time/year_sec <
real(gi_time_max,dp)) then
153 i_kl = floor(((time/year_sec)-
real(gi_time_min,dp))/
real(gi_time_stp,dp))
156 i_gr = ceiling(((time/year_sec)-
real(gi_time_min,dp))/
real(gi_time_stp,dp))
157 i_gr = min(i_gr, ndata_gi)
159 if (i_kl == i_gr)
then
161 glac_index = glacial_index(i_kl)
165 time_kl = (gi_time_min + i_kl*gi_time_stp) *year_sec
166 time_gr = (gi_time_min + i_gr*gi_time_stp) *year_sec
168 glac_index = glacial_index(i_kl) &
169 +(glacial_index(i_gr)-glacial_index(i_kl)) &
170 *(time-time_kl)/(time_gr-time_kl)
176 glac_index = glacial_index(ndata_gi)
192 t1 = -250000.0_dp *year_sec
193 t2 = -140000.0_dp *year_sec
194 t3 = -125000.0_dp *year_sec
195 t4 = -21000.0_dp *year_sec
196 t5 = -8000.0_dp *year_sec
197 t6 = 0.0_dp *year_sec
201 else if (time.lt.t2)
then
202 z_sl = z_sl_min*(time-t1)/(t2-t1)
203 else if (time.lt.t3)
then
204 z_sl = -z_sl_min*(time-t3)/(t3-t2)
205 else if (time.lt.t4)
then
206 z_sl = z_sl_min*(time-t3)/(t4-t3)
207 else if (time.lt.t5)
then
208 z_sl = -z_sl_min*(time-t5)/(t5-t4)
209 else if (time.lt.t6)
then
219 if (time/year_sec.lt.
real(specmap_time_min,dp)) then
220 z_sl = specmap_zsl(0)
221 else if (time/year_sec.lt.
real(specmap_time_max,dp)) then
223 i_kl = floor(((time/year_sec)-
real(specmap_time_min,dp))/
real(specmap_time_stp,dp))
226 i_gr = ceiling(((time/year_sec)-
real(specmap_time_min,dp))/
real(specmap_time_stp,dp))
227 i_gr = min(i_gr, ndata_specmap)
229 if (i_kl.eq.i_gr)
then
231 z_sl = specmap_zsl(i_kl)
235 time_kl = (specmap_time_min + i_kl*specmap_time_stp) *year_sec
236 time_gr = (specmap_time_min + i_gr*specmap_time_stp) *year_sec
238 z_sl = specmap_zsl(i_kl) &
239 +(specmap_zsl(i_gr)-specmap_zsl(i_kl)) &
240 *(time-time_kl)/(time_gr-time_kl)
246 z_sl = specmap_zsl(ndata_specmap)
253 if ( z_sl_old > -999999.9_dp )
then
254 dzsl_dtau = (z_sl-z_sl_old)/dtime
263 #if ( MARINE_ICE_CALVING==2 || MARINE_ICE_CALVING==3 )
265 #elif ( MARINE_ICE_CALVING==4 || MARINE_ICE_CALVING==5 )
266 z_mar = fact_z_mar*z_sl
267 #elif ( MARINE_ICE_CALVING==6 || MARINE_ICE_CALVING==7 )
268 if (z_sl >= -80.0_dp)
then
271 z_mar = 10.25_dp*(z_sl+80.0_dp)-200.0_dp
273 z_mar = fact_z_mar*z_mar
285 check_point(j,i) = .false.
291 if (maske(j,i).ge.2)
then
292 check_point(j ,i ) = .true.
293 check_point(j ,i+1) = .true.
294 check_point(j ,i-1) = .true.
295 check_point(j+1,i ) = .true.
296 check_point(j-1,i ) = .true.
303 if (check_point(j,i))
then
313 if (check_point(j,i))
then
314 maske(j,i) = maske_neu(j,i)
321 gamma_t = -4.5e-03_dp
331 temp_diff = gamma_t*(zs(j,i)-zs_ref(j,i)) + delta_ts
334 temp_mm(j,i,n) = temp_mm_present(j,i,n) + temp_diff
337 #elif (TSURFACE == 5)
342 temp_diff = gamma_t*(zs(j,i)-zs_ref(j,i))
345 temp_mm(j,i,n) = temp_mm_present(j,i,n) &
346 + glac_index*temp_mm_lgm_anom(j,i,n) &
354 temp_ma(j,i) = 0.0_dp
357 temp_ma(j,i) = temp_ma(j,i) + temp_mm(j,i,n)*inv_twelve
365 #if (ELEV_DESERT == 1)
367 gamma_p = gamma_p*1.0e-03_dp
369 zs_thresh = zs_thresh
373 #if (SOLID_PRECIP == 1) /* Marsiat (1994) */
380 inv_delta_temp_rain_snow = 1.0_dp/(temp_rain-temp_snow)
382 #elif (SOLID_PRECIP == 2) /* Bales et al. (2009) */
389 coeff(0) = 5.4714e-01_dp
390 coeff(1) = -9.1603e-02_dp
391 coeff(2) = -3.314e-03_dp
392 coeff(3) = 4.66e-04_dp
393 coeff(4) = 3.8e-05_dp
394 coeff(5) = 6.0e-07_dp
396 #elif (SOLID_PRECIP == 3) /* Huybrechts and de Wolde (1999) */
400 temp_snow = temp_rain
406 inv_sqrt2_s_stat = 1.0_dp/(sqrt(2.0_dp)*s_stat)
410 #if (ABLSURFACE==1 || ABLSURFACE==2)
413 beta1 = beta1_0 *(0.001_dp/86400.0_dp)*(rho_w/rho)
415 beta2 = beta2_0 *(0.001_dp/86400.0_dp)*(rho_w/rho)
419 mu = mu_0 *(1000.0_dp*86400.0_dp)*(rho/rho_w)
422 #elif (ABLSURFACE==3)
424 lambda_lti = lambda_lti *(0.001_dp/year_sec)*(rho_w/rho)
436 #if (ACCSURFACE <= 3)
440 #if (ELEV_DESERT == 0)
444 #elif (ELEV_DESERT == 1)
446 if (zs_ref(j,i) < zs_thresh)
then
448 = exp(gamma_p*(max(zs(j,i),zs_thresh)-zs_thresh))
451 = exp(gamma_p*(max(zs(j,i),zs_thresh)-zs_ref(j,i)))
455 stop
' boundary: Parameter ELEV_DESERT must be either 0 or 1!'
459 precip(j,i,n) = precip_present(j,i,n)*precip_fact
467 precip_fact = accfact
469 precip_fact = 1.0_dp + gamma_s*delta_ts
471 precip_fact = exp(gamma_s*delta_ts)
474 #if (ACCSURFACE <= 3)
476 precip(j,i,0) = 0.0_dp
479 precip(j,i,n) = precip(j,i,n)*precip_fact
480 precip(j,i,0) = precip(j,i,0) + precip(j,i,n)*inv_twelve
484 #elif (ACCSURFACE == 5)
486 precip(j,i,0) = 0.0_dp
490 #if (PRECIP_ANOM_INTERPOL==1)
491 precip_fact = 1.0_dp-glac_index+glac_index*precip_lgm_anom(j,i,n)
493 #elif (PRECIP_ANOM_INTERPOL==2)
494 precip_fact = exp(-glac_index*gamma_precip_lgm_anom(j,i,n))
498 precip(j,i,n) = precip_present(j,i,n)*precip_fact
499 precip(j,i,0) = precip(j,i,0) + precip(j,i,n)*inv_twelve
507 accum(j,i) = precip(j,i,0)
509 snowfall(j,i) = 0.0_dp
513 #if (SOLID_PRECIP == 1) /* Marsiat (1994) */
515 if (temp_mm(j,i,n) >= temp_rain)
then
517 else if (temp_mm(j,i,n) <= temp_snow)
then
520 frac_solid = (temp_rain-temp_mm(j,i,n))*inv_delta_temp_rain_snow
523 #elif (SOLID_PRECIP == 2) /* Bales et al. (2009) */
525 if (temp_mm(j,i,n) >= temp_rain)
then
527 else if (temp_mm(j,i,n) <= temp_snow)
then
530 frac_solid = coeff(0) + temp_mm(j,i,n) * ( coeff(1) &
531 + temp_mm(j,i,n) * ( coeff(2) &
532 + temp_mm(j,i,n) * ( coeff(3) &
533 + temp_mm(j,i,n) * ( coeff(4) &
534 + temp_mm(j,i,n) * coeff(5) ) ) ) )
538 #elif (SOLID_PRECIP == 3) /* Huybrechts and de Wolde (1999) */
540 frac_solid = 1.0_dp &
541 - 0.5_dp*
erfcc((temp_rain-temp_mm(j,i,n))*inv_sqrt2_s_stat)
545 snowfall(j,i) = snowfall(j,i) + precip(j,i,n)*frac_solid*inv_twelve
549 rainfall(j,i) = precip(j,i,0) - snowfall(j,i)
551 if (snowfall(j,i) < 0.0_dp) snowfall(j,i) = 0.0_dp
552 if (rainfall(j,i) < 0.0_dp) rainfall(j,i) = 0.0_dp
558 #if (ABLSURFACE==1 || ABLSURFACE==2)
563 temp_mm_help(n) = temp_mm(j,i,n)
566 call
pdd(temp_mm_help, s_stat, et(j,i))
574 if ((beta1*et(j,i)) <= (pmax*snowfall(j,i)))
then
575 melt_star(j,i) = beta1*et(j,i)
577 runoff(j,i) = melt(j,i)+rainfall(j,i)
579 melt_star(j,i) = pmax*snowfall(j,i)
580 melt(j,i) = beta2*(et(j,i)-melt_star(j,i)/beta1)
581 runoff(j,i) = melt(j,i)+rainfall(j,i)
584 #elif (ABLSURFACE==2)
586 if ( rainfall(j,i) <= (pmax*snowfall(j,i)) )
then
588 if ( (rainfall(j,i)+beta1*et(j,i)) <= (pmax*snowfall(j,i)) )
then
589 melt_star(j,i) = rainfall(j,i)+beta1*et(j,i)
591 runoff(j,i) = melt(j,i)
593 melt_star(j,i) = pmax*snowfall(j,i)
595 *(et(j,i)-(melt_star(j,i)-rainfall(j,i))/beta1)
596 runoff(j,i) = melt(j,i)
601 melt_star(j,i) = pmax*snowfall(j,i)
602 melt(j,i) = beta2*et(j,i)
603 runoff(j,i) = melt(j,i) + rainfall(j,i)-pmax*snowfall(j,i)
609 #elif (ABLSURFACE==3)
611 temp_jja_help = one_third*(temp_mm(j,i,6)+temp_mm(j,i,7)+temp_mm(j,i,8))
613 melt_star(j,i) = 0.0_dp
614 melt(j,i) = lambda_lti*max((temp_jja_help-temp_lti), 0.0_dp)
615 runoff(j,i) = melt(j,i) + rainfall(j,i)
626 as_perp(j,i) = accum(j,i) - evap(j,i) - runoff(j,i)
636 if (melt_star(j,i).ge.melt(j,i))
then
637 temp_s(j,i) = temp_ma(j,i) &
638 +mu*(melt_star(j,i)-melt(j,i))
640 temp_s(j,i) = temp_ma(j,i)
643 if (temp_s(j,i) > -0.001_dp) temp_s(j,i) = -0.001_dp