SURFEX v8.1
General documentation of Surfex
snow_cover_1layer.F90
Go to the documentation of this file.
1 !SFX_LIC Copyright 1994-2014 CNRS, Meteo-France and Universite Paul Sabatier
2 !SFX_LIC This is part of the SURFEX software governed by the CeCILL-C licence
3 !SFX_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt
4 !SFX_LIC for details. version 1.
5 ! #########
6  SUBROUTINE snow_cover_1layer(PTSTEP, PANSMIN, PANSMAX, PTODRY, PRHOSMIN, PRHOSMAX, &
7  PRHOFOLD, OALL_MELT, PDRAIN_TIME, PWCRN, PZ0SN, PZ0HSN, &
8  TPSNOW, PTG, PTG_COEFA, PTG_COEFB, PABS_SW, PLW1, PLW2, &
9  PTA, PQA, PVMOD, PPS, PRHOA, PSR, PZREF, PUREF, PRNSNOW,&
10  PHSNOW, PLESNOW, PGSNOW, PMELT, PDQS_SNOW, PABS_LW )
11 ! ##########################################################################
12 !
13 !!**** *SNOW_COVER_1LAYER*
14 !!
15 !! PURPOSE
16 !! -------
17 !
18 ! One layer snow mantel scheme
19 !
20 !
21 !!** METHOD
22 ! ------
23 !
24 !
25 ! The temperature equation is written as:
26 !
27 ! b T+ = y
28 !
29 !
30 !! EXTERNAL
31 !! --------
32 !!
33 !!
34 !! IMPLICIT ARGUMENTS
35 !! ------------------
36 !!
37 !! MODD_CST
38 !!
39 !!
40 !! REFERENCE
41 !! ---------
42 !!
43 !!
44 !! AUTHOR
45 !! ------
46 !!
47 !! V. Masson * Meteo-France *
48 !!
49 !! MODIFICATIONS
50 !! -------------
51 !! Original 08/09/98
52 !! J. Escobar 24/10/2012 : BUF PGI10.X , rewrite some 1 line WHERE statement
53 !! V. Masson 13/09/2013 : implicitation of coupling with roof below
54 !-------------------------------------------------------------------------------
55 !
56 !* 0. DECLARATIONS
57 ! ------------
58 !
59 USE modd_type_snow, ONLY : surf_snow
60 !
61 USE modd_csts, ONLY : xtt, xci, xrholi, xrholw, xcpd, xlstt, xlmtt, xday, xcondi
62 USE modd_snow_par, ONLY : xemissn
63 USE modd_surf_par, ONLY : xundef
64 !
65 USE mode_thermos
66 !
67 USE modi_surface_ri
68 USE modi_surface_aero_cond
69 !
70 !
71 USE yomhook ,ONLY : lhook, dr_hook
72 USE parkind1 ,ONLY : jprb
73 !
74 IMPLICIT NONE
75 !
76 !* 0.1 declarations of arguments
77 !
78 !
79 REAL, INTENT(IN) :: PTSTEP ! time step
80 REAL, INTENT(IN) :: PANSMIN ! minimum snow albedo
81 REAL, INTENT(IN) :: PANSMAX ! maximum snow albedo
82 REAL, INTENT(IN) :: PTODRY ! snow albedo decreasing constant
83 REAL, INTENT(IN) :: PRHOSMIN ! minimum snow density
84 REAL, INTENT(IN) :: PRHOSMAX ! maximum snow density
85 REAL, INTENT(IN) :: PRHOFOLD ! snow density increasing constant
86 LOGICAL, INTENT(IN) :: OALL_MELT! T --> all snow runs off if
87  ! lower surf. temperature is
88  ! positive
89 REAL, INTENT(IN) :: PDRAIN_TIME ! drainage folding time (days)
90 REAL, INTENT(IN) :: PWCRN ! critical snow amount necessary
91  ! to cover the considered surface
92 REAL, INTENT(IN) :: PZ0SN ! snow roughness length for momentum
93 REAL, INTENT(IN) :: PZ0HSN ! snow roughness length for heat
94 TYPE(surf_snow), INTENT(INOUT) :: TPSNOW
95 REAL, DIMENSION(:), INTENT(IN) :: PTG ! underlying ground temperature
96 REAL, DIMENSION(:), INTENT(IN) :: PTG_COEFA! underlying ground temperature
97 REAL, DIMENSION(:), INTENT(IN) :: PTG_COEFB! implicit terms
98 REAL, DIMENSION(:), INTENT(IN) :: PABS_SW ! absorbed SW energy (Wm-2)
99 REAL, DIMENSION(:), INTENT(IN) :: PLW1 ! LW coef independant of TSNOW
100  ! (Wm-2) usually equal to:
101  ! emis_snow * LW_down
102  !
103 REAL, DIMENSION(:), INTENT(IN) :: PLW2 ! LW coef dependant of TSNOW
104  ! (Wm-2 K-4) usually equal to:
105  ! -1 * emis_snow * stefan_constant
106  !
107 REAL, DIMENSION(:), INTENT(IN) :: PTA ! temperature at the lowest level
108 REAL, DIMENSION(:), INTENT(IN) :: PQA ! specific humidity
109  ! at the lowest level
110 REAL, DIMENSION(:), INTENT(IN) :: PVMOD ! module of the horizontal wind
111 REAL, DIMENSION(:), INTENT(IN) :: PPS ! pressure at the surface
112 REAL, DIMENSION(:), INTENT(IN) :: PRHOA ! air density
113  ! at the lowest level
114 REAL, DIMENSION(:), INTENT(IN) :: PSR ! snow rate
115 REAL, DIMENSION(:), INTENT(IN) :: PZREF ! reference height of the first
116  ! atmospheric level (temperature)
117 REAL, DIMENSION(:), INTENT(IN) :: PUREF ! reference height of the first
118  ! atmospheric level (wind)
119 REAL, DIMENSION(:), INTENT(OUT) :: PRNSNOW ! net radiation over snow
120 REAL, DIMENSION(:), INTENT(OUT) :: PHSNOW ! sensible heat flux over snow
121 REAL, DIMENSION(:), INTENT(OUT) :: PLESNOW ! latent heat flux over snow
122 REAL, DIMENSION(:), INTENT(OUT) :: PGSNOW ! flux under the snow
123 REAL, DIMENSION(:), INTENT(OUT) :: PMELT ! snow melting rate (kg/m2/s)
124 REAL, DIMENSION(:), INTENT(OUT) :: PDQS_SNOW! heat storage inside snow
125 REAL, DIMENSION(:), INTENT(OUT) :: PABS_LW ! absorbed LW rad by snow (W/m2)
126 !
127 !
128 !* 0.2 declarations of local variables
129 !
130 REAL :: ZEXPL = 0.
131 REAL :: ZIMPL = 1.
132 !
133 REAL, DIMENSION(SIZE(TPSNOW%WSNOW,1)) :: ZEXNS, ZEXNA, ZDIRCOSZW
134 REAL, DIMENSION(SIZE(TPSNOW%WSNOW,1)) :: ZZ0 ! roughness length for momentum
135 REAL, DIMENSION(SIZE(TPSNOW%WSNOW,1)) :: ZZ0H ! roughness length forheat
136 !
137 REAL, DIMENSION(SIZE(TPSNOW%WSNOW,1)) :: ZRI ! Richardson number
138 REAL, DIMENSION(SIZE(TPSNOW%WSNOW,1)) :: ZAC ! aerodynamical conductance
139 REAL, DIMENSION(SIZE(TPSNOW%WSNOW,1)) :: ZRA ! aerodynamical resistance
140 REAL, DIMENSION(SIZE(TPSNOW%WSNOW,1)) :: ZCH ! drag coefficient for heat
141 REAL, DIMENSION(SIZE(TPSNOW%WSNOW,1)) :: ZB, ZY ! coefficients in Ts eq.
142 REAL, DIMENSION(SIZE(TPSNOW%WSNOW,1)) :: ZWSNOW ! snow before evolution
143 REAL, DIMENSION(SIZE(TPSNOW%WSNOW,1)) :: ZSNOW_HC ! snow heat capacity
144 REAL, DIMENSION(SIZE(TPSNOW%WSNOW,1)) :: ZSNOW_TC ! snow thermal conductivity
145 REAL, DIMENSION(SIZE(TPSNOW%WSNOW,1)) :: ZSNOW_D ! snow depth
146 REAL, DIMENSION(SIZE(TPSNOW%WSNOW,1)) :: ZMELT ! snow melting rate (kg/m3/s)
147 REAL, DIMENSION(SIZE(TPSNOW%WSNOW,1)) :: ZTS_SNOW ! snow surface temperature
148  ! at previous time-step
149 REAL, DIMENSION(SIZE(TPSNOW%WSNOW,1)) :: ZQSAT ! specific humidity
150 ! ! for ice
151 REAL, DIMENSION(SIZE(TPSNOW%WSNOW,1)) :: ZDQSAT ! d(specific humidity)/dT
152 ! ! for ice
153 !
154 REAL, DIMENSION(SIZE(TPSNOW%WSNOW,1)) :: ZSR1, ZSR2 ! norm. snow precip.
155 !
156 LOGICAL, DIMENSION(SIZE(TPSNOW%WSNOW,1)) :: GSNOWMASK ! where snow is
157 ! ! at previuos time-step
158 LOGICAL, DIMENSION(SIZE(TPSNOW%WSNOW,1)) :: GFLUXMASK ! where fluxes can
159 ! ! be computed at
160 ! ! new time-step
161 ! ! i.e. snow occurence
162 ! ! at previous time-step
163 ! ! OR snow fall
164 INTEGER, DIMENSION(SIZE(TPSNOW%WSNOW,1)) :: JSNOWMASK1, JSNOWMASK2, JSNOWMASK3 ! where snow is or not
165 ! ! at previuos time-step
166 INTEGER, DIMENSION(SIZE(TPSNOW%WSNOW,1)) :: JFLUXMASK ! where fluxes can
167 ! ! be computed at
168 ! ! new time-step
169 ! ! i.e. snow occurence
170 ! ! at previous time-step
171 ! ! OR snow fall
172 !
173 REAL :: ZWSNOW_MIN = 0.1 ! minimum value of snow content (kg/m2) for prognostic
174 ! ! computations
175 !
176 REAL, DIMENSION(SIZE(TPSNOW%WSNOW,1)) :: ZEI_SNOW ! internal energy of snow
177 REAL, DIMENSION(SIZE(TPSNOW%WSNOW,1)) :: ZPEI_SNOW ! internal energy of snow at t+
178 REAL, DIMENSION(SIZE(TPSNOW%WSNOW,1)) :: ZWORK1
179 REAL, DIMENSION(SIZE(TPSNOW%WSNOW,1)) :: ZDQSATI, ZQSATI
180 !
181 INTEGER :: JJ, JI, JCOMPT_SNOW1, JCOMPT_SNOW2, JCOMPT_SNOW3, JCOMPT_FLUX
182 REAL(KIND=JPRB) :: ZHOOK_HANDLE
183 !-------------------------------------------------------------------------------
184 !
185 !
186 IF (lhook) CALL dr_hook('SNOW_COVER_1LAYER',0,zhook_handle)
187 zb(:)=0.
188 zy(:)=0.
189 zmelt(:) = 0.
190 pmelt(:) = 0.
191 prnsnow(:) = 0.
192 phsnow(:) = 0.
193 plesnow(:) = 0.
194 pgsnow(:) = 0.
195 !RJ: workaround to prevent decomposition unstable xundef masks for Tx_LWA_SN_RD fields
196 !RJ: in TEB_DIAGNOSTICS.nc during TEB_GARDEN_GREENROOF_BEM_3L_IRRIG_* tests
197 !RJ: problem with decomposition handling somewhere else
198 #ifdef RJ_PFIX
199 pabs_lw(:) = 0.0
200 #else
201 pabs_lw(:) = xundef
202 #endif
203 !
204 !* snow reservoir before evolution
205 !
206 zwsnow(:) = tpsnow%WSNOW(:,1)
207 zts_snow(:) = min(xtt,ptg(:))
208 !
209 zsnow_d(:) = 0.
210 zsnow_tc(:) = 0.
211 zsnow_hc(:) = 0.
212 !
213 !-------------------------------------------------------------------------------
214 !
215 !* 1.1 most useful masks
216 ! -----------------
217 !
218 gsnowmask(:)=.false.
219 gfluxmask(:)=.false.
220 jsnowmask1(:)=0.
221 jsnowmask2(:)=0.
222 jsnowmask3(:)=0.
223 jfluxmask(:)=0.
224 
225  !* 1.2 drag
226 ! ----
227 !
228 !* 1.2.1 defaults
229 ! --------
230 !
231 !* variation of temperature with altitude is neglected
232 !
233 zexns(:) = 1.
234 zexna(:) = 1.
235 !
236 !* slope is neglected in drag computation
237 !
238 zdircoszw(:) = 1.
239 !
240 !* roughness length are imposed:
241 !
242 zz0(:) = pz0sn
243 zz0h(:) = pz0hsn
244 
245 !
246 !
247 !* 1.1 most useful masks
248 ! -----------------
249 !* snow occurence at previous time-step
250 !
251 !* snow occurence during the time-step for fluxes computation
252 !
253 jcompt_snow1=0
254 jcompt_snow2=0
255 jcompt_snow3=0
256 jcompt_flux=0
257 DO jj=1,SIZE(zwsnow)
258  IF (zwsnow(jj)>0.) THEN
259  gsnowmask(jj)=.true.
260  !* surface temperature
261  zts_snow(jj) = tpsnow%TS(jj)
262  gfluxmask(jj)=.true.
263  !gsnowmask=t
264  jcompt_snow1=jcompt_snow1+1
265  jsnowmask1(jcompt_snow1) = jj
266  !gfluxmask=t
267  jcompt_flux=jcompt_flux+1
268  jfluxmask(jcompt_flux) = jj
269  IF (zwsnow(jj)>=zwsnow_min) THEN
270  !second snow mask
271  jcompt_snow3=jcompt_snow3+1
272  jsnowmask3(jcompt_snow3)=jj
273  ELSE
274  !lower limit of snow cover for prognostic computations
275  !0.1 kg/m2 of snow water content
276  tpsnow%T(jj,1) = min(ptg(jj),xtt)
277  ENDIF
278  ELSE
279  tpsnow%T(jj,1) = min(ptg(jj),xtt)
280  !gsnowmask=false
281  jcompt_snow2=jcompt_snow2+1
282  jsnowmask2(jcompt_snow2) = jj
283  IF (psr(jj)>0.) THEN
284  gfluxmask(jj)=.true.
285  jcompt_flux=jcompt_flux+1
286  jfluxmask(jcompt_flux) = jj
287  ENDIF
288  ENDIF
289 ENDDO
290 !
291 !-------------------------------------------------------------------------------
292 !
293 !* 1.2 drag
294 ! ----
295 !
296 !* 1.2.2 qsat (Tsnow)
297 ! ------------
298 !
299 zqsat(:) = qsati(zts_snow(:), pps(:) )
300 !
301 !* 1.2.3 Richardson number
302 ! -----------------
303 !
304 !* snow is present on all the considered surface.
305 !* computation occurs where snow is and/or falls.
306 !
307  CALL surface_ri(zts_snow, zqsat, zexns, zexna, pta, pqa, &
308  pzref, puref, zdircoszw, pvmod, zri )
309 !
310 !* 1.2.4 Aerodynamical conductance
311 ! -------------------------
312 !
313  CALL surface_aero_cond(zri, pzref, puref, pvmod, zz0, zz0h, zac, zra, zch)
314 !
315 !-------------------------------------------------------------------------------
316 !
317 !* 2. snow thermal characteristics
318 ! ----------------------------
319 !cdir nodep
320 DO jj=1,jcompt_snow1
321  !
322  ji = jsnowmask1(jj)
323  !
324  !* 2.1 snow heat capacity
325  zsnow_hc(ji) = tpsnow%RHO(ji,1) * xci * xrholi / xrholw
326 !* 2.2 snow depth
327  zsnow_d(ji) = zwsnow(ji) / tpsnow%RHO(ji,1)
328 !* 2.3 snow thermal conductivity
329  zsnow_tc(ji) = xcondi * (tpsnow%RHO(ji,1)/xrholw)**1.885
330 !* 2.4 internal energy of snow
331  zei_snow(ji) = zsnow_hc(ji)*zsnow_d(ji)*tpsnow%T(ji,1)
332  !
333 ENDDO
334 !
335 !cdir nodep
336 DO jj=1,jcompt_snow2
337  !
338  ji = jsnowmask2(jj)
339  !
340  !* 2.1 snow heat capacity
341  zsnow_hc(ji) = prhosmin * xci * xrholi / xrholw
342 !* 2.2 snow depth
343  zsnow_d(ji) = ptstep * psr(ji) / prhosmin
344 !* 2.3 snow thermal conductivity
345  zsnow_tc(ji) = xcondi * (prhosmin /xrholw)**1.885
346 !* 2.4 internal energy of snow
347  zei_snow(ji) = 0.
348 !
349 ENDDO
350 !
351 !-------------------------------------------------------------------------------
352 !
353 !* 3. Snow temperature evolution
354 ! --------------------------
355 !
356 !* 3.5 dqsat/ dT (Tsnow)
357 ! -----------------
358 !
359 zdqsati = dqsati(zts_snow(:),pps(:),zqsat(:))
360 WHERE (gsnowmask(:) .AND. zwsnow(:)>=zwsnow_min)
361  zdqsat(:) = zdqsati(:)
362 END WHERE
363 !
364 !* 3.1 coefficients from Temperature tendency
365 ! --------------------------------------
366 !
367 !cdir nodep
368 DO jj=1,jcompt_snow3
369 !
370  ji=jsnowmask3(jj)
371 
372  zwork1(ji) = zsnow_d(ji) * zsnow_hc(ji) / ptstep
373 !
374  zb(ji) = zb(ji) + zwork1(ji)
375 !
376 !* 3.2 coefficients from solar radiation
377 ! ---------------------------------
378 !
379  zy(ji) = zy(ji) + zwork1(ji) * tpsnow%T(ji,1) + pabs_sw(ji)
380 !
381 !
382 !* 3.3 coefficients from infra-red radiation
383 ! -------------------------------------
384 !
385  zwork1(ji) = plw2(ji) * tpsnow%T(ji,1)**3
386 !
387  zb(ji) = zb(ji) - 4 * zimpl * zwork1(ji)
388 !
389  zy(ji) = zy(ji) + plw1(ji) + zwork1(ji) * (zexpl-3.*zimpl) * tpsnow%T(ji,1)
390 !
391 !
392 !* 3.4 coefficients from sensible heat flux
393 ! ------------------------------------
394 !
395  zwork1(ji) = xcpd * prhoa(ji) * zac(ji)
396 !
397  zb(ji) = zb(ji) + zwork1(ji) * zimpl
398 !
399  zy(ji) = zy(ji) - zwork1(ji) * ( zexpl * tpsnow%T(ji,1) - pta(ji) )
400 !
401 !
402 !* 3.6 coefficients from latent heat flux
403 ! ----------------------------------
404 !
405  zwork1(ji) = xlstt * prhoa(ji) * zac(ji)
406 !
407  zb(ji) = zb(ji) + zwork1(ji) * zimpl * zdqsat(ji)
408 !
409  zy(ji) = zy(ji) - zwork1(ji) * ( zqsat(ji) - pqa(ji) - zimpl * zdqsat(ji)*tpsnow%T(ji,1) )
410 !
411 !* 3.7 coefficients from conduction flux at snow base
412 ! ----------------------------------------------
413 !
414  zwork1(ji) = zsnow_tc(ji)/(0.5*zsnow_d(ji))
415 !
416  zb(ji) = zb(ji) + zwork1(ji) * zimpl / ( 1. + zwork1(ji)*ptg_coefa(ji) )
417 !
418  zy(ji) = zy(ji) - zwork1(ji) * (zexpl * tpsnow%T(ji,1) - ptg_coefb(ji)) &
419  / ( 1. + zwork1(ji)*ptg_coefa(ji) )
420 !
421 !* 3.8 guess of snow temperature before accumulation and melting
422 ! ---------------------------------------------------------
423 !
424  tpsnow%T(ji,1) = zy(ji) / zb(ji)
425 !
426 ENDDO
427 !
428 !-------------------------------------------------------------------------------
429 !
430 !* 4. Snow melt
431 ! ---------
432 !
433 !* 4.1 melting
434 ! -------
435 !
436 !cdir nodep
437 DO jj=1,jcompt_snow1
438 !
439  ji = jsnowmask1(jj)
440 !
441  zmelt(ji) = max( tpsnow%T(ji,1) - xtt , 0. ) * zsnow_hc(ji) / xlmtt / ptstep
442 !
443  zmelt(ji) = min( zmelt(ji) , zwsnow(ji) / zsnow_d(ji) / ptstep )
444 !
445  tpsnow%T(ji,1) = min( tpsnow%T(ji,1) , xtt )
446 !
447 ENDDO
448 !
449 !* 4.2 run-off of all snow if lower surface temperature is positive
450 ! ------------------------------------------------------------
451 !
452 !* this option is used when snow is located on sloping roofs for example.
453 !
454 IF (oall_melt) THEN
455  WHERE ( gsnowmask(:) .AND. ptg(:)>xtt .AND. zwsnow(:)>=zwsnow_min )
456  pmelt(:) = pmelt(:) + zwsnow(:) / ptstep
457  END WHERE
458 END IF
459 !
460 !* 4.3 output melting in kg/m2/s
461 ! -------------------------
462 !
463 pmelt(:) = zmelt(:) * zsnow_d(:)
464 !
465 !-------------------------------------------------------------------------------
466 !
467 !* 5. fluxes
468 ! ------
469 !
470 !* 5.3 qsat (Tsnow)
471 ! ------------
472 !
473 zqsati = qsati(tpsnow%T(:,1),pps(:))
474 WHERE (gfluxmask(:))
475  zqsat(:) = zqsati(:)
476 END WHERE
477 !
478 !* 5.1 net radiation (with Ts lin. extrapolation)
479 ! -------------
480 !
481 !cdir nodep
482 DO jj = 1, jcompt_flux
483 !
484  ji = jfluxmask(jj)
485 !
486  pabs_lw(ji) = plw1(ji) + plw2(ji) * tpsnow%T(ji,1)**4
487 !
488  prnsnow(ji) = pabs_sw(ji) + pabs_lw(ji)
489 !
490 !
491 !* 5.2 sensible heat flux
492 ! ------------------
493 !
494  phsnow(ji) = xcpd * prhoa(ji) * zac(ji) * ( tpsnow%T(ji,1) - pta(ji) )
495 !
496 !
497 !* 5.4 latent heat flux
498 ! ----------------
499 !
500  plesnow(ji) = xlstt * prhoa(ji) * zac(ji) * ( zqsat(ji) - pqa(ji) )
501  !
502 !
503 !* 5.5 Conduction heat flux
504 ! --------------------
505 !
506  !PGSNOW(JI) = ZSNOW_TC(JI)/(0.5*ZSNOW_D(JI)) * ( TPSNOW%T(JI,1) - PTG(JI) )
507  pgsnow(ji) = zsnow_tc(ji)/(0.5*zsnow_d(ji)) * ( tpsnow%T(ji,1) - ptg_coefb(ji) ) &
508  / ( 1. + zsnow_tc(ji)/(0.5*zsnow_d(ji))*ptg_coefa(ji) )
509 !
510 !
511 !* 5.6 If ground T>0 C, Melting is estimated from conduction heat flux
512 ! ---------------------------------------------------------------
513 !
514  IF (ptg(ji)>xtt) pmelt(ji) = max(pmelt(ji), -pgsnow(ji)/xlmtt)
515 !
516 ENDDO
517 !
518 !-------------------------------------------------------------------------------
519 !
520 !* 6. reservoir evolution
521 ! -------------------
522 !
523 !cdir nodep
524 DO jj = 1, SIZE(tpsnow%WSNOW,1)
525 !
526 !* 6.1 snow fall
527 ! ---------
528 !
529  tpsnow%WSNOW(jj,1) = tpsnow%WSNOW(jj,1) + ptstep * psr(jj)
530 !
531 !
532 !* 6.2 sublimation
533 ! -----------
534 !
535  plesnow(jj) = min( plesnow(jj), xlstt*tpsnow%WSNOW(jj,1)/ptstep )
536 !
537  tpsnow%WSNOW(jj,1) = max( tpsnow%WSNOW(jj,1) - ptstep * plesnow(jj)/xlstt , 0.)
538 !
539  IF ( tpsnow%WSNOW(jj,1)<1.e-8 * ptstep ) tpsnow%WSNOW(jj,1) = 0.
540 !
541 !* 6.3 melting
542 ! -------
543 !
544  pmelt(jj) = min( pmelt(jj), tpsnow%WSNOW(jj,1)/ptstep )
545 !
546  tpsnow%WSNOW(jj,1)= max( tpsnow%WSNOW(jj,1) - ptstep * pmelt(jj) , 0.)
547 !
548  IF ( tpsnow%WSNOW(jj,1)<1.e-8 * ptstep ) tpsnow%WSNOW(jj,1) = 0.
549 !
550  IF (tpsnow%WSNOW(jj,1)==0.) pgsnow(jj) = max( pgsnow(jj), - pmelt(jj)*xlmtt )
551 !
552 ENDDO
553 !
554 !* 6.4 time dependent drainage
555 ! -----------------------
556 !
557 IF (pdrain_time>0.) THEN
558  WHERE ( tpsnow%WSNOW(:,1)>0.)
559  tpsnow%WSNOW(:,1) = tpsnow%WSNOW(:,1) * exp(-ptstep/pdrain_time/xday)
560  END WHERE
561 END IF
562 !
563 !* 6.5 melting of last 1mm of snow depth
564 ! ---------------------------------
565 !
566 WHERE ( tpsnow%WSNOW(:,1)<zwsnow_min .AND. pmelt(:)>0. .AND. psr(:)==0. )
567  pmelt(:) = pmelt(:) + tpsnow%WSNOW(:,1) / ptstep
568  tpsnow%WSNOW(:,1)=0.
569 END WHERE
570 !
571 WHERE ( tpsnow%WSNOW(:,1)<1.e-8 * ptstep )
572  tpsnow%WSNOW(:,1) = 0.
573 END WHERE
574 !
575 !-------------------------------------------------------------------------------
576 !
577 !* 7. albedo evolution
578 ! ----------------
579 !
580 !* 7.1 If melting occurs or not
581 ! -----------------------
582 !
583 !
584 !cdir nodep
585 DO jj=1,jcompt_snow1
586 !
587  ji = jsnowmask1(jj)
588 !
589  IF (pmelt(ji) > 0. ) THEN
590 !
591  tpsnow%ALB(ji) = (tpsnow%ALB(ji)-pansmin)*exp(-prhofold*ptstep/xday) + pansmin &
592  + psr(ji)*ptstep/pwcrn*pansmax
593 !
594  ELSEIF (pmelt(ji)==0.) THEN
595  tpsnow%ALB(ji) = tpsnow%ALB(ji) - ptodry*ptstep/xday + psr(ji)*ptstep/pwcrn*pansmax
596 !
597  ENDIF
598 !
599 ENDDO
600 !
601 !-------------------------------------------------------------------------------
602 !
603 !* 8. density evolution
604 ! -----------------
605 !
606 !* 8.1 old snow
607 ! --------
608 !
609 !cdir nodep
610 DO jj = 1, jcompt_snow1
611 !
612  ji = jsnowmask1(jj)
613 !
614  IF (tpsnow%WSNOW(ji,1)>0. ) THEN
615 !
616  zsr1(ji) = max( tpsnow%WSNOW(ji,1) , psr(ji) * ptstep )
617 !
618  tpsnow%RHO(ji,1) = (tpsnow%RHO(ji,1)-prhosmax)*exp(-prhofold*ptstep/xday) + prhosmax
619  tpsnow%RHO(ji,1) = ( (zsr1(ji)-psr(ji)*ptstep) * tpsnow%RHO(ji,1) &
620  + (psr(ji)*ptstep) * prhosmin ) / zsr1(ji)
621  ENDIF
622 !
623 ENDDO
624 !
625 !* 8.2 fresh snow
626 ! ----------
627 !
628 !cdir nodep
629 DO jj=1,SIZE(tpsnow%WSNOW,1)
630  IF ( tpsnow%WSNOW(jj,1)>0. ) THEN
631  tpsnow%ALB(jj) = max(tpsnow%ALB(jj),pansmin)
632  tpsnow%ALB(jj) = min(tpsnow%ALB(jj),pansmax)
633  IF (zwsnow(jj)==0.) THEN
634  tpsnow%ALB (jj) = pansmax
635  tpsnow%EMIS (jj) = xemissn
636  tpsnow%RHO(jj,1) = prhosmin
637  ENDIF
638  ENDIF
639  ENDDO
640 !
641 !-------------------------------------------------------------------------------
642 !
643 !* 9. fresh snow accumulation (if more than 1mm of snow depth)
644 ! -----------------------
645 !
646 !cdir nodep
647 DO jj=1,jcompt_snow3
648 !
649  ji = jsnowmask3(jj)
650 !
651  IF (psr(ji)>0. .AND. tpsnow%WSNOW(ji,1)>0.) THEN
652 !
653  zsr2(ji) = min( tpsnow%WSNOW(ji,1) , psr(ji) * ptstep )
654 !
655  tpsnow%T(ji,1) =( ( tpsnow%WSNOW(ji,1) - zsr2(ji) ) * tpsnow%T(ji,1) &
656  + zsr2(ji) * min( pta(ji) ,xtt )) / ( tpsnow%WSNOW(ji,1) )
657  ENDIF
658 !
659 ENDDO
660 !
661 !-------------------------------------------------------------------------------
662 !
663 !* 10. Surface temperature
664 ! -------------------
665 !
666 !* note that if the relation between snow pack temperature and its
667 ! surface temperature is modified, think to modify it also in
668 ! subroutine init_snow_lw.f90
669 !
670 WHERE (gsnowmask(:) )
671  tpsnow%TS(:) = tpsnow%T(:,1)
672 END WHERE
673 !
674 !-------------------------------------------------------------------------------
675 !
676 !* 11. bogus values
677 ! ------------
678 !
679 !* 11.1 snow characteristics where snow IS present at current time-step
680 ! ---------------------------------------------------------------
681 !
682 WHERE (tpsnow%WSNOW(:,1)==0.)
683  tpsnow%T(:,1) = xundef
684  tpsnow%RHO(:,1) = xundef
685  tpsnow%ALB(:) = xundef
686  tpsnow%TS(:) = xundef
687  tpsnow%EMIS(:) = xundef
688 END WHERE
689 !
690 !
691 !-------------------------------------------------------------------------------
692 !
693 !* 12. Heat storage inside snow pack
694 !
695 WHERE (gsnowmask(:))
696  zpei_snow(:) = zsnow_hc(:)*zsnow_d(:)*tpsnow%T(:,1)
697 ELSEWHERE
698  zpei_snow(:) = 0.
699 END WHERE
700 pdqs_snow(:) = (zpei_snow(:)-zei_snow(:))/ptstep
701 !
702 IF (lhook) CALL dr_hook('SNOW_COVER_1LAYER',1,zhook_handle)
703 
704 !------------------------------------------------------------------------------- !
705 END SUBROUTINE snow_cover_1layer
706 
real, save xcpd
Definition: modd_csts.F90:63
subroutine snow_cover_1layer(PTSTEP, PANSMIN, PANSMAX, PTODRY, PRHOSMIN, PRHOSMAX, PRHOFOLD, OALL_MELT, PDRAIN_TIME, PWCRN, PZ0SN, PZ0HSN, TPSNOW, PTG, PTG_COEFA, PTG_COEFB, PABS_SW, PLW1, PLW2, PTA, PQA, PVMOD, PPS, PRHOA, PSR, PZREF, PUREF, PRNSNOW, PHSNOW, PLESNOW, PGSNOW, PMELT, PDQS_SNOW, PABS_LW)
subroutine surface_ri(PTG, PQS, PEXNS, PEXNA, PTA, PQA, PZREF, PUREF, PDIRCOSZW, PVMOD, PRI)
Definition: surface_ri.F90:8
real, save xlstt
Definition: modd_csts.F90:71
real, parameter xundef
real, save xcondi
Definition: modd_csts.F90:82
subroutine surface_aero_cond(PRI, PZREF, PUREF, PVMOD, PZ0, PZ0H, PAC, PRA, PCH)
integer, parameter jprb
Definition: parkind1.F90:32
real, save xci
Definition: modd_csts.F90:65
real, save xday
Definition: modd_csts.F90:45
logical lhook
Definition: yomhook.F90:15
real, save xrholi
Definition: modd_csts.F90:81
real, save xrholw
Definition: modd_csts.F90:64
real, save xtt
Definition: modd_csts.F90:66
real, save xlmtt
Definition: modd_csts.F90:72