8module noahmp_glacier_globals
10 use machine ,
only : kind_phys
12 use module_sf_noahmplsm,
only :
sfcdif4
21 real (kind=kind_phys),
parameter :: grav = 9.80616
22 real (kind=kind_phys),
parameter :: sb = 5.67e-08
23 real (kind=kind_phys),
parameter :: vkc = 0.40
24 real (kind=kind_phys),
parameter :: tfrz = 273.16
25 real (kind=kind_phys),
parameter :: hsub = 2.8440e06
26 real (kind=kind_phys),
parameter :: hvap = 2.5104e06
27 real (kind=kind_phys),
parameter :: hfus = 0.3336e06
28 real (kind=kind_phys),
parameter :: cwat = 4.188e06
29 real (kind=kind_phys),
parameter :: cice = 2.094e06
30 real (kind=kind_phys),
parameter :: cpair = 1004.64
31 real (kind=kind_phys),
parameter :: tkwat = 0.6
32 real (kind=kind_phys),
parameter :: tkice = 2.2
33 real (kind=kind_phys),
parameter :: tkair = 0.023
34 real (kind=kind_phys),
parameter :: rair = 287.04
35 real (kind=kind_phys),
parameter :: rw = 461.269
36 real (kind=kind_phys),
parameter :: denh2o = 1000.
37 real (kind=kind_phys),
parameter :: denice = 917.
72 REAL,
PARAMETER :: Z0SNO = 0.002
73 REAL,
PARAMETER :: SSI = 0.03
74 REAL,
PARAMETER :: SWEMX = 1.00
78end module noahmp_glacier_globals
85 use noahmp_glacier_globals
127 iloc ,jloc ,cosz ,nsnow ,nsoil ,dt , & ! in : time/space/model-related
128 sfctmp ,sfcprs ,uu ,vv ,q2 ,soldn , & ! in : forcing
129 prcp ,lwdn ,tbot ,zlvl ,ficeold ,zsoil , & ! in : forcing
130 thsfc_loc ,prslkix ,prsik1x ,prslk1x , &
131 psfc ,pblhx ,iz0tlnd ,itime , &
132 sigmaf1 ,garea1 ,psi_opt , & ! in :
133 ep_1 ,ep_2 ,epsm1 ,cp , &
134 qsnow ,sneqvo ,albold ,cm ,ch ,isnow , & ! in/out :
135 sneqv ,smc ,zsnso ,snowh ,snice ,snliq , & ! in/out :
136 tg ,stc ,sh2o ,tauss ,qsfc , & ! in/out :
137 fsa ,fsr ,fira ,fsh ,fgev ,ssoil , & ! out :
138 trad ,edir ,runsrf ,runsub ,sag ,albedo , & ! out :
139 qsnbot ,ponding ,ponding1 ,ponding2 ,t2m,q2e ,z0h_total , & ! out :
141 emissi ,fpice ,ch2b , esnow , albsnd , albsni , &
144 emissi ,fpice ,ch2b , esnow. , albsnd , albsni)
155 integer ,
intent(in) :: iloc
156 integer ,
intent(in) :: jloc
157 real (kind=kind_phys) ,
intent(in) :: cosz
158 integer ,
intent(in) :: nsnow
159 integer ,
intent(in) :: nsoil
160 integer ,
intent(in) :: psi_opt
162 real (kind=kind_phys) ,
intent(in) :: dt
163 real (kind=kind_phys) ,
intent(in) :: sfctmp
164 real (kind=kind_phys) ,
intent(in) :: sfcprs
165 real (kind=kind_phys) ,
intent(in) :: uu
166 real (kind=kind_phys) ,
intent(in) :: vv
167 real (kind=kind_phys) ,
intent(in) :: q2
168 real (kind=kind_phys) ,
intent(in) :: soldn
169 real (kind=kind_phys) ,
intent(in) :: prcp
170 real (kind=kind_phys) ,
intent(in) :: lwdn
171 real (kind=kind_phys) ,
intent(in) :: tbot
172 real (kind=kind_phys) ,
intent(in) :: zlvl
173 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(in) :: ficeold
174 real (kind=kind_phys),
dimension( 1:nsoil),
intent(in) :: zsoil
175 logical ,
intent(in) :: thsfc_loc
176 real (kind=kind_phys) ,
intent(in) :: prslkix
177 real (kind=kind_phys) ,
intent(in) :: prsik1x
178 real (kind=kind_phys) ,
intent(in) :: prslk1x
180 real (kind=kind_phys) ,
intent(in) :: psfc
181 real (kind=kind_phys) ,
intent(in) :: pblhx
182 real (kind=kind_phys) ,
intent(in) :: ep_1
183 real (kind=kind_phys) ,
intent(in) :: ep_2
184 real (kind=kind_phys) ,
intent(in) :: epsm1
185 real (kind=kind_phys) ,
intent(in) :: cp
186 integer ,
intent(in) :: iz0tlnd
187 integer ,
intent(in) :: itime
189 real (kind=kind_phys) ,
intent(in) :: sigmaf1
190 real (kind=kind_phys) ,
intent(in) :: garea1
195 real (kind=kind_phys) ,
intent(inout) :: qsnow
196 real (kind=kind_phys) ,
intent(inout) :: sneqvo
197 real (kind=kind_phys) ,
intent(inout) :: albold
198 real (kind=kind_phys) ,
intent(inout) :: cm
199 real (kind=kind_phys) ,
intent(inout) :: ch
202 integer ,
intent(inout) :: isnow
203 real (kind=kind_phys) ,
intent(inout) :: sneqv
204 real (kind=kind_phys),
dimension( 1:nsoil),
intent(inout) :: smc
205 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: zsnso
206 real (kind=kind_phys) ,
intent(inout) :: snowh
207 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(inout) :: snice
208 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(inout) :: snliq
209 real (kind=kind_phys) ,
intent(inout) :: tg
210 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: stc
211 real (kind=kind_phys),
dimension( 1:nsoil),
intent(inout) :: sh2o
212 real (kind=kind_phys) ,
intent(inout) :: tauss
213 real (kind=kind_phys) ,
intent(inout) :: qsfc
216 real (kind=kind_phys) ,
intent(out) :: fsa
217 real (kind=kind_phys) ,
intent(out) :: fsr
218 real (kind=kind_phys) ,
intent(out) :: fira
219 real (kind=kind_phys) ,
intent(out) :: fsh
220 real (kind=kind_phys) ,
intent(out) :: fgev
221 real (kind=kind_phys) ,
intent(out) :: ssoil
222 real (kind=kind_phys) ,
intent(out) :: trad
223 real (kind=kind_phys) ,
intent(out) :: edir
224 real (kind=kind_phys) ,
intent(out) :: runsrf
225 real (kind=kind_phys) ,
intent(out) :: runsub
226 real (kind=kind_phys) ,
intent(out) :: sag
227 real (kind=kind_phys) ,
intent(out) ::
albedo
228 real (kind=kind_phys) ,
intent(out) :: qsnbot
229 real (kind=kind_phys) ,
intent(out) :: ponding
230 real (kind=kind_phys) ,
intent(out) :: ponding1
231 real (kind=kind_phys) ,
intent(out) :: ponding2
232 real (kind=kind_phys) ,
intent(out) :: t2m
233 real (kind=kind_phys) ,
intent(out) :: q2e
234 real (kind=kind_phys) ,
intent(out) :: z0h_total
235 real (kind=kind_phys) ,
intent(out) :: emissi
236 real (kind=kind_phys) ,
intent(out) :: fpice
237 real (kind=kind_phys) ,
intent(out) :: ch2b
238 real (kind=kind_phys) ,
intent(out) :: esnow
239 real (kind=kind_phys),
dimension(1:2) ,
intent(out) :: albsnd
240 real (kind=kind_phys),
dimension(1:2) ,
intent(out) :: albsni
244 character(len=*),
intent(inout) :: errmsg
245 integer,
intent(inout) :: errflg
250 integer,
dimension(-nsnow+1:nsoil) :: imelt
251 real (kind=kind_phys) :: rhoair
252 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: dzsnso
253 real (kind=kind_phys) :: thair
254 real (kind=kind_phys) :: qair
255 real (kind=kind_phys) :: eair
256 real (kind=kind_phys),
dimension( 1: 2) :: solad
257 real (kind=kind_phys),
dimension( 1: 2) :: solai
258 real (kind=kind_phys),
dimension( 1:nsoil) :: sice
259 real (kind=kind_phys),
dimension(-nsnow+1: 0) :: snicev
260 real (kind=kind_phys),
dimension(-nsnow+1: 0) :: snliqv
261 real (kind=kind_phys),
dimension(-nsnow+1: 0) :: epore
262 real (kind=kind_phys) :: qdew
263 real (kind=kind_phys) :: qvap
264 real (kind=kind_phys) :: lathea
265 real (kind=kind_phys) :: qmelt
266 real (kind=kind_phys) :: swdown
267 real (kind=kind_phys) :: beg_wb
268 real (kind=kind_phys) :: zbot = -8.0
270 character*256 message
275 call atm_glacier (ep_2, epsm1,sfcprs ,sfctmp ,q2 ,soldn ,cosz ,thair , &
276 qair ,eair ,rhoair ,solad ,solai ,swdown )
282 do iz = isnow+1, nsoil
283 if(iz == isnow+1)
then
284 dzsnso(iz) = - zsnso(iz)
286 dzsnso(iz) = zsnso(iz-1) - zsnso(iz)
293 eair ,sfcprs ,qair ,sfctmp ,lwdn ,uu , &
294 vv ,solad ,solai ,cosz ,zlvl , &
295 tbot ,zbot ,zsnso ,dzsnso ,sigmaf1 ,garea1 , &
296 thsfc_loc ,prslkix ,prsik1x ,prslk1x , &
297 psfc ,pblhx ,iz0tlnd ,itime ,psi_opt , &
298 ep_1, ep_2, epsm1, cp, &
299 tg ,stc ,snowh ,sneqv ,sneqvo ,sh2o , &
300 smc ,snice ,snliq ,albold ,cm ,ch , &
302 tauss ,qsfc ,errmsg ,errflg , &
306 imelt ,snicev ,snliqv ,epore ,qmelt ,ponding , &
307 sag ,fsa ,fsr ,fira ,fsh ,fgev , &
308 trad ,t2m ,ssoil ,lathea ,q2e ,emissi , &
309 ch2b ,albsnd ,albsni ,z0h_total)
312 if (errflg /= 0)
return
315 sice = max(0.0, smc - sh2o)
318 qvap = max( fgev/lathea, 0.)
319 qdew = abs( min(fgev/lathea, 0.))
324 call water_glacier (nsnow ,nsoil ,imelt ,dt ,prcp ,sfctmp , &
325 qvap ,qdew ,ficeold ,zsoil , &
326 isnow ,snowh ,sneqv ,snice ,snliq ,stc , &
327 dzsnso ,sh2o ,sice ,ponding ,zsnso ,fsh , &
328 runsrf ,runsub ,qsnow ,ponding1 ,ponding2 ,qsnbot , &
331 if(opt_gla == 2)
then
344 fsh ,fgev ,ssoil ,sag ,prcp ,edir , &
346 runsrf ,runsub ,sneqv ,dt ,beg_wb ,errmsg , errflg )
348 runsrf ,runsub ,sneqv ,dt ,beg_wb )
352 if (errflg /= 0)
return
355 if(snowh <= 1.e-6 .or. sneqv <= 1.e-3)
then
360 if(swdown.ne.0.)
then
371 subroutine atm_glacier (ep_2, epsm1, sfcprs ,sfctmp ,q2 ,soldn ,cosz ,thair , &
372 qair ,eair ,rhoair ,solad ,solai , &
381 real (kind=kind_phys) ,
intent(in) :: ep_2
382 real (kind=kind_phys) ,
intent(in) :: epsm1
383 real (kind=kind_phys) ,
intent(in) :: sfcprs
384 real (kind=kind_phys) ,
intent(in) :: sfctmp
385 real (kind=kind_phys) ,
intent(in) :: q2
386 real (kind=kind_phys) ,
intent(in) :: soldn
387 real (kind=kind_phys) ,
intent(in) :: cosz
391 real (kind=kind_phys) ,
intent(out) :: thair
392 real (kind=kind_phys) ,
intent(out) :: qair
393 real (kind=kind_phys) ,
intent(out) :: eair
394 real (kind=kind_phys),
dimension( 1: 2),
intent(out) :: solad
395 real (kind=kind_phys),
dimension( 1: 2),
intent(out) :: solai
396 real (kind=kind_phys) ,
intent(out) :: rhoair
397 real (kind=kind_phys) ,
intent(out) :: swdown
401 real (kind=kind_phys) :: pair
405 thair = sfctmp * (sfcprs/pair)**(rair/cpair)
409 eair = qair*sfcprs / (ep_2-epsm1*qair)
410 rhoair = (sfcprs+epsm1*eair) / (rair*sfctmp)
418 solad(1) = swdown*0.7*0.5
419 solad(2) = swdown*0.7*0.5
420 solai(1) = swdown*0.3*0.5
421 solai(2) = swdown*0.3*0.5
429 eair ,sfcprs ,qair ,sfctmp ,lwdn ,uu , & !in
430 vv ,solad ,solai ,cosz ,zref , & !in
431 tbot ,zbot ,zsnso ,dzsnso ,sigmaf1 ,garea1 , & !in
432 thsfc_loc ,prslkix ,prsik1x ,prslk1x , & !in
433 psfc ,pblhx ,iz0tlnd ,itime ,psi_opt , &
434 ep_1, ep_2, epsm1, cp, &
435 tg ,stc ,snowh ,sneqv ,sneqvo ,sh2o , & !inout
436 smc ,snice ,snliq ,albold ,cm ,ch , & !inout
438 tauss ,qsfc ,errmsg ,errflg , & !inout
440 tauss ,qsfc , & !inout
442 imelt ,snicev ,snliqv ,epore ,qmelt ,ponding , & !out
443 sag ,fsa ,fsr ,fira ,fsh ,fgev , & !out
444 trad ,t2m ,ssoil ,lathea ,q2e ,emissi , & !out
445 ch2b ,albsnd ,albsni ,z0h_total)
455 integer ,
intent(in) :: nsnow
456 integer ,
intent(in) :: nsoil
457 integer ,
intent(in) :: psi_opt
459 integer ,
intent(in) :: isnow
460 real (kind=kind_phys) ,
intent(in) :: dt
461 real (kind=kind_phys) ,
intent(in) :: qsnow
462 real (kind=kind_phys) ,
intent(in) :: rhoair
463 real (kind=kind_phys) ,
intent(in) :: eair
464 real (kind=kind_phys) ,
intent(in) :: sfcprs
465 real (kind=kind_phys) ,
intent(in) :: qair
466 real (kind=kind_phys) ,
intent(in) :: sfctmp
467 real (kind=kind_phys) ,
intent(in) :: lwdn
468 real (kind=kind_phys) ,
intent(in) :: uu
469 real (kind=kind_phys) ,
intent(in) :: vv
470 real (kind=kind_phys) ,
dimension( 1: 2),
intent(in) :: solad
471 real (kind=kind_phys) ,
dimension( 1: 2),
intent(in) :: solai
472 real (kind=kind_phys) ,
intent(in) :: cosz
473 real (kind=kind_phys) ,
intent(in) :: zref
474 real (kind=kind_phys) ,
intent(in) :: tbot
475 real (kind=kind_phys) ,
intent(in) :: zbot
476 real (kind=kind_phys) ,
dimension(-nsnow+1:nsoil),
intent(in) :: zsnso
477 real (kind=kind_phys) ,
dimension(-nsnow+1:nsoil),
intent(in) :: dzsnso
479 logical ,
intent(in) :: thsfc_loc
480 real (kind=kind_phys) ,
intent(in) :: prslkix
481 real (kind=kind_phys) ,
intent(in) :: prsik1x
482 real (kind=kind_phys) ,
intent(in) :: prslk1x
484 real (kind=kind_phys) ,
intent(in) :: pblhx
485 real (kind=kind_phys) ,
intent(in) :: psfc
486 real (kind=kind_phys) ,
intent(in) :: ep_1
487 real (kind=kind_phys) ,
intent(in) :: ep_2
488 real (kind=kind_phys) ,
intent(in) :: epsm1
489 real (kind=kind_phys) ,
intent(in) :: cp
490 integer ,
intent(in) :: iz0tlnd
491 integer ,
intent(in) :: itime
493 real (kind=kind_phys) ,
intent(in) :: sigmaf1
494 real (kind=kind_phys) ,
intent(in) :: garea1
497 real (kind=kind_phys) ,
intent(inout) :: tg
498 real (kind=kind_phys) ,
dimension(-nsnow+1:nsoil),
intent(inout) :: stc
499 real (kind=kind_phys) ,
intent(inout) :: snowh
500 real (kind=kind_phys) ,
intent(inout) :: sneqv
501 real (kind=kind_phys) ,
intent(inout) :: sneqvo
502 real (kind=kind_phys) ,
dimension( 1:nsoil),
intent(inout) :: sh2o
503 real (kind=kind_phys) ,
dimension( 1:nsoil),
intent(inout) :: smc
504 real (kind=kind_phys) ,
dimension(-nsnow+1: 0),
intent(inout) :: snice
505 real (kind=kind_phys) ,
dimension(-nsnow+1: 0),
intent(inout) :: snliq
506 real (kind=kind_phys) ,
intent(inout) :: albold
507 real (kind=kind_phys) ,
intent(inout) :: cm
508 real (kind=kind_phys) ,
intent(inout) :: ch
509 real (kind=kind_phys) ,
intent(inout) :: tauss
510 real (kind=kind_phys) ,
intent(inout) :: qsfc
513 character(len=*) ,
intent(inout) :: errmsg
514 integer ,
intent(inout) :: errflg
518 integer,
dimension(-nsnow+1:nsoil) ,
intent(out) :: imelt
519 real (kind=kind_phys) ,
dimension(-nsnow+1: 0),
intent(out) :: snicev
520 real (kind=kind_phys) ,
dimension(-nsnow+1: 0),
intent(out) :: snliqv
521 real (kind=kind_phys) ,
dimension(-nsnow+1: 0),
intent(out) :: epore
522 real (kind=kind_phys) ,
intent(out) :: qmelt
523 real (kind=kind_phys) ,
intent(out) :: ponding
524 real (kind=kind_phys) ,
intent(out) :: sag
525 real (kind=kind_phys) ,
intent(out) :: fsa
526 real (kind=kind_phys) ,
intent(out) :: fsr
527 real (kind=kind_phys) ,
intent(out) :: fira
528 real (kind=kind_phys) ,
intent(out) :: fsh
529 real (kind=kind_phys) ,
intent(out) :: fgev
530 real (kind=kind_phys) ,
intent(out) :: trad
531 real (kind=kind_phys) ,
intent(out) :: t2m
532 real (kind=kind_phys) ,
intent(out) :: ssoil
533 real (kind=kind_phys) ,
intent(out) :: lathea
534 real (kind=kind_phys) ,
intent(out) :: q2e
535 real (kind=kind_phys) ,
intent(out) :: emissi
536 real (kind=kind_phys) ,
intent(out) :: ch2b
537 real (kind=kind_phys),
dimension(1:2) ,
intent(out) :: albsnd
538 real (kind=kind_phys),
dimension(1:2) ,
intent(out) :: albsni
539 real (kind=kind_phys) ,
intent(out) :: z0h_total
543 real (kind=kind_phys) :: ur
544 real (kind=kind_phys) :: zlvl
545 real (kind=kind_phys) :: rsurf
546 real (kind=kind_phys) :: zpd
547 real (kind=kind_phys) :: z0mg
548 real (kind=kind_phys) :: emg
549 real (kind=kind_phys) :: fire
550 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: fact
551 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: df
552 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: hcpct
553 real (kind=kind_phys) :: gamma
554 real (kind=kind_phys) :: rhsur
560 ur = max( sqrt(uu**2.+vv**2.), 1. )
572 dt ,snowh ,snice ,snliq , &
573 df ,hcpct ,snicev ,snliqv ,epore , &
579 qsnow ,solad ,solai , &
581 sag ,fsr ,fsa ,albsnd ,albsni)
595 gamma = cpair*sfcprs/(ep_2*lathea)
599 call glacier_flux (nsoil ,nsnow ,emg ,isnow ,df ,dzsnso ,z0mg , &
600 zlvl ,zpd ,qair ,sfctmp ,rhoair ,sfcprs , &
601 ur ,gamma ,rsurf ,lwdn ,rhsur ,smc , &
602 eair ,stc ,sag ,snowh ,lathea ,sh2o , &
603 thsfc_loc ,prslkix ,prsik1x ,prslk1x , &
604 psfc ,pblhx ,iz0tlnd ,itime ,uu ,vv , &
605 sigmaf1 ,garea1 ,psi_opt ,ep_1, ep_2, epsm1, cp, &
607 cm ,ch ,tg ,qsfc ,errmsg ,errflg , &
611 fira ,fsh ,fgev ,ssoil , &
612 t2m ,q2e ,ch2b ,z0h_total)
621 errmsg =
"stop in noah-mp: emitted longwave <0"
624 call wrf_error_fatal(
"stop in noah-mp: emitted longwave <0")
635 trad = ( ( fire - (1-emissi)*lwdn ) / (emissi*sb) ) ** 0.25
640 ssoil ,snowh ,zbot ,zsnso ,df , &
645 if(opt_stc == 2)
then
646 if (snowh > 0.05 .and. tg > tfrz) tg = tfrz
653 stc ,snice ,snliq ,sneqv ,snowh , &
655 qmelt ,imelt ,ponding )
663 dt ,snowh ,snice ,snliq , & !in
664 df ,hcpct ,snicev ,snliqv ,epore , & !out
671 integer ,
intent(in) :: nsoil
672 integer ,
intent(in) :: nsnow
673 integer ,
intent(in) :: isnow
674 real (kind=kind_phys) ,
intent(in) :: dt
675 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(in) :: snice
676 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(in) :: snliq
677 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: dzsnso
678 real (kind=kind_phys) ,
intent(in) :: snowh
681 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(out) :: df
682 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(out) :: hcpct
683 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(out) :: snicev
684 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(out) :: snliqv
685 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(out) :: epore
686 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(out) :: fact
691 real (kind=kind_phys),
dimension(-nsnow+1: 0) :: cvsno
692 real (kind=kind_phys),
dimension(-nsnow+1: 0) :: tksno
693 real (kind=kind_phys) :: zmid
698 call csnow_glacier (isnow ,nsnow ,nsoil ,snice ,snliq ,dzsnso , &
699 tksno ,cvsno ,snicev ,snliqv ,epore )
703 hcpct(iz) = cvsno(iz)
709 zmid = 0.5 * (dzsnso(iz))
711 zmid = zmid + dzsnso(iz2)
713 hcpct(iz) = 1.e6 * ( 0.8194 + 0.1309*zmid )
714 df(iz) = 0.32333 + ( 0.10073 * zmid )
719 do iz = isnow+1,nsoil
720 fact(iz) = dt/(hcpct(iz)*dzsnso(iz))
726 df(1) = (df(1)*dzsnso(1)+0.35*snowh) / (snowh +dzsnso(1))
728 df(1) = (df(1)*dzsnso(1)+df(0)*dzsnso(0)) / (dzsnso(0)+dzsnso(1))
738 tksno ,cvsno ,snicev ,snliqv ,epore )
746 integer,
intent(in) :: isnow
747 integer ,
intent(in) :: nsnow
748 integer ,
intent(in) :: nsoil
749 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(in) :: snice
750 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(in) :: snliq
751 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: dzsnso
755 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(out) :: cvsno
756 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(out) :: tksno
757 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(out) :: snicev
758 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(out) :: snliqv
759 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(out) :: epore
764 real (kind=kind_phys),
dimension(-nsnow+1: 0) :: bdsnoi
770 snicev(iz) = min(1., snice(iz)/(dzsnso(iz)*denice) )
771 epore(iz) = 1. - snicev(iz)
772 snliqv(iz) = min(epore(iz),snliq(iz)/(dzsnso(iz)*denh2o))
776 bdsnoi(iz) = (snice(iz)+snliq(iz))/dzsnso(iz)
777 cvsno(iz) = cice*snicev(iz)+cwat*snliqv(iz)
787 tksno(iz) = 2.576e-6*bdsnoi(iz)**2. + 0.074
796 qsnow ,solad ,solai , & !in
797 albold ,tauss , & !inout
798 sag ,fsr ,fsa ,albsnd ,albsni)
803 real (kind=kind_phys),
intent(in) :: dt
804 real (kind=kind_phys),
intent(in) :: tg
805 real (kind=kind_phys),
intent(in) :: sneqvo
806 real (kind=kind_phys),
intent(in) :: sneqv
807 real (kind=kind_phys),
intent(in) :: cosz
808 real (kind=kind_phys),
intent(in) :: qsnow
809 real (kind=kind_phys),
dimension(1:2) ,
intent(in) :: solad
810 real (kind=kind_phys),
dimension(1:2) ,
intent(in) :: solai
813 real (kind=kind_phys),
intent(inout) :: albold
814 real (kind=kind_phys),
intent(inout) :: tauss
815 real (kind=kind_phys),
dimension(1:2) :: albsnd
816 real (kind=kind_phys),
dimension(1:2) :: albsni
819 real (kind=kind_phys),
intent(out) :: sag
820 real (kind=kind_phys),
intent(out) :: fsr
821 real (kind=kind_phys),
intent(out) :: fsa
826 real (kind=kind_phys) :: fage
827 real (kind=kind_phys) :: alb
828 real (kind=kind_phys) :: abs
829 real (kind=kind_phys) :: ref
830 real (kind=kind_phys) :: fsno
831 real (kind=kind_phys),
dimension(1:2) :: albice
833 real (kind=kind_phys),
parameter :: mpe = 1.e-6
851 if(opt_alb == 2)
then
863 if(sneqv > 0.0) fsno = 1.0
869 albsnd(ib) = albice(ib)*(1.-fsno) + albsnd(ib)*fsno
870 albsni(ib) = albice(ib)*(1.-fsno) + albsni(ib)*fsno
874 abs = solad(ib)*(1.-albsnd(ib)) + solai(ib)*(1.-albsni(ib))
878 ref = solad(ib)*albsnd(ib) + solai(ib)*albsni(ib)
893 real (kind=kind_phys),
intent(in) :: dt
894 real (kind=kind_phys),
intent(in) :: tg
895 real (kind=kind_phys),
intent(in) :: sneqvo
896 real (kind=kind_phys),
intent(in) :: sneqv
899 real (kind=kind_phys),
intent(inout) :: tauss
902 real (kind=kind_phys),
intent(out) :: fage
905 real (kind=kind_phys) :: tage
906 real (kind=kind_phys) :: age1
907 real (kind=kind_phys) :: age2
908 real (kind=kind_phys) :: age3
909 real (kind=kind_phys) :: dela
910 real (kind=kind_phys) :: sge
911 real (kind=kind_phys) :: dels
912 real (kind=kind_phys) :: dela0
913 real (kind=kind_phys) :: arg
917 if(sneqv.le.0.0)
then
919 else if (sneqv.gt.800.)
then
924 arg = 5.e3*(1./tfrz-1./tg)
926 age2 = exp(amin1(0.,10.*arg))
928 tage = age1+age2+age3
930 dels = amax1(0.0,sneqv-sneqvo) / swemx
931 sge = (tauss+dela)*(1.0-dels)
932 tauss = amax1(0.,sge)
935 fage= tauss/(tauss+1.)
947 integer,
intent(in) :: nband
949 real (kind=kind_phys),
intent(in) :: cosz
950 real (kind=kind_phys),
intent(in) :: fage
954 real (kind=kind_phys),
dimension(1:2),
intent(out) :: albsnd
955 real (kind=kind_phys),
dimension(1:2),
intent(out) :: albsni
958 real (kind=kind_phys) :: fzen
959 real (kind=kind_phys) :: cf1
960 real (kind=kind_phys) :: sl2
961 real (kind=kind_phys) :: sl1
962 real (kind=kind_phys) :: sl
963 real (kind=kind_phys),
parameter :: c1 = 0.2
964 real (kind=kind_phys),
parameter :: c2 = 0.5
970 albsnd(1: nband) = 0.
971 albsni(1: nband) = 0.
978 cf1=((1.+sl1)/(1.+sl2*cosz)-sl1)
981 albsni(1)=0.95*(1.-c1*fage)
982 albsni(2)=0.65*(1.-c2*fage)
984 albsnd(1)=albsni(1)+0.4*fzen*(1.-albsni(1))
985 albsnd(2)=albsni(2)+0.4*fzen*(1.-albsni(2))
997 integer,
intent(in) :: nband
999 real (kind=kind_phys),
intent(in) :: qsnow
1000 real (kind=kind_phys),
intent(in) :: dt
1001 real (kind=kind_phys),
intent(in) :: albold
1005 real (kind=kind_phys),
intent(inout) :: alb
1008 real (kind=kind_phys),
dimension(1:2),
intent(out) :: albsnd
1009 real (kind=kind_phys),
dimension(1:2),
intent(out) :: albsni
1015 albsnd(1: nband) = 0.
1016 albsni(1: nband) = 0.
1020 alb = 0.55 + (albold-0.55) * exp(-0.01*dt/3600.)
1025 if (qsnow > 0.)
then
1026 alb = alb + min(qsnow*dt,swemx) * (0.84-alb)/(swemx)
1040 zlvl ,zpd ,qair ,sfctmp ,rhoair ,sfcprs , & !in
1041 ur ,gamma ,rsurf ,lwdn ,rhsur ,smc , & !in
1042 eair ,stc ,sag ,snowh ,lathea ,sh2o , & !in
1043 thsfc_loc ,prslkix ,prsik1x ,prslk1x , &
1044 psfc ,pblhx ,iz0tlnd ,itime ,uu ,vv , &
1045 sigmaf1 ,garea1 ,psi_opt ,ep_1, ep_2, epsm1, cp, & !in
1047 cm ,ch ,tgb ,qsfc ,errmsg ,errflg , & !inout
1049 cm ,ch ,tgb ,qsfc , & !inout
1051 irb ,shb ,evb ,ghb , & !out
1052 t2mb ,q2b ,ehb2 ,z0h_total)
1066 integer,
intent(in) :: nsnow
1067 integer,
intent(in) :: nsoil
1068 integer,
intent(in) :: psi_opt
1070 real (kind=kind_phys),
intent(in) :: emg
1071 integer,
intent(in) :: isnow
1072 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: df
1073 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: dzsnso
1074 real (kind=kind_phys),
intent(in) :: z0m
1075 real (kind=kind_phys),
intent(in) :: zlvl
1076 real (kind=kind_phys),
intent(in) :: zpd
1077 real (kind=kind_phys),
intent(in) :: qair
1078 real (kind=kind_phys),
intent(in) :: sfctmp
1079 real (kind=kind_phys),
intent(in) :: rhoair
1080 real (kind=kind_phys),
intent(in) :: sfcprs
1081 real (kind=kind_phys),
intent(in) :: ur
1082 real (kind=kind_phys),
intent(in) :: gamma
1083 real (kind=kind_phys),
intent(in) :: rsurf
1084 real (kind=kind_phys),
intent(in) :: lwdn
1085 real (kind=kind_phys),
intent(in) :: rhsur
1086 real (kind=kind_phys),
intent(in) :: eair
1087 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: stc
1088 real (kind=kind_phys),
dimension( 1:nsoil),
intent(in) :: smc
1089 real (kind=kind_phys),
dimension( 1:nsoil),
intent(in) :: sh2o
1090 real (kind=kind_phys),
intent(in) :: sag
1091 real (kind=kind_phys),
intent(in) :: snowh
1092 real (kind=kind_phys),
intent(in) :: lathea
1094 logical ,
intent(in) :: thsfc_loc
1095 real (kind=kind_phys),
intent(in) :: prslkix
1096 real (kind=kind_phys),
intent(in) :: prsik1x
1097 real (kind=kind_phys),
intent(in) :: prslk1x
1099 real (kind=kind_phys) ,
intent(in) :: pblhx
1100 real (kind=kind_phys) ,
intent(in) :: psfc
1101 real (kind=kind_phys) ,
intent(in) :: ep_1
1102 real (kind=kind_phys) ,
intent(in) :: ep_2
1103 real (kind=kind_phys) ,
intent(in) :: epsm1
1104 real (kind=kind_phys) ,
intent(in) :: cp
1105 integer ,
intent(in) :: iz0tlnd
1106 integer ,
intent(in) :: itime
1107 real (kind=kind_phys) ,
intent(in) :: uu
1108 real (kind=kind_phys) ,
intent(in) :: vv
1110 real (kind=kind_phys),
intent(in) :: sigmaf1
1111 real (kind=kind_phys),
intent(in) :: garea1
1114 real (kind=kind_phys),
intent(inout) :: cm
1115 real (kind=kind_phys),
intent(inout) :: ch
1116 real (kind=kind_phys),
intent(inout) :: tgb
1117 real (kind=kind_phys),
intent(inout) :: qsfc
1120 character(len=*),
intent(inout) :: errmsg
1121 integer,
intent(inout) :: errflg
1126 real (kind=kind_phys),
intent(out) :: irb
1127 real (kind=kind_phys),
intent(out) :: shb
1128 real (kind=kind_phys),
intent(out) :: evb
1129 real (kind=kind_phys),
intent(out) :: ghb
1130 real (kind=kind_phys),
intent(out) :: t2mb
1131 real (kind=kind_phys),
intent(out) :: q2b
1132 real (kind=kind_phys),
intent(out) :: ehb2
1133 real (kind=kind_phys),
intent(out) :: z0h_total
1140 real (kind=kind_phys) :: mpe
1141 real (kind=kind_phys) :: dtg
1143 real (kind=kind_phys) :: mozold
1144 real (kind=kind_phys) :: fm2
1145 real (kind=kind_phys) :: fh2
1146 real (kind=kind_phys) :: ch2
1147 real (kind=kind_phys) :: h
1148 real (kind=kind_phys) :: fv
1149 real (kind=kind_phys) :: cir
1150 real (kind=kind_phys) :: cgh
1151 real (kind=kind_phys) :: csh
1152 real (kind=kind_phys) :: cev
1153 real (kind=kind_phys) :: cq2b
1155 real (kind=kind_phys) :: z0h
1157 real (kind=kind_phys) :: qfx
1158 real (kind=kind_phys) :: cq2
1161 real(kind=kind_phys) :: rb1i
1162 real(kind=kind_phys) :: fm10i
1164 real(kind=kind_phys) :: stress1i
1166 real(kind=kind_phys) :: wspd1i
1167 real(kind=kind_phys) :: flhc1i
1168 real(kind=kind_phys) :: flqc1i
1170 real(kind=kind_phys) :: tv1i
1172 real(kind=kind_phys) :: thv1i
1173 real(kind=kind_phys) :: tvsi
1174 real(kind=kind_phys) :: zlvli
1176 real(kind=kind_phys) :: snwd
1178 real(kind=kind_phys) :: reyni
1179 real(kind=kind_phys) :: virtfaci
1181 real(kind=kind_phys) :: tem1,tem2,zvfun1,gdx
1182 real(kind=kind_phys),
parameter :: z0lo=0.1, z0up=1.0
1184 real (kind=kind_phys) :: moz
1185 real (kind=kind_phys) :: fm
1186 real (kind=kind_phys) :: fh
1187 real (kind=kind_phys) :: ramb
1188 real (kind=kind_phys) :: rahb
1189 real (kind=kind_phys) :: rawb
1190 real (kind=kind_phys) :: estg
1191 real (kind=kind_phys) :: destg
1192 real (kind=kind_phys) :: esatw
1193 real (kind=kind_phys) :: esati
1194 real (kind=kind_phys) :: dsatw
1195 real (kind=kind_phys) :: dsati
1196 real (kind=kind_phys) :: a
1197 real (kind=kind_phys) :: b
1198 real (kind=kind_phys) :: t, tdc
1199 real (kind=kind_phys),
dimension( 1:nsoil) :: sice
1200 real (kind=kind_phys) :: czil
1202 tdc(t) = min( 50., max(-50.,(t-tfrz)) )
1229 fv = ur*vkc/log(zlvli/z0m)
1230 reyni = fv*z0m/(1.5e-05)
1232 if (opt_trs == 1)
then
1234 elseif (opt_trs == 2)
then
1235 z0h = z0m*exp(-czil*0.4*258.2*sqrt(fv*z0m))
1236 elseif (opt_trs == 3)
then
1238 elseif (opt_trs == 4)
then
1239 if (reyni .gt. 2.0)
then
1240 z0h = z0m/exp(2.46*(reyni)**0.25 - log(7.4))
1242 z0h = z0m/exp(-log(0.397))
1248 virtfaci = 1.0 + 0.61 * max(qair, 1.e-8)
1249 tv1i = sfctmp * virtfaci
1252 thv1i = sfctmp * prslkix * virtfaci
1254 thv1i = sfctmp / prslk1x * virtfaci
1257 if ( ur < 2.0) niter = 2
1260 cgh = 2.*df(isnow+1)/dzsnso(isnow+1)
1263 tem1 = (z0m - z0lo) / (z0up - z0lo)
1264 tem1 = min(max(tem1, 0.0_kind_phys), 1.0_kind_phys)
1265 tem2 = max(sigmaf1, 0.1_kind_phys)
1266 zvfun1= sqrt(tem1 * tem2)
1269 if(opt_sfc == 1 .or. opt_sfc == 2 .or. opt_sfc == 4)
then
1270 loop3:
do iter = 1, niterb
1271 if(opt_sfc == 1 .or. opt_sfc == 2)
then
1276 qair ,sfctmp ,h ,rhoair ,mpe ,ur , &
1278 & moz ,mozsgn ,fm ,fh ,fm2 ,fh2,fv, errmsg, errflg, &
1280 & moz ,mozsgn ,fm ,fh ,fm2 ,fh2,fv , &
1285 if (errflg /= 0)
return
1289 if(opt_sfc == 4)
then
1291 call sfcdif4(1 ,1 ,uu ,vv ,sfctmp , &
1292 sfcprs ,psfc ,pblhx ,gdx ,z0m , &
1294 itime ,snwd ,1 ,psi_opt, &
1295 tgb ,qair ,zlvl ,iz0tlnd,qsfc , &
1296 h ,qfx ,cm ,ch ,ch2 , &
1297 cq2 ,moz ,fv ,rb1i, fm, fh, &
1298 stress1i,fm10i ,fh2 , wspd1i ,flhc1i ,flqc1i)
1318 if(opt_sfc == 1 .or. opt_sfc == 2 .or. opt_sfc == 3)
then
1319 ramb = max(1.,1./(cm*ur))
1320 rahb = max(1.,1./(ch*ur))
1321 elseif(opt_sfc == 4)
then
1322 ramb = max(1.,1./(cm*wspd1i) )
1323 rahb = max(1.,1./(ch*wspd1i) )
1331 call esat(t, esatw, esati, dsatw, dsati)
1340 csh = rhoair*cpair/rahb
1341 if(snowh > 0.0 .or. opt_gla == 1)
then
1342 cev = rhoair*cpair/gamma/(rsurf+rawb)
1349 irb = cir * tgb**4 - emg*lwdn
1350 shb = csh * (tgb - sfctmp )
1351 evb = cev * (estg*rhsur - eair )
1352 ghb = cgh * (tgb - stc(isnow+1))
1354 b = sag-irb-shb-evb-ghb
1355 a = 4.*cir*tgb**3 + csh + cev*destg + cgh
1358 irb = irb + 4.*cir*tgb**3*dtg
1360 evb = evb + cev*destg*dtg
1367 h = csh * (tgb - sfctmp)
1370 call esat(t, esatw, esati, dsatw, dsati)
1376 qsfc = ep_2*(estg*rhsur)/(sfcprs+epsm1*(estg*rhsur))
1377 qfx = (qsfc-qair)*cev*gamma/cpair
1382 if (opt_sfc == 3)
then
1387 tvsi = tgb * virtfaci
1389 tvsi = tgb/prsik1x * virtfaci
1393 (zlvli, zvfun1, gdx,tv1i,thv1i, ur, z0m, z0h, tvsi, grav,thsfc_loc, &
1394 rb1i, fm,fh,fm10i,fh2,cm,ch,stress1i,fv)
1398 ramb = max(1.,1./(cm*ur))
1399 rahb = max(1.,1./(ch*ur))
1405 call esat(t, esatw, esati, dsatw, dsati)
1414 csh = rhoair*cpair/rahb
1416 if(snowh > 0.0 .or. opt_gla == 1)
then
1417 cev = rhoair*cpair/gamma/(rsurf+rawb)
1424 irb = cir * tgb**4 - emg*lwdn
1425 shb = csh * (tgb - sfctmp )
1426 evb = cev * (estg*rhsur - eair )
1427 ghb = cgh * (tgb - stc(isnow+1))
1429 b = sag-irb-shb-evb-ghb
1430 a = 4.*cir*tgb**3 + csh + cev*destg + cgh
1433 irb = irb + 4.*cir*tgb**3*dtg
1435 evb = evb + cev*destg*dtg
1443 call esat(t, esatw, esati, dsatw, dsati)
1449 qsfc = ep_2*(estg*rhsur)/(sfcprs+epsm1*(estg*rhsur))
1459 if(opt_stc == 1 .or. opt_stc ==3)
then
1460 if ((maxval(sice) > 0.0 .or. snowh > 0.0) .and. tgb > tfrz .and. opt_gla == 1)
then
1463 call esat(t, esatw, esati, dsatw, dsati)
1465 qsfc = ep_2*(estg*rhsur)/(sfcprs+epsm1*(estg*rhsur))
1466 irb = cir * tgb**4 - emg*lwdn
1467 shb = csh * (tgb - sfctmp)
1468 evb = cev * (estg*rhsur - eair )
1469 ghb = sag - (irb+shb+evb)
1474 ehb2 = fv*vkc/(log((2.+z0h)/z0h)-fh2)
1477 if (opt_sfc ==3)
then
1482 if (opt_sfc == 4)
then
1487 if (ehb2.lt.1.e-5 )
then
1491 t2mb = tgb - shb/(rhoair*cpair) * 1./ehb2
1492 q2b = qsfc - evb/(lathea*rhoair)*(1./cq2b + rsurf)
1501 subroutine esat(t, esw, esi, desw, desi)
1509 real (kind=kind_phys),
intent(in) :: t
1513 real (kind=kind_phys),
intent(out) :: esw
1514 real (kind=kind_phys),
intent(out) :: esi
1515 real (kind=kind_phys),
intent(out) :: desw
1516 real (kind=kind_phys),
intent(out) :: desi
1520 real (kind=kind_phys) :: a0,a1,a2,a3,a4,a5,a6
1521 real (kind=kind_phys) :: b0,b1,b2,b3,b4,b5,b6
1522 real (kind=kind_phys) :: c0,c1,c2,c3,c4,c5,c6
1523 real (kind=kind_phys) :: d0,d1,d2,d3,d4,d5,d6
1525 parameter(a0=6.107799961 , a1=4.436518521e-01, &
1526 a2=1.428945805e-02, a3=2.650648471e-04, &
1527 a4=3.031240396e-06, a5=2.034080948e-08, &
1530 parameter(b0=6.109177956 , b1=5.034698970e-01, &
1531 b2=1.886013408e-02, b3=4.176223716e-04, &
1532 b4=5.824720280e-06, b5=4.838803174e-08, &
1535 parameter(c0= 4.438099984e-01, c1=2.857002636e-02, &
1536 c2= 7.938054040e-04, c3=1.215215065e-05, &
1537 c4= 1.036561403e-07, c5=3.532421810e-10, &
1538 c6=-7.090244804e-13)
1540 parameter(d0=5.030305237e-01, d1=3.773255020e-02, &
1541 d2=1.267995369e-03, d3=2.477563108e-05, &
1542 d4=3.005693132e-07, d5=2.158542548e-09, &
1545 esw = 100.*(a0+t*(a1+t*(a2+t*(a3+t*(a4+t*(a5+t*a6))))))
1546 esi = 100.*(b0+t*(b1+t*(b2+t*(b3+t*(b4+t*(b5+t*b6))))))
1547 desw = 100.*(c0+t*(c1+t*(c2+t*(c3+t*(c4+t*(c5+t*c6))))))
1548 desi = 100.*(d0+t*(d1+t*(d2+t*(d3+t*(d4+t*(d5+t*d6))))))
1555 qair ,sfctmp ,h ,rhoair ,mpe ,ur , & !in
1557 & moz ,mozsgn ,fm ,fh ,fm2 ,fh2 , fv, & !inout
1558 & errmsg ,errflg , & !inout
1560 & moz ,mozsgn ,fm ,fh ,fm2 ,fh2 , fv, & !inout
1569 integer,
intent(in) :: iter
1570 real (kind=kind_phys),
intent(in) :: zlvl
1571 real (kind=kind_phys),
intent(in) :: zpd
1572 real (kind=kind_phys),
intent(in) :: z0h
1573 real (kind=kind_phys),
intent(in) :: z0m
1574 real (kind=kind_phys),
intent(in) :: qair
1575 real (kind=kind_phys),
intent(in) :: sfctmp
1576 real (kind=kind_phys),
intent(in) :: h
1577 real (kind=kind_phys),
intent(in) :: rhoair
1578 real (kind=kind_phys),
intent(in) :: mpe
1579 real (kind=kind_phys),
intent(in) :: ur
1582 real (kind=kind_phys),
intent(inout) :: moz
1583 integer,
intent(inout) :: mozsgn
1584 real (kind=kind_phys),
intent(inout) :: fm
1585 real (kind=kind_phys),
intent(inout) :: fh
1586 real (kind=kind_phys),
intent(inout) :: fm2
1587 real (kind=kind_phys),
intent(inout) :: fh2
1588 real (kind=kind_phys),
intent(inout) :: fv
1591 character(len=*),
intent(inout) :: errmsg
1592 integer,
intent(inout) :: errflg
1596 real (kind=kind_phys),
intent(out) :: cm
1597 real (kind=kind_phys),
intent(out) :: ch
1598 real (kind=kind_phys),
intent(out) :: ch2
1601 real (kind=kind_phys) :: mozold
1602 real (kind=kind_phys) :: tmpcm
1603 real (kind=kind_phys) :: tmpch
1604 real (kind=kind_phys) :: mol
1605 real (kind=kind_phys) :: tvir
1606 real (kind=kind_phys) :: tmp1,tmp2,tmp3
1607 real (kind=kind_phys) :: fmnew
1608 real (kind=kind_phys) :: fhnew
1609 real (kind=kind_phys) :: moz2
1610 real (kind=kind_phys) :: tmpcm2
1611 real (kind=kind_phys) :: tmpch2
1612 real (kind=kind_phys) :: fm2new
1613 real (kind=kind_phys) :: fh2new
1614 real (kind=kind_phys) :: tmp12,tmp22,tmp32
1616 real (kind=kind_phys) :: cmfm, chfh, cm2fm2, ch2fh2
1624 if(zlvl <= zpd)
then
1625 write(*,*)
'critical glacier problem: zlvl <= zpd; model stops', zlvl, zpd
1628 errmsg =
"stop in noah-mp glacier"
1631 call wrf_error_fatal(
"stop in noah-mp glacier")
1635 tmpcm = log((zlvl-zpd) / z0m)
1636 tmpch = log((zlvl-zpd) / z0h)
1637 tmpcm2 = log((2.0 + z0m) / z0m)
1638 tmpch2 = log((2.0 + z0h) / z0h)
1646 tvir = (1. + 0.61*qair) * sfctmp
1647 tmp1 = vkc * (grav/tvir) * h/(rhoair*cpair)
1648 if (abs(tmp1) .le. mpe) tmp1 = mpe
1649 mol = -1. * fv**3 / tmp1
1650 moz = min( (zlvl-zpd)/mol, 1.)
1651 moz2 = min( (2.0 + z0h)/mol, 1.)
1656 if (mozold*moz .lt. 0.) mozsgn = mozsgn+1
1657 if (mozsgn .ge. 2)
then
1667 if (moz .lt. 0.)
then
1668 tmp1 = (1. - 16.*moz)**0.25
1669 tmp2 = log((1.+tmp1*tmp1)/2.)
1670 tmp3 = log((1.+tmp1)/2.)
1671 fmnew = 2.*tmp3 + tmp2 - 2.*atan(tmp1) + 1.5707963
1675 tmp12 = (1. - 16.*moz2)**0.25
1676 tmp22 = log((1.+tmp12*tmp12)/2.)
1677 tmp32 = log((1.+tmp12)/2.)
1678 fm2new = 2.*tmp32 + tmp22 - 2.*atan(tmp12) + 1.5707963
1696 fm = 0.5 * (fm+fmnew)
1697 fh = 0.5 * (fh+fhnew)
1698 fm2 = 0.5 * (fm2+fm2new)
1699 fh2 = 0.5 * (fh2+fh2new)
1704 fh = min(fh,0.9*tmpch)
1705 fm = min(fm,0.9*tmpcm)
1706 fh2 = min(fh2,0.9*tmpch2)
1707 fm2 = min(fm2,0.9*tmpcm2)
1713 if(abs(cmfm) <= mpe) cmfm = mpe
1714 if(abs(chfh) <= mpe) chfh = mpe
1715 if(abs(cm2fm2) <= mpe) cm2fm2 = mpe
1716 if(abs(ch2fh2) <= mpe) ch2fh2 = mpe
1717 cm = vkc*vkc/(cmfm*cmfm)
1718 ch = vkc*vkc/(cmfm*chfh)
1719 ch2 = vkc*vkc/(cm2fm2*ch2fh2)
1730 ssoil ,snowh ,zbot ,zsnso ,df , & !in
1742 integer,
intent(in) :: nsoil
1743 integer,
intent(in) :: nsnow
1744 integer,
intent(in) :: isnow
1746 real (kind=kind_phys),
intent(in) :: dt
1747 real (kind=kind_phys),
intent(in) :: tbot
1748 real (kind=kind_phys),
intent(in) :: ssoil
1749 real (kind=kind_phys),
intent(in) :: snowh
1750 real (kind=kind_phys),
intent(in) :: zbot
1751 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: zsnso
1752 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: df
1753 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: hcpct
1757 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: stc
1762 real (kind=kind_phys) :: zbotsno
1763 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: ai, bi, ci, rhsts
1764 real (kind=kind_phys) :: eflxb
1765 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: phi
1771 phi(isnow+1:nsoil) = 0.
1775 zbotsno = zbot - snowh
1780 stc ,tbot ,zbotsno ,df , &
1781 hcpct ,ssoil ,phi , &
1782 ai ,bi ,ci ,rhsts , &
1786 ai ,bi ,ci ,rhsts , &
1794 stc ,tbot ,zbot ,df , & !in
1795 hcpct ,ssoil ,phi , & !in
1796 ai ,bi ,ci ,rhsts , & !out
1808 integer,
intent(in) :: nsoil
1809 integer,
intent(in) :: nsnow
1810 integer,
intent(in) :: isnow
1811 real (kind=kind_phys),
intent(in) :: tbot
1812 real (kind=kind_phys),
intent(in) :: zbot
1814 real (kind=kind_phys),
intent(in) :: ssoil
1815 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: zsnso
1816 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: stc
1817 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: df
1818 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: hcpct
1819 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: phi
1823 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(out) :: rhsts
1824 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(out) :: ai
1825 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(out) :: bi
1826 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(out) :: ci
1827 real (kind=kind_phys),
intent(out) :: botflx
1832 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: ddz
1833 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: denom
1834 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: dtsdz
1835 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: eflux
1836 real (kind=kind_phys) :: temp1
1839 do k = isnow+1, nsoil
1840 if (k == isnow+1)
then
1841 denom(k) = - zsnso(k) * hcpct(k)
1842 temp1 = - zsnso(k+1)
1843 ddz(k) = 2.0 / temp1
1844 dtsdz(k) = 2.0 * (stc(k) - stc(k+1)) / temp1
1845 eflux(k) = df(k) * dtsdz(k) - ssoil - phi(k)
1846 else if (k < nsoil)
then
1847 denom(k) = (zsnso(k-1) - zsnso(k)) * hcpct(k)
1848 temp1 = zsnso(k-1) - zsnso(k+1)
1849 ddz(k) = 2.0 / temp1
1850 dtsdz(k) = 2.0 * (stc(k) - stc(k+1)) / temp1
1851 eflux(k) = (df(k)*dtsdz(k) - df(k-1)*dtsdz(k-1)) - phi(k)
1852 else if (k == nsoil)
then
1853 denom(k) = (zsnso(k-1) - zsnso(k)) * hcpct(k)
1854 temp1 = zsnso(k-1) - zsnso(k)
1855 if(opt_tbot == 1)
then
1858 if(opt_tbot == 2)
then
1859 dtsdz(k) = (stc(k) - tbot) / ( 0.5*(zsnso(k-1)+zsnso(k)) - zbot)
1860 botflx = -df(k) * dtsdz(k)
1862 eflux(k) = (-botflx - df(k-1)*dtsdz(k-1) ) - phi(k)
1866 do k = isnow+1, nsoil
1867 if (k == isnow+1)
then
1869 ci(k) = - df(k) * ddz(k) / denom(k)
1870 if (opt_stc == 1 .or. opt_stc == 3)
then
1873 if (opt_stc == 2)
then
1874 bi(k) = - ci(k) + df(k)/(0.5*zsnso(k)*zsnso(k)*hcpct(k))
1876 else if (k < nsoil)
then
1877 ai(k) = - df(k-1) * ddz(k-1) / denom(k)
1878 ci(k) = - df(k ) * ddz(k ) / denom(k)
1879 bi(k) = - (ai(k) + ci(k))
1880 else if (k == nsoil)
then
1881 ai(k) = - df(k-1) * ddz(k-1) / denom(k)
1883 bi(k) = - (ai(k) + ci(k))
1885 rhsts(k) = eflux(k)/ (-denom(k))
1893 ai ,bi ,ci ,rhsts , & !inout
1902 integer,
intent(in) :: nsoil
1903 integer,
intent(in) :: nsnow
1904 integer,
intent(in) :: isnow
1905 real (kind=kind_phys),
intent(in) :: dt
1908 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: ai
1909 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: bi
1910 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: ci
1911 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: stc
1912 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: rhsts
1916 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: rhstsin
1917 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: ciin
1920 do k = isnow+1,nsoil
1921 rhsts(k) = rhsts(k) * dt
1923 bi(k) = 1. + bi(k) * dt
1929 do k = isnow+1,nsoil
1930 rhstsin(k) = rhsts(k)
1936 call rosr12_glacier (ci,ai,bi,ciin,rhstsin,rhsts,isnow+1,nsoil,nsnow)
1940 do k = isnow+1,nsoil
1941 stc(k) = stc(k) + ci(k)
1968 integer,
intent(in) :: ntop
1969 integer,
intent(in) :: nsoil,nsnow
1972 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in):: a, b, d
1973 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout):: c,p,delta
1979 p(ntop) = - c(ntop) / b(ntop)
1983 delta(ntop) = d(ntop) / b(ntop)
1988 p(k) = - c(k) * ( 1.0 / (b(k) + a(k) * p(k -1)) )
1989 delta(k) = (d(k) - a(k)* delta(k -1))* (1.0/ (b(k) + a(k)&
1995 p(nsoil) = delta(nsoil)
2000 kk = nsoil - k + (ntop-1) + 1
2001 p(kk) = p(kk) * p(kk +1) + delta(kk)
2010 stc ,snice ,snliq ,sneqv ,snowh , & !inout
2011 smc ,sh2o , & !inout
2012 qmelt ,imelt ,ponding )
2020 integer,
intent(in) :: nsnow
2021 integer,
intent(in) :: nsoil
2022 integer,
intent(in) :: isnow
2023 real (kind=kind_phys),
intent(in) :: dt
2024 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: fact
2025 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: dzsnso
2029 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: stc
2030 real (kind=kind_phys),
dimension(-nsnow+1:0) ,
intent(inout) :: snice
2031 real (kind=kind_phys),
dimension(-nsnow+1:0) ,
intent(inout) :: snliq
2032 real (kind=kind_phys),
intent(inout) :: sneqv
2033 real (kind=kind_phys),
intent(inout) :: snowh
2034 real (kind=kind_phys),
dimension( 1:nsoil),
intent(inout) :: sh2o
2035 real (kind=kind_phys),
dimension( 1:nsoil),
intent(inout) :: smc
2038 real (kind=kind_phys),
intent(out) :: qmelt
2039 integer,
dimension(-nsnow+1:nsoil),
intent(out) :: imelt
2040 real (kind=kind_phys),
intent(out) :: ponding
2045 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: hm
2046 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: xm
2047 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: wmass0
2048 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: wice0
2049 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: wliq0
2050 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: mice
2051 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: mliq
2052 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: heatr
2053 real (kind=kind_phys) :: temp1
2054 real (kind=kind_phys) :: propor
2055 real (kind=kind_phys) :: xmf
2075 wmass0(j) = mice(j) + mliq(j)
2079 if (mice(j) > 0. .and. stc(j) >= tfrz)
then
2082 if (mliq(j) > 0. .and. stc(j) < tfrz)
then
2091 if (imelt(j) > 0)
then
2092 hm(j) = (stc(j)-tfrz)/fact(j)
2096 if (imelt(j) == 1 .and. hm(j) < 0.)
then
2100 if (imelt(j) == 2 .and. hm(j) > 0.)
then
2104 xm(j) = hm(j)*dt/hfus
2109if (opt_gla == 2)
then
2111 if (isnow == 0 .and. sneqv > 0. .and. stc(1) >= tfrz)
then
2112 hm(1) = (stc(1)-tfrz)/fact(1)
2114 xm(1) = hm(1)*dt/hfus
2117 sneqv = max(0.,temp1-xm(1))
2118 propor = sneqv/temp1
2119 snowh = max(0.,propor * snowh)
2120 heatr(1) = hm(1) - hfus*(temp1-sneqv)/dt
2121 if (heatr(1) > 0.)
then
2122 xm(1) = heatr(1)*dt/hfus
2123 stc(1) = stc(1) + fact(1)*heatr(1)
2128 qmelt = max(0.,(temp1-sneqv))/dt
2130 ponding = temp1-sneqv
2138 if (imelt(j) > 0 .and. abs(hm(j)) > 0.)
then
2141 if (xm(j) > 0.)
then
2142 mice(j) = max(0., wice0(j)-xm(j))
2143 heatr(j) = hm(j) - hfus*(wice0(j)-mice(j))/dt
2144 else if (xm(j) < 0.)
then
2145 mice(j) = min(wmass0(j), wice0(j)-xm(j))
2146 heatr(j) = hm(j) - hfus*(wice0(j)-mice(j))/dt
2149 mliq(j) = max(0.,wmass0(j)-mice(j))
2151 if (abs(heatr(j)) > 0.)
then
2152 stc(j) = stc(j) + fact(j)*heatr(j)
2153 if (mliq(j)*mice(j)>0.) stc(j) = tfrz
2156 qmelt = qmelt + max(0.,(wice0(j)-mice(j)))/dt
2161if (opt_gla == 1)
then
2164 mliq(j) = sh2o(j) * dzsnso(j) * 1000.
2165 mice(j) = (smc(j) - sh2o(j)) * dzsnso(j) * 1000.
2174 wmass0(j) = mice(j) + mliq(j)
2178 if (mice(j) > 0. .and. stc(j) >= tfrz)
then
2181 if (mliq(j) > 0. .and. stc(j) < tfrz)
then
2186 if (isnow == 0 .and. sneqv > 0. .and. j == 1)
then
2187 if (stc(j) >= tfrz)
then
2196 if (imelt(j) > 0)
then
2197 hm(j) = (stc(j)-tfrz)/fact(j)
2201 if (imelt(j) == 1 .and. hm(j) < 0.)
then
2205 if (imelt(j) == 2 .and. hm(j) > 0.)
then
2209 xm(j) = hm(j)*dt/hfus
2214 if (isnow == 0 .and. sneqv > 0. .and. xm(1) > 0.)
then
2216 sneqv = max(0.,temp1-xm(1))
2217 propor = sneqv/temp1
2218 snowh = max(0.,propor * snowh)
2219 heatr(1) = hm(1) - hfus*(temp1-sneqv)/dt
2220 if (heatr(1) > 0.)
then
2221 xm(1) = heatr(1)*dt/hfus
2229 qmelt = max(0.,(temp1-sneqv))/dt
2231 ponding = temp1-sneqv
2237 if (imelt(j) > 0 .and. abs(hm(j)) > 0.)
then
2240 if (xm(j) > 0.)
then
2241 mice(j) = max(0., wice0(j)-xm(j))
2242 heatr(j) = hm(j) - hfus*(wice0(j)-mice(j))/dt
2243 else if (xm(j) < 0.)
then
2244 mice(j) = min(wmass0(j), wice0(j)-xm(j))
2245 heatr(j) = hm(j) - hfus*(wice0(j)-mice(j))/dt
2248 mliq(j) = max(0.,wmass0(j)-mice(j))
2250 if (abs(heatr(j)) > 0.)
then
2251 stc(j) = stc(j) + fact(j)*heatr(j)
2253 if (mliq(j)*mice(j)>0.) stc(j) = tfrz
2257 if (j > 0) xmf = xmf + hfus * (wice0(j)-mice(j))/dt
2260 qmelt = qmelt + max(0.,(wice0(j)-mice(j)))/dt
2271 if (any(stc(1:4) > tfrz) .and. any(stc(1:4) < tfrz))
then
2273 if ( stc(j) > tfrz )
then
2274 heatr(j) = (stc(j)-tfrz)/fact(j)
2276 if (j .ne. k .and. stc(k) < tfrz .and. heatr(j) > 0.1)
then
2277 heatr(k) = (stc(k)-tfrz)/fact(k)
2278 if (abs(heatr(k)) > heatr(j))
then
2279 heatr(k) = heatr(k) + heatr(j)
2280 stc(k) = tfrz + heatr(k)*fact(k)
2283 heatr(j) = heatr(j) + heatr(k)
2289 stc(j) = tfrz + heatr(j)*fact(j)
2296 if (any(stc(1:4) > tfrz) .and. any(stc(1:4) < tfrz))
then
2298 if ( stc(j) < tfrz )
then
2299 heatr(j) = (stc(j)-tfrz)/fact(j)
2301 if (j .ne. k .and. stc(k) > tfrz .and. heatr(j) < -0.1)
then
2302 heatr(k) = (stc(k)-tfrz)/fact(k)
2303 if (heatr(k) > abs(heatr(j)))
then
2304 heatr(k) = heatr(k) + heatr(j)
2305 stc(k) = tfrz + heatr(k)*fact(k)
2308 heatr(j) = heatr(j) + heatr(k)
2314 stc(j) = tfrz + heatr(j)*fact(j)
2321 if (any(stc(1:4) > tfrz) .and. any(mice(1:4) > 0.))
then
2323 if ( stc(j) > tfrz )
then
2324 heatr(j) = (stc(j)-tfrz)/fact(j)
2325 xm(j) = heatr(j)*dt/hfus
2327 if (j .ne. k .and. mice(k) > 0. .and. xm(j) > 0.1)
then
2328 if (mice(k) > xm(j))
then
2329 mice(k) = mice(k) - xm(j)
2330 xmf = xmf + hfus * xm(j)/dt
2334 xm(j) = xm(j) - mice(k)
2335 xmf = xmf + hfus * mice(k)/dt
2339 mliq(k) = max(0.,wmass0(k)-mice(k))
2342 heatr(j) = xm(j)*hfus/dt
2343 stc(j) = tfrz + heatr(j)*fact(j)
2350 if (any(stc(1:4) < tfrz) .and. any(mliq(1:4) > 0.))
then
2352 if ( stc(j) < tfrz )
then
2353 heatr(j) = (stc(j)-tfrz)/fact(j)
2354 xm(j) = heatr(j)*dt/hfus
2356 if (j .ne. k .and. mliq(k) > 0. .and. xm(j) < -0.1)
then
2357 if (mliq(k) > abs(xm(j)))
then
2358 mice(k) = mice(k) - xm(j)
2359 xmf = xmf + hfus * xm(j)/dt
2363 xm(j) = xm(j) + mliq(k)
2364 xmf = xmf - hfus * mliq(k)/dt
2368 mliq(k) = max(0.,wmass0(k)-mice(k))
2371 heatr(j) = xm(j)*hfus/dt
2372 stc(j) = tfrz + heatr(j)*fact(j)
2385 if(opt_gla == 1)
then
2386 sh2o(j) = mliq(j) / (1000. * dzsnso(j))
2387 sh2o(j) = max(0.0,min(1.0,sh2o(j)))
2389 elseif(opt_gla == 2)
then
2399 qvap ,qdew ,ficeold ,zsoil , & !in
2400 isnow ,snowh ,sneqv ,snice ,snliq ,stc , & !inout
2401 dzsnso ,sh2o ,sice ,ponding ,zsnso ,fsh , & !inout
2402 runsrf ,runsub ,qsnow ,ponding1 ,ponding2 ,qsnbot , & !out
2411 integer,
intent(in) :: nsnow
2412 integer,
intent(in) :: nsoil
2413 integer,
dimension(-nsnow+1:0) ,
intent(in) :: imelt
2414 real (kind=kind_phys),
intent(in) :: dt
2415 real (kind=kind_phys),
intent(in) :: prcp
2416 real (kind=kind_phys),
intent(in) :: sfctmp
2417 real (kind=kind_phys),
intent(inout) :: qvap
2418 real (kind=kind_phys),
intent(inout) :: qdew
2419 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(in) :: ficeold
2420 real (kind=kind_phys),
dimension( 1:nsoil),
intent(in) :: zsoil
2423 integer,
intent(inout) :: isnow
2424 real (kind=kind_phys),
intent(inout) :: snowh
2425 real (kind=kind_phys),
intent(inout) :: sneqv
2426 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(inout) :: snice
2427 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(inout) :: snliq
2428 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: stc
2429 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: dzsnso
2430 real (kind=kind_phys),
dimension( 1:nsoil),
intent(inout) :: sh2o
2431 real (kind=kind_phys),
dimension( 1:nsoil),
intent(inout) :: sice
2432 real (kind=kind_phys) ,
intent(inout) :: ponding
2433 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: zsnso
2434 real (kind=kind_phys) ,
intent(inout) :: fsh
2437 real (kind=kind_phys),
intent(out) :: runsrf
2438 real (kind=kind_phys),
intent(out) :: runsub
2439 real (kind=kind_phys),
intent(out) :: qsnow
2440 real (kind=kind_phys),
intent(out) :: ponding1
2441 real (kind=kind_phys),
intent(out) :: ponding2
2442 real (kind=kind_phys),
intent(out) :: qsnbot
2443 real (kind=kind_phys),
intent(out) :: fpice
2444 real (kind=kind_phys),
intent(out) :: esnow
2447 real (kind=kind_phys) :: qrain
2448 real (kind=kind_phys) :: qseva
2449 real (kind=kind_phys) :: qsdew
2450 real (kind=kind_phys) :: qsnfro
2451 real (kind=kind_phys) :: qsnsub
2452 real (kind=kind_phys) :: snowhin
2453 real (kind=kind_phys) :: snoflow
2454 real (kind=kind_phys) :: bdfall
2455 real (kind=kind_phys) :: replace
2456 real (kind=kind_phys),
dimension( 1:nsoil) :: sice_save
2457 real (kind=kind_phys),
dimension( 1:nsoil) :: sh2o_save
2475 if(opt_snf == 1 .or. opt_snf == 4)
then
2476 if(sfctmp > tfrz+2.5)
then
2479 if(sfctmp <= tfrz+0.5)
then
2481 else if(sfctmp <= tfrz+2.)
then
2482 fpice = 1.-(-54.632 + 0.2*sfctmp)
2489 if(opt_snf == 2)
then
2490 if(sfctmp >= tfrz+2.2)
then
2497 if(opt_snf == 3)
then
2498 if(sfctmp >= tfrz)
then
2509 bdfall = min(120.,67.92+51.25*exp((sfctmp-tfrz)/2.59))
2511 qrain = prcp * (1.-fpice)
2512 qsnow = prcp * fpice
2513 snowhin = qsnow/bdfall
2520 esnow = qsnsub*2.83e+6
2523 snowhin ,qsnow ,qsnfro ,qsnsub ,qrain , &
2525 isnow ,snowh ,sneqv ,snice ,snliq , &
2526 sh2o ,sice ,stc ,dzsnso ,zsnso , &
2528 qsnbot ,snoflow ,ponding1 ,ponding2)
2532 runsrf = (ponding+ponding1+ponding2)/dt
2535 runsrf = runsrf + qsnbot + qrain
2537 runsrf = runsrf + qsnbot
2541 if(opt_gla == 1)
then
2544 replace = replace + dzsnso(ilev)*(sice(ilev) - sice_save(ilev) + sh2o(ilev) - sh2o_save(ilev))
2546 replace = replace * 1000.0 / dt
2548 sice = min(1.0,sice_save)
2549 elseif(opt_gla == 2)
then
2557 if(opt_gla == 1)
then
2558 runsub = snoflow + replace
2559 elseif(opt_gla == 2)
then
2570 snowhin ,qsnow ,qsnfro ,qsnsub ,qrain , & !in
2571 ficeold ,zsoil , & !in
2572 isnow ,snowh ,sneqv ,snice ,snliq , & !inout
2573 sh2o ,sice ,stc ,dzsnso ,zsnso , & !inout
2575 qsnbot ,snoflow ,ponding1 ,ponding2)
2580 integer,
intent(in) :: nsnow
2581 integer,
intent(in) :: nsoil
2582 integer,
dimension(-nsnow+1:0) ,
intent(in) :: imelt
2583 real (kind=kind_phys),
intent(in) :: dt
2584 real (kind=kind_phys),
intent(in) :: sfctmp
2585 real (kind=kind_phys),
intent(in) :: snowhin
2586 real (kind=kind_phys),
intent(in) :: qsnow
2587 real (kind=kind_phys),
intent(inout) :: qsnfro
2588 real (kind=kind_phys),
intent(inout) :: qsnsub
2589 real (kind=kind_phys),
intent(in) :: qrain
2590 real (kind=kind_phys),
dimension(-nsnow+1:0) ,
intent(in) :: ficeold
2591 real (kind=kind_phys),
dimension( 1:nsoil),
intent(in) :: zsoil
2594 integer,
intent(inout) :: isnow
2595 real (kind=kind_phys),
intent(inout) :: snowh
2596 real (kind=kind_phys),
intent(inout) :: sneqv
2597 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(inout) :: snice
2598 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(inout) :: snliq
2599 real (kind=kind_phys),
dimension( 1:nsoil),
intent(inout) :: sh2o
2600 real (kind=kind_phys),
dimension( 1:nsoil),
intent(inout) :: sice
2601 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: stc
2602 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: dzsnso
2603 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: zsnso
2604 real (kind=kind_phys),
intent(inout) :: fsh
2607 real (kind=kind_phys),
intent(out) :: qsnbot
2608 real (kind=kind_phys),
intent(out) :: snoflow
2609 real (kind=kind_phys),
intent(out) :: ponding1
2610 real (kind=kind_phys),
intent(out) :: ponding2
2614 real (kind=kind_phys) :: bdsnow
2615 real (kind=kind_phys),
parameter :: mwd = 100.
2623 isnow ,snowh ,dzsnso ,stc ,snice , &
2628 snliq ,imelt ,ficeold, &
2632 isnow ,sh2o ,stc ,snice ,snliq , &
2633 dzsnso ,sice ,snowh ,sneqv , &
2637 isnow ,stc ,snice ,snliq ,dzsnso )
2642 do iz = -nsnow+1, isnow
2652 isnow ,dzsnso ,snowh ,sneqv ,snice , &
2653 snliq ,sh2o ,sice ,stc , &
2654 ponding1 ,ponding2 ,fsh , &
2659 if(sneqv > mwd .and. isnow /= 0)
then
2660 bdsnow = snice(0) / dzsnso(0)
2661 snoflow = (sneqv - mwd)
2662 snice(0) = snice(0) - snoflow
2663 dzsnso(0) = dzsnso(0) - snoflow/bdsnow
2664 snoflow = snoflow / dt
2673 sneqv = sneqv + snice(iz) + snliq(iz)
2674 snowh = snowh + dzsnso(iz)
2681 dzsnso(iz) = -dzsnso(iz)
2684 dzsnso(1) = zsoil(1)
2686 dzsnso(iz) = (zsoil(iz) - zsoil(iz-1))
2689 zsnso(isnow+1) = dzsnso(isnow+1)
2690 do iz = isnow+2 ,nsoil
2691 zsnso(iz) = zsnso(iz-1) + dzsnso(iz)
2694 do iz = isnow+1 ,nsoil
2695 dzsnso(iz) = -dzsnso(iz)
2703 isnow ,snowh ,dzsnso ,stc ,snice , & !inout
2713 integer,
intent(in) :: nsoil
2714 integer,
intent(in) :: nsnow
2715 real (kind=kind_phys),
intent(in) :: dt
2716 real (kind=kind_phys),
intent(in) :: qsnow
2717 real (kind=kind_phys),
intent(in) :: snowhin
2718 real (kind=kind_phys),
intent(in) :: sfctmp
2722 integer,
intent(inout) :: isnow
2723 real (kind=kind_phys),
intent(inout) :: snowh
2724 real (kind=kind_phys),
intent(inout) :: sneqv
2725 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: dzsnso
2726 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: stc
2727 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(inout) :: snice
2728 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(inout) :: snliq
2738 if(isnow == 0 .and. qsnow > 0.)
then
2739 snowh = snowh + snowhin * dt
2740 sneqv = sneqv + qsnow * dt
2745 if(isnow == 0 .and. qsnow>0. .and. snowh >= 0.05)
then
2750 stc(0) = min(273.16, sfctmp)
2757 if(isnow < 0 .and. newnode == 0 .and. qsnow > 0.)
then
2758 snice(isnow+1) = snice(isnow+1) + qsnow * dt
2759 dzsnso(isnow+1) = dzsnso(isnow+1) + snowhin * dt
2768 snliq ,imelt ,ficeold, & !in
2775 integer,
intent(in) :: nsoil
2776 integer,
intent(in) :: nsnow
2777 integer,
dimension(-nsnow+1:0) ,
intent(in) :: imelt
2778 real (kind=kind_phys),
intent(in) :: dt
2779 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: stc
2780 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(in) :: snice
2781 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(in) :: snliq
2782 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(in) :: ficeold
2785 integer,
intent(inout) :: isnow
2786 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: dzsnso
2789 real (kind=kind_phys),
parameter :: c2 = 21.e-3
2790 real (kind=kind_phys),
parameter :: c3 = 2.5e-6
2791 real (kind=kind_phys),
parameter :: c4 = 0.04
2792 real (kind=kind_phys),
parameter :: c5 = 2.0
2793 real (kind=kind_phys),
parameter :: dm = 100.0
2794 real (kind=kind_phys),
parameter :: eta0 = 1.8e+6
2796 real (kind=kind_phys) :: burden
2797 real (kind=kind_phys) :: ddz1
2798 real (kind=kind_phys) :: ddz2
2799 real (kind=kind_phys) :: ddz3
2800 real (kind=kind_phys) :: dexpf
2801 real (kind=kind_phys) :: td
2802 real (kind=kind_phys) :: pdzdtc
2803 real (kind=kind_phys) :: void
2804 real (kind=kind_phys) :: wx
2805 real (kind=kind_phys) :: bi
2806 real (kind=kind_phys),
dimension(-nsnow+1:0) :: fice
2815 wx = snice(j) + snliq(j)
2816 fice(j) = snice(j) / wx
2817 void = 1. - (snice(j)/denice + snliq(j)/denh2o) / dzsnso(j)
2820 if (void > 0.001 .and. snice(j) > 0.1)
then
2821 bi = snice(j) / dzsnso(j)
2822 td = max(0.,tfrz-stc(j))
2829 if (bi > dm) ddz1 = ddz1*exp(-46.0e-3*(bi-dm))
2833 if (snliq(j) > 0.01*dzsnso(j)) ddz1=ddz1*c5
2837 ddz2 = -(burden+0.5*wx)*exp(-0.08*td-c2*bi)/eta0
2841 if (imelt(j) == 1)
then
2842 ddz3 = max(0.,(ficeold(j) - fice(j))/max(1.e-6,ficeold(j)))
2850 pdzdtc = (ddz1 + ddz2 + ddz3)*dt
2851 pdzdtc = max(-0.5,pdzdtc)
2855 dzsnso(j) = dzsnso(j)*(1.+pdzdtc)
2856 dzsnso(j) = min(max(dzsnso(j),(snliq(j)+snice(j))/500.0),(snliq(j)+snice(j))/50.0)
2861 burden = burden + wx
2869 isnow ,sh2o ,stc ,snice ,snliq , & !inout
2870 dzsnso ,sice ,snowh ,sneqv , & !inout
2877 integer,
intent(in) :: nsnow
2878 integer,
intent(in) :: nsoil
2882 integer,
intent(inout) :: isnow
2883 real (kind=kind_phys),
dimension( 1:nsoil),
intent(inout) :: sh2o
2884 real (kind=kind_phys),
dimension( 1:nsoil),
intent(inout) :: sice
2885 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: stc
2886 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(inout) :: snice
2887 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(inout) :: snliq
2888 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: dzsnso
2889 real (kind=kind_phys),
intent(inout) :: sneqv
2890 real (kind=kind_phys),
intent(inout) :: snowh
2891 real (kind=kind_phys),
intent(inout) :: ponding1
2892 real (kind=kind_phys),
intent(inout) :: ponding2
2897 integer :: isnow_old
2900 real (kind=kind_phys) :: zwice
2901 real (kind=kind_phys) :: zwliq
2902 real (kind=kind_phys) :: dzmin(3)
2903 data dzmin /0.045, 0.05, 0.2/
2909 do j = isnow_old+1,0
2910 if (snice(j) <= .1)
then
2912 snliq(j+1) = snliq(j+1) + snliq(j)
2913 snice(j+1) = snice(j+1) + snice(j)
2915 if (isnow_old < -1)
then
2916 snliq(j-1) = snliq(j-1) + snliq(j)
2917 snice(j-1) = snice(j-1) + snice(j)
2919 ponding1 = ponding1 + snliq(j)
2931 if (j > isnow+1 .and. isnow < -1)
then
2932 do i = j, isnow+2, -1
2934 snliq(i) = snliq(i-1)
2935 snice(i) = snice(i-1)
2936 dzsnso(i)= dzsnso(i-1)
2945 if(sice(1) < 0.)
then
2946 sh2o(1) = sh2o(1) + sice(1)
2950 if(isnow ==0)
return
2958 sneqv = sneqv + snice(j) + snliq(j)
2959 snowh = snowh + dzsnso(j)
2960 zwice = zwice + snice(j)
2961 zwliq = zwliq + snliq(j)
2968 if (snowh < 0.05 .and. isnow < 0 )
then
2971 ponding2 = ponding2 + zwliq
2972 if(sneqv <= 0.) snowh = 0.
2984 if (isnow < -1)
then
2989 do i = isnow_old+1,0
2990 if (dzsnso(i) < dzmin(mssi))
then
2992 if (i == isnow+1)
then
2994 else if (i == 0)
then
2998 if ((dzsnso(i-1)+dzsnso(i)) < (dzsnso(i+1)+dzsnso(i))) neibor = i-1
3002 if (neibor > i)
then
3011 stc(j), dzsnso(l), snliq(l), snice(l), stc(l) )
3014 if (j-1 > isnow+1)
then
3015 do k = j-1, isnow+2, -1
3017 snice(k) = snice(k-1)
3018 snliq(k) = snliq(k-1)
3019 dzsnso(k) = dzsnso(k-1)
3025 if (isnow >= -1)
exit
3049 real (kind=kind_phys),
intent(in) :: dz2
3050 real (kind=kind_phys),
intent(in) :: wliq2
3051 real (kind=kind_phys),
intent(in) :: wice2
3052 real (kind=kind_phys),
intent(in) :: t2
3053 real (kind=kind_phys),
intent(inout) :: dz
3054 real (kind=kind_phys),
intent(inout) :: wliq
3055 real (kind=kind_phys),
intent(inout) :: wice
3056 real (kind=kind_phys),
intent(inout) :: t
3060 real (kind=kind_phys) :: dzc
3061 real (kind=kind_phys) :: wliqc
3062 real (kind=kind_phys) :: wicec
3063 real (kind=kind_phys) :: tc
3064 real (kind=kind_phys) :: h
3065 real (kind=kind_phys) :: h2
3066 real (kind=kind_phys) :: hc
3071 wicec = (wice+wice2)
3072 wliqc = (wliq+wliq2)
3073 h = (cice*wice+cwat*wliq) * (t-tfrz)+hfus*wliq
3074 h2= (cice*wice2+cwat*wliq2) * (t2-tfrz)+hfus*wliq2
3078 tc = tfrz + hc/(cice*wicec + cwat*wliqc)
3079 else if (hc.le.hfus*wliqc)
then
3082 tc = tfrz + (hc - hfus*wliqc) / (cice*wicec + cwat*wliqc)
3094 isnow ,stc ,snice ,snliq ,dzsnso )
3100 integer,
intent(in) :: nsnow
3101 integer,
intent(in) :: nsoil
3105 integer ,
intent(inout) :: isnow
3106 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: stc
3107 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(inout) :: snice
3108 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(inout) :: snliq
3109 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: dzsnso
3115 real (kind=kind_phys) :: drr
3116 real (kind=kind_phys),
dimension( 1:nsnow) :: dz
3117 real (kind=kind_phys),
dimension( 1:nsnow) :: swice
3118 real (kind=kind_phys),
dimension( 1:nsnow) :: swliq
3119 real (kind=kind_phys),
dimension( 1:nsnow) :: tsno
3120 real (kind=kind_phys) :: zwice
3121 real (kind=kind_phys) :: zwliq
3122 real (kind=kind_phys) :: propor
3123 real (kind=kind_phys) :: dtdz
3127 if (j <= abs(isnow))
then
3128 dz(j) = dzsnso(j+isnow)
3129 swice(j) = snice(j+isnow)
3130 swliq(j) = snliq(j+isnow)
3131 tsno(j) = stc(j+isnow)
3139 if (dz(1) > 0.05)
then
3142 swice(1) = swice(1)/2.
3143 swliq(1) = swliq(1)/2.
3152 if (dz(1) > 0.05)
then
3155 zwice = propor*swice(1)
3156 zwliq = propor*swliq(1)
3158 swice(1) = propor*swice(1)
3159 swliq(1) = propor*swliq(1)
3162 call combo_glacier (dz(2), swliq(2), swice(2), tsno(2), drr, &
3163 zwliq, zwice, tsno(1))
3167 if (msno <= 2 .and. dz(2) > 0.10)
then
3169 dtdz = (tsno(1) - tsno(2))/((dz(1)+dz(2))/2.)
3171 swice(2) = swice(2)/2.
3172 swliq(2) = swliq(2)/2.
3176 tsno(3) = tsno(2) - dtdz*dz(2)/2.
3177 if (tsno(3) >= tfrz)
then
3180 tsno(2) = tsno(2) + dtdz*dz(2)/2.
3188 if (dz(2) > 0.2)
then
3191 zwice = propor*swice(2)
3192 zwliq = propor*swliq(2)
3194 swice(2) = propor*swice(2)
3195 swliq(2) = propor*swliq(2)
3197 call combo_glacier (dz(3), swliq(3), swice(3), tsno(3), drr, &
3198 zwliq, zwice, tsno(2))
3205 dzsnso(j) = dz(j-isnow)
3206 snice(j) = swice(j-isnow)
3207 snliq(j) = swliq(j-isnow)
3208 stc(j) = tsno(j-isnow)
3221 isnow ,dzsnso ,snowh ,sneqv ,snice , & !inout
3222 snliq ,sh2o ,sice ,stc , & !inout
3223 ponding1 ,ponding2 ,fsh , & !inout
3233 integer,
intent(in) :: nsnow
3234 integer,
intent(in) :: nsoil
3235 real (kind=kind_phys),
intent(in) :: dt
3236 real (kind=kind_phys),
intent(inout) :: qsnfro
3237 real (kind=kind_phys),
intent(inout) :: qsnsub
3238 real (kind=kind_phys),
intent(in) :: qrain
3242 real (kind=kind_phys),
intent(out) :: qsnbot
3246 integer,
intent(inout) :: isnow
3247 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: dzsnso
3248 real (kind=kind_phys),
intent(inout) :: snowh
3249 real (kind=kind_phys),
intent(inout) :: sneqv
3250 real (kind=kind_phys),
dimension(-nsnow+1:0),
intent(inout) :: snice
3251 real (kind=kind_phys),
dimension(-nsnow+1:0),
intent(inout) :: snliq
3252 real (kind=kind_phys),
dimension( 1:nsoil),
intent(inout) :: sh2o
3253 real (kind=kind_phys),
dimension( 1:nsoil),
intent(inout) :: sice
3254 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: stc
3255 real (kind=kind_phys),
intent(inout) :: ponding1
3256 real (kind=kind_phys),
intent(inout) :: ponding2
3257 real (kind=kind_phys),
intent(inout) :: fsh
3262 real (kind=kind_phys) :: qin
3263 real (kind=kind_phys) :: qout
3264 real (kind=kind_phys) :: wgdif
3265 real (kind=kind_phys),
dimension(-nsnow+1:0) :: vol_liq
3266 real (kind=kind_phys),
dimension(-nsnow+1:0) :: vol_ice
3267 real (kind=kind_phys),
dimension(-nsnow+1:0) :: epore
3268 real (kind=kind_phys) :: propor, temp
3273 if(sneqv == 0.)
then
3274 if(opt_gla == 1)
then
3275 sice(1) = sice(1) + (qsnfro-qsnsub)*dt/(dzsnso(1)*1000.)
3276 elseif(opt_gla == 2)
then
3277 fsh = fsh - (qsnfro-qsnsub)*hsub
3288 if(isnow == 0 .and. sneqv > 0.)
then
3289 if(opt_gla == 1)
then
3291 sneqv = sneqv - qsnsub*dt + qsnfro*dt
3293 snowh = max(0.,propor * snowh)
3294 elseif(opt_gla == 2)
then
3295 fsh = fsh - (qsnfro-qsnsub)*hsub
3301 sice(1) = sice(1) + sneqv/(dzsnso(1)*1000.)
3305 if(sice(1) < 0.)
then
3306 sh2o(1) = sh2o(1) + sice(1)
3311 if(snowh <= 1.e-8 .or. sneqv <= 1.e-6)
then
3318 if ( isnow < 0 )
then
3320 wgdif = snice(isnow+1) - qsnsub*dt + qsnfro*dt
3321 snice(isnow+1) = wgdif
3322 if (wgdif < 1.e-6 .and. isnow <0)
then
3324 isnow ,sh2o ,stc ,snice ,snliq , &
3325 dzsnso ,sice ,snowh ,sneqv , &
3326 ponding1, ponding2 )
3329 if ( isnow < 0 )
then
3330 snliq(isnow+1) = snliq(isnow+1) + qrain * dt
3331 snliq(isnow+1) = max(0., snliq(isnow+1))
3341 if (j >= isnow+1)
then
3342 vol_ice(j) = min(1., snice(j)/(dzsnso(j)*denice))
3343 epore(j) = 1. - vol_ice(j)
3344 vol_liq(j) = min(epore(j),snliq(j)/(dzsnso(j)*denh2o))
3354 if (j >= isnow+1)
then
3355 snliq(j) = snliq(j) + qin
3357 if (epore(j) < 0.05 .or. epore(j+1) < 0.05)
then
3360 qout = max(0.,(vol_liq(j)-ssi*epore(j))*dzsnso(j))
3361 qout = min(qout,(1.-vol_ice(j+1)-vol_liq(j+1))*dzsnso(j+1))
3364 qout = max(0.,(vol_liq(j) - ssi*epore(j))*dzsnso(j))
3367 snliq(j) = snliq(j) - qout
3381 fsh ,fgev ,ssoil ,sag ,prcp ,edir , &
3383 runsrf ,runsub ,sneqv ,dt ,beg_wb, errmsg , errflg )
3385 runsrf ,runsub ,sneqv ,dt ,beg_wb )
3393 integer ,
intent(in) :: iloc
3394 integer ,
intent(in) :: jloc
3395 real (kind=kind_phys) ,
intent(in) :: swdown
3396 real (kind=kind_phys) ,
intent(in) :: fsa
3397 real (kind=kind_phys) ,
intent(in) :: fsr
3398 real (kind=kind_phys) ,
intent(in) :: fira
3399 real (kind=kind_phys) ,
intent(in) :: fsh
3400 real (kind=kind_phys) ,
intent(in) :: fgev
3401 real (kind=kind_phys) ,
intent(in) :: ssoil
3402 real (kind=kind_phys) ,
intent(in) :: sag
3404 real (kind=kind_phys) ,
intent(in) :: prcp
3405 real (kind=kind_phys) ,
intent(in) :: edir
3406 real (kind=kind_phys) ,
intent(in) :: runsrf
3407 real (kind=kind_phys) ,
intent(in) :: runsub
3408 real (kind=kind_phys) ,
intent(in) :: sneqv
3409 real (kind=kind_phys) ,
intent(in) :: dt
3410 real (kind=kind_phys) ,
intent(in) :: beg_wb
3413 character(len=*) ,
intent(inout) :: errmsg
3414 integer ,
intent(inout) :: errflg
3417 real (kind=kind_phys) :: end_wb
3418 real (kind=kind_phys) :: errwat
3419 real (kind=kind_phys) :: erreng
3420 real (kind=kind_phys) :: errsw
3421 character(len=256) :: message
3423 errsw = swdown - (fsa + fsr)
3424 if (errsw > 0.01)
then
3425 write(*,*)
"sag =",sag
3426 write(*,*)
"fsa =",fsa
3427 write(*,*)
"fsr =",fsr
3428 write(message,*)
'errsw =',errsw
3431 errmsg = trim(message)//new_line(
'A')//
"radiation budget problem in noahmp glacier"
3434 call wrf_message(trim(message))
3435 call wrf_error_fatal(
"radiation budget problem in noahmp glacier")
3439 erreng = sag-(fira+fsh+fgev+ssoil)
3440 if(erreng > 0.01)
then
3441 write(message,*)
'erreng =',erreng
3443 errmsg = trim(message)
3445 call wrf_message(trim(message))
3447 write(message,
'(i6,1x,i6,1x,5f10.4)')iloc,jloc,sag,fira,fsh,fgev,ssoil
3450 errmsg = trim(errmsg)//new_line(
'A')//
"energy budget problem in noahmp glacier"
3453 call wrf_message(trim(message))
3454 call wrf_error_fatal(
"energy budget problem in noahmp glacier")
3459 errwat = end_wb-beg_wb-(prcp-edir-runsrf-runsub)*dt
3472 integer,
intent(in) :: iopt_alb
3473 integer,
intent(in) :: iopt_snf
3474 integer,
intent(in) :: iopt_tbot
3475 integer,
intent(in) :: iopt_stc
3477 integer,
intent(in) :: iopt_gla
3478 integer,
intent(in) :: iopt_sfc
3479 integer,
intent(in) :: iopt_trs
3485 opt_tbot = iopt_tbot
3500 use noahmp_glacier_globals
subroutine, public stability(z1, zvfun, gdx, tv1, thv1, wind, z0max, ztmax, tvs, grav, thsfc_loc, rb, fm, fh, fm10, fh2, cm, ch, stress, ustar)
subroutine, private atm_glacier(ep_2, epsm1, sfcprs, sfctmp, q2, soldn, cosz, thair, qair, eair, rhoair, solad, solai, swdown)
re-process atmospheric forcing
subroutine esat(t, esw, esi, desw, desi)
subroutine, private thermoprop_glacier(nsoil, nsnow, isnow, dzsnso, dt, snowh, snice, snliq, df, hcpct, snicev, snliqv, epore, fact)
calculate thermal properties of soil, snow, lake, and frozen soil.
subroutine, private combo_glacier(dz, wliq, wice, t, dz2, wliq2, wice2, t2)
subroutine, private sfcdif1_glacier(iter,zlvl,zpd,z0h,z0m, qair,sfctmp,h,rhoair,mpe,ur, ifdef ccpp
compute surface drag coefficient cm for momentum and ch for heat
subroutine, private rosr12_glacier(p, a, b, c, d, delta, ntop, nsoil, nsnow)
subroutine, private snowh2o_glacier(nsnow, nsoil, dt, qsnfro, qsnsub, qrain, isnow, dzsnso, snowh, sneqv, snice, snliq, sh2o, sice, stc, ponding1, ponding2, fsh, qsnbot)
subroutine, private hrt_glacier(nsnow, nsoil, isnow, zsnso, stc, tbot, zbot, df, hcpct, ssoil, phi, ai, bi, ci, rhsts, botflx)
subroutine, private tsnosoi_glacier(nsoil, nsnow, isnow, dt, tbot, ssoil, snowh, zbot, zsnso, df, hcpct, stc)
subroutine sfcdif4(iloc, jloc, ux, vx, t1d, p1d, psfcpa, pblhx, dx, znt, ep_1, ep_2, cp, itime, snwh, isice, psi_opt, tsk, qx, zlvl, iz0tlnd, qsfc, hfx, qfx, cm, chs, chs2, cqs2, rmolx, ust, rbx, fmx, fhx, stressx, fm10x, fh2x, wspdx, flhcx, flqcx)
subroutine, private compact_glacier(nsnow, nsoil, dt, stc, snice, snliq, imelt, ficeold, isnow, dzsnso)
subroutine, private snowalb_bats_glacier(nband, cosz, fage, albsnd, albsni)
subroutine, private error_glacier(iloc,jloc,swdown,fsa,fsr,fira, fsh,fgev,ssoil,sag,prcp,edir, ifdef ccpp
subroutine, private combine_glacier(nsnow, nsoil, isnow, sh2o, stc, snice, snliq, dzsnso, sice, snowh, sneqv, ponding1, ponding2)
subroutine, private radiation_glacier(dt, tg, sneqvo, sneqv, cosz, qsnow, solad, solai, albold, tauss, sag, fsr, fsa, albsnd, albsni)
Compute solar radiation: absorbed & reflected by the ground.
subroutine, private divide_glacier(nsnow, nsoil, isnow, stc, snice, snliq, dzsnso)
subroutine, private snowwater_glacier(nsnow, nsoil, imelt, dt, sfctmp, snowhin, qsnow, qsnfro, qsnsub, qrain, ficeold, zsoil, isnow, snowh, sneqv, snice, snliq, sh2o, sice, stc, dzsnso, zsnso, fsh, qsnbot, snoflow, ponding1, ponding2)
subroutine, private water_glacier(nsnow, nsoil, imelt, dt, prcp, sfctmp, qvap, qdew, ficeold, zsoil, isnow, snowh, sneqv, snice, snliq, stc, dzsnso, sh2o, sice, ponding, zsnso, fsh, runsrf, runsub, qsnow, ponding1, ponding2, qsnbot, fpice, esnow)
subroutine, private snowfall_glacier(nsoil, nsnow, dt, qsnow, snowhin, sfctmp, isnow, snowh, dzsnso, stc, snice, snliq, sneqv)
subroutine, private phasechange_glacier(nsnow, nsoil, isnow, dt, fact, dzsnso, stc, snice, snliq, sneqv, snowh, smc, sh2o, qmelt, imelt, ponding)
subroutine, public noahmp_glacier( iloc,jloc,cosz,nsnow,nsoil,dt, sfctmp,sfcprs,uu,vv,q2,soldn, prcp,lwdn,tbot,zlvl,ficeold,zsoil, thsfc_loc,prslkix,prsik1x,prslk1x, psfc,pblhx,iz0tlnd,itime, sigmaf1,garea1,psi_opt, ep_1,ep_2,epsm1,cp, qsnow,sneqvo,albold,cm,ch,isnow, sneqv,smc,zsnso,snowh,snice,snliq, tg,stc,sh2o,tauss,qsfc, fsa,fsr,fira,fsh,fgev,ssoil, trad,edir,runsrf,runsub,sag,albedo, qsnbot,ponding,ponding1,ponding2,t2m, q2e,z0h_total, ifdef ccpp
subroutine, private csnow_glacier(isnow, nsnow, nsoil, snice, snliq, dzsnso, tksno, cvsno, snicev, snliqv, epore)
snow bulk density, volumetric capacity, and thermal conductivity
subroutine, private energy_glacier(nsnow,nsoil,isnow,dt,qsnow,rhoair, eair,sfcprs,qair,sfctmp,lwdn,uu, vv,solad,solai,cosz,zref, tbot,zbot,zsnso,dzsnso,sigmaf1,garea1, thsfc_loc,prslkix,prsik1x,prslk1x, psfc,pblhx,iz0tlnd,itime,psi_opt, ep_1, ep_2, epsm1, cp, tg,stc,snowh,sneqv,sneqvo,sh2o, smc,snice,snliq,albold,cm,ch, ifdef ccpp
Compute energy budget (momentum & energy fluxes and phase changes).
subroutine albedo(parameters, vegtyp, ist, ice, nsoil, dt, cosz, fage, elai, esai, tg, tv, snowh, fsno, fwet, smc, sneqvo, sneqv, qsnow, fveg, iloc, jloc, albold, tauss, albgrd, albgri, albd, albi, fabd, fabi, ftdd, ftid, ftii, fsun, frevi, frevd, fregd, fregi, bgap, wgap, albsnd, albsni)
surface albedos. also fluxes (per unit incoming direct and diffuse radiation) reflected,...
subroutine, private snowalb_class_glacier(nband, qsnow, dt, alb, albold, albsnd, albsni)
subroutine, private snow_age_glacier(dt, tg, sneqvo, sneqv, tauss, fage)
subroutine, private hstep_glacier(nsnow, nsoil, isnow, dt, ai, bi, ci, rhsts, stc)
subroutine, private glacier_flux(nsoil,nsnow,emg,isnow,df,dzsnso,z0m, zlvl,zpd,qair,sfctmp,rhoair,sfcprs, ur,gamma,rsurf,lwdn,rhsur,smc, eair,stc,sag,snowh,lathea,sh2o, thsfc_loc,prslkix,prsik1x,prslk1x, psfc,pblhx,iz0tlnd,itime,uu,vv, sigmaf1,garea1,psi_opt,ep_1, ep_2, epsm1, cp, ifdef ccpp
use newton-raphson iteration to solve ground (tg) temperature that balances the surface energy budget...
subroutine, public noahmp_options_glacier(iopt_alb, iopt_snf, iopt_tbot, iopt_stc, iopt_gla, iopt_sfc, iopt_trs)
This module contains the interface of noahmp_glacier_routines and noahmp_glacier_globals.
This module contains NoahMP glacier routines.
This module contains the CCPP-compliant GFS surface layer scheme.