8module module_sf_noahmplsm
12use machine ,
only : kind_phys
184 real (kind=kind_phys),
parameter :: grav = 9.80616
185 real (kind=kind_phys),
parameter :: sb = 5.67e-08
186 real (kind=kind_phys),
parameter :: vkc = 0.40
187 real (kind=kind_phys),
parameter :: tfrz = 273.16
188 real (kind=kind_phys),
parameter :: hsub = 2.8440e06
189 real (kind=kind_phys),
parameter :: hvap = 2.5104e06
190 real (kind=kind_phys),
parameter :: hfus = 0.3336e06
191 real (kind=kind_phys),
parameter :: cwat = 4.188e06
192 real (kind=kind_phys),
parameter :: cice = 2.094e06
193 real (kind=kind_phys),
parameter :: cpair = 1004.64
194 real (kind=kind_phys),
parameter :: tkwat = 0.6
195 real (kind=kind_phys),
parameter :: tkice = 2.2
196 real (kind=kind_phys),
parameter :: tkair = 0.023
197 real (kind=kind_phys),
parameter :: rair = 287.04
198 real (kind=kind_phys),
parameter :: rw = 461.269
199 real (kind=kind_phys),
parameter :: denh2o = 1000.
200 real (kind=kind_phys),
parameter :: denice = 917.
202 integer,
private,
parameter :: mband = 2
203 integer,
private,
parameter :: nsoil = 4
204 integer,
private,
parameter :: nstage = 8
212 logical :: urban_flag
219 real (kind=kind_phys) :: ch2op
220 real (kind=kind_phys) :: dleaf
221 real (kind=kind_phys) :: z0mvt
222 real (kind=kind_phys) :: hvt
223 real (kind=kind_phys) :: hvb
224 real (kind=kind_phys) :: z0mhvt
225 real (kind=kind_phys) :: den
226 real (kind=kind_phys) :: rc
227 real (kind=kind_phys) :: mfsno
228 real (kind=kind_phys) :: scffac
229 real (kind=kind_phys) :: cbiom
230 real (kind=kind_phys) :: saim(12)
231 real (kind=kind_phys) :: laim(12)
232 real (kind=kind_phys) :: sla
233 real (kind=kind_phys) :: prcpiceden
234 real (kind=kind_phys) :: dilefc
235 real (kind=kind_phys) :: dilefw
236 real (kind=kind_phys) :: fragr
237 real (kind=kind_phys) :: ltovrc
239 real (kind=kind_phys) :: c3psn
240 real (kind=kind_phys) :: kc25
241 real (kind=kind_phys) :: akc
242 real (kind=kind_phys) :: ko25
243 real (kind=kind_phys) :: ako
244 real (kind=kind_phys) :: vcmx25
245 real (kind=kind_phys) :: avcmx
246 real (kind=kind_phys) :: bp
247 real (kind=kind_phys) :: mp
248 real (kind=kind_phys) :: qe25
249 real (kind=kind_phys) :: aqe
250 real (kind=kind_phys) :: rmf25
251 real (kind=kind_phys) :: rms25
252 real (kind=kind_phys) :: rmr25
253 real (kind=kind_phys) :: arm
254 real (kind=kind_phys) :: folnmx
255 real (kind=kind_phys) :: tmin
257 real (kind=kind_phys) :: xl
258 real (kind=kind_phys) :: rhol(mband)
259 real (kind=kind_phys) :: rhos(mband)
260 real (kind=kind_phys) :: taul(mband)
261 real (kind=kind_phys) :: taus(mband)
263 real (kind=kind_phys) :: mrp
264 real (kind=kind_phys) :: cwpvt
266 real (kind=kind_phys) :: wrrat
267 real (kind=kind_phys) :: wdpool
268 real (kind=kind_phys) :: tdlef
271 real (kind=kind_phys) :: rgl
272 real (kind=kind_phys) :: rsmin
273 real (kind=kind_phys) :: hs
274 real (kind=kind_phys) :: topt
275 real (kind=kind_phys) :: rsmax
277 real (kind=kind_phys) :: slarea
278 real (kind=kind_phys) :: eps(5)
284 real (kind=kind_phys) :: albsat(mband)
285 real (kind=kind_phys) :: albdry(mband)
286 real (kind=kind_phys) :: albice(mband)
287 real (kind=kind_phys) :: alblak(mband)
288 real (kind=kind_phys) :: omegas(mband)
289 real (kind=kind_phys) :: betads
290 real (kind=kind_phys) :: betais
291 real (kind=kind_phys) :: eg(2)
297 real (kind=kind_phys) :: co2
298 real (kind=kind_phys) :: o2
299 real (kind=kind_phys) :: timean
300 real (kind=kind_phys) :: fsatmx
301 real (kind=kind_phys) :: z0sno
302 real (kind=kind_phys) :: ssi
303 real (kind=kind_phys) :: snow_ret_fac
304 real (kind=kind_phys) :: swemx
305 real (kind=kind_phys) :: snow_emis
306 real (kind=kind_phys) :: tau0
307 real (kind=kind_phys) :: grain_growth
308 real (kind=kind_phys) :: extra_growth
309 real (kind=kind_phys) :: dirt_soot
310 real (kind=kind_phys) :: bats_cosz
311 real (kind=kind_phys) :: bats_vis_new
312 real (kind=kind_phys) :: bats_nir_new
313 real (kind=kind_phys) :: bats_vis_age
314 real (kind=kind_phys) :: bats_nir_age
315 real (kind=kind_phys) :: bats_vis_dir
316 real (kind=kind_phys) :: bats_nir_dir
317 real (kind=kind_phys) :: rsurf_snow
318 real (kind=kind_phys) :: rsurf_exp
326 real (kind=kind_phys) :: plantpop
327 real (kind=kind_phys) :: irri
328 real (kind=kind_phys) :: gddtbase
329 real (kind=kind_phys) :: gddtcut
330 real (kind=kind_phys) :: gdds1
331 real (kind=kind_phys) :: gdds2
332 real (kind=kind_phys) :: gdds3
333 real (kind=kind_phys) :: gdds4
334 real (kind=kind_phys) :: gdds5
336 real (kind=kind_phys) :: aref
337 real (kind=kind_phys) :: psnrf
338 real (kind=kind_phys) :: i2par
339 real (kind=kind_phys) :: tassim0
340 real (kind=kind_phys) :: tassim1
341 real (kind=kind_phys) :: tassim2
342 real (kind=kind_phys) :: k
343 real (kind=kind_phys) :: epsi
344 real (kind=kind_phys) :: q10mr
345 real (kind=kind_phys) :: foln_mx
346 real (kind=kind_phys) :: lefreez
347 real (kind=kind_phys) :: dile_fc(nstage)
348 real (kind=kind_phys) :: dile_fw(nstage)
349 real (kind=kind_phys) :: fra_gr
350 real (kind=kind_phys) :: lf_ovrc(nstage)
351 real (kind=kind_phys) :: st_ovrc(nstage)
352 real (kind=kind_phys) :: rt_ovrc(nstage)
353 real (kind=kind_phys) :: lfmr25
354 real (kind=kind_phys) :: stmr25
355 real (kind=kind_phys) :: rtmr25
356 real (kind=kind_phys) :: grainmr25
357 real (kind=kind_phys) :: lfpt(nstage)
358 real (kind=kind_phys) :: stpt(nstage)
359 real (kind=kind_phys) :: rtpt(nstage)
360 real (kind=kind_phys) :: grainpt(nstage)
361 real (kind=kind_phys) :: bio2lai
366 real (kind=kind_phys) :: bexp(nsoil)
367 real (kind=kind_phys) :: smcdry(nsoil)
369 real (kind=kind_phys) :: smcwlt(nsoil)
370 real (kind=kind_phys) :: smcref(nsoil)
371 real (kind=kind_phys) :: smcmax(nsoil)
372 real (kind=kind_phys) :: psisat(nsoil)
373 real (kind=kind_phys) :: dksat(nsoil)
374 real (kind=kind_phys) :: dwsat(nsoil)
375 real (kind=kind_phys) :: quartz(nsoil)
376 real (kind=kind_phys) :: f1
380 real (kind=kind_phys) :: slope
381 real (kind=kind_phys) :: csoil
382 real (kind=kind_phys) :: zbot
383 real (kind=kind_phys) :: czil
384 real (kind=kind_phys) :: refdk
385 real (kind=kind_phys) :: refkdt
387 real (kind=kind_phys) :: kdt
388 real (kind=kind_phys) :: frzx
395 real(kind=kind_phys),
parameter :: prt=1.
396 real(kind=kind_phys),
parameter :: p1000mb = 100000.
398 real(kind=kind_phys),
parameter :: svp1 = 0.6112
399 real(kind=kind_phys),
parameter :: svp2 = 17.67
400 real(kind=kind_phys),
parameter :: svp3 = 29.65
401 real(kind=kind_phys),
parameter :: svpt0 = 273.15
402 real(kind=kind_phys),
parameter :: onethird = 1./3.
403 real(kind=kind_phys),
parameter :: sqrt3 = 1.7320508075688773
404 real(kind=kind_phys),
parameter :: atan1 = 0.785398163397
406 real(kind=kind_phys),
parameter :: vconvc=1.25
408 real(kind=kind_phys),
parameter ::
snowz0 = 0.011
409 real(kind=kind_phys),
parameter :: wmin = 0.1
411 real(kind=kind_phys),
dimension(0:1000 ),
save :: psim_stab,psim_unstab, &
412 psih_stab,psih_unstab
422 iloc , jloc , lat , yearlen , julian , cosz , & ! in : time/space-related
423 dt , dx , dz8w , nsoil , zsoil , nsnow , & ! in : model configuration
424 shdfac , shdmax , vegtyp , ice , ist , croptype, & ! in : vegetation/soil characteristics
425 smceq , & ! in : vegetation/soil characteristics
426 sfctmp , sfcprs , psfc , uu , vv , q2, garea1 , & ! in : forcing
427 qc , soldn , lwdn,thsfc_loc, prslkix,prsik1x,prslk1x,& ! in : forcing
428 pblhx , iz0tlnd , itime ,psi_opt ,&
429 prcpconv, prcpnonc, prcpshcv, prcpsnow, prcpgrpl, prcphail, & ! in : forcing
430 tbot , co2air , o2air , foln , ficeold , zlvl , & ! in : forcing
431 ep_1 , ep_2 , epsm1 , cp , & ! in : constants
432 albold , sneqvo , & ! in/out :
433 stc , sh2o , smc , tah , eah , fwet , & ! in/out :
434 canliq , canice , tv , tg , qsfc, qsnow, qrain, & ! in/out :
435 isnow , zsnso , snowh , sneqv , snice , snliq , & ! in/out :
436 zwt , wa , wt , wslake , lfmass , rtmass , & ! in/out :
437 stmass , wood , stblcp , fastcp , lai , sai , & ! in/out :
438 cm , ch , tauss , & ! in/out :
439 grain , gdd , pgs , & ! in/out
440 smcwtd ,deeprech , rech , ustarx , & ! in/out :
441 z0wrf , z0hwrf , ts , & ! out :
442 fsa , fsr , fira , fsh , ssoil , fcev , & ! out :
443 fgev , fctr , ecan , etran , edir , trad , & ! out :
444 tgb , tgv , t2mv , t2mb , q2v , q2b , & ! out :
445 runsrf , runsub , apar , psn , sav , sag , & ! out :
446 fsno , nee , gpp , npp , fveg , albedo , & ! out :
447 qsnbot , ponding , ponding1, ponding2, rssun , rssha , & ! out :
448 albd , albi , albsnd , albsni , & ! out :
449 bgap , wgap , chv , chb , emissi , & ! out :
450 shg , shc , shb , evg , evb , ghv , & ! out :
451 ghb , irg , irc , irb , tr , evc , & ! out :
452 chleaf , chuc , chv2 , chb2 , fpice , pahv , &
453 pahg , pahb , pah , esnow , canhs , laisun , &
454 laisha , rb , qsfcveg , qsfcbare &
468 type (noahmp_parameters),
intent(in) :: parameters
470 integer ,
intent(in) :: ice
471 integer ,
intent(in) :: ist
472 integer ,
intent(in) :: vegtyp
473 INTEGER ,
INTENT(IN) :: CROPTYPE
474 integer ,
intent(in) :: nsnow
475 integer ,
intent(in) :: nsoil
476 integer ,
intent(in) :: iloc
477 integer ,
intent(in) :: jloc
478 real (kind=kind_phys) ,
intent(in) :: ep_1
479 real (kind=kind_phys) ,
intent(in) :: ep_2
480 real (kind=kind_phys) ,
intent(in) :: epsm1
481 real (kind=kind_phys) ,
intent(in) :: cp
482 real (kind=kind_phys) ,
intent(in) :: dt
483 real (kind=kind_phys),
dimension( 1:nsoil),
intent(in) :: zsoil
484 real (kind=kind_phys) ,
intent(in) :: q2
485 real (kind=kind_phys) ,
intent(in) :: sfctmp
486 real (kind=kind_phys) ,
intent(in) :: uu
487 real (kind=kind_phys) ,
intent(in) :: vv
488 real (kind=kind_phys) ,
intent(in) :: soldn
489 real (kind=kind_phys) ,
intent(in) :: lwdn
490 real (kind=kind_phys) ,
intent(in) :: sfcprs
492 logical ,
intent(in) :: thsfc_loc
493 real (kind=kind_phys) ,
intent(in) :: prslkix
494 real (kind=kind_phys) ,
intent(in) :: prsik1x
495 real (kind=kind_phys) ,
intent(in) :: prslk1x
496 real (kind=kind_phys) ,
intent(in) :: garea1
498 real (kind=kind_phys) ,
intent(in) :: pblhx
499 integer ,
intent(in) :: iz0tlnd
500 integer ,
intent(in) :: itime
501 integer ,
intent(in) :: psi_opt
503 real (kind=kind_phys) ,
intent(inout) :: zlvl
504 real (kind=kind_phys) ,
intent(in) :: cosz
505 real (kind=kind_phys) ,
intent(in) :: tbot
506 real (kind=kind_phys) ,
intent(in) :: foln
507 real (kind=kind_phys) ,
intent(in) :: shdfac
508 integer ,
intent(in) :: yearlen
509 real (kind=kind_phys) ,
intent(in) :: julian
510 real (kind=kind_phys) ,
intent(in) :: lat
511 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(in) :: ficeold
512 real (kind=kind_phys),
dimension( 1:nsoil),
intent(in) :: smceq
513 real (kind=kind_phys) ,
intent(in) :: prcpconv
514 real (kind=kind_phys) ,
intent(in) :: prcpnonc
515 real (kind=kind_phys) ,
intent(in) :: prcpshcv
516 real (kind=kind_phys) ,
intent(in) :: prcpsnow
517 real (kind=kind_phys) ,
intent(in) :: prcpgrpl
518 real (kind=kind_phys) ,
intent(in) :: prcphail
521 real (kind=kind_phys) ,
intent(in) :: qc
522 real (kind=kind_phys) ,
intent(inout) :: qsfc
523 real (kind=kind_phys) ,
intent(in) :: psfc
524 real (kind=kind_phys) ,
intent(in) :: dz8w
525 real (kind=kind_phys) ,
intent(in) :: dx
526 real (kind=kind_phys) ,
intent(in) :: shdmax
531 real (kind=kind_phys) ,
intent(inout) :: qsnow
532 REAL (kind=kind_phys) ,
INTENT(INOUT) :: qrain
533 real (kind=kind_phys) ,
intent(inout) :: fwet
534 real (kind=kind_phys) ,
intent(inout) :: sneqvo
535 real (kind=kind_phys) ,
intent(inout) :: eah
536 real (kind=kind_phys) ,
intent(inout) :: tah
537 real (kind=kind_phys) ,
intent(inout) :: albold
538 real (kind=kind_phys) ,
intent(inout) :: cm
539 real (kind=kind_phys) ,
intent(inout) :: ch
540 real (kind=kind_phys) ,
intent(inout) :: tauss
541 real (kind=kind_phys) ,
intent(inout) :: ustarx
544 integer ,
intent(inout) :: isnow
545 real (kind=kind_phys) ,
intent(inout) :: canliq
546 real (kind=kind_phys) ,
intent(inout) :: canice
547 real (kind=kind_phys) ,
intent(inout) :: sneqv
548 real (kind=kind_phys),
dimension( 1:nsoil),
intent(inout) :: smc
549 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: zsnso
550 real (kind=kind_phys) ,
intent(inout) :: snowh
551 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(inout) :: snice
552 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(inout) :: snliq
553 real (kind=kind_phys) ,
intent(inout) :: tv
554 real (kind=kind_phys) ,
intent(inout) :: tg
555 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: stc
556 real (kind=kind_phys),
dimension( 1:nsoil),
intent(inout) :: sh2o
557 real (kind=kind_phys) ,
intent(inout) :: zwt
558 real (kind=kind_phys) ,
intent(inout) :: wa
559 real (kind=kind_phys) ,
intent(inout) :: wt
560 real (kind=kind_phys) ,
intent(inout) :: wslake
561 real (kind=kind_phys),
intent(inout) :: smcwtd
562 real (kind=kind_phys),
intent(inout) :: deeprech
563 real (kind=kind_phys),
intent(inout) :: rech
566 real (kind=kind_phys) ,
intent(out) :: z0wrf
567 real (kind=kind_phys) ,
intent(out) :: z0hwrf
568 real (kind=kind_phys) ,
intent(out) :: fsa
569 real (kind=kind_phys) ,
intent(out) :: fsr
570 real (kind=kind_phys) ,
intent(out) :: fira
571 real (kind=kind_phys) ,
intent(out) :: fsh
572 real (kind=kind_phys) ,
intent(out) :: fcev
573 real (kind=kind_phys) ,
intent(out) :: fgev
574 real (kind=kind_phys) ,
intent(out) :: fctr
575 real (kind=kind_phys) ,
intent(out) :: ssoil
576 real (kind=kind_phys) ,
intent(out) :: trad
577 real (kind=kind_phys) ,
intent(out) :: ts
578 real (kind=kind_phys) ,
intent(out) :: ecan
579 real (kind=kind_phys) ,
intent(out) :: etran
580 real (kind=kind_phys) ,
intent(out) :: edir
581 real (kind=kind_phys) ,
intent(out) :: runsrf
582 real (kind=kind_phys) ,
intent(out) :: runsub
583 real (kind=kind_phys) ,
intent(out) :: psn
584 real (kind=kind_phys) ,
intent(out) :: apar
585 real (kind=kind_phys) ,
intent(out) :: sav
586 real (kind=kind_phys) ,
intent(out) :: sag
587 real (kind=kind_phys) ,
intent(out) :: fsno
588 real (kind=kind_phys) ,
intent(out) :: fveg
589 real (kind=kind_phys) ,
intent(out) ::
albedo
590 real (kind=kind_phys) :: errwat
591 real (kind=kind_phys) ,
intent(out) :: qsnbot
592 real (kind=kind_phys) ,
intent(out) :: ponding
593 real (kind=kind_phys) ,
intent(out) :: ponding1
594 real (kind=kind_phys) ,
intent(out) :: ponding2
595 real (kind=kind_phys) ,
intent(out) :: esnow
596 real (kind=kind_phys) ,
intent(out) :: rb
597 real (kind=kind_phys) ,
intent(out) :: laisun
598 real (kind=kind_phys) ,
intent(out) :: laisha
599 real (kind=kind_phys) ,
intent(out) :: qsfcveg
600 real (kind=kind_phys) ,
intent(out) :: qsfcbare
603 real (kind=kind_phys) ,
intent(out) :: t2mv
604 real (kind=kind_phys) ,
intent(out) :: t2mb
605 real (kind=kind_phys),
intent(out) :: rssun
606 real (kind=kind_phys),
intent(out) :: rssha
607 real (kind=kind_phys),
intent(out) :: bgap
608 real (kind=kind_phys),
intent(out) :: wgap
609 real (kind=kind_phys),
dimension(1:2) ,
intent(out) :: albd
610 real (kind=kind_phys),
dimension(1:2) ,
intent(out) :: albi
611 real (kind=kind_phys),
dimension(1:2) ,
intent(out) :: albsnd
612 real (kind=kind_phys),
dimension(1:2) ,
intent(out) :: albsni
613 real (kind=kind_phys),
intent(out) :: tgv
614 real (kind=kind_phys),
intent(out) :: tgb
615 real (kind=kind_phys) :: q1
616 real (kind=kind_phys),
intent(out) :: emissi
619 character(len=*),
intent(inout) :: errmsg
620 integer,
intent(inout) :: errflg
625 integer,
dimension(-nsnow+1:nsoil) :: imelt
626 real (kind=kind_phys) :: cmc
627 real (kind=kind_phys) :: taux
628 real (kind=kind_phys) :: tauy
629 real (kind=kind_phys) :: rhoair
631 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: dzsnso
632 real (kind=kind_phys) :: thair
633 real (kind=kind_phys) :: qair
634 real (kind=kind_phys) :: eair
635 real (kind=kind_phys),
dimension( 1: 2) :: solad
636 real (kind=kind_phys),
dimension( 1: 2) :: solai
637 real (kind=kind_phys) :: qprecc
638 real (kind=kind_phys) :: qprecl
639 real (kind=kind_phys) :: igs
640 real (kind=kind_phys) :: elai
641 real (kind=kind_phys) :: esai
642 real (kind=kind_phys) :: bevap
643 real (kind=kind_phys),
dimension( 1:nsoil) :: btrani
644 real (kind=kind_phys) :: btran
645 real (kind=kind_phys) :: qin
646 real (kind=kind_phys) :: qdis
647 real (kind=kind_phys),
dimension( 1:nsoil) :: sice
648 real (kind=kind_phys),
dimension(-nsnow+1: 0) :: snicev
649 real (kind=kind_phys),
dimension(-nsnow+1: 0) :: snliqv
650 real (kind=kind_phys),
dimension(-nsnow+1: 0) :: epore
651 real (kind=kind_phys) :: totsc
652 real (kind=kind_phys) :: totlb
653 real (kind=kind_phys) :: t2m
654 real (kind=kind_phys) :: qdew
655 real (kind=kind_phys) :: qvap
656 real (kind=kind_phys) :: lathea
657 real (kind=kind_phys) :: swdown
658 real (kind=kind_phys) :: qmelt
659 real (kind=kind_phys) :: beg_wb
660 real (kind=kind_phys),
intent(out) :: irc
661 real (kind=kind_phys),
intent(out) :: irg
662 real (kind=kind_phys),
intent(out) :: shc
663 real (kind=kind_phys),
intent(out) :: shg
664 real (kind=kind_phys),
intent(out) :: evg
665 real (kind=kind_phys),
intent(out) :: ghv
666 real (kind=kind_phys),
intent(out) :: irb
667 real (kind=kind_phys),
intent(out) :: shb
668 real (kind=kind_phys),
intent(out) :: evb
669 real (kind=kind_phys),
intent(out) :: ghb
670 real (kind=kind_phys),
intent(out) :: evc
671 real (kind=kind_phys),
intent(out) :: tr
672 real (kind=kind_phys),
intent(out) :: fpice
673 real (kind=kind_phys),
intent(out) :: pahv
674 real (kind=kind_phys),
intent(out) :: pahg
675 real (kind=kind_phys),
intent(out) :: pahb
676 real (kind=kind_phys),
intent(out) :: pah
679 real (kind=kind_phys) :: fsrv
680 real (kind=kind_phys) :: fsrg
681 real (kind=kind_phys),
intent(out) :: q2v
682 real (kind=kind_phys),
intent(out) :: q2b
683 real (kind=kind_phys) :: q2e
684 real (kind=kind_phys) :: qfx
685 real (kind=kind_phys),
intent(out) :: chv
686 real (kind=kind_phys),
intent(out) :: chb
687 real (kind=kind_phys),
intent(out) :: chleaf
688 real (kind=kind_phys),
intent(out) :: chuc
689 real (kind=kind_phys),
intent(out) :: chv2
690 real (kind=kind_phys),
intent(out) :: chb2
695 real (kind=kind_phys) ,
intent(in) :: co2air
696 real (kind=kind_phys) ,
intent(in) :: o2air
699 real (kind=kind_phys) ,
intent(inout) :: lfmass
700 real (kind=kind_phys) ,
intent(inout) :: rtmass
701 real (kind=kind_phys) ,
intent(inout) :: stmass
702 real (kind=kind_phys) ,
intent(inout) :: wood
703 real (kind=kind_phys) ,
intent(inout) :: stblcp
704 real (kind=kind_phys) ,
intent(inout) :: fastcp
705 real (kind=kind_phys) ,
intent(inout) :: lai
706 real (kind=kind_phys) ,
intent(inout) :: sai
707 real (kind=kind_phys) ,
intent(inout) :: grain
708 real (kind=kind_phys) ,
intent(inout) :: gdd
709 integer ,
intent(inout) :: pgs
712 real (kind=kind_phys) ,
intent(out) :: nee
713 real (kind=kind_phys) ,
intent(out) :: gpp
714 real (kind=kind_phys) ,
intent(out) :: npp
715 real (kind=kind_phys) :: autors
716 real (kind=kind_phys) :: heters
717 real (kind=kind_phys) :: troot
718 real (kind=kind_phys) :: bdfall
719 real (kind=kind_phys) :: rain
720 real (kind=kind_phys) :: snow
721 real (kind=kind_phys) :: fp
722 real (kind=kind_phys) :: prcp
724 real (kind=kind_phys) :: qintr
725 real (kind=kind_phys) :: qdripr
726 real (kind=kind_phys) :: qthror
727 real (kind=kind_phys) :: qints
728 real (kind=kind_phys) :: qdrips
729 real (kind=kind_phys) :: qthros
730 real (kind=kind_phys) :: snowhin
731 real (kind=kind_phys) :: latheav
732 real (kind=kind_phys) :: latheag
733 logical :: frozen_ground
734 logical :: frozen_canopy
735 logical :: dveg_active
736 logical :: crop_active
738 real (kind=kind_phys) ,
intent(out) :: canhs
754 call atm (parameters,ep_2, epsm1, sfcprs ,sfctmp ,q2 , &
755 prcpconv, prcpnonc,prcpshcv,prcpsnow,prcpgrpl,prcphail, &
756 soldn ,cosz ,thair ,qair , &
757 eair ,rhoair ,qprecc ,qprecl ,solad ,solai , &
758 swdown ,bdfall ,rain ,snow ,fp ,fpice , prcp )
762 do iz = isnow+1, nsoil
763 if(iz == isnow+1)
then
764 dzsnso(iz) = - zsnso(iz)
766 dzsnso(iz) = zsnso(iz-1) - zsnso(iz)
773 do iz=1,parameters%nroot
774 troot = troot + stc(iz)*dzsnso(iz)/(-zsoil(parameters%nroot))
780 beg_wb = canliq + canice + sneqv + wa
782 beg_wb = beg_wb + smc(iz) * dzsnso(iz) * 1000.
788 call phenology (parameters,vegtyp ,croptype, snowh , tv , lat , yearlen , julian , &
789 lai , sai , troot , elai , esai ,igs, pgs)
792 if(dveg == 1 .or. dveg == 6 .or. dveg == 7)
then
794 if(fveg <= 0.05) fveg = 0.05
795 else if (dveg == 2 .or. dveg == 3 .or. dveg == 8)
then
796 fveg = 1.-exp(-0.52*(lai+sai))
797 if(fveg <= 0.05) fveg = 0.05
798 else if (dveg == 4 .or. dveg == 5 .or. dveg == 9)
then
800 if(fveg <= 0.05) fveg = 0.05
802 write(*,*)
"-------- fatal called in sflx -----------"
805 errmsg =
"namelist parameter dveg unknown"
808 call wrf_error_fatal(
"namelist parameter dveg unknown")
811 if(opt_crop > 0 .and. croptype > 0)
then
813 if(fveg <= 0.05) fveg = 0.05
815 if(parameters%urban_flag .or. vegtyp == parameters%isbarren) fveg = 0.0
816 if(elai+esai == 0.0) fveg = 0.0
818 call precip_heat(parameters,iloc ,jloc ,vegtyp ,dt ,uu ,vv , &
819 elai ,esai ,fveg ,ist , &
820 bdfall ,rain ,snow ,fp , &
821 canliq ,canice ,tv ,sfctmp ,tg , &
822 qintr ,qdripr ,qthror ,qints ,qdrips ,qthros , &
823 pahv ,pahg ,pahb ,qrain ,qsnow ,snowhin, &
828 call energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , &
829 isnow ,dt ,rhoair ,sfcprs ,qair , &
830 sfctmp ,thair ,lwdn ,uu ,vv ,zlvl , &
831 co2air ,o2air ,solad ,solai ,cosz ,igs , &
832 eair ,tbot ,zsnso ,zsoil , &
833 elai ,esai ,fwet ,foln , &
834 fveg ,shdfac, pahv ,pahg ,pahb , &
835 qsnow ,dzsnso ,lat ,canliq ,canice ,iloc, jloc , &
836 thsfc_loc, prslkix,prsik1x,prslk1x,garea1, &
837 pblhx ,iz0tlnd, itime ,psi_opt, ep_1, ep_2, epsm1,cp, &
839 imelt ,snicev ,snliqv ,epore ,t2m ,fsno , &
840 sav ,sag ,qmelt ,fsa ,fsr ,taux , &
841 tauy ,fira ,fsh ,fcev ,fgev ,fctr , &
842 trad ,psn ,apar ,ssoil ,btrani ,btran , &
843 ponding,ts ,latheav , latheag , frozen_canopy,frozen_ground, &
844 tv ,tg ,stc ,snowh ,eah ,tah , &
845 sneqvo ,sneqv ,sh2o ,smc ,snice ,snliq , &
846 albold ,cm ,ch ,dx ,dz8w ,q2 , &
849 tauss ,laisun ,laisha ,rb , errmsg ,errflg , &
851 tauss ,laisun ,laisha ,rb , &
856 fsrg ,rssun ,rssha ,albd ,albi ,albsnd,albsni, bgap ,wgap, tgv,tgb,&
857 q1 ,q2v ,q2b ,q2e ,chv ,chb , &
858 emissi ,pah ,canhs, &
859 shg,shc,shb,evg,evb,ghv,ghb,irg,irc,irb,tr,evc,chleaf,chuc,chv2,chb2 )
861 qsfcveg = eah*ep_2/(sfcprs + epsm1*eah)
866 if (errflg /= 0)
return
868 sice(:) = max(0.0, smc(:) - sh2o(:))
871 qvap = max( fgev/latheag, 0.)
872 qdew = abs( min(fgev/latheag, 0.))
877 call water (parameters,vegtyp ,nsnow ,nsoil ,imelt ,dt ,uu , &
878 vv ,fcev ,fctr ,qprecc ,qprecl ,elai , &
879 esai ,sfctmp ,qvap ,qdew ,zsoil ,btrani , &
880 ficeold,ponding,tg ,ist ,fveg ,iloc,jloc , smceq , &
881 bdfall ,fp ,rain ,snow , &
882 qsnow ,qrain ,snowhin,latheav,latheag,frozen_canopy,frozen_ground, &
883 isnow ,canliq ,canice ,tv ,snowh ,sneqv , &
884 snice ,snliq ,stc ,zsnso ,sh2o ,smc , &
885 sice ,zwt ,wa ,wt ,dzsnso ,wslake , &
886 smcwtd ,deeprech,rech , &
887 cmc ,ecan ,etran ,fwet ,runsrf ,runsub , &
888 qin ,qdis ,ponding1 ,ponding2,&
895 crop_active = .false.
896 dveg_active = .false.
897 if (dveg == 2 .or. dveg == 5 .or. dveg == 6) dveg_active = .true.
898 if (opt_crop > 0 .and. croptype > 0)
then
900 dveg_active = .false.
903 IF (dveg_active)
THEN
904 call carbon (parameters,nsnow ,nsoil ,vegtyp ,dt ,zsoil , &
905 dzsnso ,stc ,smc ,tv ,tg ,psn , &
906 foln ,btran ,apar ,fveg ,igs , &
907 troot ,ist ,lat ,iloc ,jloc , &
908 lfmass ,rtmass ,stmass ,wood ,stblcp ,fastcp , &
909 gpp ,npp ,nee ,autors ,heters ,totsc , &
913 if (opt_crop == 1 .and. crop_active)
then
914 call carbon_crop (parameters,nsnow ,nsoil ,vegtyp ,dt ,zsoil ,julian , &
915 dzsnso ,stc ,smc ,tv ,psn ,foln ,btran , &
917 lfmass ,rtmass ,stmass ,wood ,stblcp ,fastcp ,grain , &
919 gpp ,npp ,nee ,autors ,heters ,totsc ,totlb, pgs )
924 call error (parameters,swdown ,fsa ,fsr ,fira ,fsh ,fcev , &
925 fgev ,fctr ,ssoil ,beg_wb ,canliq ,canice , &
926 sneqv ,wa ,smc ,dzsnso ,prcp ,ecan , &
927 etran ,edir ,runsrf ,runsub ,dt ,nsoil , &
928 nsnow ,ist ,errwat ,iloc , jloc ,fveg , &
929 sav ,sag ,fsrv ,fsrg ,zwt ,pah , &
931 pahv ,pahg ,pahb ,canhs,errmsg, errflg)
933 pahv ,pahg ,pahb, canhs )
937 if (errflg /= 0)
return
941 qfx = etran + ecan + edir
942 if ( parameters%urban_flag )
then
943 qsfc = qfx/(rhoair*ch) + qair
947 if(snowh <= 1.e-6 .or. sneqv <= 1.e-3)
then
952 if(swdown.ne.0.)
then
965 subroutine atm (parameters,ep_2,epsm1,sfcprs ,sfctmp ,q2 , &
966 prcpconv,prcpnonc ,prcpshcv,prcpsnow,prcpgrpl,prcphail , &
967 soldn ,cosz ,thair ,qair , &
968 eair ,rhoair ,qprecc ,qprecl ,solad , solai , &
969 swdown ,bdfall ,rain ,snow ,fp , fpice ,prcp )
977 type (noahmp_parameters),
intent(in) :: parameters
978 real (kind=kind_phys) ,
intent(in) :: ep_2
979 real (kind=kind_phys) ,
intent(in) :: epsm1
980 real (kind=kind_phys) ,
intent(in) :: sfcprs
981 real (kind=kind_phys) ,
intent(in) :: sfctmp
982 real (kind=kind_phys) ,
intent(in) :: q2
983 real (kind=kind_phys) ,
intent(in) :: prcpconv
984 real (kind=kind_phys) ,
intent(in) :: prcpnonc
985 real (kind=kind_phys) ,
intent(in) :: prcpshcv
986 real (kind=kind_phys) ,
intent(in) :: prcpsnow
987 real (kind=kind_phys) ,
intent(in) :: prcpgrpl
988 real (kind=kind_phys) ,
intent(in) :: prcphail
989 real (kind=kind_phys) ,
intent(in) :: soldn
990 real (kind=kind_phys) ,
intent(in) :: cosz
994 real (kind=kind_phys) ,
intent(out) :: thair
995 real (kind=kind_phys) ,
intent(out) :: qair
996 real (kind=kind_phys) ,
intent(out) :: eair
997 real (kind=kind_phys) ,
intent(out) :: rhoair
998 real (kind=kind_phys) ,
intent(out) :: qprecc
999 real (kind=kind_phys) ,
intent(out) :: qprecl
1000 real (kind=kind_phys),
dimension( 1: 2),
intent(out) :: solad
1001 real (kind=kind_phys),
dimension( 1: 2),
intent(out) :: solai
1002 real (kind=kind_phys) ,
intent(out) :: swdown
1003 real (kind=kind_phys) ,
intent(out) :: bdfall
1004 real (kind=kind_phys) ,
intent(out) :: rain
1005 real (kind=kind_phys) ,
intent(out) :: snow
1006 real (kind=kind_phys) ,
intent(out) :: fp
1007 real (kind=kind_phys) ,
intent(out) :: fpice
1008 real (kind=kind_phys) ,
intent(out) :: prcp
1012 real (kind=kind_phys) :: pair
1013 real (kind=kind_phys) :: prcp_frozen
1014 real (kind=kind_phys),
parameter :: rho_grpl = 500.0
1015 real (kind=kind_phys),
parameter :: rho_hail = 917.0
1020 thair = sfctmp * (sfcprs/pair)**(rair/cpair)
1024 eair = qair*sfcprs / (ep_2-epsm1*qair)
1025 rhoair = (sfcprs+epsm1*eair) / (rair*sfctmp)
1033 solad(1) = swdown*0.7*0.5
1034 solad(2) = swdown*0.7*0.5
1035 solai(1) = swdown*0.3*0.5
1036 solai(2) = swdown*0.3*0.5
1038 prcp = prcpconv + prcpnonc + prcpshcv
1040 if(opt_snf == 4)
then
1041 qprecc = prcpconv + prcpshcv
1044 qprecc = 0.10 * prcp
1045 qprecl = 0.90 * prcp
1051 if(qprecc + qprecl > 0.) &
1052 fp = (qprecc + qprecl) / (10.*qprecc + qprecl)
1058 if(opt_snf == 1)
then
1059 if(sfctmp > tfrz+2.5)
then
1062 if(sfctmp <= tfrz+0.5)
then
1064 else if(sfctmp <= tfrz+2.)
then
1065 fpice = 1.-(-54.632 + 0.2*sfctmp)
1072 if(opt_snf == 2)
then
1073 if(sfctmp >= tfrz+2.2)
then
1080 if(opt_snf == 3)
then
1081 if(sfctmp >= tfrz)
then
1091 bdfall = min(120.,67.92+51.25*exp((sfctmp-tfrz)/2.59))
1092 if(opt_snf == 4 .or. opt_snf == 5)
then
1093 prcp_frozen = prcpsnow + prcpgrpl + prcphail
1094 if(prcpnonc > 0. .and. prcp_frozen > 0.)
then
1095 fpice = min(1.0,prcp_frozen/prcpnonc)
1096 fpice = max(0.0,fpice)
1097 if(opt_snf==4) bdfall = bdfall*(prcpsnow/prcp_frozen) + rho_grpl*(prcpgrpl/prcp_frozen) + &
1098 rho_hail*(prcphail/prcp_frozen)
1099 if(opt_snf==5) bdfall = parameters%prcpiceden
1106 rain = prcp * (1.-fpice)
1117 subroutine phenology (parameters,vegtyp ,croptype, snowh , tv , lat , yearlen , julian , & !in
1118 lai , sai , troot , elai , esai , igs, pgs)
1126 type (noahmp_parameters),
intent(in) :: parameters
1127 integer ,
intent(in ) :: vegtyp
1128 integer ,
intent(in ) :: croptype
1129 real (kind=kind_phys) ,
intent(in ) :: snowh
1130 real (kind=kind_phys) ,
intent(in ) :: tv
1131 real (kind=kind_phys) ,
intent(in ) :: lat
1132 integer ,
intent(in ) :: yearlen
1133 real (kind=kind_phys) ,
intent(in ) :: julian
1134 real (kind=kind_phys) ,
intent(in ) :: troot
1135 real (kind=kind_phys) ,
intent(inout) :: lai
1136 real (kind=kind_phys) ,
intent(inout) :: sai
1139 real (kind=kind_phys) ,
intent(out ) :: elai
1140 real (kind=kind_phys) ,
intent(out ) :: esai
1141 real (kind=kind_phys) ,
intent(out ) :: igs
1142 integer ,
intent(in ) :: pgs
1146 real (kind=kind_phys) :: db
1147 real (kind=kind_phys) :: fb
1148 real (kind=kind_phys) :: snowhc
1153 real (kind=kind_phys) :: day
1154 real (kind=kind_phys) :: wt1,wt2
1155 real (kind=kind_phys) :: t
1158if (croptype == 0)
then
1160 if ( dveg == 1 .or. dveg == 3 .or. dveg == 4 )
then
1167 day = mod( julian + ( 0.5 * yearlen ) , real(yearlen) )
1170 t = 12. * day / real(yearlen)
1175 if (it1 .lt. 1) it1 = 12
1176 if (it2 .gt. 12) it2 = 1
1178 lai = wt1*parameters%laim(it1) + wt2*parameters%laim(it2)
1179 sai = wt1*parameters%saim(it1) + wt2*parameters%saim(it2)
1182 if(dveg == 7 .or. dveg == 8 .or. dveg == 9)
then
1183 sai = max(0.05,0.1 * lai)
1184 if (lai < 0.05) sai = 0.0
1187 if (sai < 0.05) sai = 0.0
1188 if (lai < 0.05 .or. sai == 0.0) lai = 0.0
1190 if ( ( vegtyp == parameters%iswater ) .or. ( vegtyp == parameters%isbarren ) .or. &
1191 ( vegtyp == parameters%isice ) .or. ( parameters%urban_flag ) )
then
1200 db = min( max(snowh - parameters%hvb,0.), parameters%hvt-parameters%hvb )
1201 fb = db / max(1.e-06,parameters%hvt-parameters%hvb)
1203 if(parameters%hvt> 0. .and. parameters%hvt <= 1.0)
then
1204 snowhc = parameters%hvt*exp(-snowh/0.2)
1206 if (snowh < snowhc)
then
1215 if (esai < 0.05 .and. croptype == 0) esai = 0.0
1216 if ((elai < 0.05 .or. esai == 0.0) .and. croptype == 0) elai = 0.0
1220 if ((tv .gt. parameters%tmin .and. croptype == 0).or.(pgs > 2 .and. pgs < 7 .and. croptype > 0))
then
1233 subroutine precip_heat (parameters,iloc ,jloc ,vegtyp ,dt ,uu ,vv , & !in
1234 elai ,esai ,fveg ,ist , & !in
1235 bdfall ,rain ,snow ,fp , & !in
1236 canliq ,canice ,tv ,sfctmp ,tg , & !in
1237 qintr ,qdripr ,qthror ,qints ,qdrips ,qthros , & !out
1238 pahv ,pahg ,pahb ,qrain ,qsnow ,snowhin, & !out
1248 type (noahmp_parameters),
intent(in) :: parameters
1249 integer,
intent(in) :: iloc
1250 integer,
intent(in) :: jloc
1251 integer,
intent(in) :: vegtyp
1252 integer,
intent(in) :: ist
1253 real (kind=kind_phys),
intent(in) :: dt
1254 real (kind=kind_phys),
intent(in) :: uu
1255 real (kind=kind_phys),
intent(in) :: vv
1256 real (kind=kind_phys),
intent(in) :: elai
1257 real (kind=kind_phys),
intent(in) :: esai
1258 real (kind=kind_phys),
intent(in) :: fveg
1259 real (kind=kind_phys),
intent(in) :: bdfall
1260 real (kind=kind_phys),
intent(in) :: rain
1261 real (kind=kind_phys),
intent(in) :: snow
1262 real (kind=kind_phys),
intent(in) :: fp
1263 real (kind=kind_phys),
intent(in) :: tv
1264 real (kind=kind_phys),
intent(in) :: sfctmp
1265 real (kind=kind_phys),
intent(in) :: tg
1268 real (kind=kind_phys),
intent(inout) :: canliq
1269 real (kind=kind_phys),
intent(inout) :: canice
1272 real (kind=kind_phys),
intent(out) :: qintr
1273 real (kind=kind_phys),
intent(out) :: qdripr
1274 real (kind=kind_phys),
intent(out) :: qthror
1275 real (kind=kind_phys),
intent(out) :: qints
1276 real (kind=kind_phys),
intent(out) :: qdrips
1277 real (kind=kind_phys),
intent(out) :: qthros
1278 real (kind=kind_phys),
intent(out) :: pahv
1279 real (kind=kind_phys),
intent(out) :: pahg
1280 real (kind=kind_phys),
intent(out) :: pahb
1281 real (kind=kind_phys),
intent(out) :: qrain
1282 real (kind=kind_phys),
intent(out) :: qsnow
1283 real (kind=kind_phys),
intent(out) :: snowhin
1284 real (kind=kind_phys),
intent(out) :: fwet
1285 real (kind=kind_phys),
intent(out) :: cmc
1289 real (kind=kind_phys) :: maxsno
1290 real (kind=kind_phys) :: maxliq
1291 real (kind=kind_phys) :: ft
1292 real (kind=kind_phys) :: fv
1293 real (kind=kind_phys) :: pah_ac
1294 real (kind=kind_phys) :: pah_cg
1295 real (kind=kind_phys) :: pah_ag
1296 real (kind=kind_phys) :: icedrip
1326 maxliq = parameters%ch2op * (elai+ esai)
1330 if((elai+ esai).gt.0.)
then
1331 qintr = fveg * rain * fp
1332 qintr = min(qintr, (maxliq - canliq)/dt * (1.-exp(-rain*dt/maxliq)) )
1333 qintr = max(qintr, 0.)
1334 qdripr = fveg * rain - qintr
1335 qthror = (1.-fveg) * rain
1336 canliq=max(0.,canliq+qintr*dt)
1341 if(canliq > 0.)
then
1342 qdripr = qdripr + canliq/dt
1349 pah_ac = fveg * rain * (cwat/1000.0) * (sfctmp - tv)
1350 pah_cg = qdripr * (cwat/1000.0) * (tv - tg)
1351 pah_ag = qthror * (cwat/1000.0) * (sfctmp - tg)
1359 maxsno = 6.6*(0.27+46./bdfall) * (elai+ esai)
1361 if((elai+ esai).gt.0.)
then
1362 qints = fveg * snow * fp
1363 qints = min(qints, (maxsno - canice)/dt * (1.-exp(-snow*dt/maxsno)) )
1364 qints = max(qints, 0.)
1365 ft = max(0.0,(tv - 270.15) / 1.87e5)
1366 fv = sqrt(uu*uu + vv*vv) / 1.56e5
1368 icedrip = max(0.,canice) * (fv+ft)
1369 qdrips = (fveg * snow - qints) + icedrip
1370 qthros = (1.0-fveg) * snow
1371 canice= max(0.,canice + (qints - icedrip)*dt)
1376 if(canice > 0.)
then
1377 qdrips = qdrips + canice/dt
1386 if(canice.gt.0.)
then
1387 fwet = max(0.,canice) / max(maxsno,1.e-06)
1389 fwet = max(0.,canliq) / max(maxliq,1.e-06)
1391 fwet = min(fwet, 1.) ** 0.667
1395 cmc = canliq + canice
1399 pah_ac = pah_ac + fveg * snow * (cice/1000.0) * (sfctmp - tv)
1400 pah_cg = pah_cg + qdrips * (cice/1000.0) * (tv - tg)
1401 pah_ag = pah_ag + qthros * (cice/1000.0) * (sfctmp - tg)
1403 pahv = pah_ac - pah_cg
1407 if (fveg > 0.0 .and. fveg < 1.0)
then
1409 pahb = pahb / (1.0-fveg)
1410 elseif (fveg <= 0.0)
then
1414 elseif (fveg >= 1.0)
then
1418 pahv = max(pahv,-20.0)
1419 pahv = min(pahv,20.0)
1420 pahg = max(pahg,-20.0)
1421 pahg = min(pahg,20.0)
1422 pahb = max(pahb,-20.0)
1423 pahb = min(pahb,20.0)
1442 qrain = qdripr + qthror
1443 qsnow = qdrips + qthros
1444 snowhin = qsnow/bdfall
1446 if (ist == 2 .and. tg > tfrz)
then
1464 subroutine error (parameters,swdown ,fsa ,fsr ,fira ,fsh ,fcev , &
1465 fgev ,fctr ,ssoil ,beg_wb ,canliq ,canice , &
1466 sneqv ,wa ,smc ,dzsnso ,prcp ,ecan , &
1467 etran ,edir ,runsrf ,runsub ,dt ,nsoil , &
1468 nsnow ,ist ,errwat, iloc ,jloc ,fveg , &
1469 sav ,sag ,fsrv ,fsrg ,zwt ,pah , &
1471 pahv ,pahg ,pahb ,canhs,errmsg, errflg)
1473 pahv ,pahg ,pahb ,canhs)
1481 type (noahmp_parameters),
intent(in) :: parameters
1482 integer ,
intent(in) :: nsnow
1483 integer ,
intent(in) :: nsoil
1484 integer ,
intent(in) :: ist
1485 integer ,
intent(in) :: iloc
1486 integer ,
intent(in) :: jloc
1487 real (kind=kind_phys) ,
intent(in) :: swdown
1488 real (kind=kind_phys) ,
intent(in) :: fsa
1489 real (kind=kind_phys) ,
intent(in) :: fsr
1490 real (kind=kind_phys) ,
intent(in) :: fira
1491 real (kind=kind_phys) ,
intent(in) :: fsh
1492 real (kind=kind_phys) ,
intent(in) :: fcev
1493 real (kind=kind_phys) ,
intent(in) :: fgev
1494 real (kind=kind_phys) ,
intent(in) :: fctr
1495 real (kind=kind_phys) ,
intent(in) :: ssoil
1496 real (kind=kind_phys) ,
intent(in) :: fveg
1497 real (kind=kind_phys) ,
intent(in) :: sav
1498 real (kind=kind_phys) ,
intent(in) :: sag
1499 real (kind=kind_phys) ,
intent(in) :: fsrv
1500 real (kind=kind_phys) ,
intent(in) :: fsrg
1501 real (kind=kind_phys) ,
intent(in) :: zwt
1503 real (kind=kind_phys) ,
intent(in) :: prcp
1504 real (kind=kind_phys) ,
intent(in) :: ecan
1505 real (kind=kind_phys) ,
intent(in) :: etran
1506 real (kind=kind_phys) ,
intent(in) :: edir
1507 real (kind=kind_phys) ,
intent(in) :: runsrf
1508 real (kind=kind_phys) ,
intent(in) :: runsub
1509 real (kind=kind_phys) ,
intent(in) :: canliq
1510 real (kind=kind_phys) ,
intent(in) :: canice
1511 real (kind=kind_phys) ,
intent(in) :: sneqv
1512 real (kind=kind_phys),
dimension( 1:nsoil),
intent(in) :: smc
1513 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: dzsnso
1514 real (kind=kind_phys) ,
intent(in) :: wa
1515 real (kind=kind_phys) ,
intent(in) :: dt
1516 real (kind=kind_phys) ,
intent(in) :: beg_wb
1517 real (kind=kind_phys) ,
intent(out) :: errwat
1518 real (kind=kind_phys),
intent(in) :: pah
1519 real (kind=kind_phys),
intent(in) :: pahv
1520 real (kind=kind_phys),
intent(in) :: pahg
1521 real (kind=kind_phys),
intent(in) :: pahb
1522 real (kind=kind_phys),
intent(in) :: canhs
1525 character(len=*) ,
intent(inout) :: errmsg
1526 integer ,
intent(inout) :: errflg
1530 real (kind=kind_phys) :: end_wb
1532 real (kind=kind_phys) :: erreng
1533 real (kind=kind_phys) :: errsw
1534 real (kind=kind_phys) :: fsrvg
1535 character(len=256) :: message
1538 errsw = swdown - (fsa + fsr)
1541 if (abs(errsw) > 0.01)
then
1542 write(*,*)
"vegetation!"
1543 write(*,*)
"swdown*fveg =",swdown*fveg
1544 write(*,*)
"fveg*(sav+sag) =",fveg*sav + sag
1545 write(*,*)
"fveg*(fsrv +fsrg)=",fveg*fsrv + fsrg
1546 write(*,*)
"ground!"
1547 write(*,*)
"(1-.fveg)*swdown =",(1.-fveg)*swdown
1548 write(*,*)
"(1.-fveg)*sag =",(1.-fveg)*sag
1549 write(*,*)
"(1.-fveg)*fsrg=",(1.-fveg)*fsrg
1550 write(*,*)
"fsrv =",fsrv
1551 write(*,*)
"fsrg =",fsrg
1552 write(*,*)
"fsr =",fsr
1553 write(*,*)
"sav =",sav
1554 write(*,*)
"sag =",sag
1555 write(*,*)
"fsa =",fsa
1557 write(message,*)
'errsw =',errsw
1560 errmsg = trim(message)//new_line(
'A')//
"stop in noah-mp"
1563 call wrf_message(trim(message))
1564 call wrf_error_fatal(
"stop in noah-mp")
1568 erreng = sav+sag-(fira+fsh+fcev+fgev+fctr+ssoil+canhs) +pah
1570 if(abs(erreng) > 0.01)
then
1571 write(message,*)
'erreng =',erreng,
' at i,j: ',iloc,jloc
1573 errmsg = trim(message)
1575 call wrf_message(trim(message))
1577 write(message,
'(a17,f10.4)')
"net solar: ",fsa
1579 errmsg = trim(errmsg)//new_line(
'A')//trim(message)
1581 call wrf_message(trim(message))
1583 write(message,
'(a17,f10.4)')
"net longwave: ",fira
1585 errmsg = trim(errmsg)//new_line(
'A')//trim(message)
1587 call wrf_message(trim(message))
1589 write(message,
'(a17,f10.4)')
"total sensible: ",fsh
1591 errmsg = trim(errmsg)//new_line(
'A')//trim(message)
1593 call wrf_message(trim(message))
1595 write(message,
'(a17,f10.4)')
"canopy evap: ",fcev
1597 errmsg = trim(errmsg)//new_line(
'A')//trim(message)
1599 call wrf_message(trim(message))
1601 write(message,
'(a17,f10.4)')
"ground evap: ",fgev
1603 errmsg = trim(errmsg)//new_line(
'A')//trim(message)
1605 call wrf_message(trim(message))
1607 write(message,
'(a17,f10.4)')
"transpiration: ",fctr
1609 errmsg = trim(errmsg)//new_line(
'A')//trim(message)
1611 call wrf_message(trim(message))
1613 write(message,
'(a17,f10.4)')
"total ground: ",ssoil
1615 errmsg = trim(errmsg)//new_line(
'A')//trim(message)
1617 call wrf_message(trim(message))
1619 write(message,
'(a17,f10.4)')
"canopy heat storage: ",canhs
1621 errmsg = trim(errmsg)//new_line(
'A')//trim(message)
1623 call wrf_message(trim(message))
1625 write(message,
'(a17,4f10.4)')
"precip advected: ",pah,pahv,pahg,pahb
1627 errmsg = trim(errmsg)//new_line(
'A')//trim(message)
1629 call wrf_message(trim(message))
1631 write(message,
'(a17,f10.4)')
"precip: ",prcp
1633 errmsg = trim(errmsg)//new_line(
'A')//trim(message)
1635 call wrf_message(trim(message))
1637 write(message,
'(a17,f10.4)')
"veg fraction: ",fveg
1640 errmsg = trim(errmsg)//new_line(
'A')//trim(message)//new_line(
'A')//
"energy budget problem in noahmp lsm"
1643 call wrf_message(trim(message))
1644 call wrf_error_fatal(
"energy budget problem in noahmp lsm")
1650 end_wb = canliq + canice + sneqv + wa
1652 end_wb = end_wb + smc(iz) * dzsnso(iz) * 1000.
1654 errwat = end_wb-beg_wb-(prcp-ecan-etran-edir-runsrf-runsub)*dt
1660 end subroutine error
1672 subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in
1673 isnow ,dt ,rhoair ,sfcprs ,qair , & !in
1674 sfctmp ,thair ,lwdn ,uu ,vv ,zref , & !in
1675 co2air ,o2air ,solad ,solai ,cosz ,igs , & !in
1676 eair ,tbot ,zsnso ,zsoil , & !in
1677 elai ,esai ,fwet ,foln , & !in
1678 fveg ,shdfac, pahv ,pahg ,pahb , & !in
1679 qsnow ,dzsnso ,lat ,canliq ,canice ,iloc , jloc, & !in
1680 thsfc_loc, prslkix,prsik1x,prslk1x,garea1, & !in
1681 pblhx , iz0tlnd, itime,psi_opt,ep_1, ep_2, epsm1, cp, &
1682 z0wrf ,z0hwrf , & !out
1683 imelt ,snicev ,snliqv ,epore ,t2m ,fsno , & !out
1684 sav ,sag ,qmelt ,fsa ,fsr ,taux , & !out
1685 tauy ,fira ,fsh ,fcev ,fgev ,fctr , & !out
1686 trad ,psn ,apar ,ssoil ,btrani ,btran , & !out
1687 ponding,ts ,latheav , latheag , frozen_canopy,frozen_ground, & !out
1688 tv ,tg ,stc ,snowh ,eah ,tah , & !inout
1689 sneqvo ,sneqv ,sh2o ,smc ,snice ,snliq , & !inout
1690 albold ,cm ,ch ,dx ,dz8w ,q2 , & !inout
1693 tauss ,laisun ,laisha ,rb ,errmsg ,errflg, & !inout
1695 tauss ,laisun ,laisha ,rb , & !inout
1698 qc ,qsfc ,psfc , & !in
1699 t2mv ,t2mb ,fsrv , &
1700 fsrg ,rssun ,rssha ,albd ,albi,albsnd ,albsni,bgap ,wgap,tgv,tgb,&
1701 q1 ,q2v ,q2b ,q2e ,chv ,chb, emissi,pah,canhs,&
1702 shg,shc,shb,evg,evb,ghv,ghb,irg,irc,irb,tr,evc,chleaf,chuc,chv2,chb2 )
1741 type (noahmp_parameters),
intent(in) :: parameters
1742 integer ,
intent(in) :: iloc
1743 integer ,
intent(in) :: jloc
1744 integer ,
intent(in) :: ice
1745 integer ,
intent(in) :: vegtyp
1746 integer ,
intent(in) :: ist
1747 integer ,
intent(in) :: nsnow
1748 integer ,
intent(in) :: nsoil
1749 integer ,
intent(in) :: isnow
1750 real (kind=kind_phys) ,
intent(in) :: dt
1751 real (kind=kind_phys) ,
intent(in) :: qsnow
1752 real (kind=kind_phys) ,
intent(in) :: rhoair
1753 real (kind=kind_phys) ,
intent(in) :: eair
1754 real (kind=kind_phys) ,
intent(in) :: sfcprs
1756 logical ,
intent(in) :: thsfc_loc
1757 real (kind=kind_phys) ,
intent(in) :: prslkix
1758 real (kind=kind_phys) ,
intent(in) :: prsik1x
1759 real (kind=kind_phys) ,
intent(in) :: prslk1x
1760 real (kind=kind_phys) ,
intent(in) :: garea1
1762 real (kind=kind_phys) ,
intent(in) :: pblhx
1763 real (kind=kind_phys) ,
intent(in) :: ep_1
1764 real (kind=kind_phys) ,
intent(in) :: ep_2
1765 real (kind=kind_phys) ,
intent(in) :: epsm1
1766 real (kind=kind_phys) ,
intent(in) :: cp
1767 integer ,
intent(in) :: iz0tlnd
1768 integer ,
intent(in) :: itime
1769 integer ,
intent(in) :: psi_opt
1771 real (kind=kind_phys) ,
intent(in) :: qair
1772 real (kind=kind_phys) ,
intent(in) :: sfctmp
1773 real (kind=kind_phys) ,
intent(in) :: thair
1774 real (kind=kind_phys) ,
intent(in) :: lwdn
1775 real (kind=kind_phys) ,
intent(in) :: uu
1776 real (kind=kind_phys) ,
intent(in) :: vv
1777 real (kind=kind_phys) ,
dimension( 1: 2),
intent(in) :: solad
1778 real (kind=kind_phys) ,
dimension( 1: 2),
intent(in) :: solai
1779 real (kind=kind_phys) ,
intent(in) :: cosz
1780 real (kind=kind_phys) ,
intent(in) :: elai
1781 real (kind=kind_phys) ,
intent(in) :: esai
1782 real (kind=kind_phys) ,
intent(in) :: fwet
1783 real (kind=kind_phys) ,
intent(in) :: fveg
1784 real (kind=kind_phys) ,
intent(in) :: shdfac
1785 real (kind=kind_phys) ,
intent(in) :: lat
1786 real (kind=kind_phys) ,
intent(in) :: canliq
1787 real (kind=kind_phys) ,
intent(in) :: canice
1788 real (kind=kind_phys) ,
intent(in) :: foln
1789 real (kind=kind_phys) ,
intent(in) :: co2air
1790 real (kind=kind_phys) ,
intent(in) :: o2air
1791 real (kind=kind_phys) ,
intent(in) :: igs
1793 real (kind=kind_phys) ,
intent(in) :: zref
1794 real (kind=kind_phys) ,
intent(in) :: tbot
1795 real (kind=kind_phys) ,
dimension(-nsnow+1:nsoil),
intent(in) :: zsnso
1796 real (kind=kind_phys) ,
dimension( 1:nsoil),
intent(in) :: zsoil
1797 real (kind=kind_phys) ,
dimension(-nsnow+1:nsoil),
intent(in) :: dzsnso
1798 real (kind=kind_phys),
intent(in) :: pahv
1799 real (kind=kind_phys),
intent(in) :: pahg
1800 real (kind=kind_phys),
intent(in) :: pahb
1803 real (kind=kind_phys) ,
intent(in) :: qc
1804 real (kind=kind_phys) ,
intent(inout) :: qsfc
1805 real (kind=kind_phys) ,
intent(in) :: psfc
1806 real (kind=kind_phys) ,
intent(in) :: dx
1807 real (kind=kind_phys) ,
intent(in) :: dz8w
1808 real (kind=kind_phys) ,
intent(in) :: q2
1812 real (kind=kind_phys) ,
intent(out) :: z0wrf
1813 real (kind=kind_phys) ,
intent(out) :: z0hwrf
1814 integer,
dimension(-nsnow+1:nsoil),
intent(out) :: imelt
1815 real (kind=kind_phys) ,
dimension(-nsnow+1: 0),
intent(out) :: snicev
1816 real (kind=kind_phys) ,
dimension(-nsnow+1: 0),
intent(out) :: snliqv
1817 real (kind=kind_phys) ,
dimension(-nsnow+1: 0),
intent(out) :: epore
1818 real (kind=kind_phys) ,
intent(out) :: fsno
1819 real (kind=kind_phys) ,
intent(out) :: qmelt
1820 real (kind=kind_phys) ,
intent(out) :: ponding
1821 real (kind=kind_phys) ,
intent(out) :: sav
1822 real (kind=kind_phys) ,
intent(out) :: sag
1823 real (kind=kind_phys) ,
intent(out) :: fsa
1824 real (kind=kind_phys) ,
intent(out) :: fsr
1825 real (kind=kind_phys) ,
intent(out) :: taux
1826 real (kind=kind_phys) ,
intent(out) :: tauy
1827 real (kind=kind_phys) ,
intent(out) :: fira
1828 real (kind=kind_phys) ,
intent(out) :: fsh
1829 real (kind=kind_phys) ,
intent(out) :: fcev
1830 real (kind=kind_phys) ,
intent(out) :: fgev
1831 real (kind=kind_phys) ,
intent(out) :: fctr
1832 real (kind=kind_phys) ,
intent(out) :: trad
1833 real (kind=kind_phys) ,
intent(out) :: t2m
1834 real (kind=kind_phys) ,
intent(out) :: psn
1835 real (kind=kind_phys) ,
intent(out) :: apar
1836 real (kind=kind_phys) ,
intent(out) :: ssoil
1837 real (kind=kind_phys) ,
dimension( 1:nsoil),
intent(out) :: btrani
1838 real (kind=kind_phys) ,
intent(out) :: btran
1840 real (kind=kind_phys) ,
intent(out) :: latheav
1841 real (kind=kind_phys) ,
intent(out) :: latheag
1842 real (kind=kind_phys) ,
intent(out) :: ts
1843 logical ,
intent(out) :: frozen_ground
1844 logical ,
intent(out) :: frozen_canopy
1847 real (kind=kind_phys) ,
intent(out) :: fsrv
1848 real (kind=kind_phys) ,
intent(out) :: fsrg
1849 real (kind=kind_phys),
intent(out) :: rssun
1850 real (kind=kind_phys),
intent(out) :: rssha
1854 real (kind=kind_phys) ,
intent(out) :: t2mv
1855 real (kind=kind_phys) ,
intent(out) :: t2mb
1856 real (kind=kind_phys) ,
intent(out) :: bgap
1857 real (kind=kind_phys) ,
intent(out) :: wgap
1858 real (kind=kind_phys) ,
intent(out) :: canhs
1859 real (kind=kind_phys),
dimension(1:2) ,
intent(out) :: albd
1860 real (kind=kind_phys),
dimension(1:2) ,
intent(out) :: albi
1861 real (kind=kind_phys),
dimension(1:2) ,
intent(out) :: albsnd
1862 real (kind=kind_phys),
dimension(1:2) ,
intent(out) :: albsni
1866 real (kind=kind_phys) ,
intent(inout) :: tv
1867 real (kind=kind_phys) ,
intent(inout) :: tg
1868 real (kind=kind_phys) ,
dimension(-nsnow+1:nsoil),
intent(inout) :: stc
1869 real (kind=kind_phys) ,
intent(inout) :: snowh
1870 real (kind=kind_phys) ,
intent(inout) :: sneqv
1871 real (kind=kind_phys) ,
intent(inout) :: sneqvo
1872 real (kind=kind_phys) ,
dimension( 1:nsoil),
intent(inout) :: sh2o
1873 real (kind=kind_phys) ,
dimension( 1:nsoil),
intent(inout) :: smc
1874 real (kind=kind_phys) ,
dimension(-nsnow+1: 0),
intent(inout) :: snice
1875 real (kind=kind_phys) ,
dimension(-nsnow+1: 0),
intent(inout) :: snliq
1876 real (kind=kind_phys) ,
intent(inout) :: eah
1877 real (kind=kind_phys) ,
intent(inout) :: tah
1878 real (kind=kind_phys) ,
intent(inout) :: albold
1879 real (kind=kind_phys) ,
intent(inout) :: tauss
1880 real (kind=kind_phys) ,
intent(inout) :: cm
1881 real (kind=kind_phys) ,
intent(inout) :: ch
1882 real (kind=kind_phys) ,
intent(inout) :: q1
1883 real (kind=kind_phys) ,
intent(inout) :: ustarx
1884 real (kind=kind_phys) ,
intent(inout) :: rb
1885 real (kind=kind_phys) ,
intent(inout) :: laisun
1886 real (kind=kind_phys) ,
intent(inout) :: laisha
1888 character(len=*) ,
intent(inout) :: errmsg
1889 integer ,
intent(inout) :: errflg
1892 real (kind=kind_phys),
intent(out) :: emissi
1893 real (kind=kind_phys),
intent(out) :: pah
1898 real (kind=kind_phys) :: ur
1899 real (kind=kind_phys) :: zlvl
1900 real (kind=kind_phys) :: fsun
1901 real (kind=kind_phys) :: rsurf
1902 real (kind=kind_phys) :: l_rsurf
1903 real (kind=kind_phys) :: d_rsurf
1904 real (kind=kind_phys) :: bevap
1905 real (kind=kind_phys) :: mol
1906 real (kind=kind_phys) :: vai
1907 real (kind=kind_phys) :: cwp
1908 real (kind=kind_phys) :: zpd
1909 real (kind=kind_phys) :: z0m
1910 real (kind=kind_phys) :: zpdg
1911 real (kind=kind_phys) :: z0mg
1912 real (kind=kind_phys) :: emv
1913 real (kind=kind_phys) :: emg
1914 real (kind=kind_phys) :: fire
1916 real (kind=kind_phys) :: psnsun
1917 real (kind=kind_phys) :: psnsha
1922 real (kind=kind_phys) :: parsun
1923 real (kind=kind_phys) :: parsha
1925 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: fact
1926 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: df
1927 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: hcpct
1928 real (kind=kind_phys) :: bdsno
1929 real (kind=kind_phys) :: fmelt
1930 real (kind=kind_phys) :: gx
1931 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: phi
1933 real (kind=kind_phys) :: gammav
1934 real (kind=kind_phys) :: gammag
1935 real (kind=kind_phys) :: psi
1936 real (kind=kind_phys) :: rhsur
1940 real (kind=kind_phys) :: tauxv
1941 real (kind=kind_phys) :: tauyv
1942 real (kind=kind_phys),
intent(out) :: irc
1943 real (kind=kind_phys),
intent(out) :: irg
1944 real (kind=kind_phys),
intent(out) :: shc
1945 real (kind=kind_phys),
intent(out) :: shg
1947 real (kind=kind_phys),
intent(out) :: q2v
1948 real (kind=kind_phys),
intent(out) :: q2b
1949 real (kind=kind_phys),
intent(out) :: q2e
1951 real (kind=kind_phys),
intent(out) :: evc
1952 real (kind=kind_phys),
intent(out) :: evg
1953 real (kind=kind_phys),
intent(out) :: tr
1954 real (kind=kind_phys),
intent(out) :: ghv
1955 real (kind=kind_phys),
intent(out) :: tgv
1956 real (kind=kind_phys) :: cmv
1957 real (kind=kind_phys),
intent(out) :: chv
1961 real (kind=kind_phys) :: tauxb
1962 real (kind=kind_phys) :: tauyb
1963 real (kind=kind_phys),
intent(out) :: irb
1964 real (kind=kind_phys),
intent(out) :: shb
1965 real (kind=kind_phys),
intent(out) :: evb
1966 real (kind=kind_phys),
intent(out) :: ghb
1967 real (kind=kind_phys),
intent(out) :: tgb
1968 real (kind=kind_phys) :: cmb
1969 real (kind=kind_phys),
intent(out) :: chb
1970 real (kind=kind_phys),
intent(out) :: chleaf
1971 real (kind=kind_phys),
intent(out) :: chuc
1973 real (kind=kind_phys),
intent(out) :: chv2
1974 real (kind=kind_phys),
intent(out) :: chb2
1975 real (kind=kind_phys) :: noahmpres
1977 real (kind=kind_phys) :: csigmaf0
1978 real (kind=kind_phys) :: csigmaf1
1980 real (kind=kind_phys) :: cdmnv
1981 real (kind=kind_phys) :: ezpdv
1982 real (kind=kind_phys) :: cdmng
1983 real (kind=kind_phys) :: ezpdg
1984 real (kind=kind_phys) :: ezpd
1985 real (kind=kind_phys) :: aone
1987 real (kind=kind_phys) :: canopy_density_factor
1988 real (kind=kind_phys) :: vai_limited
1992 real (kind=kind_phys),
parameter :: mpe = 1.e-6
1993 real (kind=kind_phys),
parameter :: psiwlt = -150.
1994 real (kind=kind_phys),
parameter :: z0 = 0.015
2031 canopy_density_factor = 1.0
2038 ur = max( sqrt(uu**2.+vv**2.), 1. )
2044 if(vai > 0.) veg = .true.
2049 if(snowh <= 1.e-6 .or. sneqv <= 1.e-3)
then
2053 if(snowh.gt.0.)
then
2054 bdsno = sneqv / snowh
2055 fmelt = (bdsno/100.)**parameters%mfsno
2056 fsno = tanh( snowh /(parameters%scffac * fmelt))
2062 if(tg .le. tfrz)
then
2063 z0mg = 0.01 * (1.0-fsno) + fsno * parameters%z0sno
2068 z0mg = z0 * (1.0-fsno) + fsno * parameters%z0sno
2076 if(opt_z0m == 1)
then
2078 z0m = parameters%z0mvt
2079 zpd = 0.65 * parameters%hvt
2081 elseif(opt_z0m == 2)
then
2083 z0m = parameters%z0mhvt * parameters%hvt
2084 zpd = 0.65 * parameters%hvt
2085 if(vegtyp /= 13)
then
2086 vai_limited = min(vai, 2.0)
2087 canopy_density_factor = (1.0 - exp(-vai_limited)) / (1.0 - exp(-2.0))
2088 z0m = exp(canopy_density_factor * log(z0m) + (1.0 - canopy_density_factor) * log(z0mg))
2089 zpd = canopy_density_factor * zpd
2094 if(snowh.gt.zpd) zpd = snowh
2105 IF (parameters%urban_flag)
THEN
2106 z0mg = parameters%Z0MVT
2107 zpdg = 0.65 * parameters%HVT
2112 zlvl = max(zpd,parameters%hvt) + zref
2113 if(zpdg >= zlvl) zlvl = zpdg + zref
2118 cwp = parameters%cwpvt
2122 call thermoprop (parameters,nsoil ,nsnow ,isnow ,ist ,dzsnso , &
2123 dt ,snowh ,snice ,snliq , shdfac, &
2124 smc ,sh2o ,tg ,stc ,ur , &
2125 lat ,z0m ,zlvl ,vegtyp , &
2126 df ,hcpct ,snicev ,snliqv ,epore , &
2131 call radiation (parameters,vegtyp ,ist ,ice ,nsoil , &
2132 sneqvo ,sneqv ,dt ,cosz ,snowh , &
2133 tg ,tv ,fsno ,qsnow ,fwet , &
2134 elai ,esai ,smc ,solad ,solai , &
2135 fveg ,iloc ,jloc , &
2137 fsun ,laisun ,laisha ,parsun ,parsha , &
2138 sav ,sag ,fsr ,fsa ,fsrv , &
2139 fsrg ,albd ,albi ,albsnd ,albsni ,bgap ,wgap )
2143 emv = 1. - exp(-(elai+esai)/1.0)
2145 emg = 0.98*(1.-fsno) + parameters%snow_emis*fsno
2147 emg = parameters%eg(ist)*(1.-fsno) + parameters%snow_emis*fsno
2155 do iz = 1, parameters%nroot
2156 if(opt_btr == 1)
then
2157 gx = (sh2o(iz)-parameters%smcwlt(iz)) / (parameters%smcref(iz)-parameters%smcwlt(iz))
2159 if(opt_btr == 2)
then
2160 psi = max(psiwlt,-parameters%psisat(iz)*(max(0.01,sh2o(iz))/parameters%smcmax(iz))**(-parameters%bexp(iz)) )
2161 gx = (1.-psi/psiwlt)/(1.+parameters%psisat(iz)/psiwlt)
2163 if(opt_btr == 3)
then
2164 psi = max(psiwlt,-parameters%psisat(iz)*(max(0.01,sh2o(iz))/parameters%smcmax(iz))**(-parameters%bexp(iz)) )
2165 gx = 1.-exp(-5.8*(log(psiwlt/psi)))
2168 gx = min(1.,max(0.,gx))
2169 btrani(iz) = max(mpe,dzsnso(iz) / (-zsoil(parameters%nroot)) * gx)
2170 btran = btran + btrani(iz)
2172 btran = max(mpe,btran)
2174 btrani(1:parameters%nroot) = btrani(1:parameters%nroot)/btran
2179 bevap = max(0.0,sh2o(1)/parameters%smcmax(1))
2185 if(opt_rsf == 1 .or. opt_rsf == 4)
then
2189 l_rsurf = (-zsoil(1)) * ( exp( (1.0 - min(1.0,sh2o(1)/parameters%smcmax(1))) ** parameters%rsurf_exp ) - 1.0 ) / ( 2.71828 - 1.0 )
2190 d_rsurf = 2.2e-5 * parameters%smcmax(1) * parameters%smcmax(1) * ( 1.0 - parameters%smcwlt(1) / parameters%smcmax(1) ) ** (2.0+3.0/parameters%bexp(1))
2191 rsurf = l_rsurf / d_rsurf
2192 elseif(opt_rsf == 2)
then
2193 rsurf = fsno * 1. + (1.-fsno)* exp(8.25-4.225*bevap)
2194 elseif(opt_rsf == 3)
then
2195 rsurf = fsno * 1. + (1.-fsno)* exp(8.25-6.0 *bevap)
2198 if(opt_rsf == 4)
then
2199 rsurf = 1. / (fsno * (1./parameters%rsurf_snow) + (1.-fsno) * (1./max(rsurf, 0.001)))
2202 if(sh2o(1) < 0.01 .and. snowh == 0.) rsurf = 1.e6
2203 psi = -parameters%psisat(1)*(max(0.01,sh2o(1))/parameters%smcmax(1))**(-parameters%bexp(1))
2204 rhsur = fsno + (1.-fsno) * exp(psi*grav/(rw*tg))
2208 if (parameters%urban_flag .and. snowh == 0. )
then
2214 if (tv .gt. tfrz)
then
2216 frozen_canopy = .false.
2219 frozen_canopy = .true.
2221 gammav = cpair*sfcprs/(ep_2*latheav)
2223 if (tg .gt. tfrz)
then
2225 frozen_ground = .false.
2228 frozen_ground = .true.
2230 gammag = cpair*sfcprs/(ep_2*latheag)
2241 if (veg .and. fveg > 0)
then
2245 call vege_flux (parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , &
2246 dt ,sav ,sag ,lwdn ,ur , &
2247 uu ,vv ,sfctmp ,thair ,qair , &
2248 eair ,rhoair ,snowh ,vai ,gammav ,gammag , &
2249 fwet ,laisun ,laisha ,cwp ,dzsnso , &
2250 zlvl ,zpd ,z0m ,fveg ,shdfac, &
2251 z0mg ,emv ,emg ,canliq ,fsno, &
2252 canice ,stc ,df ,rssun ,rssha , &
2253 rsurf ,latheav ,latheag ,parsun ,parsha ,igs , &
2254 foln ,co2air ,o2air ,btran ,sfcprs , &
2255 rhsur ,iloc ,jloc ,q2 ,pahv ,pahg , &
2256 thsfc_loc, prslkix,prsik1x,prslk1x, garea1, &
2257 pblhx ,iz0tlnd ,itime ,psi_opt ,ep_1, ep_2, epsm1, cp, &
2258 eah ,tah ,tv ,tgv ,cmv, ustarx , &
2260 chv ,dx ,dz8w ,errmsg ,errflg , &
2264 tauxv ,tauyv ,irg ,irc ,shg , &
2265 shc ,evg ,evc ,tr ,ghv , &
2266 t2mv ,psnsun ,psnsha ,canhs , &
2270 q2v ,chv2 ,chleaf ,chuc , &
2275 cdmnv = 0.4*0.4/log((zlvl-zpd)/z0m)**2
2276 aone = 2.6*(10.0*parameters%hvt/(zlvl-zpd))**0.355
2281 if (errflg /= 0)
return
2288 call bare_flux (parameters,nsnow ,nsoil ,isnow ,dt ,sag , &
2289 lwdn ,ur ,uu ,vv ,sfctmp , &
2290 thair ,qair ,eair ,rhoair ,snowh , &
2291 dzsnso ,zlvl ,zpdg ,z0mg ,fsno, &
2292 emg ,stc ,df ,rsurf ,latheag , &
2293 gammag ,rhsur ,iloc ,jloc ,q2 ,pahb , &
2294 thsfc_loc, prslkix,prsik1x,prslk1x,vegtyp,fveg,shdfac,garea1, &
2295 pblhx ,iz0tlnd ,itime ,psi_opt ,ep_1, ep_2, epsm1, cp, &
2297 tgb ,cmb ,chb, ustarx,errmsg ,errflg , &
2299 tgb ,cmb ,chb, ustarx, &
2301 tauxb ,tauyb ,irb ,shb ,evb,csigmaf0,&
2302 ghb ,t2mb ,dx ,dz8w , &
2309 cdmng = 0.4*0.4/log((zlvl-zpdg)/z0mg)**2
2314 if (ezpdv .ge. ezpdg )
then
2316 elseif (ezpdv .gt. 0.0 .and. ezpdv .lt. ezpdg)
then
2317 ezpd = (1.0 -fveg)*ezpdg
2324 if (errflg /= 0)
return
2330 if (veg .and. fveg > 0)
then
2331 taux = fveg * tauxv + (1.0 - fveg) * tauxb
2332 tauy = fveg * tauyv + (1.0 - fveg) * tauyb
2333 fira = fveg * irg + (1.0 - fveg) * irb + irc
2334 fsh = fveg * shg + (1.0 - fveg) * shb + shc
2335 fgev = fveg * evg + (1.0 - fveg) * evb
2336 ssoil = fveg * ghv + (1.0 - fveg) * ghb
2339 pah = fveg * pahg + (1.0 - fveg) * pahb + pahv
2340 tg = fveg * tgv + (1.0 - fveg) * tgb
2341 t2m = fveg * t2mv + (1.0 - fveg) * t2mb
2342 ts = fveg * tah + (1.0 - fveg) * tgb
2343 cm = fveg * cmv + (1.0 - fveg) * cmb
2344 ch = fveg * chv + (1.0 - fveg) * chb
2345 q1 = fveg * (eah*ep_2/(sfcprs + epsm1*eah)) + (1.0 - fveg)*qsfc
2346 q2e = fveg * q2v + (1.0 - fveg) * q2b
2350 ts = (fveg*chv*tah + (1.0-fveg)*chb*tgb ) / ch
2355 call thermalz0(parameters,fveg,z0m,z0mg,zlvl,zpd,ezpd,ustarx, &
2356 vegtyp,vai,ur,csigmaf0,csigmaf1,aone,cdmnv,cdmng,2, &
2380 call thermalz0(parameters,fveg,z0m,z0mg,zlvl,zpd,ezpd,ustarx, &
2381 vegtyp,vai,ur,csigmaf0,csigmaf1,aone,cdmnv,cdmng,0, &
2389 write(6,*)
'emitted longwave <0; skin t may be wrong due to inconsistent'
2390 write(6,*)
'input of shdfac with lai'
2391 write(6,*) iloc, jloc,
'shdfac=',fveg,
'vai=',vai,
'tv=',tv,
'tg=',tg
2392 write(6,*)
'lwdn=',lwdn,
'fira=',fira,
'snowh=',snowh
2395 errmsg =
"stop in noah-mp"
2398 call wrf_error_fatal(
"stop in noah-mp")
2404 emissi = fveg * ( emg*(1-emv) + emv + emv*(1-emv)*(1-emg) ) + &
2411 trad = ( ( fire - (1-emissi)*lwdn ) / (emissi*sb) ) ** 0.25
2416 apar = parsun*laisun + parsha*laisha
2417 psn = psnsun*laisun + psnsha*laisha
2421 call tsnosoi (parameters,ice ,nsoil ,nsnow ,isnow ,ist , &
2422 tbot ,zsnso ,ssoil ,df ,hcpct , &
2423 sag ,dt ,snowh ,dzsnso , &
2426 stc ,errmsg ,errflg )
2432 if (errflg /= 0)
return
2436 if(opt_stc == 2)
then
2437 if (snowh > 0.05 .and. tg > tfrz)
then
2440 if (veg .and. fveg > 0)
then
2441 tg = fveg * tgv + (1.0 - fveg) * tgb
2442 ts = fveg * tv + (1.0 - fveg) * tgb
2452 call phasechange (parameters,nsnow ,nsoil ,isnow ,dt ,fact , &
2453 dzsnso ,hcpct ,ist ,iloc ,jloc , &
2454 stc ,snice ,snliq ,sneqv ,snowh , &
2456 smc ,sh2o ,errmsg ,errflg , &
2460 qmelt ,imelt ,ponding )
2462 if (errflg /= 0)
return
2470 subroutine thermoprop (parameters,nsoil ,nsnow ,isnow ,ist ,dzsnso , & !in
2471 dt ,snowh ,snice ,snliq , shdfac, & !in
2472 smc ,sh2o ,tg ,stc ,ur , & !in
2473 lat ,z0m ,zlvl ,vegtyp , & !in
2474 df ,hcpct ,snicev ,snliqv ,epore , & !out
2480 type (noahmp_parameters),
intent(in) :: parameters
2481 integer ,
intent(in) :: nsoil
2482 integer ,
intent(in) :: nsnow
2483 integer ,
intent(in) :: isnow
2484 integer ,
intent(in) :: ist
2485 real (kind=kind_phys) ,
intent(in) :: dt
2486 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(in) :: snice
2487 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(in) :: snliq
2488 real (kind=kind_phys) ,
intent(in) :: shdfac
2489 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: dzsnso
2490 real (kind=kind_phys),
dimension( 1:nsoil),
intent(in) :: smc
2491 real (kind=kind_phys),
dimension( 1:nsoil),
intent(in) :: sh2o
2492 real (kind=kind_phys) ,
intent(in) :: snowh
2493 real (kind=kind_phys),
intent(in) :: tg
2494 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: stc
2495 real (kind=kind_phys),
intent(in) :: ur
2496 real (kind=kind_phys),
intent(in) :: lat
2497 real (kind=kind_phys),
intent(in) :: z0m
2498 real (kind=kind_phys),
intent(in) :: zlvl
2499 integer ,
intent(in) :: vegtyp
2502 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(out) :: df
2503 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(out) :: hcpct
2504 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(out) :: snicev
2505 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(out) :: snliqv
2506 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(out) :: epore
2507 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(out) :: fact
2512 real (kind=kind_phys),
dimension(-nsnow+1: 0) :: cvsno
2513 real (kind=kind_phys),
dimension(-nsnow+1: 0) :: tksno
2514 real (kind=kind_phys),
dimension( 1:nsoil) :: sice
2515 real (kind=kind_phys),
parameter :: sbeta = -2.0
2516 real (kind=kind_phys),
dimension(4,20) :: soil_carbon
2517 real (kind=kind_phys),
parameter :: soil_carbon_df = 0.25
2518 real (kind=kind_phys),
parameter :: soil_carbon_hcpct = 2.5e6
2523 soil_carbon(1,:) = (/90,65,90,65,90,40,50,50,40,50,90,60,60,60,0,20,0,90,90,60/)
2524 soil_carbon(2,:) = (/40,30,40,30,40,25,30,30,25,30,40,30,30,30,0,15,0,60,60,40/)
2525 soil_carbon(3,:) = (/20,15,20,15,20,15,20,15,15,15,25,20,20,20,0,10,0,40,40,30/)
2526 soil_carbon(4,:) = (/15,10,15,10,15,10,15,10,10,10,20,10,10,10,0,10,0,40,30,20/)
2528 soil_carbon = soil_carbon / 130.0
2532 call csnow (parameters,isnow ,nsnow ,nsoil ,snice ,snliq ,dzsnso , &
2533 tksno ,cvsno ,snicev ,snliqv ,epore )
2537 hcpct(iz) = cvsno(iz)
2543 sice(iz) = smc(iz) - sh2o(iz)
2544 hcpct(iz) = sh2o(iz)*cwat + (1.0-parameters%smcmax(iz))*parameters%csoil &
2545 + (parameters%smcmax(iz)-smc(iz))*cpair + sice(iz)*cice
2546 call tdfcnd (parameters,iz,df(iz), smc(iz), sh2o(iz))
2551 df(iz) = (1.0 - soil_carbon(iz,vegtyp)) * df(iz) + soil_carbon(iz,vegtyp) * soil_carbon_df
2554 if ( parameters%urban_flag )
then
2565 df(1) = df(1) * exp(sbeta * shdfac)
2572 if(stc(iz) > tfrz)
then
2584 do iz = isnow+1,nsoil
2585 fact(iz) = dt/(hcpct(iz)*dzsnso(iz))
2591 df(1) = (df(1)*dzsnso(1)+0.35*snowh) / (snowh +dzsnso(1))
2593 df(1) = (df(1)*dzsnso(1)+df(0)*dzsnso(0)) / (dzsnso(0)+dzsnso(1))
2603 subroutine csnow (parameters,isnow ,nsnow ,nsoil ,snice ,snliq ,dzsnso , & !in
2604 tksno ,cvsno ,snicev ,snliqv ,epore )
2612 type (noahmp_parameters),
intent(in) :: parameters
2613 integer,
intent(in) :: isnow
2614 integer ,
intent(in) :: nsnow
2615 integer ,
intent(in) :: nsoil
2616 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(in) :: snice
2617 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(in) :: snliq
2618 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: dzsnso
2622 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(out) :: cvsno
2623 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(out) :: tksno
2624 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(out) :: snicev
2625 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(out) :: snliqv
2626 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(out) :: epore
2631 real (kind=kind_phys),
dimension(-nsnow+1: 0) :: bdsnoi
2637 snicev(iz) = min(1., snice(iz)/(dzsnso(iz)*denice) )
2638 epore(iz) = 1. - snicev(iz)
2639 snliqv(iz) = min(epore(iz),snliq(iz)/(dzsnso(iz)*denh2o))
2643 bdsnoi(iz) = (snice(iz)+snliq(iz))/dzsnso(iz)
2644 cvsno(iz) = cice*snicev(iz)+cwat*snliqv(iz)
2658 end subroutine csnow
2665 subroutine tdfcnd (parameters, isoil, df, smc, sh2o)
2674 type (noahmp_parameters),
intent(in) :: parameters
2675 integer,
intent(in) :: isoil
2676 real (kind=kind_phys),
intent(in) :: smc
2677 real (kind=kind_phys),
intent(in) :: sh2o
2678 real (kind=kind_phys),
intent(out) :: df
2681 real (kind=kind_phys) :: ake
2682 real (kind=kind_phys) :: gammd
2683 real (kind=kind_phys) :: thkdry
2684 real (kind=kind_phys) :: thko
2685 real (kind=kind_phys) :: thkqtz
2686 real (kind=kind_phys) :: thksat
2687 real (kind=kind_phys) :: thks
2688 real (kind=kind_phys) :: thkw
2689 real (kind=kind_phys) :: satratio
2690 real (kind=kind_phys) :: xu
2691 real (kind=kind_phys) :: xunfroz
2720 satratio = smc / parameters%smcmax(isoil)
2729 thks = (thkqtz ** parameters%quartz(isoil))* (thko ** (1. - parameters%quartz(isoil)))
2733 if(smc > 0.) xunfroz = sh2o / smc
2735 xu = xunfroz * parameters%smcmax(isoil)
2738 thksat = thks ** (1. - parameters%smcmax(isoil))* tkice ** (parameters%smcmax(isoil) - xu)* thkw ** &
2742 gammd = (1. - parameters%smcmax(isoil))*2700.
2744 thkdry = (0.135* gammd+ 64.7)/ (2700. - 0.947* gammd)
2746 if ( (sh2o + 0.0005) < smc )
then
2756 if ( satratio > 0.1 )
then
2758 ake = log10(satratio) + 1.0
2769 df = ake * (thksat - thkdry) + thkdry
2778 subroutine radiation (parameters,vegtyp ,ist ,ice ,nsoil , & !in
2779 sneqvo ,sneqv ,dt ,cosz ,snowh , & !in
2780 tg ,tv ,fsno ,qsnow ,fwet , & !in
2781 elai ,esai ,smc ,solad ,solai , & !in
2782 fveg ,iloc ,jloc , & !in
2783 albold ,tauss , & !inout
2784 fsun ,laisun ,laisha ,parsun ,parsha , & !out
2785 sav ,sag ,fsr ,fsa ,fsrv , &
2786 fsrg ,albd ,albi ,albsnd ,albsni ,bgap ,wgap)
2791 type (noahmp_parameters),
intent(in) :: parameters
2792 integer,
intent(in) :: iloc
2793 integer,
intent(in) :: jloc
2794 integer,
intent(in) :: vegtyp
2795 integer,
intent(in) :: ist
2796 integer,
intent(in) :: ice
2797 integer,
intent(in) :: nsoil
2799 real (kind=kind_phys),
intent(in) :: dt
2800 real (kind=kind_phys),
intent(in) :: qsnow
2801 real (kind=kind_phys),
intent(in) :: sneqvo
2802 real (kind=kind_phys),
intent(in) :: sneqv
2803 real (kind=kind_phys),
intent(in) :: snowh
2804 real (kind=kind_phys),
intent(in) :: cosz
2805 real (kind=kind_phys),
intent(in) :: tg
2806 real (kind=kind_phys),
intent(in) :: tv
2807 real (kind=kind_phys),
intent(in) :: elai
2808 real (kind=kind_phys),
intent(in) :: esai
2809 real (kind=kind_phys),
intent(in) :: fwet
2810 real (kind=kind_phys),
dimension(1:nsoil),
intent(in) :: smc
2811 real (kind=kind_phys),
dimension(1:2) ,
intent(in) :: solad
2812 real (kind=kind_phys),
dimension(1:2) ,
intent(in) :: solai
2813 real (kind=kind_phys),
intent(in) :: fsno
2814 real (kind=kind_phys),
intent(in) :: fveg
2817 real (kind=kind_phys),
intent(inout) :: albold
2818 real (kind=kind_phys),
intent(inout) :: tauss
2821 real (kind=kind_phys),
intent(out) :: fsun
2822 real (kind=kind_phys),
intent(out) :: laisun
2823 real (kind=kind_phys),
intent(out) :: laisha
2824 real (kind=kind_phys),
intent(out) :: parsun
2825 real (kind=kind_phys),
intent(out) :: parsha
2826 real (kind=kind_phys),
intent(out) :: sav
2827 real (kind=kind_phys),
intent(out) :: sag
2828 real (kind=kind_phys),
intent(out) :: fsa
2829 real (kind=kind_phys),
intent(out) :: fsr
2832 real (kind=kind_phys),
intent(out) :: fsrv
2833 real (kind=kind_phys),
intent(out) :: fsrg
2834 real (kind=kind_phys),
intent(out) :: bgap
2835 real (kind=kind_phys),
intent(out) :: wgap
2836 real (kind=kind_phys),
dimension(1:2),
intent(out) :: albsnd
2837 real (kind=kind_phys),
dimension(1:2),
intent(out) :: albsni
2841 real (kind=kind_phys) :: fage
2842 real (kind=kind_phys),
dimension(1:2) :: albgrd
2843 real (kind=kind_phys),
dimension(1:2) :: albgri
2844 real (kind=kind_phys),
dimension(1:2) :: albd
2845 real (kind=kind_phys),
dimension(1:2) :: albi
2846 real (kind=kind_phys),
dimension(1:2) :: fabd
2847 real (kind=kind_phys),
dimension(1:2) :: fabi
2848 real (kind=kind_phys),
dimension(1:2) :: ftdd
2849 real (kind=kind_phys),
dimension(1:2) :: ftid
2850 real (kind=kind_phys),
dimension(1:2) :: ftii
2852 real (kind=kind_phys),
dimension(1:2) :: frevi
2853 real (kind=kind_phys),
dimension(1:2) :: frevd
2854 real (kind=kind_phys),
dimension(1:2) :: fregi
2855 real (kind=kind_phys),
dimension(1:2) :: fregd
2858 real (kind=kind_phys) :: fsha
2859 real (kind=kind_phys) :: vai
2861 real (kind=kind_phys),
parameter :: mpe = 1.e-6
2868 call albedo (parameters,vegtyp ,ist ,ice ,nsoil , &
2869 dt ,cosz ,fage ,elai ,esai , &
2870 tg ,tv ,snowh ,fsno ,fwet , &
2871 smc ,sneqvo ,sneqv ,qsnow ,fveg , &
2874 albgrd ,albgri ,albd ,albi ,fabd , &
2875 fabi ,ftdd ,ftid ,ftii ,fsun , &
2876 frevi ,frevd ,fregd ,fregi ,bgap , &
2877 wgap ,albsnd ,albsni )
2885 if (vai .gt. 0.)
then
2891 call surrad (parameters,mpe ,fsun ,fsha ,elai ,vai , &
2892 laisun ,laisha ,solad ,solai ,fabd , &
2893 fabi ,ftdd ,ftid ,ftii ,albgrd , &
2894 albgri ,albd ,albi ,iloc ,jloc , &
2895 parsun ,parsha ,sav ,sag ,fsa , &
2897 frevi ,frevd ,fregd ,fregi ,fsrv , &
2908 subroutine albedo (parameters,vegtyp ,ist ,ice ,nsoil , & !in
2909 dt ,cosz ,fage ,elai ,esai , & !in
2910 tg ,tv ,snowh ,fsno ,fwet , & !in
2911 smc ,sneqvo ,sneqv ,qsnow ,fveg , & !in
2913 albold ,tauss , & !inout
2914 albgrd ,albgri ,albd ,albi ,fabd , & !out
2915 fabi ,ftdd ,ftid ,ftii ,fsun , & !out
2916 frevi ,frevd ,fregd ,fregi ,bgap , & !out
2917 wgap ,albsnd ,albsni )
2927 type (noahmp_parameters),
intent(in) :: parameters
2928 integer,
intent(in) :: iloc
2929 integer,
intent(in) :: jloc
2930 integer,
intent(in) :: nsoil
2931 integer,
intent(in) :: vegtyp
2932 integer,
intent(in) :: ist
2933 integer,
intent(in) :: ice
2935 real (kind=kind_phys),
intent(in) :: dt
2936 real (kind=kind_phys),
intent(in) :: qsnow
2937 real (kind=kind_phys),
intent(in) :: cosz
2938 real (kind=kind_phys),
intent(in) :: snowh
2939 real (kind=kind_phys),
intent(in) :: tg
2940 real (kind=kind_phys),
intent(in) :: tv
2941 real (kind=kind_phys),
intent(in) :: elai
2942 real (kind=kind_phys),
intent(in) :: esai
2943 real (kind=kind_phys),
intent(in) :: fsno
2944 real (kind=kind_phys),
intent(in) :: fwet
2945 real (kind=kind_phys),
intent(in) :: sneqvo
2946 real (kind=kind_phys),
intent(in) :: sneqv
2947 real (kind=kind_phys),
intent(in) :: fveg
2948 real (kind=kind_phys),
dimension(1:nsoil),
intent(in) :: smc
2951 real (kind=kind_phys),
intent(inout) :: albold
2952 real (kind=kind_phys),
intent(inout) :: tauss
2955 real (kind=kind_phys),
dimension(1: 2),
intent(out) :: albgrd
2956 real (kind=kind_phys),
dimension(1: 2),
intent(out) :: albgri
2957 real (kind=kind_phys),
dimension(1: 2),
intent(out) :: albd
2958 real (kind=kind_phys),
dimension(1: 2),
intent(out) :: albi
2959 real (kind=kind_phys),
dimension(1: 2),
intent(out) :: fabd
2960 real (kind=kind_phys),
dimension(1: 2),
intent(out) :: fabi
2961 real (kind=kind_phys),
dimension(1: 2),
intent(out) :: ftdd
2962 real (kind=kind_phys),
dimension(1: 2),
intent(out) :: ftid
2963 real (kind=kind_phys),
dimension(1: 2),
intent(out) :: ftii
2964 real (kind=kind_phys),
intent(out) :: fsun
2966 real (kind=kind_phys),
dimension(1: 2),
intent(out) :: frevd
2967 real (kind=kind_phys),
dimension(1: 2),
intent(out) :: frevi
2968 real (kind=kind_phys),
dimension(1: 2),
intent(out) :: fregd
2969 real (kind=kind_phys),
dimension(1: 2),
intent(out) :: fregi
2970 real (kind=kind_phys),
intent(out) :: bgap
2971 real (kind=kind_phys),
intent(out) :: wgap
2977 real (kind=kind_phys) :: fage
2978 real (kind=kind_phys) :: alb
2983 real (kind=kind_phys) :: wl
2984 real (kind=kind_phys) :: ws
2985 real (kind=kind_phys) :: mpe
2987 real (kind=kind_phys),
dimension(1:2) :: rho
2988 real (kind=kind_phys),
dimension(1:2) :: tau
2989 real (kind=kind_phys),
dimension(1:2) :: ftdi
2990 real (kind=kind_phys),
dimension(1:2) :: albsnd
2991 real (kind=kind_phys),
dimension(1:2) :: albsni
2993 real (kind=kind_phys) :: vai
2994 real (kind=kind_phys) :: gdir
2995 real (kind=kind_phys) :: ext
3022 if (ib.eq.1) fsun = 0.
3027 call snow_age (parameters,dt,tg,sneqvo,sneqv,tauss,fage)
3035 wl = elai / max(vai,mpe)
3036 ws = esai / max(vai,mpe)
3037 rho(ib) = max(parameters%rhol(ib)*wl+parameters%rhos(ib)*ws, mpe)
3038 tau(ib) = max(parameters%taul(ib)*wl+parameters%taus(ib)*ws, mpe)
3044 call snowalb_bats (parameters,nband, fsno,cosz,fage,albsnd,albsni)
3045 if(opt_alb == 2)
then
3046 call snowalb_class (parameters,nband,qsnow,dt,alb,albold,albsnd,albsni,iloc,jloc)
3052 call groundalb (parameters,nsoil ,nband ,ice ,ist , &
3053 fsno ,smc ,albsnd ,albsni ,cosz , &
3062 call twostream (parameters,ib ,ic ,vegtyp ,cosz ,vai , &
3063 fwet ,tv ,albgrd ,albgri ,rho , &
3064 tau ,fveg ,ist ,iloc ,jloc , &
3065 fabd ,albd ,ftdd ,ftid ,gdir , &
3066 frevd ,fregd ,bgap ,wgap)
3069 call twostream (parameters,ib ,ic ,vegtyp ,cosz ,vai , &
3070 fwet ,tv ,albgrd ,albgri ,rho , &
3071 tau ,fveg ,ist ,iloc ,jloc , &
3072 fabi ,albi ,ftdi ,ftii ,gdir , &
3073 frevi ,fregi ,bgap ,wgap)
3079 ext = gdir/cosz * sqrt(1.-rho(1)-tau(1))
3080 fsun = (1.-exp(-ext*vai)) / max(ext*vai,mpe)
3083 if (ext .lt. 0.01)
then
3097 subroutine surrad (parameters,mpe ,fsun ,fsha ,elai ,vai , & !in
3098 laisun ,laisha ,solad ,solai ,fabd , & !in
3099 fabi ,ftdd ,ftid ,ftii ,albgrd , & !in
3100 albgri ,albd ,albi ,iloc ,jloc , & !in
3101 parsun ,parsha ,sav ,sag ,fsa , & !out
3103 frevi ,frevd ,fregd ,fregi ,fsrv , &
3111 type (noahmp_parameters),
intent(in) :: parameters
3112 integer,
intent(in) :: iloc
3113 integer,
intent(in) :: jloc
3114 real (kind=kind_phys),
intent(in) :: mpe
3116 real (kind=kind_phys),
intent(in) :: fsun
3117 real (kind=kind_phys),
intent(in) :: fsha
3118 real (kind=kind_phys),
intent(in) :: elai
3119 real (kind=kind_phys),
intent(in) :: vai
3120 real (kind=kind_phys),
intent(in) :: laisun
3121 real (kind=kind_phys),
intent(in) :: laisha
3123 real (kind=kind_phys),
dimension(1:2),
intent(in) :: solad
3124 real (kind=kind_phys),
dimension(1:2),
intent(in) :: solai
3125 real (kind=kind_phys),
dimension(1:2),
intent(in) :: fabd
3126 real (kind=kind_phys),
dimension(1:2),
intent(in) :: fabi
3127 real (kind=kind_phys),
dimension(1:2),
intent(in) :: ftdd
3128 real (kind=kind_phys),
dimension(1:2),
intent(in) :: ftid
3129 real (kind=kind_phys),
dimension(1:2),
intent(in) :: ftii
3130 real (kind=kind_phys),
dimension(1:2),
intent(in) :: albgrd
3131 real (kind=kind_phys),
dimension(1:2),
intent(in) :: albgri
3132 real (kind=kind_phys),
dimension(1:2),
intent(in) :: albd
3133 real (kind=kind_phys),
dimension(1:2),
intent(in) :: albi
3135 real (kind=kind_phys),
dimension(1:2),
intent(in) :: frevd
3136 real (kind=kind_phys),
dimension(1:2),
intent(in) :: frevi
3137 real (kind=kind_phys),
dimension(1:2),
intent(in) :: fregd
3138 real (kind=kind_phys),
dimension(1:2),
intent(in) :: fregi
3142 real (kind=kind_phys),
intent(out) :: parsun
3143 real (kind=kind_phys),
intent(out) :: parsha
3144 real (kind=kind_phys),
intent(out) :: sav
3145 real (kind=kind_phys),
intent(out) :: sag
3146 real (kind=kind_phys),
intent(out) :: fsa
3147 real (kind=kind_phys),
intent(out) :: fsr
3148 real (kind=kind_phys),
intent(out) :: fsrv
3149 real (kind=kind_phys),
intent(out) :: fsrg
3155 real (kind=kind_phys) :: abs
3156 real (kind=kind_phys) :: rnir
3157 real (kind=kind_phys) :: rvis
3158 real (kind=kind_phys) :: laifra
3159 real (kind=kind_phys) :: trd
3160 real (kind=kind_phys) :: tri
3161 real (kind=kind_phys),
dimension(1:2) :: cad
3162 real (kind=kind_phys),
dimension(1:2) :: cai
3178 cad(ib) = solad(ib)*fabd(ib)
3179 cai(ib) = solai(ib)*fabi(ib)
3180 sav = sav + cad(ib) + cai(ib)
3181 fsa = fsa + cad(ib) + cai(ib)
3185 trd = solad(ib)*ftdd(ib)
3186 tri = solad(ib)*ftid(ib) + solai(ib)*ftii(ib)
3190 abs = trd*(1.-albgrd(ib)) + tri*(1.-albgri(ib))
3198 laifra = elai / max(vai,mpe)
3199 if (fsun .gt. 0.)
then
3200 parsun = (cad(1)+fsun*cai(1)) * laifra / max(laisun,mpe)
3201 parsha = (fsha*cai(1))*laifra / max(laisha,mpe)
3204 parsha = (cad(1)+cai(1))*laifra /max(laisha,mpe)
3209 rvis = albd(1)*solad(1) + albi(1)*solai(1)
3210 rnir = albd(2)*solad(2) + albi(2)*solai(2)
3214 fsrv = frevd(1)*solad(1)+frevi(1)*solai(1)+frevd(2)*solad(2)+frevi(2)*solai(2)
3215 fsrg = fregd(1)*solad(1)+fregi(1)*solai(1)+fregd(2)*solad(2)+fregi(2)*solai(2)
3224 subroutine snow_age (parameters,dt,tg,sneqvo,sneqv,tauss,fage)
3231 type (noahmp_parameters),
intent(in) :: parameters
3232 real (kind=kind_phys),
intent(in) :: dt
3233 real (kind=kind_phys),
intent(in) :: tg
3234 real (kind=kind_phys),
intent(in) :: sneqvo
3235 real (kind=kind_phys),
intent(in) :: sneqv
3238 real (kind=kind_phys),
intent(out) :: fage
3241 real (kind=kind_phys),
intent(inout) :: tauss
3243 real (kind=kind_phys) :: tage
3244 real (kind=kind_phys) :: age1
3245 real (kind=kind_phys) :: age2
3246 real (kind=kind_phys) :: age3
3247 real (kind=kind_phys) :: dela
3248 real (kind=kind_phys) :: sge
3249 real (kind=kind_phys) :: dels
3250 real (kind=kind_phys) :: dela0
3251 real (kind=kind_phys) :: arg
3255 if(sneqv.le.0.0)
then
3258 dela0 = dt/parameters%tau0
3259 arg = parameters%grain_growth*(1./tfrz-1./tg)
3261 age2 = exp(amin1(0.,parameters%extra_growth*arg))
3262 age3 = parameters%dirt_soot
3263 tage = age1+age2+age3
3265 dels = amax1(0.0,sneqv-sneqvo) / parameters%swemx
3266 sge = (tauss+dela)*(1.0-dels)
3267 tauss = amax1(0.,sge)
3270 fage= tauss/(tauss+1.)
3284 type (noahmp_parameters),
intent(in) :: parameters
3285 integer,
intent(in) :: nband
3287 real (kind=kind_phys),
intent(in) :: cosz
3288 real (kind=kind_phys),
intent(in) :: fsno
3289 real (kind=kind_phys),
intent(in) :: fage
3293 real (kind=kind_phys),
dimension(1:2),
intent(out) :: albsnd
3294 real (kind=kind_phys),
dimension(1:2),
intent(out) :: albsni
3300 real (kind=kind_phys) :: fzen
3301 real (kind=kind_phys) :: cf1
3302 real (kind=kind_phys) :: sl2
3303 real (kind=kind_phys) :: sl1
3304 real (kind=kind_phys) :: sl
3312 albsnd(1: nband) = 0.
3313 albsni(1: nband) = 0.
3317 sl=parameters%bats_cosz
3320 cf1=((1.+sl1)/(1.+sl2*cosz)-sl1)
3323 albsni(1)=parameters%bats_vis_new*(1.-parameters%bats_vis_age*fage)
3324 albsni(2)=parameters%bats_nir_new*(1.-parameters%bats_nir_age*fage)
3326 albsnd(1)=albsni(1)+parameters%bats_vis_dir*fzen*(1.-albsni(1))
3327 albsnd(2)=albsni(2)+parameters%bats_vis_dir*fzen*(1.-albsni(2))
3335 subroutine snowalb_class (parameters,nband,qsnow,dt,alb,albold,albsnd,albsni,iloc,jloc)
3341 type (noahmp_parameters),
intent(in) :: parameters
3342 integer,
intent(in) :: iloc
3343 integer,
intent(in) :: jloc
3344 integer,
intent(in) :: nband
3346 real (kind=kind_phys),
intent(in) :: qsnow
3347 real (kind=kind_phys),
intent(in) :: dt
3348 real (kind=kind_phys),
intent(in) :: albold
3352 real (kind=kind_phys),
intent(inout) :: alb
3355 real (kind=kind_phys),
dimension(1:2),
intent(out) :: albsnd
3356 real (kind=kind_phys),
dimension(1:2),
intent(out) :: albsni
3365 albsnd(1: nband) = 0.
3366 albsni(1: nband) = 0.
3370 alb = 0.55 + (albold-0.55) * exp(-0.01*dt/3600.)
3375 if (qsnow > 0.)
then
3376 alb = alb + min(qsnow,parameters%swemx/dt) * (0.84-alb)/(parameters%swemx/dt)
3390 subroutine groundalb (parameters,nsoil ,nband ,ice ,ist , & !in
3391 fsno ,smc ,albsnd ,albsni ,cosz , & !in
3392 tg ,iloc ,jloc , & !in
3399 type (noahmp_parameters),
intent(in) :: parameters
3400 integer,
intent(in) :: iloc
3401 integer,
intent(in) :: jloc
3402 integer,
intent(in) :: nsoil
3403 integer,
intent(in) :: nband
3404 integer,
intent(in) :: ice
3405 integer,
intent(in) :: ist
3406 real (kind=kind_phys),
intent(in) :: fsno
3407 real (kind=kind_phys),
intent(in) :: tg
3408 real (kind=kind_phys),
intent(in) :: cosz
3409 real (kind=kind_phys),
dimension(1:nsoil),
intent(in) :: smc
3410 real (kind=kind_phys),
dimension(1: 2),
intent(in) :: albsnd
3411 real (kind=kind_phys),
dimension(1: 2),
intent(in) :: albsni
3415 real (kind=kind_phys),
dimension(1: 2),
intent(out) :: albgrd
3416 real (kind=kind_phys),
dimension(1: 2),
intent(out) :: albgri
3421 real (kind=kind_phys) :: inc
3422 real (kind=kind_phys) :: albsod
3423 real (kind=kind_phys) :: albsoi
3427 inc = max(0.11-0.40*smc(1), 0.)
3428 if (ist .eq. 1)
then
3429 albsod = min(parameters%albsat(ib)+inc,parameters%albdry(ib))
3431 else if (tg .gt. tfrz)
then
3432 albsod = 0.06/(max(0.01,cosz)**1.7 + 0.15)
3435 albsod = parameters%alblak(ib)
3446 albgrd(ib) = albsod*(1.-fsno) + albsnd(ib)*fsno
3447 albgri(ib) = albsoi*(1.-fsno) + albsni(ib)*fsno
3460 subroutine twostream (parameters,ib ,ic ,vegtyp ,cosz ,vai , & !in
3461 fwet ,t ,albgrd ,albgri ,rho , & !in
3462 tau ,fveg ,ist ,iloc ,jloc , & !in
3463 fab ,fre ,ftd ,fti ,gdir , & !)
3464 frev ,freg ,bgap ,wgap)
3477 type (noahmp_parameters),
intent(in) :: parameters
3478 integer,
intent(in) :: iloc
3479 integer,
intent(in) :: jloc
3480 integer,
intent(in) :: ist
3481 integer,
intent(in) :: ib
3482 integer,
intent(in) :: ic
3483 integer,
intent(in) :: vegtyp
3485 real (kind=kind_phys),
intent(in) :: cosz
3486 real (kind=kind_phys),
intent(in) :: vai
3487 real (kind=kind_phys),
intent(in) :: fwet
3488 real (kind=kind_phys),
intent(in) :: t
3490 real (kind=kind_phys),
dimension(1:2),
intent(in) :: albgrd
3491 real (kind=kind_phys),
dimension(1:2),
intent(in) :: albgri
3492 real (kind=kind_phys),
dimension(1:2),
intent(in) :: rho
3493 real (kind=kind_phys),
dimension(1:2),
intent(in) :: tau
3494 real (kind=kind_phys),
intent(in) :: fveg
3498 real (kind=kind_phys),
dimension(1:2),
intent(out) :: fab
3499 real (kind=kind_phys),
dimension(1:2),
intent(out) :: fre
3500 real (kind=kind_phys),
dimension(1:2),
intent(out) :: ftd
3501 real (kind=kind_phys),
dimension(1:2),
intent(out) :: fti
3502 real (kind=kind_phys),
intent(out) :: gdir
3503 real (kind=kind_phys),
dimension(1:2),
intent(out) :: frev
3504 real (kind=kind_phys),
dimension(1:2),
intent(out) :: freg
3507 real (kind=kind_phys) :: omega
3508 real (kind=kind_phys) :: omegal
3509 real (kind=kind_phys) :: betai
3510 real (kind=kind_phys) :: betail
3511 real (kind=kind_phys) :: betad
3512 real (kind=kind_phys) :: betadl
3513 real (kind=kind_phys) :: ext
3514 real (kind=kind_phys) :: avmu
3516 real (kind=kind_phys) :: coszi
3517 real (kind=kind_phys) :: asu
3518 real (kind=kind_phys) :: chil
3520 real (kind=kind_phys) :: tmp0,tmp1,tmp2,tmp3,tmp4,tmp5,tmp6,tmp7,tmp8,tmp9
3521 real (kind=kind_phys) :: p1,p2,p3,p4,s1,s2,u1,u2,u3
3522 real (kind=kind_phys) :: b,c,d,d1,d2,f,h,h1,h2,h3,h4,h5,h6,h7,h8,h9,h10
3523 real (kind=kind_phys) :: phi1,phi2,sigma
3524 real (kind=kind_phys) :: ftds,ftis,fres
3525 real (kind=kind_phys) :: denfveg
3526 real (kind=kind_phys) :: vai_spread
3528 real (kind=kind_phys) :: freveg,frebar,ftdveg,ftiveg,ftdbar,ftibar
3529 real (kind=kind_phys) :: thetaz
3535 real (kind=kind_phys),
parameter :: pai = 3.14159265
3536 real (kind=kind_phys) :: hd
3537 real (kind=kind_phys) :: bb
3538 real (kind=kind_phys) :: thetap
3539 real (kind=kind_phys) :: fa
3540 real (kind=kind_phys) :: newvai
3542 real (kind=kind_phys),
intent(inout) :: bgap
3543 real (kind=kind_phys),
intent(inout) :: wgap
3545 real (kind=kind_phys) :: kopen
3546 real (kind=kind_phys) :: gap
3555 if(opt_rad == 1)
then
3556 denfveg = -log(max(1.0-fveg,0.01))/(pai*parameters%rc**2)
3557 hd = parameters%hvt - parameters%hvb
3559 thetap = atan(bb/parameters%rc * tan(acos(max(0.01,cosz))) )
3561 bgap = exp(-denfveg * pai * parameters%rc**2/cos(thetap) )
3562 fa = vai/(1.33 * pai * parameters%rc**3.0 *(bb/parameters%rc)*denfveg)
3564 wgap = (1.0-bgap) * exp(-0.5*newvai/cosz)
3565 gap = min(1.0-fveg, bgap+wgap)
3570 if(opt_rad == 2)
then
3575 if(opt_rad == 3)
then
3588 coszi = max(0.001, cosz)
3589 chil = min( max(parameters%xl, -0.4), 0.6)
3590 if (abs(chil) .le. 0.01) chil = 0.01
3591 phi1 = 0.5 - 0.633*chil - 0.330*chil*chil
3592 phi2 = 0.877 * (1.-2.*phi1)
3593 gdir = phi1 + phi2*coszi
3595 avmu = ( 1. - phi1/phi2 * log((phi1+phi2)/phi1) ) / phi2
3596 omegal = rho(ib) + tau(ib)
3597 tmp0 = gdir + phi2*coszi
3599 asu = 0.5*omegal*gdir/tmp0 * ( 1.-tmp1/tmp0*log((tmp1+tmp0)/tmp1) )
3600 betadl = (1.+avmu*ext)/(omegal*avmu*ext)*asu
3601 betail = 0.5 * ( rho(ib)+tau(ib) + (rho(ib)-tau(ib)) &
3602 * ((1.+chil)/2.)**2 ) / omegal
3606 if (t .gt. tfrz)
then
3611 tmp0 = (1.-fwet)*omegal + fwet*parameters%omegas(ib)
3612 tmp1 = ( (1.-fwet)*omegal*betadl + fwet*parameters%omegas(ib)*parameters%betads ) / tmp0
3613 tmp2 = ( (1.-fwet)*omegal*betail + fwet*parameters%omegas(ib)*parameters%betais ) / tmp0
3622 b = 1. - omega + omega*betai
3625 d = tmp0 * omega*betad
3626 f = tmp0 * omega*(1.-betad)
3628 h = sqrt(tmp1) / avmu
3629 sigma = tmp0*tmp0 - tmp1
3630 if ( abs(sigma) < 1.e-6 ) sigma = sign(1.e-6_kind_phys,sigma)
3638 u1 = b - c/albgrd(ib)
3639 u2 = b - c*albgrd(ib)
3640 u3 = f + c*albgrd(ib)
3642 u1 = b - c/albgri(ib)
3643 u2 = b - c*albgri(ib)
3644 u3 = f + c*albgri(ib)
3648 d1 = p1*tmp2/s1 - p2*tmp3*s1
3651 d2 = tmp4/s1 - tmp5*s1
3653 tmp6 = d - h1*p3/sigma
3654 tmp7 = ( d - c - h1/sigma*(u1+tmp0) ) * s2
3655 h2 = ( tmp6*tmp2/s1 - p2*tmp7 ) / d1
3656 h3 = - ( tmp6*tmp3*s1 - p1*tmp7 ) / d1
3659 tmp9 = ( u3 - tmp8*(u2-tmp0) ) * s2
3660 h5 = - ( tmp8*tmp4/s1 + tmp9 ) / d2
3661 h6 = ( tmp8*tmp5*s1 + tmp9 ) / d2
3662 h7 = (c*tmp2) / (d1*s1)
3663 h8 = (-c*tmp3*s1) / d1
3665 h10 = (-tmp5*s1) / d2
3671 ftds = s2 *(1.0-gap) + gap
3672 ftis = (h4*s2/sigma + h5*s1 + h6/s1)*(1.0-gap)
3675 ftis = (h9*s1 + h10/s1)*(1.0-kopen) + kopen
3683 fres = (h1/sigma + h2 + h3)*(1.0-gap ) + albgrd(ib)*gap
3684 freveg = (h1/sigma + h2 + h3)*(1.0-gap )
3685 frebar = albgrd(ib)*gap
3687 fres = (h7 + h8) *(1.0-kopen) + albgri(ib)*kopen
3688 freveg = (h7 + h8) *(1.0-kopen) + albgri(ib)*kopen
3697 fab(ib) = 1. - fre(ib) - (1.-albgrd(ib))*ftd(ib) &
3698 - (1.-albgri(ib))*fti(ib)
3712 subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & !in
3713 dt ,sav ,sag ,lwdn ,ur , & !in
3714 uu ,vv ,sfctmp ,thair ,qair , & !in
3715 eair ,rhoair ,snowh ,vai ,gammav ,gammag, & !in
3716 fwet ,laisun ,laisha ,cwp ,dzsnso , & !in
3717 zlvl ,zpd ,z0m ,fveg ,shdfac, & !in
3718 z0mg ,emv ,emg ,canliq ,fsno, & !in
3719 canice ,stc ,df ,rssun ,rssha , & !in
3720 rsurf ,latheav ,latheag ,parsun ,parsha ,igs , & !in
3721 foln ,co2air ,o2air ,btran ,sfcprs , & !in
3722 rhsur ,iloc ,jloc ,q2 ,pahv ,pahg , & !in
3723 thsfc_loc, prslkix,prsik1x,prslk1x, garea1, & !in
3724 pblhx ,iz0tlnd ,itime ,psi_opt ,ep_1, ep_2, epsm1, cp, &
3725 eah ,tah ,tv ,tg ,cm,ustarx,& !inout
3727 ch ,dx ,dz8w ,errmsg ,errflg , & !inout
3729 ch ,dx ,dz8w , & !inout
3731 tauxv ,tauyv ,irg ,irc ,shg , & !out
3732 shc ,evg ,evc ,tr ,gh , & !out
3733 t2mv ,psnsun ,psnsha ,canhs , & !out
3735 qc ,qsfc ,psfc , & !in
3736 q2v ,cah2 ,chleaf ,chuc , & !inout
3747 use funcphys,
only : fpvs
3751 type (noahmp_parameters),
intent(in) :: parameters
3752 integer,
intent(in) :: iloc
3753 integer,
intent(in) :: jloc
3754 logical,
intent(in) :: veg
3755 integer,
intent(in) :: nsnow
3756 integer,
intent(in) :: nsoil
3757 integer,
intent(in) :: isnow
3758 integer,
intent(in) :: vegtyp
3759 real (kind=kind_phys),
intent(in) :: fveg
3760 real (kind=kind_phys),
intent(in) :: sav
3761 real (kind=kind_phys),
intent(in) :: sag
3762 real (kind=kind_phys),
intent(in) :: lwdn
3763 real (kind=kind_phys),
intent(in) :: ur
3764 real (kind=kind_phys),
intent(in) :: uu
3765 real (kind=kind_phys),
intent(in) :: vv
3766 real (kind=kind_phys),
intent(in) :: sfctmp
3767 real (kind=kind_phys),
intent(in) :: thair
3768 real (kind=kind_phys),
intent(in) :: eair
3769 real (kind=kind_phys),
intent(in) :: qair
3770 real (kind=kind_phys),
intent(in) :: rhoair
3771 real (kind=kind_phys),
intent(in) :: dt
3772 real (kind=kind_phys),
intent(in) :: fsno
3774 real (kind=kind_phys) ,
intent(in) :: pblhx
3775 real (kind=kind_phys) ,
intent(in) :: ep_1
3776 real (kind=kind_phys) ,
intent(in) :: ep_2
3777 real (kind=kind_phys) ,
intent(in) :: epsm1
3778 real (kind=kind_phys) ,
intent(in) :: cp
3779 integer ,
intent(in) :: iz0tlnd
3780 integer ,
intent(in) :: itime
3781 integer ,
intent(in) :: psi_opt
3784 real (kind=kind_phys),
intent(in) :: snowh
3785 real (kind=kind_phys),
intent(in) :: fwet
3786 real (kind=kind_phys),
intent(in) :: cwp
3788 real (kind=kind_phys),
intent(in) :: vai
3789 real (kind=kind_phys),
intent(in) :: laisun
3790 real (kind=kind_phys),
intent(in) :: laisha
3791 real (kind=kind_phys),
intent(in) :: zlvl
3792 real (kind=kind_phys),
intent(in) :: zpd
3793 real (kind=kind_phys),
intent(in) :: z0m
3794 real (kind=kind_phys),
intent(in) :: z0mg
3795 real (kind=kind_phys),
intent(in) :: emv
3796 real (kind=kind_phys),
intent(in) :: emg
3798 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: stc
3799 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: df
3800 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: dzsnso
3801 real (kind=kind_phys),
intent(in) :: canliq
3802 real (kind=kind_phys),
intent(in) :: canice
3803 real (kind=kind_phys),
intent(in) :: rsurf
3806 real (kind=kind_phys),
intent(in) :: gammav
3807 real (kind=kind_phys),
intent(in) :: latheav
3808 real (kind=kind_phys),
intent(in) :: gammag
3809 real (kind=kind_phys),
intent(in) :: latheag
3810 real (kind=kind_phys),
intent(in) :: parsun
3811 real (kind=kind_phys),
intent(in) :: parsha
3812 real (kind=kind_phys),
intent(in) :: foln
3813 real (kind=kind_phys),
intent(in) :: co2air
3814 real (kind=kind_phys),
intent(in) :: o2air
3815 real (kind=kind_phys),
intent(in) :: igs
3816 real (kind=kind_phys),
intent(in) :: sfcprs
3817 real (kind=kind_phys),
intent(in) :: btran
3818 real (kind=kind_phys),
intent(in) :: rhsur
3820 real (kind=kind_phys) ,
intent(in) :: qc
3821 real (kind=kind_phys) ,
intent(in) :: psfc
3822 real (kind=kind_phys) ,
intent(in) :: dx
3823 real (kind=kind_phys) ,
intent(in) :: q2
3824 real (kind=kind_phys) ,
intent(in) :: dz8w
3825 real (kind=kind_phys) ,
intent(inout) :: qsfc
3826 real (kind=kind_phys),
intent(in) :: pahv
3827 real (kind=kind_phys),
intent(in) :: pahg
3830 real (kind=kind_phys),
intent(inout) :: eah
3831 real (kind=kind_phys),
intent(inout) :: tah
3832 real (kind=kind_phys),
intent(inout) :: tv
3833 real (kind=kind_phys),
intent(inout) :: tg
3834 real (kind=kind_phys),
intent(inout) :: cm
3835 real (kind=kind_phys),
intent(inout) :: ch
3838 character(len=*),
intent(inout) :: errmsg
3839 integer,
intent(inout) :: errflg
3844 real (kind=kind_phys),
intent(out) :: tauxv
3845 real (kind=kind_phys),
intent(out) :: tauyv
3846 real (kind=kind_phys),
intent(out) :: irc
3847 real (kind=kind_phys),
intent(out) :: shc
3848 real (kind=kind_phys),
intent(out) :: evc
3849 real (kind=kind_phys),
intent(out) :: irg
3850 real (kind=kind_phys),
intent(out) :: shg
3851 real (kind=kind_phys),
intent(out) :: evg
3852 real (kind=kind_phys),
intent(out) :: tr
3853 real (kind=kind_phys),
intent(out) :: gh
3854 real (kind=kind_phys),
intent(out) :: t2mv
3855 real (kind=kind_phys),
intent(out) :: psnsun
3856 real (kind=kind_phys),
intent(out) :: psnsha
3857 real (kind=kind_phys),
intent(out) :: chleaf
3858 real (kind=kind_phys),
intent(out) :: chuc
3859 real (kind=kind_phys),
intent(out) :: canhs
3860 real (kind=kind_phys),
intent(out) :: q2v
3861 real (kind=kind_phys),
intent(out) :: rb
3862 real (kind=kind_phys) :: cah
3863 real (kind=kind_phys) :: u10v
3864 real (kind=kind_phys) :: v10v
3865 real (kind=kind_phys) :: wspd
3868 real (kind=kind_phys) :: gdx
3869 real (kind=kind_phys) :: snwd
3872 real (kind=kind_phys) :: cw
3873 real (kind=kind_phys) :: fv
3874 real (kind=kind_phys) :: wstar
3875 real (kind=kind_phys) :: z0mo
3876 real (kind=kind_phys) :: z0h
3877 real (kind=kind_phys) :: z0hg
3878 real (kind=kind_phys) :: ramc
3879 real (kind=kind_phys) :: rahc
3880 real (kind=kind_phys) :: rawc
3881 real (kind=kind_phys) :: ramg
3882 real (kind=kind_phys) :: rahg
3883 real (kind=kind_phys) :: rawg
3885 real (kind=kind_phys),
intent(out) :: rssun
3886 real (kind=kind_phys),
intent(out) :: rssha
3888 real (kind=kind_phys) :: mol
3889 real (kind=kind_phys) :: dtv
3890 real (kind=kind_phys) :: dtg
3892 real (kind=kind_phys) :: air,cir
3893 real (kind=kind_phys) :: csh
3894 real (kind=kind_phys) :: cev
3895 real (kind=kind_phys) :: cgh
3896 real (kind=kind_phys) :: atr,ctr
3897 real (kind=kind_phys) :: ata,bta
3898 real (kind=kind_phys) :: aea,bea
3900 real (kind=kind_phys) :: estv
3901 real (kind=kind_phys) :: estg
3902 real (kind=kind_phys) :: destv
3903 real (kind=kind_phys) :: destg
3904 real (kind=kind_phys) :: esatw
3905 real (kind=kind_phys) :: esati
3906 real (kind=kind_phys) :: dsatw
3907 real (kind=kind_phys) :: dsati
3909 real (kind=kind_phys) :: fm
3910 real (kind=kind_phys) :: fh
3911 real (kind=kind_phys) :: fhg
3912 real (kind=kind_phys) :: fhgh
3913 real (kind=kind_phys) :: hcan
3915 real (kind=kind_phys) :: a
3916 real (kind=kind_phys) :: b
3917 real (kind=kind_phys) :: cvh
3918 real (kind=kind_phys) :: caw
3919 real (kind=kind_phys) :: ctw
3920 real (kind=kind_phys) :: cew
3921 real (kind=kind_phys) :: cgw
3922 real (kind=kind_phys) :: cond
3923 real (kind=kind_phys) :: uc
3924 real (kind=kind_phys) :: kh
3925 real (kind=kind_phys) :: h
3926 real (kind=kind_phys) :: hg
3927 real (kind=kind_phys) :: moz
3928 real (kind=kind_phys) :: mozg
3929 real (kind=kind_phys) :: mozold
3930 real (kind=kind_phys) :: fm2
3931 real (kind=kind_phys) :: fh2
3932 real (kind=kind_phys) :: ch2
3933 real (kind=kind_phys) :: thstar
3935 real (kind=kind_phys) :: fm10
3936 real (kind=kind_phys) :: rb1v
3937 real (kind=kind_phys) :: stress1v
3940 real (kind=kind_phys) :: flhcv
3941 real (kind=kind_phys) :: flqcv
3942 real (kind=kind_phys) :: wspdv
3944 real (kind=kind_phys) :: thvair
3945 real (kind=kind_phys) :: thah
3946 real (kind=kind_phys) :: rahc2
3947 real (kind=kind_phys) :: rawc2
3948 real (kind=kind_phys),
intent(out):: cah2
3949 real (kind=kind_phys) :: ch2v
3950 real (kind=kind_phys) :: cq2v
3951 real (kind=kind_phys) :: eah2
3952 real (kind=kind_phys) :: qfx
3953 real (kind=kind_phys) :: e1
3954 real (kind=kind_phys) :: hcv
3956 real (kind=kind_phys) :: vaie
3957 real (kind=kind_phys) :: laisune
3958 real (kind=kind_phys) :: laishae
3964 integer,
parameter :: niterc = 20
3966 integer,
parameter :: niterg = 5
3968 real (kind=kind_phys) :: mpe
3974 logical ,
intent(in ) :: thsfc_loc
3975 real (kind=kind_phys),
intent(in ) :: prslkix
3976 real (kind=kind_phys),
intent(in ) :: prsik1x
3977 real (kind=kind_phys),
intent(in ) :: prslk1x
3978 real (kind=kind_phys),
intent(in ) :: garea1
3979 real (kind=kind_phys),
intent(in ) :: shdfac
3980 real (kind=kind_phys),
intent(inout) :: ustarx
3981 real (kind=kind_phys),
intent( out) :: csigmaf1
3982 real (kind=kind_phys) :: csigmaf0
3984 real (kind=kind_phys) :: temptrs
3987 real (kind=kind_phys) :: t, tdc
3989 real(kind=kind_phys) :: evpot
3990 real(kind=kind_phys) :: fhi, qss, wrk
3991 real(kind=kind_phys),
parameter :: qmin=1.0e-8
3993 character(len=80) :: message
3995 tdc(t) = min( 50., max(-50.,(t-tfrz)) )
4019 laisune = min(6.,laisun)
4020 laishae = min(6.,laisha)
4025 call esat(t, esatw, esati, dsatw, dsati)
4034 qsfc = ep_2*eair/(psfc+epsm1*eair)
4037 hcan = parameters%hvt
4038 uc = ur*log(hcan/z0m)/log(zlvl/z0m)
4039 uc = ur*log((hcan-zpd+z0m)/z0m)/log(zlvl/z0m)
4040 if((hcan-zpd) <= 0.)
then
4041 write(message,*)
"critical problem: hcan <= zpd"
4043 errmsg = trim(message)
4045 call wrf_message ( message )
4047 write(message,*)
'i,j point=',iloc, jloc
4049 errmsg = trim(errmsg)//new_line(
'A')//trim(message)
4051 call wrf_message ( message )
4053 write(message,*)
'hcan =',hcan
4055 errmsg = trim(errmsg)//new_line(
'A')//trim(message)
4057 call wrf_message ( message )
4059 write(message,*)
'zpd =',zpd
4061 errmsg = trim(errmsg)//new_line(
'A')//trim(message)
4063 call wrf_message ( message )
4065 write (message, *)
'snowh =',snowh
4068 errmsg = trim(errmsg)//new_line(
'A')//trim(message)//new_line(
'A')//
"critical problem in module_sf_noahmplsm:vegeflux"
4071 call wrf_message ( message )
4072 call wrf_error_fatal (
"critical problem in module_sf_noahmplsm:vegeflux" )
4077 if(opt_sfc == 4)
then
4080 snwd = snowh * 1000.0
4083 if (snowh .gt. 0.1)
then
4092 loop1:
do iter = 1, niterc
4101 call thermalz0(parameters,fveg,z0m,z0mg,zlvl,zpd,zpd,ustarx, &
4102 vegtyp,vaie,ur,csigmaf0,csigmaf1,temptrs,temptrs,temptrs,0, &
4105 call thermalz0(parameters,fveg,z0m,z0mg,zlvl,zpd,zpd,ustarx, &
4106 vegtyp,vaie,ur,csigmaf0,csigmaf1,temptrs,temptrs,temptrs,1, &
4111 if(opt_sfc == 1)
then
4112 call sfcdif1(parameters,iter ,sfctmp ,rhoair ,h ,qair , &
4113 zlvl ,zpd ,z0m ,z0h ,ur , &
4116 moz ,mozsgn ,fm ,fh ,fm2 ,fh2 ,fv, errmsg ,errflg ,&
4118 moz ,mozsgn ,fm ,fh ,fm2,fh2, fv, &
4122 if (errflg /= 0)
return
4126 if(opt_sfc == 2)
then
4127 call sfcdif2(parameters,iter ,z0m ,tah ,thair ,ur , &
4128 zlvl ,iloc ,jloc , &
4129 cm ,ch ,moz ,wstar , &
4137 if(opt_sfc == 3)
then
4138 call sfcdif3(parameters,iloc ,jloc ,iter ,sfctmp ,qair ,ur , &
4139 zlvl ,tah ,thsfc_loc,prslkix,prsik1x ,prslk1x ,z0m , &
4140 z0h, zpd ,snowh ,shdfac ,garea1 , &
4141 ustarx ,fm ,fh ,fm2 ,fh2 , &
4146 if(opt_sfc == 4)
then
4148 call sfcdif4(iloc ,jloc ,uu ,vv ,sfctmp , &
4149 sfcprs ,psfc ,pblhx ,gdx ,z0m , &
4151 itime ,snwd ,mnice ,psi_opt, &
4152 tah ,qair ,zlvl ,iz0tlnd,qsfc , &
4153 h ,qfx ,cm ,ch ,ch2v , &
4154 cq2v ,moz ,fv ,rb1v, fm, fh, &
4155 stress1v,fm10 ,fh2 ,wspdv ,flhcv ,flqcv)
4168 if(opt_sfc == 1 .or. opt_sfc == 2 .or. opt_sfc == 3)
then
4169 ramc = max(1.,1./(cm*ur))
4170 rahc = max(1.,1./(ch*ur))
4171 elseif(opt_sfc == 4)
then
4172 ramc = max(1.,1./(cm*wspdv) )
4173 rahc = max(1.,1./(ch*wspdv) )
4181 call ragrb(parameters,iter ,vaie ,rhoair ,hg ,tah , &
4182 zpd ,z0mg ,z0hg ,hcan ,uc , &
4183 z0h ,fv ,cwp ,vegtyp ,mpe , &
4184 tv ,mozg ,fhg ,fhgh ,iloc ,jloc , &
4185 ramg ,rahg ,rawg ,rb )
4190 call esat(t, esatw, esati, dsatw, dsati)
4202 if (opt_crs == 1)
then
4203 call stomata (parameters,vegtyp,mpe ,parsun ,foln ,iloc , jloc , &
4204 tv ,estv ,eah ,sfctmp,sfcprs, &
4205 o2air ,co2air,igs ,btran ,rb , &
4208 call stomata (parameters,vegtyp,mpe ,parsha ,foln ,iloc , jloc , &
4209 tv ,estv ,eah ,sfctmp,sfcprs, &
4210 o2air ,co2air,igs ,btran ,rb , &
4214 if (opt_crs == 2)
then
4215 call canres (parameters,ep_2, epsm1,parsun,tv ,btran ,eah ,sfcprs, &
4216 rssun ,psnsun,iloc ,jloc )
4218 call canres (parameters,ep_2, epsm1,parsha,tv ,btran ,eah ,sfcprs, &
4219 rssha ,psnsha,iloc ,jloc )
4225 air = -emv*(1.+(1.-emv)*(1.-emg))*lwdn - emv*emg*sb*tg**4
4226 cir = (2.-emv*(1.-emg))*emv*sb
4233 cond = cah + cvh + cgh
4234 ata = (sfctmp*cah + tg*cgh) / cond
4236 csh = (1.-bta)*rhoair*cpair*cvh
4240 evpot= fveg*rhoair*cpair*vaie/rb * (estv-eah) / gammav
4242 if(evpot > 0. .and. fwet > 0.)
then
4244 cew = min(fwet,canliq*latheav/dt/evpot) * vaie/rb
4246 cew = min(fwet,canice*latheav/dt/evpot) * vaie/rb
4251 ctw = (1.-fwet)*(laisune/(rb+rssun) + laishae/(rb+rssha))
4252 cgw = 1./(rawg+rsurf)
4253 cond = caw + cew + ctw + cgw
4254 aea = (eair*caw + estg*cgw) / cond
4255 bea = (cew+ctw)/cond
4256 cev = (1.-bea)*cew*rhoair*cpair/gammav
4257 ctr = (1.-bea)*ctw*rhoair*cpair/gammav
4262 eah = aea + bea*estv
4264 irc = fveg*(air + cir*tv**4)
4265 shc = fveg*rhoair*cpair*cvh * ( tv-tah)
4266 evc = fveg*rhoair*cpair*cew * (estv-eah) / gammav
4267 tr = fveg*rhoair*cpair*ctw * (estv-eah) / gammav
4269 evc = min(canliq*latheav/dt,evc)
4271 evc = min(canice*latheav/dt,evc)
4275 hcv = fveg*(parameters%cbiom*vaie*cwat + canliq*cwat/denh2o + canice*cice/denice)
4277 b = sav-irc-shc-evc-tr+pahv
4279 a = fveg*(4.*cir*tv**3 + csh + (cev+ctr)*destv) + hcv/dt
4282 irc = irc + fveg*4.*cir*tv**3*dtv
4283 shc = shc + fveg*csh*dtv
4284 evc = evc + fveg*cev*destv*dtv
4285 tr = tr + fveg*ctr*destv*dtv
4293 h = rhoair*cpair*(tah - sfctmp) /rahc
4294 hg = rhoair*cpair*(tg - tah) /rahg
4297 qsfc = (ep_2*eah)/(sfcprs+epsm1*eah)
4299 if ( opt_sfc == 4 )
then
4300 qfx = (qsfc-qair)*rhoair*caw
4307 air = - emg*(1.-emv)*lwdn - emg*emv*sb*tv**4
4309 csh = rhoair*cpair/rahg
4310 cev = rhoair*cpair / (gammag*(rawg+rsurf))
4311 cgh = 2.*df(isnow+1)/dzsnso(isnow+1)
4314 call esat(t, esatw, esati, dsatw, dsati)
4323 irg = cir*tg**4 + air
4324 shg = csh * (tg - tah )
4325 evg = cev * (estg*rhsur - eah )
4326 gh = cgh * (tg - stc(isnow+1))
4328 b = sag-irg-shg-evg-gh+pahg
4329 a = 4.*cir*tg**3+csh+cev*destg+cgh
4332 irg = irg + 4.*cir*tg**3*dtg
4334 evg = evg + cev*destg*dtg
4338 if (liter == 1)
then
4341 if (iter >= 5 .and. abs(dtv) <= 0.01 .and. abs(dtg) <= 0.01 .and. liter == 0)
then
4351 if(opt_stc == 1 .or. opt_stc == 3)
then
4352 if (snowh > 0.05 .and. tg > tfrz)
then
4353 if(opt_stc == 1) tg = tfrz
4354 if(opt_stc == 3) tg = (1.-fsno)*tg + fsno*tfrz
4355 irg = cir*tg**4 - emg*(1.-emv)*lwdn - emg*emv*sb*tv**4
4356 shg = csh * (tg - tah)
4357 evg = cev * (estg*rhsur - eah)
4358 gh = sag+pahg - (irg+shg+evg)
4364 tauxv = -rhoair*cm*ur*uu
4365 tauyv = -rhoair*cm*ur*vv
4375 if (opt_sfc == 1 .or. opt_sfc == 2 )
then
4377 cah2 = fv*vkc/log((2.+z0h)/z0h)
4378 cah2 = fv*vkc/(log((2.+z0h)/z0h)-fh2)
4383 if (opt_sfc ==3)
then
4388 if (opt_sfc == 4 )
then
4389 rahc2 = max(1.,1./(ch2v*wspdv))
4392 cq2v = 1./max(1.,1./(cq2v*wspdv))
4395 if (cah2 .lt. 1.e-5 )
then
4400 t2mv = tah - (shg+shc/fveg)/(rhoair*cpair) * 1./cah2
4402 q2v = qsfc - ((evc+tr)/fveg+evg)/(latheav*rhoair) * 1./cq2v
4406 if(opt_diag ==3)
then
4407 if(opt_sfc == 1 .or. opt_sfc == 3)
then
4412 t2mv = tah*wrk + sfctmp*prslkix*fhi - (grav+grav)/cp
4414 t2mv = tah*wrk + sfctmp*fhi - (grav+grav)/cp
4417 if((evc+tr)/fveg+evg >= 0.)
then
4418 q2v = qsfc*wrk + max(qmin,qair)*fhi
4421 qss = ep_2 * qss / (psfc + epsm1 * qss)
4422 q2v= qss*wrk + max(qmin,qair)*fhi
4425 qss = ep_2 * qss / (psfc + epsm1 * qss)
4428 errmsg =
'Problem :opt_diag=3 is only applied for opt_sfc=1&3'
4445 subroutine bare_flux (parameters,nsnow ,nsoil ,isnow ,dt ,sag , & !in
4446 lwdn ,ur ,uu ,vv ,sfctmp , & !in
4447 thair ,qair ,eair ,rhoair ,snowh , & !in
4448 dzsnso ,zlvl ,zpd ,z0m ,fsno , & !in
4449 emg ,stc ,df ,rsurf ,lathea , & !in
4450 gamma ,rhsur ,iloc ,jloc ,q2 ,pahb , & !in
4451 thsfc_loc, prslkix,prsik1x,prslk1x,vegtyp,fveg,shdfac,garea1, & !in
4452 pblhx , iz0tlnd , itime ,psi_opt,ep_1,ep_2,epsm1,cp ,&
4454 tgb ,cm ,ch,ustarx,errmsg ,errflg , & !inout
4456 tgb ,cm ,ch,ustarx, & !inout
4458 tauxb ,tauyb ,irb ,shb ,evb , & !out
4460 ghb ,t2mb ,dx ,dz8w , & !out
4461 qc ,qsfc ,psfc , & !in
4471 use funcphys,
only : fpvs
4475 type (noahmp_parameters),
intent(in) :: parameters
4476 integer ,
intent(in) :: iloc
4477 integer ,
intent(in) :: jloc
4478 integer,
intent(in) :: nsnow
4479 integer,
intent(in) :: nsoil
4480 integer,
intent(in) :: isnow
4481 real (kind=kind_phys),
intent(in) :: dt
4482 real (kind=kind_phys),
intent(in) :: sag
4483 real (kind=kind_phys),
intent(in) :: lwdn
4484 real (kind=kind_phys),
intent(in) :: ur
4485 real (kind=kind_phys),
intent(in) :: uu
4486 real (kind=kind_phys),
intent(in) :: vv
4487 real (kind=kind_phys),
intent(in) :: sfctmp
4488 real (kind=kind_phys),
intent(in) :: thair
4489 real (kind=kind_phys),
intent(in) :: qair
4490 real (kind=kind_phys),
intent(in) :: eair
4491 real (kind=kind_phys),
intent(in) :: rhoair
4492 real (kind=kind_phys),
intent(in) :: snowh
4493 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: dzsnso
4494 real (kind=kind_phys),
intent(in) :: zlvl
4495 real (kind=kind_phys),
intent(in) :: zpd
4496 real (kind=kind_phys),
intent(in) :: z0m
4497 real (kind=kind_phys),
intent(in) :: emg
4498 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: stc
4499 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: df
4500 real (kind=kind_phys),
intent(in) :: rsurf
4501 real (kind=kind_phys),
intent(in) :: lathea
4502 real (kind=kind_phys),
intent(in) :: gamma
4503 real (kind=kind_phys),
intent(in) :: rhsur
4504 real (kind=kind_phys),
intent(in) :: fsno
4506 real (kind=kind_phys),
intent(in) :: pblhx
4507 real (kind=kind_phys),
intent(in) :: ep_1
4508 real (kind=kind_phys),
intent(in) :: ep_2
4509 real (kind=kind_phys),
intent(in) :: epsm1
4510 real (kind=kind_phys),
intent(in) :: cp
4511 integer,
intent(in) :: iz0tlnd
4512 integer,
intent(in) :: itime
4513 integer,
intent(in) :: psi_opt
4517 real (kind=kind_phys) ,
intent(in) :: qc
4518 real (kind=kind_phys) ,
intent(inout) :: qsfc
4519 real (kind=kind_phys) ,
intent(in) :: psfc
4520 real (kind=kind_phys) ,
intent(in) :: sfcprs
4521 real (kind=kind_phys) ,
intent(in) :: dx
4522 real (kind=kind_phys) ,
intent(in) :: q2
4523 real (kind=kind_phys) ,
intent(in) :: dz8w
4525 real (kind=kind_phys),
intent(in) :: pahb
4528 real (kind=kind_phys),
intent(inout) :: tgb
4529 real (kind=kind_phys),
intent(inout) :: cm
4530 real (kind=kind_phys),
intent(inout) :: ch
4532 character(len=*),
intent(inout) :: errmsg
4533 integer,
intent(inout) :: errflg
4539 real (kind=kind_phys),
intent(out) :: tauxb
4540 real (kind=kind_phys),
intent(out) :: tauyb
4541 real (kind=kind_phys),
intent(out) :: irb
4542 real (kind=kind_phys),
intent(out) :: shb
4543 real (kind=kind_phys),
intent(out) :: evb
4544 real (kind=kind_phys),
intent(out) :: ghb
4545 real (kind=kind_phys),
intent(out) :: t2mb
4547 real (kind=kind_phys),
intent(out) :: q2b
4548 real (kind=kind_phys) :: ehb
4549 real (kind=kind_phys) :: u10b
4550 real (kind=kind_phys) :: v10b
4551 real (kind=kind_phys) :: wspd
4556 real (kind=kind_phys) :: gdx
4557 real (kind=kind_phys) :: snwd
4560 real (kind=kind_phys) :: fm10
4561 real (kind=kind_phys) :: rb1b
4562 real (kind=kind_phys) :: stress1b
4564 real (kind=kind_phys) :: wspdb
4565 real (kind=kind_phys) :: flhcb
4566 real (kind=kind_phys) :: flqcb
4569 real (kind=kind_phys) :: taux
4570 real (kind=kind_phys) :: tauy
4571 real (kind=kind_phys) :: fira
4572 real (kind=kind_phys) :: fsh
4573 real (kind=kind_phys) :: fgev
4574 real (kind=kind_phys) :: ssoil
4575 real (kind=kind_phys) :: fire
4576 real (kind=kind_phys) :: trad
4577 real (kind=kind_phys) :: tah
4579 real (kind=kind_phys) :: cw
4580 real (kind=kind_phys) :: fv
4581 real (kind=kind_phys) :: wstar
4582 real (kind=kind_phys) :: z0mo
4583 real (kind=kind_phys) :: z0h
4584 real (kind=kind_phys) :: rb
4585 real (kind=kind_phys) :: ramb
4586 real (kind=kind_phys) :: rahb
4587 real (kind=kind_phys) :: rawb
4588 real (kind=kind_phys) :: mol
4589 real (kind=kind_phys) :: dtg
4591 real (kind=kind_phys) :: cir
4592 real (kind=kind_phys) :: csh
4593 real (kind=kind_phys) :: cev
4594 real (kind=kind_phys) :: cgh
4596 real(kind=kind_phys) :: kbsigmaf0
4597 real(kind=kind_phys) :: reynb
4601 real (kind=kind_phys) :: rahb2
4602 real (kind=kind_phys) :: rawb2
4603 real (kind=kind_phys),
intent(out) :: ehb2
4604 real (kind=kind_phys) :: ch2b
4605 real (kind=kind_phys) :: cq2b
4606 real (kind=kind_phys) :: thvair
4607 real (kind=kind_phys) :: thgh
4608 real (kind=kind_phys) :: emb
4609 real (kind=kind_phys) :: qfx
4610 real (kind=kind_phys) :: estg2
4611 real (kind=kind_phys) :: e1
4614 real (kind=kind_phys) :: estg
4615 real (kind=kind_phys) :: destg
4616 real (kind=kind_phys) :: esatw
4617 real (kind=kind_phys) :: esati
4618 real (kind=kind_phys) :: dsatw
4619 real (kind=kind_phys) :: dsati
4621 real (kind=kind_phys) :: a
4622 real (kind=kind_phys) :: b
4623 real (kind=kind_phys) :: h
4624 real (kind=kind_phys) :: moz
4625 real (kind=kind_phys) :: mozold
4626 real (kind=kind_phys) :: fm
4627 real (kind=kind_phys) :: fh
4629 real (kind=kind_phys) :: fm2
4630 real (kind=kind_phys) :: fh2
4631 real (kind=kind_phys) :: ch2
4635 real (kind=kind_phys) :: mpe
4643 logical ,
intent(in ) :: thsfc_loc
4644 real (kind=kind_phys),
intent(in ) :: prslkix
4645 real (kind=kind_phys),
intent(in ) :: prsik1x
4646 real (kind=kind_phys),
intent(in ) :: prslk1x
4647 integer ,
intent(in ) :: vegtyp
4648 real (kind=kind_phys),
intent(in ) :: fveg
4649 real (kind=kind_phys),
intent(in ) :: shdfac
4650 real (kind=kind_phys),
intent(in ) :: garea1
4651 real (kind=kind_phys),
intent(inout) :: ustarx
4652 real (kind=kind_phys),
intent( out) :: csigmaf0
4653 real (kind=kind_phys) :: csigmaf1
4655 real (kind=kind_phys) :: temptrs
4657 real (kind=kind_phys) :: t, tdc
4659 real(kind=kind_phys) :: fhi, qss, wrk
4660 real(kind=kind_phys),
parameter :: qmin=1.0e-8
4662 tdc(t) = min( 50., max(-50.,(t-tfrz)) )
4678 cgh = 2.*df(isnow+1)/dzsnso(isnow+1)
4680 reynb = ustarx*z0m/(1.5e-05)
4682 if (reynb .gt. 2.0)
then
4683 kbsigmaf0 = 2.46*reynb**0.25 - log(7.4)
4685 kbsigmaf0 = - log(0.397)
4688 z0h = max(z0m/exp(kbsigmaf0),1.0e-6)
4690 if (opt_sfc == 4)
then
4693 snwd = snowh * 1000.0
4695 if (snowh .gt. 0.1)
then
4703 loop3:
do iter = 1, niterb
4710 call thermalz0(parameters,fveg,z0m,z0m,zlvl,zpd,zpd,ustarx, &
4711 vegtyp,0._kind_phys,ur,csigmaf0,csigmaf1,temptrs,temptrs,temptrs,0, &
4714 if(opt_sfc == 1)
then
4715 call sfcdif1(parameters,iter ,sfctmp ,rhoair ,h ,qair , &
4716 zlvl ,zpd ,z0m ,z0h ,ur , &
4719 moz ,mozsgn ,fm ,fh ,fm2 ,fh2 ,fv,errmsg ,errflg ,&
4721 moz ,mozsgn ,fm ,fh ,fm2 ,fh2 ,fv, &
4725 if (errflg /= 0)
return
4729 if(opt_sfc == 2)
then
4730 call sfcdif2(parameters,iter ,z0m ,tgb ,thair ,ur , &
4731 zlvl ,iloc ,jloc , &
4732 cm ,ch ,moz ,wstar , &
4745 if(opt_sfc == 3)
then
4746 call sfcdif3(parameters,iloc ,jloc ,iter ,sfctmp ,qair ,ur , &
4747 zlvl ,tgb ,thsfc_loc,prslkix,prsik1x ,prslk1x ,z0m , &
4748 z0h, zpd,snowh ,shdfac ,garea1 , &
4749 ustarx ,fm ,fh ,fm2 ,fh2 , &
4754 if(opt_sfc == 4)
then
4756 call sfcdif4(iloc ,jloc ,uu ,vv ,sfctmp , &
4757 sfcprs ,psfc ,pblhx ,gdx ,z0m , &
4759 itime ,snwd ,mnice ,psi_opt , &
4760 tgb ,qair ,zlvl ,iz0tlnd,qsfc , &
4761 h ,qfx ,cm ,ch ,ch2b , &
4762 cq2b ,moz ,fv ,rb1b, fm, fh , &
4763 stress1b,fm10 ,fh2 , wspdb ,flhcb ,flqcb)
4776 ch2b = min(0.01,ch2b)
4777 cq2b = min(0.01,cq2b)
4782 if(opt_sfc == 1 .or. opt_sfc == 2 .or. opt_sfc == 3)
then
4783 ramb = max(1.,1./(cm*ur))
4784 rahb = max(1.,1./(ch*ur))
4785 elseif(opt_sfc == 4)
then
4786 ramb = max(1.,1./(cm*wspdb) )
4787 rahb = max(1.,1./(ch*wspdb) )
4799 call esat(t, esatw, esati, dsatw, dsati)
4808 csh = rhoair*cpair/rahb
4809 cev = rhoair*cpair/gamma/(rsurf+rawb)
4813 irb = cir * tgb**4 - emg*lwdn
4814 shb = csh * (tgb - sfctmp )
4815 evb = cev * (estg*rhsur - eair )
4816 ghb = cgh * (tgb - stc(isnow+1))
4818 b = sag-irb-shb-evb-ghb+pahb
4819 a = 4.*cir*tgb**3 + csh + cev*destg + cgh
4822 irb = irb + 4.*cir*tgb**3*dtg
4824 evb = evb + cev*destg*dtg
4831 h = csh * (tgb - sfctmp)
4834 call esat(t, esatw, esati, dsatw, dsati)
4840 qsfc = ep_2*(estg*rhsur)/(psfc+epsm1*(estg*rhsur))
4842 qfx = (qsfc-qair)*cev*gamma/cpair
4849 if(opt_stc == 1 .or. opt_stc == 3)
then
4850 if (snowh > 0.05 .and. tgb > tfrz)
then
4851 if(opt_stc == 1) tgb = tfrz
4852 if(opt_stc == 3) tgb = (1.-fsno)*tgb + fsno*tfrz
4853 irb = cir * tgb**4 - emg*lwdn
4854 shb = csh * (tgb - sfctmp)
4855 evb = cev * (estg*rhsur - eair )
4856 ghb = sag+pahb - (irb+shb+evb)
4862 tauxb = -rhoair*cm*ur*uu
4863 tauyb = -rhoair*cm*ur*vv
4868 if(opt_sfc == 1 .or. opt_sfc ==2 )
then
4869 ehb2 = fv*vkc/log((2.+z0h)/z0h)
4870 ehb2 = fv*vkc/(log((2.+z0h)/z0h)-fh2)
4872 if (ehb2.lt.1.e-5 )
then
4876 t2mb = tgb - shb/(rhoair*cpair) * 1./ehb2
4877 q2b = qsfc - evb/(lathea*rhoair)*(1./cq2b + rsurf)
4879 if (parameters%urban_flag) q2b = qsfc
4883 if(opt_sfc == 3 )
then
4886 if (ehb2.lt.1.e-5 )
then
4890 t2mb = tgb - shb/(rhoair*cpair) * 1./ehb2
4891 q2b = qsfc - evb/(lathea*rhoair)*(1./cq2b + rsurf)
4893 if (parameters%urban_flag) q2b = qsfc
4896 if(opt_sfc == 4)
then
4898 rahb2 = max(1.,1./(ch2b*wspdb))
4900 cq2b = 1./max(1.,1./(cq2b*wspdb))
4902 if (ehb2.lt.1.e-5 )
then
4906 t2mb = tgb - shb/(rhoair*cpair*ehb2)
4908 q2b = qsfc - evb/(lathea*rhoair)*(1./cq2b + rsurf)
4913 if(opt_diag ==3)
then
4914 if(opt_sfc == 1 .or. opt_sfc == 3)
then
4919 t2mb = tgb*wrk + sfctmp*prslkix*fhi - (grav+grav)/cp
4921 t2mb = tgb*wrk + sfctmp*fhi - (grav+grav)/cp
4925 q2b = qsfc*wrk + max(qmin,qair)*fhi
4928 qss = ep_2 * qss / (psfc + epsm1 * qss)
4929 q2b= qss*wrk + max(qmin,qair)*fhi
4932 qss = ep_2 * qss / (psfc + epsm1 * qss)
4935 errmsg =
'Problem :opt_diag=3 is only applied for opt_sfc=1&3'
4940 if (parameters%urban_flag) q2b = qsfc
4952 subroutine ragrb(parameters,iter ,vai ,rhoair ,hg ,tah , & !in
4953 zpd ,z0mg ,z0hg ,hcan ,uc , & !in
4954 z0h ,fv ,cwp ,vegtyp ,mpe , & !in
4955 tv ,mozg ,fhg ,fhgh ,iloc ,jloc , & !inout
4956 ramg ,rahg ,rawg ,rb )
4965 type (noahmp_parameters),
intent(in) :: parameters
4966 integer,
intent(in) :: iloc
4967 integer,
intent(in) :: jloc
4968 integer,
intent(in) :: iter
4969 integer,
intent(in) :: vegtyp
4970 real (kind=kind_phys),
intent(in) :: vai
4971 real (kind=kind_phys),
intent(in) :: rhoair
4972 real (kind=kind_phys),
intent(in) :: hg
4973 real (kind=kind_phys),
intent(in) :: tv
4974 real (kind=kind_phys),
intent(in) :: tah
4975 real (kind=kind_phys),
intent(in) :: zpd
4976 real (kind=kind_phys),
intent(in) :: z0mg
4977 real (kind=kind_phys),
intent(in) :: hcan
4978 real (kind=kind_phys),
intent(in) :: uc
4979 real (kind=kind_phys),
intent(in) :: z0h
4980 real (kind=kind_phys),
intent(in) :: z0hg
4981 real (kind=kind_phys),
intent(in) :: fv
4982 real (kind=kind_phys),
intent(in) :: cwp
4983 real (kind=kind_phys),
intent(in) :: mpe
4987 real (kind=kind_phys),
intent(inout) :: mozg
4988 real (kind=kind_phys),
intent(inout) :: fhg
4989 real (kind=kind_phys),
intent(inout) :: fhgh
4992 real (kind=kind_phys) :: ramg
4993 real (kind=kind_phys) :: rahg
4994 real (kind=kind_phys) :: rawg
4995 real (kind=kind_phys) :: rb
4998 real (kind=kind_phys) :: kh
4999 real (kind=kind_phys) :: tmp1
5000 real (kind=kind_phys) :: tmp2
5001 real (kind=kind_phys) :: tmprah2
5002 real (kind=kind_phys) :: tmprb
5003 real (kind=kind_phys) :: molg,fhgnew,cwpc
5004 real (kind=kind_phys) :: mozgh, fhgnewh
5013 tmp1 = vkc * (grav/tah) * hg/(rhoair*cpair)
5014 if (abs(tmp1) .le. mpe) tmp1 = mpe
5015 molg = -1. * fv**3 / tmp1
5016 mozg = min( (zpd-z0mg)/molg, 1.)
5017 mozgh = min( (hcan - zpd)/molg, 1.)
5021 fhgnew = (1. - 15.*mozg)**(-0.25)
5022 fhgnewh = 0.74 * (1. - 9.*mozg)**(-0.5)
5024 fhgnew = 1.+ 4.7*mozg
5025 fhgnewh = 0.74 + 4.7*mozgh
5032 fhg = 0.5 * (fhg+fhgnew)
5033 fhgh = 0.5 * (fhgh+fhgnewh)
5036 cwpc = (cwp * vai * hcan * fhg)**0.5
5038 cwpc = max(min(cwpc,5.0),1.0)
5040 tmp1 = exp( -cwpc*z0hg/hcan )
5041 tmp2 = exp( -cwpc*(z0h+zpd)/hcan )
5042 tmprah2 = hcan*exp(cwpc) / cwpc * (tmp1-tmp2)
5046 kh = max( vkc*fv*(hcan-zpd)/(max(fhgh,0.1)), mpe )
5053 tmprb = cwpc*50. / (1. - exp(-cwpc/2.))
5054 rb = tmprb * sqrt(parameters%dleaf/uc)
5055 rb = min(max(rb, 5.0),50.0)
5057 end subroutine ragrb
5063 subroutine sfcdif1(parameters,iter ,sfctmp ,rhoair ,h ,qair , & !in
5064 & zlvl ,zpd ,z0m ,z0h ,ur , & !in
5065 & mpe ,iloc ,jloc , & !in
5067 & moz ,mozsgn ,fm ,fh ,fm2,fh2,fv,errmsg,errflg, & !inout
5069 & moz ,mozsgn ,fm ,fh ,fm2,fh2, fv, & !inout
5079 type (noahmp_parameters),
intent(in) :: parameters
5080 integer,
intent(in) :: iloc
5081 integer,
intent(in) :: jloc
5082 integer,
intent(in) :: iter
5083 real (kind=kind_phys),
intent(in) :: sfctmp
5084 real (kind=kind_phys),
intent(in) :: rhoair
5085 real (kind=kind_phys),
intent(in) :: h
5086 real (kind=kind_phys),
intent(in) :: qair
5087 real (kind=kind_phys),
intent(in) :: zlvl
5088 real (kind=kind_phys),
intent(in) :: zpd
5089 real (kind=kind_phys),
intent(in) :: z0h
5090 real (kind=kind_phys),
intent(in) :: z0m
5091 real (kind=kind_phys),
intent(in) :: ur
5092 real (kind=kind_phys),
intent(in) :: mpe
5095 integer,
intent(inout) :: mozsgn
5096 real (kind=kind_phys),
intent(inout) :: moz
5097 real (kind=kind_phys),
intent(inout) :: fm
5098 real (kind=kind_phys),
intent(inout) :: fh
5099 real (kind=kind_phys),
intent(inout) :: fm2
5100 real (kind=kind_phys),
intent(inout) :: fh2
5101 real (kind=kind_phys),
intent(inout) :: fv
5103 character(len=*),
intent(inout) :: errmsg
5104 integer,
intent(inout) :: errflg
5109 real (kind=kind_phys),
intent(out) :: cm
5110 real (kind=kind_phys),
intent(out) :: ch
5111 real (kind=kind_phys),
intent(out) :: ch2
5114 real (kind=kind_phys) :: mol
5115 real (kind=kind_phys) :: tmpcm
5116 real (kind=kind_phys) :: tmpch
5117 real (kind=kind_phys) :: fmnew
5118 real (kind=kind_phys) :: fhnew
5119 real (kind=kind_phys) :: mozold
5120 real (kind=kind_phys) :: tmp1,tmp2,tmp3,tmp4,tmp5
5121 real (kind=kind_phys) :: tvir
5122 real (kind=kind_phys) :: moz2
5123 real (kind=kind_phys) :: tmpcm2
5124 real (kind=kind_phys) :: tmpch2
5125 real (kind=kind_phys) :: fm2new
5126 real (kind=kind_phys) :: fh2new
5127 real (kind=kind_phys) :: tmp12,tmp22,tmp32
5129 real (kind=kind_phys) :: cmfm, chfh, cm2fm2, ch2fh2
5135 if(zlvl <= zpd)
then
5136 write(*,*)
'critical problem: zlvl <= zpd; model stops'
5139 errmsg =
"stop in noah-mp"
5142 call wrf_error_fatal(
"stop in noah-mp")
5146 tmpcm = log((zlvl-zpd) / z0m)
5147 tmpch = log((zlvl-zpd) / z0h)
5148 tmpcm2 = log((2.0 + z0m) / z0m)
5149 tmpch2 = log((2.0 + z0h) / z0h)
5157 tvir = (1. + 0.61*qair) * sfctmp
5158 tmp1 = vkc * (grav/tvir) * h/(rhoair*cpair)
5159 if (abs(tmp1) .le. mpe) tmp1 = mpe
5160 mol = -1. * fv**3 / tmp1
5161 moz = min( (zlvl-zpd)/mol, 1.)
5162 moz2 = min( (2.0 + z0h)/mol, 1.)
5167 if (mozold*moz .lt. 0.) mozsgn = mozsgn+1
5168 if (mozsgn .ge. 2)
then
5178 if (moz .lt. 0.)
then
5179 tmp1 = (1. - 16.*moz)**0.25
5180 tmp2 = log((1.+tmp1*tmp1)/2.)
5181 tmp3 = log((1.+tmp1)/2.)
5182 fmnew = 2.*tmp3 + tmp2 - 2.*atan(tmp1) + 1.5707963
5186 tmp12 = (1. - 16.*moz2)**0.25
5187 tmp22 = log((1.+tmp12*tmp12)/2.)
5188 tmp32 = log((1.+tmp12)/2.)
5189 fm2new = 2.*tmp32 + tmp22 - 2.*atan(tmp12) + 1.5707963
5207 fm = 0.5 * (fm+fmnew)
5208 fh = 0.5 * (fh+fhnew)
5209 fm2 = 0.5 * (fm2+fm2new)
5210 fh2 = 0.5 * (fh2+fh2new)
5215 fh = min(fh,0.9*tmpch)
5216 fm = min(fm,0.9*tmpcm)
5217 fh2 = min(fh2,0.9*tmpch2)
5218 fm2 = min(fm2,0.9*tmpcm2)
5224 if(abs(cmfm) <= mpe) cmfm = mpe
5225 if(abs(chfh) <= mpe) chfh = mpe
5226 if(abs(cm2fm2) <= mpe) cm2fm2 = mpe
5227 if(abs(ch2fh2) <= mpe) ch2fh2 = mpe
5228 cm = vkc*vkc/(cmfm*cmfm)
5229 ch = vkc*vkc/(cmfm*chfh)
5230 ch2 = vkc*vkc/(cm2fm2*ch2fh2)
5244 subroutine sfcdif2(parameters,iter ,z0 ,thz0 ,thlm ,sfcspd , & !in
5245 zlm ,iloc ,jloc , & !in
5246 akms ,akhs ,rlmo ,wstar2 , & !in
5256 type (noahmp_parameters),
intent(in) :: parameters
5257 integer,
intent(in) :: iloc
5258 integer,
intent(in) :: jloc
5259 integer,
intent(in) :: iter
5260 real (kind=kind_phys),
intent(in) :: zlm, z0, thz0, thlm, sfcspd
5261 real (kind=kind_phys),
intent(inout) :: akms
5262 real (kind=kind_phys),
intent(inout) :: akhs
5263 real (kind=kind_phys),
intent(inout) :: rlmo
5264 real (kind=kind_phys),
intent(inout) :: wstar2
5265 real (kind=kind_phys),
intent(inout) :: ustar
5267 real (kind=kind_phys) zz, pslmu, pslms, pslhu, pslhs
5268 real (kind=kind_phys) xx, pspmu, yy, pspms, psphu, psphs
5269 real (kind=kind_phys) zilfc, zu, zt, rdz, cxch
5270 real (kind=kind_phys) dthv, du2, btgh, zslu, zslt, rlogu, rlogt
5271 real (kind=kind_phys) zetalt, zetalu, zetau, zetat, xlu4, xlt4, xu4, xt4
5273 real (kind=kind_phys) xlu, xlt, xu, xt, psmz, simm, pshz, simh, ustark, rlmn, &
5278 integer,
parameter :: itrmx = 5
5279 real (kind=kind_phys),
parameter :: wwst = 1.2
5280 real (kind=kind_phys),
parameter :: wwst2 = wwst * wwst
5281 real (kind=kind_phys),
parameter :: vkrm = 0.40
5282 real (kind=kind_phys),
parameter :: excm = 0.001
5283 real (kind=kind_phys),
parameter :: beta = 1.0 / 270.0
5284 real (kind=kind_phys),
parameter :: btg = beta * grav
5285 real (kind=kind_phys),
parameter :: elfc = vkrm * btg
5286 real (kind=kind_phys),
parameter :: wold = 0.15
5287 real (kind=kind_phys),
parameter :: wnew = 1.0 - wold
5288 real (kind=kind_phys),
parameter :: pihf = 3.14159265 / 2.
5289 real (kind=kind_phys),
parameter :: epsu2 = 1.e-4
5290 real (kind=kind_phys),
parameter :: epsust = 0.07
5291 real (kind=kind_phys),
parameter :: epsit = 1.e-4
5292 real (kind=kind_phys),
parameter :: epsa = 1.e-8
5293 real (kind=kind_phys),
parameter :: ztmin = -5.0
5294 real (kind=kind_phys),
parameter :: ztmax = 1.0
5295 real (kind=kind_phys),
parameter :: hpbl = 1000.0
5296 real (kind=kind_phys),
parameter :: sqvisc = 258.2
5297 real (kind=kind_phys),
parameter :: ric = 0.183
5298 real (kind=kind_phys),
parameter :: rric = 1.0 / ric
5299 real (kind=kind_phys),
parameter :: fhneu = 0.8
5300 real (kind=kind_phys),
parameter :: rfc = 0.191
5301 real (kind=kind_phys),
parameter :: rfac = ric / ( fhneu * rfc * rfc )
5307 pslmu(zz)= -0.96* log(1.0-4.5* zz)
5308 pslms(zz)= zz * rric -2.076* (1. -1./ (zz +1.))
5309 pslhu(zz)= -0.96* log(1.0-4.5* zz)
5310 pslhs(zz)= zz * rfac -2.076* (1. -1./ (zz +1.))
5312 pspmu(xx)= -2.* log( (xx +1.)*0.5) - log( (xx * xx +1.)*0.5) &
5316 psphu(xx)= -2.* log( (xx * xx +1.)*0.5)
5329 zilfc = - parameters%czil * vkrm * sqvisc
5336 du2 = max(sfcspd * sfcspd,epsu2)
5340 if (btgh * akhs * dthv .ne. 0.0)
then
5341 wstar2 = wwst2* abs(btgh * akhs * dthv)** (2./3.)
5345 ustar = max(sqrt(akms * sqrt(du2+ wstar2)),epsust)
5346 rlmo = elfc * akhs * dthv / ustar **3
5350 zt = max(1.e-6,exp(zilfc * sqrt(ustar * z0))* z0)
5353 rlogu = log(zslu / zu)
5354 rlogt = log(zslt / zt)
5359 zetalt = max(zslt * rlmo,ztmin)
5360 rlmo = zetalt / zslt
5361 zetalu = zslu * rlmo
5365 if (ilech .eq. 0)
then
5366 if (rlmo .lt. 0.)
then
5367 xlu4 = 1. -16.* zetalu
5368 xlt4 = 1. -16.* zetalt
5369 xu4 = 1. -16.* zetau
5370 xt4 = 1. -16.* zetat
5371 xlu = sqrt(sqrt(xlu4))
5372 xlt = sqrt(sqrt(xlt4))
5373 xu = sqrt(sqrt(xu4))
5375 xt = sqrt(sqrt(xt4))
5377 simm = pspmu(xlu) - psmz + rlogu
5379 simh = psphu(xlt) - pshz + rlogt
5381 zetalu = min(zetalu,ztmax)
5382 zetalt = min(zetalt,ztmax)
5383 zetau = min(zetau,ztmax/(zslu/zu))
5384 zetat = min(zetat,ztmax/(zslt/zt))
5386 simm = pspms(zetalu) - psmz + rlogu
5388 simh = psphs(zetalt) - pshz + rlogt
5394 if (rlmo .lt. 0.)
then
5396 simm = pslmu(zetalu) - psmz + rlogu
5398 simh = pslhu(zetalt) - pshz + rlogt
5400 zetalu = min(zetalu,ztmax)
5401 zetalt = min(zetalt,ztmax)
5403 simm = pslms(zetalu) - psmz + rlogu
5405 simh = pslhs(zetalt) - pshz + rlogt
5413 ustar = max(sqrt(akms * sqrt(du2+ wstar2)),epsust)
5416 zt = max(1.e-6,exp(zilfc * sqrt(ustar * z0))* z0)
5419 rlogt = log(zslt / zt)
5420 ustark = ustar * vkrm
5421 if(simm < 1.e-6) simm = 1.e-6
5422 akms = max(ustark / simm,cxch)
5426 if(simh < 1.e-6) simh = 1.e-6
5427 akhs = max(ustark / simh,cxch)
5429 if (btgh * akhs * dthv .ne. 0.0)
then
5430 wstar2 = wwst2* abs(btgh * akhs * dthv)** (2./3.)
5435 rlmn = elfc * akhs * dthv / ustar **3
5439 rlma = rlmo * wold+ rlmn * wnew
5452 subroutine sfcdif3(parameters,iloc ,jloc ,iter ,sfctmp ,qair ,ur , & !in
5453 zlvl ,tgb ,thsfc_loc,prslkix,prsik1x ,prslk1x ,z0m , & !in
5454 z0h,zpd ,snowh ,fveg ,garea1 , & !in
5455 ustarx ,fm ,fh ,fm2 ,fh2 , & !inout
5465 type (noahmp_parameters),
intent(in) :: parameters
5466 integer,
intent(in ) :: iloc
5467 integer,
intent(in ) :: jloc
5468 integer,
intent(in ) :: iter
5469 real (kind=kind_phys),
intent(in ) :: sfctmp
5470 real (kind=kind_phys),
intent(in ) :: qair
5471 real (kind=kind_phys),
intent(in ) :: ur
5472 real (kind=kind_phys),
intent(in ) :: zlvl
5473 real (kind=kind_phys),
intent(in ) :: tgb
5474 logical,
intent(in ) :: thsfc_loc
5475 real (kind=kind_phys),
intent(in ) :: prslkix
5476 real (kind=kind_phys),
intent(in ) :: prsik1x
5477 real (kind=kind_phys),
intent(in ) :: prslk1x
5478 real (kind=kind_phys),
intent(in ) :: z0m
5479 real (kind=kind_phys),
intent(in ) :: z0h
5480 real (kind=kind_phys),
intent(in ) :: zpd
5481 real (kind=kind_phys),
intent(in ) :: snowh
5482 real (kind=kind_phys),
intent(in ) :: fveg
5483 real (kind=kind_phys),
intent(in ) :: garea1
5484 real (kind=kind_phys),
intent(inout) :: ustarx
5485 real (kind=kind_phys),
intent(inout) :: fm
5486 real (kind=kind_phys),
intent(inout) :: fh
5487 real (kind=kind_phys),
intent(inout) :: fm2
5488 real (kind=kind_phys),
intent(inout) :: fh2
5489 real (kind=kind_phys),
intent( out) :: fv
5490 real (kind=kind_phys),
intent( out) :: cm
5491 real (kind=kind_phys),
intent( out) :: ch
5493 real (kind=kind_phys) :: snwd
5494 real (kind=kind_phys) :: zlvlb
5495 real (kind=kind_phys) :: virtfac
5496 real (kind=kind_phys) :: tv1
5497 real (kind=kind_phys) :: thv1
5498 real (kind=kind_phys) :: tvs
5499 real (kind=kind_phys) :: rb1
5500 real (kind=kind_phys) :: stress1
5501 real (kind=kind_phys) :: fm10
5502 real (kind=kind_phys) :: tem1,tem2,zvfun1,gdx
5503 real (kind=kind_phys),
parameter :: z0lo=0.1, z0up=1.0
5513 virtfac = 1.0 + 0.61 * max(qair, 1.0e-8)
5514 tv1 = sfctmp * virtfac
5517 thv1 = sfctmp * prslkix * virtfac
5519 thv1 = sfctmp / prslk1x * virtfac
5522 tem1 = (z0m - z0lo) / (z0up - z0lo)
5523 tem1 = min(max(tem1, 0.0_kind_phys), 1.0_kind_phys)
5524 tem2 = max(fveg, 0.1_kind_phys)
5525 zvfun1 = sqrt(tem1 * tem2)
5534 tvs = tgb/prsik1x * virtfac
5537 call gfs_stability (zlvlb, zvfun1, gdx, tv1, thv1, ur, z0m, z0h, tvs, grav, thsfc_loc, &
5538 rb1, fm,fh,fm10,fh2,cm,ch,stress1,fv)
5544subroutine gfs_stability &
5546 ( z1, zvfun, gdx, tv1, thv1, wind, z0max, ztmax, tvs, grav, &
5549 rb, fm, fh, fm10, fh2, cm, ch, stress, ustar)
5555real(kind=kind_phys),
parameter :: ca=0.4_kind_phys
5557real(kind=kind_phys),
intent(in) :: z1
5558real(kind=kind_phys),
intent(in) :: zvfun
5559real(kind=kind_phys),
intent(in) :: gdx
5560real(kind=kind_phys),
intent(in) :: tv1
5561real(kind=kind_phys),
intent(in) :: thv1
5562real(kind=kind_phys),
intent(in) :: wind
5563real(kind=kind_phys),
intent(in) :: z0max
5564real(kind=kind_phys),
intent(in) :: ztmax
5565real(kind=kind_phys),
intent(in) :: tvs
5566real(kind=kind_phys),
intent(in) :: grav
5567logical,
intent(in) :: thsfc_loc
5569real(kind=kind_phys),
intent(out) :: rb
5570real(kind=kind_phys),
intent(out) :: fm
5571real(kind=kind_phys),
intent(out) :: fh
5572real(kind=kind_phys),
intent(out) :: fm10
5573real(kind=kind_phys),
intent(out) :: fh2
5574real(kind=kind_phys),
intent(out) :: cm
5575real(kind=kind_phys),
intent(out) :: ch
5576real(kind=kind_phys),
intent(out) :: stress
5577real(kind=kind_phys),
intent(out) :: ustar
5580real(kind=kind_phys),
parameter :: a0 = -3.975
5581real(kind=kind_phys),
parameter :: a1 = 12.32
5582real(kind=kind_phys),
parameter :: b1 = -7.755
5583real(kind=kind_phys),
parameter :: b2 = 6.041
5584real(kind=kind_phys),
parameter :: a0p = -7.941
5585real(kind=kind_phys),
parameter :: a1p = 24.75
5586real(kind=kind_phys),
parameter :: b1p = -8.705
5587real(kind=kind_phys),
parameter :: b2p = 7.899
5589real(kind=kind_phys),
parameter :: alpha = 5.0
5590real(kind=kind_phys),
parameter :: alpha4 = 4.0 * alpha
5591real(kind=kind_phys),
parameter :: xkrefsqr = 0.3
5592real(kind=kind_phys),
parameter :: xkmin = 0.05
5593real(kind=kind_phys),
parameter :: xkgdx = 3000.0
5594real(kind=kind_phys),
parameter :: zolmin = -10.0
5595real(kind=kind_phys),
parameter :: zero = 0.0
5596real(kind=kind_phys),
parameter :: one = 1.0
5598real(kind=kind_phys) :: aa
5599real(kind=kind_phys) :: aa0
5600real(kind=kind_phys) :: bb
5601real(kind=kind_phys) :: bb0
5602real(kind=kind_phys) :: dtv
5603real(kind=kind_phys) :: adtv
5604real(kind=kind_phys) :: hl1
5605real(kind=kind_phys) :: hl12
5606real(kind=kind_phys) :: pm
5607real(kind=kind_phys) :: ph
5608real(kind=kind_phys) :: pm10
5609real(kind=kind_phys) :: ph2
5610real(kind=kind_phys) :: z1i
5611real(kind=kind_phys) :: fms
5612real(kind=kind_phys) :: fhs
5613real(kind=kind_phys) :: hl0
5614real(kind=kind_phys) :: hl0inf
5615real(kind=kind_phys) :: hlinf
5616real(kind=kind_phys) :: hl110
5617real(kind=kind_phys) :: hlt
5618real(kind=kind_phys) :: hltinf
5619real(kind=kind_phys) :: olinf
5620real(kind=kind_phys) :: tem1
5621real(kind=kind_phys) :: tem2
5622real(kind=kind_phys) :: zolmax
5624real(kind=kind_phys) xkzo
5634if(gdx >= xkgdx)
then
5643 xkzo = min(max(tem2, xkmin), xkzo)
5646zolmax = xkrefsqr / sqrt(xkzo)
5651 adtv = max(abs(dtv),0.001_kind_phys)
5652 dtv = sign(1.0_kind_phys,dtv) * adtv
5655 rb = max(-5000.0_kind_phys, (grav+grav) * dtv * z1 &
5656 / ((thv1 + tvs) * wind * wind))
5658 rb = max(-5000.0_kind_phys, grav * dtv * z1 &
5659 / (tv1 * wind * wind))
5664 fm = log((z0max+z1) * tem1)
5665 fh = log((ztmax+z1) * tem2)
5666 fm10 = log((z0max+10.0_kind_phys) * tem1)
5667 fh2 = log((ztmax+2.0_kind_phys) * tem2)
5668 hlinf = rb * fm * fm / fh
5669 hlinf = min(max(hlinf,zolmin),zolmax)
5673 if (dtv >= zero)
then
5675 if(hlinf > 0.25_kind_phys)
then
5677 hl0inf = z0max * tem1
5678 hltinf = ztmax * tem1
5679 aa = sqrt(one + alpha4 * hlinf)
5680 aa0 = sqrt(one + alpha4 * hl0inf)
5682 bb0 = sqrt(one + alpha4 * hltinf)
5683 pm = aa0 - aa + log( (aa + one)/(aa0 + one) )
5684 ph = bb0 - bb + log( (bb + one)/(bb0 + one) )
5687 hl1 = fms * fms * rb / fhs
5688 hl1 = min(hl1, zolmax)
5696 aa = sqrt(one + alpha4 * hl1)
5697 aa0 = sqrt(one + alpha4 * hl0)
5699 bb0 = sqrt(one + alpha4 * hlt)
5700 pm = aa0 - aa + log( (one+aa)/(one+aa0) )
5701 ph = bb0 - bb + log( (one+bb)/(one+bb0) )
5702 hl110 = hl1 * 10.0_kind_phys * z1i
5703 aa = sqrt(one + alpha4 * hl110)
5704 pm10 = aa0 - aa + log( (one+aa)/(one+aa0) )
5705 hl12 = (hl1+hl1) * z1i
5707 bb = sqrt(one + alpha4 * hl12)
5708 ph2 = bb0 - bb + log( (one+bb)/(one+bb0) )
5716 tem1 = 50.0_kind_phys * z0max
5717 if(abs(olinf) <= tem1)
then
5719 hlinf = max(hlinf, zolmin)
5724 if (hlinf >= -0.5_kind_phys)
then
5726 pm = (a0 + a1*hl1) * hl1 / (one+ (b1+b2*hl1) *hl1)
5727 ph = (a0p + a1p*hl1) * hl1 / (one+ (b1p+b2p*hl1)*hl1)
5728 hl110 = hl1 * 10.0_kind_phys * z1i
5729 pm10 = (a0 + a1*hl110) * hl110/(one+(b1+b2*hl110)*hl110)
5730 hl12 = (hl1+hl1) * z1i
5731 ph2 = (a0p + a1p*hl12) * hl12/(one+(b1p+b2p*hl12)*hl12)
5734 tem1 = one / sqrt(hl1)
5735 pm = log(hl1) + 2.0_kind_phys * sqrt(tem1) - 0.8776_kind_phys
5736 ph = log(hl1) + 0.5_kind_phys * tem1 + 1.386_kind_phys
5737 hl110 = hl1 * 10.0_kind_phys * z1i
5738 pm10 = log(hl110) + 2.0_kind_phys/sqrt(sqrt(hl110)) - 0.8776_kind_phys
5739 hl12 = (hl1+hl1) * z1i
5740 ph2 = log(hl12) + 0.5_kind_phys / sqrt(hl12) + 1.386_kind_phys
5751 cm = ca * ca / (fm * fm)
5752 ch = ca * ca / (fm * fh)
5753 tem1 = 0.00001_kind_phys/z1
5756 stress = cm * wind * wind
5757 ustar = sqrt(stress)
5761 end subroutine gfs_stability
5770 subroutine thermalz0(parameters, fveg, z0m, z0mg, zlvl, zpd, ezpd, & !in
5771 ustarx, vegtyp, vaie, ur, c_sigma_f0, c_sigma_f1, a1, & !in
5772 cdmn_v, cdmn_g, surface_flag, & !in
5781 type (noahmp_parameters),
intent(in ) :: parameters
5782 integer ,
intent(in ) :: vegtyp
5783 integer ,
intent(in ) :: surface_flag
5784 real (kind=kind_phys),
intent(in ) :: fveg
5785 real (kind=kind_phys),
intent(in ) :: z0m
5786 real (kind=kind_phys),
intent(in ) :: z0mg
5787 real (kind=kind_phys),
intent(in ) :: zlvl
5788 real (kind=kind_phys),
intent(in ) :: zpd
5789 real (kind=kind_phys),
intent(in ) :: ezpd
5790 real (kind=kind_phys),
intent(in ) :: ustarx
5791 real (kind=kind_phys),
intent(in ) :: vaie
5792 real (kind=kind_phys),
intent(in ) :: ur
5793 real (kind=kind_phys),
intent(in ) :: a1
5794 real (kind=kind_phys),
intent(in ) :: cdmn_v
5795 real (kind=kind_phys),
intent(in ) :: cdmn_g
5796 real (kind=kind_phys),
intent(inout) :: c_sigma_f0
5797 real (kind=kind_phys),
intent(inout) :: c_sigma_f1
5798 real (kind=kind_phys),
intent(out ) :: z0m_out
5799 real (kind=kind_phys),
intent(out ) :: z0h_out
5802 real (kind=kind_phys) :: czil
5803 real (kind=kind_phys) :: coeff_a
5804 real (kind=kind_phys) :: coeff_b
5805 real (kind=kind_phys) :: c_sigma_fveg
5806 real (kind=kind_phys) :: g_sigma
5807 real (kind=kind_phys) :: sigma_a
5808 real (kind=kind_phys) :: cdmn
5809 real (kind=kind_phys) :: reyn
5810 real (kind=kind_phys) :: kb_sigma_f0
5811 real (kind=kind_phys) :: kb_sigma_f1
5812 real (kind=kind_phys) :: kb_sigma_fveg
5814 integer,
parameter :: bare_flag = 0, vegetated_flag = 1, composite_flag = 2
5815 integer,
parameter :: z0heqz0m = 1, &
5819 real (kind=kind_phys),
parameter :: blumel_gamma = 0.5, &
5820 blumel_zeta = 1.0, &
5836 surface_flag_select :
select case(surface_flag)
5838 case (composite_flag)
5840 if (opt_trs == z0heqz0m)
then
5843 z0m_out = fveg * z0m + (1.0 - fveg) * z0mg
5846 elseif (opt_trs == chen09)
then
5849 z0m_out = fveg * z0m + (1.0 - fveg) * z0mg
5850 czil = 10.0 ** (- 0.4 * parameters%hvt)
5852 reyn = ustarx*z0m_out/viscosity
5853 if (reyn > 2.0)
then
5854 kb_sigma_f0 = 2.46*reyn**0.25 - log(7.4)
5856 kb_sigma_f0 = - log(0.397)
5859 z0h_out = exp( fveg * log(z0m * exp(-czil*0.4*258.2*sqrt(ustarx*z0m))) + &
5860 (1.0 - fveg) * log(max(z0mg/exp(kb_sigma_f0),1.0e-6)) )
5862 elseif (opt_trs == tessel)
then
5864 z0m_out = exp(fveg * log(z0m) + (1.0 - fveg) * log(z0mg))
5865 if (vegtyp <= 5)
then
5866 z0h_out = fveg * log(z0m) + (1.0 - fveg) * log(z0mg * 0.1)
5868 z0h_out = fveg * log(z0m * 0.01) + (1.0 - fveg) * log(z0mg * 0.1)
5871 elseif (opt_trs == blumel99)
then
5873 coeff_a = (c_sigma_f0 - c_sigma_f1)/(1.0 - exp(-1.0*a1))
5874 coeff_b = c_sigma_f0 - coeff_a
5875 c_sigma_fveg = coeff_a * exp(-1.0*a1*fveg) + coeff_b
5882 g_sigma = fveg**blumel_gamma + fveg*(1.0-fveg)*blumel_zeta
5883 cdmn = g_sigma*cdmn_v + (1.0-g_sigma)*cdmn_g
5884 z0m_out = (zlvl - ezpd)*exp(-0.4/sqrt(cdmn))
5885 kb_sigma_fveg = c_sigma_fveg/log((zlvl-ezpd)/z0m_out) - &
5886 log((zlvl-ezpd)/z0m_out)
5887 z0h_out = z0m_out/exp(kb_sigma_fveg)
5895 if (opt_trs == z0heqz0m)
then
5899 elseif (opt_trs == tessel)
then
5901 if (vegtyp <= 5)
then
5904 z0h_out = z0m_out * 0.01
5907 elseif (opt_trs == chen09 .or. opt_trs == blumel99)
then
5909 reyn = ustarx*z0m_out/viscosity
5910 if (reyn > 2.0)
then
5911 kb_sigma_f0 = 2.46*reyn**0.25 - log(7.4)
5913 kb_sigma_f0 = - log(0.397)
5916 z0h_out = max(z0m_out/exp(kb_sigma_f0),1.0e-6)
5917 c_sigma_f0 = log((zlvl-zpd)/z0m_out) * &
5918 (log((zlvl-zpd)/z0m_out) + kb_sigma_f0)
5922 case (vegetated_flag)
5926 if (opt_trs == z0heqz0m)
then
5930 elseif (opt_trs == chen09)
then
5932 czil = 10.0 ** (- 0.4 * parameters%hvt)
5933 z0h_out = z0m_out * exp(-czil*0.4*258.2*sqrt(ustarx*z0m_out))
5935 elseif (opt_trs == tessel)
then
5937 if (vegtyp <= 5)
then
5940 z0h_out = z0m_out*0.01
5943 elseif (opt_trs == blumel99)
then
5945 sigma_a = 1.0 - (0.5/(0.5+vaie)) * exp(-vaie**2/8.0)
5946 kb_sigma_f1 = 16.4 * (sigma_a*vaie**3)**(-0.25) * &
5947 sqrt(parameters%dleaf*ur/log((zlvl-zpd)/z0m_out))
5948 z0h_out = z0m_out/exp(kb_sigma_f1)
5949 c_sigma_f1 = log((zlvl-zpd)/z0m_out)*(log((zlvl-zpd)/z0m_out)+kb_sigma_f1)
5953 end select surface_flag_select
5962 subroutine esat(t, esw, esi, desw, desi)
5970 real (kind=kind_phys),
intent(in) :: t
5974 real (kind=kind_phys),
intent(out) :: esw
5975 real (kind=kind_phys),
intent(out) :: esi
5976 real (kind=kind_phys),
intent(out) :: desw
5977 real (kind=kind_phys),
intent(out) :: desi
5981 real (kind=kind_phys) :: a0,a1,a2,a3,a4,a5,a6
5982 real (kind=kind_phys) :: b0,b1,b2,b3,b4,b5,b6
5983 real (kind=kind_phys) :: c0,c1,c2,c3,c4,c5,c6
5984 real (kind=kind_phys) :: d0,d1,d2,d3,d4,d5,d6
5986 parameter(a0=6.107799961 , a1=4.436518521e-01, &
5987 a2=1.428945805e-02, a3=2.650648471e-04, &
5988 a4=3.031240396e-06, a5=2.034080948e-08, &
5991 parameter(b0=6.109177956 , b1=5.034698970e-01, &
5992 b2=1.886013408e-02, b3=4.176223716e-04, &
5993 b4=5.824720280e-06, b5=4.838803174e-08, &
5996 parameter(c0= 4.438099984e-01, c1=2.857002636e-02, &
5997 c2= 7.938054040e-04, c3=1.215215065e-05, &
5998 c4= 1.036561403e-07, c5=3.532421810e-10, &
5999 c6=-7.090244804e-13)
6001 parameter(d0=5.030305237e-01, d1=3.773255020e-02, &
6002 d2=1.267995369e-03, d3=2.477563108e-05, &
6003 d4=3.005693132e-07, d5=2.158542548e-09, &
6006 esw = 100.*(a0+t*(a1+t*(a2+t*(a3+t*(a4+t*(a5+t*a6))))))
6007 esi = 100.*(b0+t*(b1+t*(b2+t*(b3+t*(b4+t*(b5+t*b6))))))
6008 desw = 100.*(c0+t*(c1+t*(c2+t*(c3+t*(c4+t*(c5+t*c6))))))
6009 desi = 100.*(d0+t*(d1+t*(d2+t*(d3+t*(d4+t*(d5+t*d6))))))
6017 subroutine stomata (parameters,vegtyp ,mpe ,apar ,foln ,iloc , jloc, & !in
6018 tv ,ei ,ea ,sfctmp ,sfcprs , & !in
6019 o2 ,co2 ,igs ,btran ,rb , & !in
6025 type (noahmp_parameters),
intent(in) :: parameters
6026 integer,
intent(in) :: iloc
6027 integer,
intent(in) :: jloc
6028 integer,
intent(in) :: vegtyp
6030 real (kind=kind_phys),
intent(in) :: igs
6031 real (kind=kind_phys),
intent(in) :: mpe
6033 real (kind=kind_phys),
intent(in) :: tv
6034 real (kind=kind_phys),
intent(in) :: ei
6035 real (kind=kind_phys),
intent(in) :: ea
6036 real (kind=kind_phys),
intent(in) :: apar
6037 real (kind=kind_phys),
intent(in) :: o2
6038 real (kind=kind_phys),
intent(in) :: co2
6039 real (kind=kind_phys),
intent(in) :: sfcprs
6040 real (kind=kind_phys),
intent(in) :: sfctmp
6041 real (kind=kind_phys),
intent(in) :: btran
6042 real (kind=kind_phys),
intent(in) :: foln
6043 real (kind=kind_phys),
intent(in) :: rb
6046 real (kind=kind_phys),
intent(out) :: rs
6047 real (kind=kind_phys),
intent(out) :: psn
6050 real (kind=kind_phys) :: rlb
6060 real (kind=kind_phys) :: ab
6061 real (kind=kind_phys) :: bc
6062 real (kind=kind_phys) :: f1
6063 real (kind=kind_phys) :: f2
6064 real (kind=kind_phys) :: tc
6065 real (kind=kind_phys) :: cs
6066 real (kind=kind_phys) :: kc
6067 real (kind=kind_phys) :: ko
6068 real (kind=kind_phys) :: a,b,c,q
6069 real (kind=kind_phys) :: r1,r2
6070 real (kind=kind_phys) :: fnf
6071 real (kind=kind_phys) :: ppf
6072 real (kind=kind_phys) :: wc
6073 real (kind=kind_phys) :: wj
6074 real (kind=kind_phys) :: we
6075 real (kind=kind_phys) :: cp
6076 real (kind=kind_phys) :: ci
6077 real (kind=kind_phys) :: awc
6078 real (kind=kind_phys) :: vcmx
6079 real (kind=kind_phys) :: j
6080 real (kind=kind_phys) :: cea
6081 real (kind=kind_phys) :: cf
6083 f1(ab,bc) = ab**((bc-25.)/10.)
6084 f2(ab) = 1. + exp((-2.2e05+710.*(ab+273.16))/(8.314*(ab+273.16)))
6085 real (kind=kind_phys) :: t
6091 cf = sfcprs/(8.314*sfctmp)*1.e06
6092 rs = 1./parameters%bp * cf
6095 if (apar .le. 0.)
return
6097 fnf = min( foln/max(mpe,parameters%folnmx), 1.0 )
6100 j = ppf*parameters%qe25
6101 kc = parameters%kc25 * f1(parameters%akc,tc)
6102 ko = parameters%ko25 * f1(parameters%ako,tc)
6103 awc = kc * (1.+o2/ko)
6104 cp = 0.5*kc/ko*o2*0.21
6105 vcmx = parameters%vcmx25 / f2(tc) * fnf * btran * f1(parameters%avcmx,tc)
6109 ci = 0.7*co2*parameters%c3psn + 0.4*co2*(1.-parameters%c3psn)
6117 cea = max(0.25*ei*parameters%c3psn+0.40*ei*(1.-parameters%c3psn), min(ea,ei) )
6122 wj = max(ci-cp,0.)*j/(ci+2.*cp)*parameters%c3psn + j*(1.-parameters%c3psn)
6123 wc = max(ci-cp,0.)*vcmx/(ci+awc)*parameters%c3psn + vcmx*(1.-parameters%c3psn)
6124 we = 0.5*vcmx*parameters%c3psn + 4000.*vcmx*ci/sfcprs*(1.-parameters%c3psn)
6125 psn = min(wj,wc,we) * igs
6127 cs = max( co2-1.37*rlb*sfcprs*psn, mpe )
6128 a = parameters%mp*psn*sfcprs*cea / (cs*ei) + parameters%bp
6129 b = ( parameters%mp*psn*sfcprs/cs + parameters%bp ) * rlb - 1.
6132 q = -0.5*( b + sqrt(b*b-4.*a*c) )
6134 q = -0.5*( b - sqrt(b*b-4.*a*c) )
6139 ci = max( cs-psn*sfcprs*1.65*rs, 0. )
6155 subroutine canres (parameters,ep_2,epsm1,par ,sfctmp,rcsoil ,eah ,sfcprs , & !in
6156 rc ,psn ,iloc ,jloc )
6174 type (noahmp_parameters),
intent(in) :: parameters
6175 integer,
intent(in) :: iloc
6176 integer,
intent(in) :: jloc
6177 real (kind=kind_phys),
intent(in) :: ep_2
6178 real (kind=kind_phys),
intent(in) :: epsm1
6179 real (kind=kind_phys),
intent(in) :: par
6180 real (kind=kind_phys),
intent(in) :: sfctmp
6181 real (kind=kind_phys),
intent(in) :: sfcprs
6182 real (kind=kind_phys),
intent(in) :: eah
6183 real (kind=kind_phys),
intent(in) :: rcsoil
6187 real (kind=kind_phys),
intent(out) :: rc
6188 real (kind=kind_phys),
intent(out) :: psn
6192 real (kind=kind_phys) :: rcq
6193 real (kind=kind_phys) :: rcs
6194 real (kind=kind_phys) :: rct
6195 real (kind=kind_phys) :: ff
6196 real (kind=kind_phys) :: q2
6197 real (kind=kind_phys) :: q2sat
6198 real (kind=kind_phys) :: dqsdt2
6211 q2 = ep_2 * eah / (sfcprs + epsm1 * eah)
6212 q2 = q2 / (1.0 - q2)
6214 call calhum(parameters,sfctmp, sfcprs, q2sat, dqsdt2)
6218 ff = 2.0 * par / parameters%rgl
6219 rcs = (ff + parameters%rsmin / parameters%rsmax) / (1.0+ ff)
6220 rcs = max(rcs,0.0001)
6224 rct = 1.0- 0.0016* ( (parameters%topt - sfctmp)**2.0)
6225 rct = max(rct,0.0001)
6229 rcq = 1.0/ (1.0+ parameters%hs * max(0.,q2sat-q2))
6234 rc = parameters%rsmin / (rcs * rct * rcq * rcsoil)
6243 subroutine calhum(parameters,sfctmp, sfcprs, q2sat, dqsdt2)
6247 type (noahmp_parameters),
intent(in) :: parameters
6248 real (kind=kind_phys),
intent(in) :: sfctmp, sfcprs
6249 real (kind=kind_phys),
intent(out) :: q2sat, dqsdt2
6250 real (kind=kind_phys),
parameter :: a2=17.67,a3=273.15,a4=29.65, elwv=2.501e6, &
6251 a23m4=a2*(a3-a4), e0=0.611, rv=461.0, &
6253 real (kind=kind_phys) :: es, sfcprsx
6256 es = e0 * exp( elwv/rv*(1./a3 - 1./sfctmp) )
6258 sfcprsx = sfcprs*1.e-3
6259 q2sat = epsilon * es / (sfcprsx-es)
6261 q2sat = q2sat * 1.e3
6265 dqsdt2=(q2sat/(1+q2sat))*a23m4/(sfctmp-a4)**2
6268 q2sat = q2sat / 1.e3
6279 subroutine tsnosoi (parameters,ice ,nsoil ,nsnow ,isnow ,ist , & !in
6280 tbot ,zsnso ,ssoil ,df ,hcpct , & !in
6281 sag ,dt ,snowh ,dzsnso , & !in
6282 tg ,iloc ,jloc , & !in
6284 stc ,errmsg ,errflg)
6297 type (noahmp_parameters),
intent(in) :: parameters
6298 integer,
intent(in) :: iloc
6299 integer,
intent(in) :: jloc
6300 integer,
intent(in) :: ice
6301 integer,
intent(in) :: nsoil
6302 integer,
intent(in) :: nsnow
6303 integer,
intent(in) :: isnow
6304 integer,
intent(in) :: ist
6306 real (kind=kind_phys),
intent(in) :: dt
6307 real (kind=kind_phys),
intent(in) :: tbot
6308 real (kind=kind_phys),
intent(in) :: ssoil
6309 real (kind=kind_phys),
intent(in) :: sag
6310 real (kind=kind_phys),
intent(in) :: snowh
6311 real (kind=kind_phys),
intent(in) :: tg
6312 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: zsnso
6313 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: dzsnso
6314 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: df
6315 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: hcpct
6319 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: stc
6321 character(len=*) ,
intent(inout) :: errmsg
6322 integer ,
intent(inout) :: errflg
6328 real (kind=kind_phys) :: zbotsno
6329 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: ai, bi, ci, rhsts
6330 real (kind=kind_phys) :: eflxb
6331 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: phi
6333 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: tbeg
6334 real (kind=kind_phys) :: err_est
6335 real (kind=kind_phys) :: ssoil2
6336 real (kind=kind_phys) :: eflxb2
6337 character(len=256) :: message
6341 phi(isnow+1:nsoil) = 0.
6345 zbotsno = parameters%zbot - snowh
6349 do iz = isnow+1, nsoil
6355 call hrt (parameters,nsnow ,nsoil ,isnow ,zsnso , &
6356 stc ,tbot ,zbotsno ,dt , &
6357 df ,hcpct ,ssoil ,phi , &
6358 ai ,bi ,ci ,rhsts , &
6361 call hstep (parameters,nsnow ,nsoil ,isnow ,dt , &
6362 ai ,bi ,ci ,rhsts , &
6368 if(opt_tbot == 1)
then
6370 else if(opt_tbot == 2)
then
6371 eflxb2 = df(nsoil)*(tbot-stc(nsoil)) / &
6372 (0.5*(zsnso(nsoil-1)+zsnso(nsoil)) - zbotsno)
6382 do iz = isnow+1, nsoil
6383 err_est = err_est + (stc(iz)-tbeg(iz)) * dzsnso(iz) * hcpct(iz) / dt
6386 if (opt_stc == 1 .or. opt_stc == 3)
then
6387 err_est = err_est - (ssoil +eflxb)
6389 ssoil2 = df(isnow+1)*(tg-stc(isnow+1))/(0.5*dzsnso(isnow+1))
6390 err_est = err_est - (ssoil2+eflxb2)
6393 if (abs(err_est) > 1.)
then
6394 write(message,*)
'tsnosoi is losing(-)/gaining(+) false energy',err_est,
' w/m2'
6396 errmsg = trim(message)
6398 call wrf_message(trim(message))
6400 write(message,
'(i6,1x,i6,1x,i3,f18.13,5f20.12)') &
6401 iloc, jloc, ist,err_est,ssoil,snowh,tg,stc(isnow+1),eflxb
6403 errmsg = trim(errmsg)//new_line(
'A')//trim(message)
6405 call wrf_message(trim(message))
6418 subroutine hrt (parameters,nsnow ,nsoil ,isnow ,zsnso , &
6419 stc ,tbot ,zbot ,dt , &
6420 df ,hcpct ,ssoil ,phi , &
6421 ai ,bi ,ci ,rhsts , &
6433 type (noahmp_parameters),
intent(in) :: parameters
6434 integer,
intent(in) :: nsoil
6435 integer,
intent(in) :: nsnow
6436 integer,
intent(in) :: isnow
6437 real (kind=kind_phys),
intent(in) :: tbot
6438 real (kind=kind_phys),
intent(in) :: zbot
6440 real (kind=kind_phys),
intent(in) :: dt
6441 real (kind=kind_phys),
intent(in) :: ssoil
6442 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: zsnso
6443 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: stc
6444 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: df
6445 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: hcpct
6446 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: phi
6450 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(out) :: rhsts
6451 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(out) :: ai
6452 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(out) :: bi
6453 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(out) :: ci
6454 real (kind=kind_phys),
intent(out) :: botflx
6459 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: ddz
6460 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: dz
6461 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: denom
6462 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: dtsdz
6463 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: eflux
6464 real (kind=kind_phys) :: temp1
6467 do k = isnow+1, nsoil
6468 if (k == isnow+1)
then
6469 denom(k) = - zsnso(k) * hcpct(k)
6470 temp1 = - zsnso(k+1)
6471 ddz(k) = 2.0 / temp1
6472 dtsdz(k) = 2.0 * (stc(k) - stc(k+1)) / temp1
6473 eflux(k) = df(k) * dtsdz(k) - ssoil - phi(k)
6474 else if (k < nsoil)
then
6475 denom(k) = (zsnso(k-1) - zsnso(k)) * hcpct(k)
6476 temp1 = zsnso(k-1) - zsnso(k+1)
6477 ddz(k) = 2.0 / temp1
6478 dtsdz(k) = 2.0 * (stc(k) - stc(k+1)) / temp1
6479 eflux(k) = (df(k)*dtsdz(k) - df(k-1)*dtsdz(k-1)) - phi(k)
6480 else if (k == nsoil)
then
6481 denom(k) = (zsnso(k-1) - zsnso(k)) * hcpct(k)
6482 temp1 = zsnso(k-1) - zsnso(k)
6483 if(opt_tbot == 1)
then
6486 if(opt_tbot == 2)
then
6487 dtsdz(k) = (stc(k) - tbot) / ( 0.5*(zsnso(k-1)+zsnso(k)) - zbot)
6488 botflx = -df(k) * dtsdz(k)
6490 eflux(k) = (-botflx - df(k-1)*dtsdz(k-1) ) - phi(k)
6494 do k = isnow+1, nsoil
6495 if (k == isnow+1)
then
6497 ci(k) = - df(k) * ddz(k) / denom(k)
6498 if (opt_stc == 1 .or. opt_stc == 3 )
then
6501 if (opt_stc == 2)
then
6502 bi(k) = - ci(k) + df(k)/(0.5*zsnso(k)*zsnso(k)*hcpct(k))
6504 else if (k < nsoil)
then
6505 ai(k) = - df(k-1) * ddz(k-1) / denom(k)
6506 ci(k) = - df(k ) * ddz(k ) / denom(k)
6507 bi(k) = - (ai(k) + ci(k))
6508 else if (k == nsoil)
then
6509 ai(k) = - df(k-1) * ddz(k-1) / denom(k)
6511 bi(k) = - (ai(k) + ci(k))
6513 rhsts(k) = eflux(k)/ (-denom(k))
6522 subroutine hstep (parameters,nsnow ,nsoil ,isnow ,dt , &
6523 ai ,bi ,ci ,rhsts , &
6532 type (noahmp_parameters),
intent(in) :: parameters
6533 integer,
intent(in) :: nsoil
6534 integer,
intent(in) :: nsnow
6535 integer,
intent(in) :: isnow
6536 real (kind=kind_phys),
intent(in) :: dt
6539 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: rhsts
6540 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: ai
6541 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: bi
6542 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: ci
6543 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: stc
6547 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: rhstsin
6548 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: ciin
6551 do k = isnow+1,nsoil
6552 rhsts(k) = rhsts(k) * dt
6554 bi(k) = 1. + bi(k) * dt
6560 do k = isnow+1,nsoil
6561 rhstsin(k) = rhsts(k)
6567 call rosr12 (ci,ai,bi,ciin,rhstsin,rhsts,isnow+1,nsoil,nsnow)
6571 do k = isnow+1,nsoil
6572 stc(k) = stc(k) + ci(k)
6575 end subroutine hstep
6581 subroutine rosr12 (p,a,b,c,d,delta,ntop,nsoil,nsnow)
6602 integer,
intent(in) :: ntop
6603 integer,
intent(in) :: nsoil,nsnow
6606 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in):: a, b, d
6607 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout):: c,p,delta
6613 p(ntop) = - c(ntop) / b(ntop)
6617 delta(ntop) = d(ntop) / b(ntop)
6622 p(k) = - c(k) * ( 1.0 / (b(k) + a(k) * p(k -1)) )
6623 delta(k) = (d(k) - a(k)* delta(k -1))* (1.0/ (b(k) + a(k)&
6629 p(nsoil) = delta(nsoil)
6634 kk = nsoil - k + (ntop-1) + 1
6635 p(kk) = p(kk) * p(kk +1) + delta(kk)
6644 subroutine phasechange (parameters,nsnow ,nsoil ,isnow ,dt ,fact , & !in
6645 dzsnso ,hcpct ,ist ,iloc ,jloc , & !in
6646 stc ,snice ,snliq ,sneqv ,snowh , & !inout
6648 smc ,sh2o ,errmsg ,errflg , & !inout
6650 smc ,sh2o , & !inout
6652 qmelt ,imelt ,ponding )
6660 type (noahmp_parameters),
intent(in) :: parameters
6661 integer,
intent(in) :: iloc
6662 integer,
intent(in) :: jloc
6663 integer,
intent(in) :: nsnow
6664 integer,
intent(in) :: nsoil
6665 integer,
intent(in) :: isnow
6666 integer,
intent(in) :: ist
6667 real (kind=kind_phys),
intent(in) :: dt
6668 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: fact
6669 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: dzsnso
6670 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: hcpct
6673 integer,
dimension(-nsnow+1:nsoil),
intent(out) :: imelt
6674 real (kind=kind_phys),
intent(out) :: qmelt
6675 real (kind=kind_phys),
intent(out) :: ponding
6679 real (kind=kind_phys),
intent(inout) :: sneqv
6680 real (kind=kind_phys),
intent(inout) :: snowh
6681 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: stc
6682 real (kind=kind_phys),
dimension( 1:nsoil),
intent(inout) :: sh2o
6683 real (kind=kind_phys),
dimension( 1:nsoil),
intent(inout) :: smc
6684 real (kind=kind_phys),
dimension(-nsnow+1:0) ,
intent(inout) :: snice
6685 real (kind=kind_phys),
dimension(-nsnow+1:0) ,
intent(inout) :: snliq
6687 character(len=*) ,
intent(inout) :: errmsg
6688 integer ,
intent(inout) :: errflg
6694 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: hm
6695 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: xm
6696 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: wmass0
6697 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: wice0
6698 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: wliq0
6699 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: mice
6700 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: mliq
6701 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: supercool
6702 real (kind=kind_phys) :: heatr
6703 real (kind=kind_phys) :: temp1
6704 real (kind=kind_phys) :: propor
6705 real (kind=kind_phys) :: smp
6706 real (kind=kind_phys) :: xmf
6715 do j = -nsnow+1, nsoil
6725 mliq(j) = sh2o(j) * dzsnso(j) * 1000.
6726 mice(j) = (smc(j) - sh2o(j)) * dzsnso(j) * 1000.
6729 do j = isnow+1,nsoil
6735 wmass0(j) = mice(j) + mliq(j)
6740 if (opt_frz == 1)
then
6741 if(stc(j) < tfrz)
then
6742 smp = hfus*(tfrz-stc(j))/(grav*stc(j))
6743 supercool(j) = parameters%smcmax(j)*(smp/parameters%psisat(j))**(-1./parameters%bexp(j))
6744 supercool(j) = supercool(j)*dzsnso(j)*1000.
6747 if (opt_frz == 2)
then
6749 call frh2o (parameters,j,supercool(j),stc(j),smc(j),sh2o(j),errmsg,errflg)
6750 if (errflg /=0)
return
6752 call frh2o (parameters,j,supercool(j),stc(j),smc(j),sh2o(j))
6754 supercool(j) = supercool(j)*dzsnso(j)*1000.
6759 do j = isnow+1,nsoil
6760 if (mice(j) > 0. .and. stc(j) >= tfrz)
then
6763 if (mliq(j) > supercool(j) .and. stc(j) < tfrz)
then
6768 if (isnow == 0 .and. sneqv > 0. .and. j == 1)
then
6769 if (stc(j) >= tfrz)
then
6777 do j = isnow+1,nsoil
6778 if (imelt(j) > 0)
then
6779 hm(j) = (stc(j)-tfrz)/fact(j)
6783 if (imelt(j) == 1 .and. hm(j) < 0.)
then
6787 if (imelt(j) == 2 .and. hm(j) > 0.)
then
6791 xm(j) = hm(j)*dt/hfus
6796 if (isnow == 0 .and. sneqv > 0. .and. xm(1) > 0.)
then
6798 sneqv = max(0.,temp1-xm(1))
6799 propor = sneqv/temp1
6800 snowh = max(0.,propor * snowh)
6801 snowh = min(max(snowh,sneqv/500.0),sneqv/50.0)
6802 heatr = hm(1) - hfus*(temp1-sneqv)/dt
6803 if (heatr > 0.)
then
6804 xm(1) = heatr*dt/hfus
6810 qmelt = max(0.,(temp1-sneqv))/dt
6812 ponding = temp1-sneqv
6817 do j = isnow+1,nsoil
6818 if (imelt(j) > 0 .and. abs(hm(j)) > 0.)
then
6821 if (xm(j) > 0.)
then
6822 mice(j) = max(0., wice0(j)-xm(j))
6823 heatr = hm(j) - hfus*(wice0(j)-mice(j))/dt
6824 else if (xm(j) < 0.)
then
6826 mice(j) = min(wmass0(j), wice0(j)-xm(j))
6828 if (wmass0(j) < supercool(j))
then
6831 mice(j) = min(wmass0(j) - supercool(j),wice0(j)-xm(j))
6832 mice(j) = max(mice(j),0.0)
6835 heatr = hm(j) - hfus*(wice0(j)-mice(j))/dt
6838 mliq(j) = max(0.,wmass0(j)-mice(j))
6840 if (abs(heatr) > 0.)
then
6841 stc(j) = stc(j) + fact(j)*heatr
6843 if (mliq(j)*mice(j)>0.) stc(j) = tfrz
6844 if (mice(j) == 0.)
then
6846 hm(j+1) = hm(j+1) + heatr
6847 xm(j+1) = hm(j+1)*dt/hfus
6852 xmf = xmf + hfus * (wice0(j)-mice(j))/dt
6855 qmelt = qmelt + max(0.,(wice0(j)-mice(j)))/dt
6866 sh2o(j) = mliq(j) / (1000. * dzsnso(j))
6867 smc(j) = (mliq(j) + mice(j)) / (1000. * dzsnso(j))
6879 subroutine frh2o (parameters,isoil,free,tkelv,smc,sh2o,&
6914 type (noahmp_parameters),
intent(in) :: parameters
6915 integer,
intent(in) :: isoil
6916 real (kind=kind_phys),
intent(in) :: sh2o,smc,tkelv
6917 real (kind=kind_phys),
intent(out) :: free
6919 character(len=*),
intent(inout) :: errmsg
6920 integer,
intent(inout) :: errflg
6922 real (kind=kind_phys) :: bx,denom,df,dswl,fk,swl,swlk
6923 integer :: nlog,kcount
6925 real (kind=kind_phys),
parameter :: ck = 8.0, blim = 5.5,
error = 0.005, &
6927 character(len=80) :: message
6934 bx = parameters%bexp(isoil)
6939 if (parameters%bexp(isoil) > blim) bx = blim
6946 if (tkelv > (tfrz- 1.e-3))
then
6960 if (swl > (smc -0.02)) swl = smc -0.02
6964 if (swl < 0.) swl = 0.
6966 if (.not.( (nlog < 10) .and. (kcount == 0)))
goto 1002
6968 df = log( ( parameters%psisat(isoil) * grav / hfus ) * ( ( 1. + ck * swl )**2.) * &
6969 ( parameters%smcmax(isoil) / (smc - swl) )** bx) - log( - ( &
6970 tkelv - tfrz)/ tkelv)
6971 denom = 2. * ck / ( 1. + ck * swl ) + bx / ( smc - swl )
6972 swlk = swl - df / denom
6976 if (swlk > (smc -0.02)) swlk = smc - 0.02
6977 if (swlk < 0.) swlk = 0.
6982 dswl = abs(swlk - swl)
6987 if ( dswl <=
error )
then
7007 if (kcount == 0)
then
7008 write(message,
'("flerchinger used in new version. iterations=", i6)') nlog
7010 errmsg = trim(message)
7012 call wrf_message(trim(message))
7014 fk = ( ( (hfus / (grav * ( - parameters%psisat(isoil))))* &
7015 ( (tkelv - tfrz)/ tkelv))** ( -1/ bx))* parameters%smcmax(isoil)
7016 if (fk < 0.02) fk = 0.02
7024 end subroutine frh2o
7034 subroutine water (parameters,vegtyp ,nsnow ,nsoil ,imelt ,dt ,uu , & !in
7035 vv ,fcev ,fctr ,qprecc ,qprecl ,elai , & !in
7036 esai ,sfctmp ,qvap ,qdew ,zsoil ,btrani , & !in
7037 ficeold,ponding,tg ,ist ,fveg ,iloc ,jloc ,smceq , & !in
7038 bdfall ,fp ,rain ,snow, & !in mb/an: v3.7
7039 qsnow ,qrain ,snowhin,latheav,latheag,frozen_canopy,frozen_ground, & !in mb
7040 isnow ,canliq ,canice ,tv ,snowh ,sneqv , & !inout
7041 snice ,snliq ,stc ,zsnso ,sh2o ,smc , & !inout
7042 sice ,zwt ,wa ,wt ,dzsnso ,wslake , & !inout
7043 smcwtd ,deeprech,rech , & !inout
7044 cmc ,ecan ,etran ,fwet ,runsrf ,runsub , & !out
7045 qin ,qdis ,ponding1 ,ponding2, &
7054 type (noahmp_parameters),
intent(in) :: parameters
7055 integer,
intent(in) :: iloc
7056 integer,
intent(in) :: jloc
7057 integer,
intent(in) :: vegtyp
7058 integer,
intent(in) :: nsnow
7059 integer ,
intent(in) :: ist
7060 integer,
intent(in) :: nsoil
7061 integer,
dimension(-nsnow+1:0) ,
intent(in) :: imelt
7062 real (kind=kind_phys),
intent(in) :: dt
7063 real (kind=kind_phys),
intent(in) :: uu
7064 real (kind=kind_phys),
intent(in) :: vv
7065 real (kind=kind_phys),
intent(in) :: fcev
7066 real (kind=kind_phys),
intent(in) :: fctr
7067 real (kind=kind_phys),
intent(in) :: qprecc
7068 real (kind=kind_phys),
intent(in) :: qprecl
7069 real (kind=kind_phys),
intent(in) :: elai
7070 real (kind=kind_phys),
intent(in) :: esai
7071 real (kind=kind_phys),
intent(in) :: sfctmp
7072 real (kind=kind_phys),
intent(in) :: qvap
7073 real (kind=kind_phys),
intent(in) :: qdew
7074 real (kind=kind_phys),
dimension( 1:nsoil),
intent(in) :: zsoil
7075 real (kind=kind_phys),
dimension( 1:nsoil),
intent(in) :: btrani
7076 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(in) :: ficeold
7078 real (kind=kind_phys) ,
intent(in) :: tg
7079 real (kind=kind_phys) ,
intent(in) :: fveg
7080 real (kind=kind_phys) ,
intent(in) :: bdfall
7081 real (kind=kind_phys) ,
intent(in) :: fp
7082 real (kind=kind_phys) ,
intent(in) :: rain
7083 real (kind=kind_phys) ,
intent(in) :: snow
7084 real (kind=kind_phys),
dimension( 1:nsoil),
intent(in) :: smceq
7085 real (kind=kind_phys) ,
intent(in) :: qsnow
7086 real (kind=kind_phys) ,
intent(in) :: qrain
7087 real (kind=kind_phys) ,
intent(in) :: snowhin
7090 integer,
intent(inout) :: isnow
7091 real (kind=kind_phys),
intent(inout) :: canliq
7092 real (kind=kind_phys),
intent(inout) :: canice
7093 real (kind=kind_phys),
intent(inout) :: tv
7094 real (kind=kind_phys),
intent(inout) :: snowh
7095 real (kind=kind_phys),
intent(inout) :: sneqv
7096 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(inout) :: snice
7097 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(inout) :: snliq
7098 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: stc
7099 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: zsnso
7100 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: dzsnso
7101 real (kind=kind_phys),
dimension( 1:nsoil),
intent(inout) :: sh2o
7102 real (kind=kind_phys),
dimension( 1:nsoil),
intent(inout) :: sice
7103 real (kind=kind_phys),
dimension( 1:nsoil),
intent(inout) :: smc
7104 real (kind=kind_phys),
intent(inout) :: zwt
7105 real (kind=kind_phys),
intent(inout) :: wa
7106 real (kind=kind_phys),
intent(inout) :: wt
7108 real (kind=kind_phys),
intent(inout) :: wslake
7109 real (kind=kind_phys) ,
intent(inout) :: ponding
7110 real (kind=kind_phys),
intent(inout) :: smcwtd
7111 real (kind=kind_phys),
intent(inout) :: deeprech
7112 real (kind=kind_phys),
intent(inout) :: rech
7115 real (kind=kind_phys),
intent(out) :: cmc
7116 real (kind=kind_phys),
intent(out) :: ecan
7117 real (kind=kind_phys),
intent(out) :: etran
7118 real (kind=kind_phys),
intent(out) :: fwet
7119 real (kind=kind_phys),
intent(out) :: runsrf
7120 real (kind=kind_phys),
intent(out) :: runsub
7121 real (kind=kind_phys),
intent(out) :: qin
7122 real (kind=kind_phys),
intent(out) :: qdis
7123 real (kind=kind_phys),
intent(out) :: ponding1
7124 real (kind=kind_phys),
intent(out) :: ponding2
7125 real (kind=kind_phys),
intent(out) :: esnow
7126 real (kind=kind_phys),
intent(out) :: qsnbot
7127 real (kind=kind_phys) ,
intent(in) :: latheav
7128 real (kind=kind_phys) ,
intent(in) :: latheag
7129 logical ,
intent(in) :: frozen_ground
7130 logical ,
intent(in) :: frozen_canopy
7135 real (kind=kind_phys) :: qinsur
7136 real (kind=kind_phys) :: qseva
7137 real (kind=kind_phys) :: qsdew
7138 real (kind=kind_phys) :: qsnfro
7139 real (kind=kind_phys) :: qsnsub
7140 real (kind=kind_phys),
dimension( 1:nsoil) :: etrani
7141 real (kind=kind_phys),
dimension( 1:nsoil) :: wcnd
7142 real (kind=kind_phys) :: qdrain
7143 real (kind=kind_phys) :: snoflow
7144 real (kind=kind_phys) :: fcrmax
7146 real (kind=kind_phys),
parameter :: wslmax = 5000.
7152 etrani(1:nsoil) = 0.
7159 call canwater (parameters,vegtyp ,dt , &
7160 fcev ,fctr ,elai , &
7161 esai ,tg ,fveg ,iloc , jloc, &
7162 bdfall ,frozen_canopy , &
7163 canliq ,canice ,tv , &
7164 cmc ,ecan ,etran , &
7170 if (sneqv > 0.)
then
7171 qsnsub = min(qvap, sneqv/dt)
7177 if (sneqv > 0.)
then
7180 qsdew = qdew - qsnfro
7182 call snowwater (parameters,nsnow ,nsoil ,imelt ,dt ,zsoil , &
7183 & sfctmp ,snowhin,qsnow ,qsnfro ,qsnsub , &
7184 & qrain ,ficeold,iloc ,jloc , &
7185 & isnow ,snowh ,sneqv ,snice ,snliq , &
7186 & sh2o ,sice ,stc ,zsnso ,dzsnso , &
7187 & qsnbot ,snoflow,ponding1 ,ponding2)
7189 if(frozen_ground)
then
7190 sice(1) = sice(1) + (qsdew-qseva)*dt/(dzsnso(1)*1000.)
7193 if(sice(1) < 0.)
then
7194 sh2o(1) = sh2o(1) + sice(1)
7202 qinsur = (ponding+ponding1+ponding2)/dt * 0.001
7206 qinsur = qinsur+(qsnbot + qsdew + qrain) * 0.001
7208 qinsur = qinsur+(qsnbot + qsdew) * 0.001
7211 qseva = qseva * 0.001
7213 do iz = 1, parameters%nroot
7214 etrani(iz) = etran * btrani(iz) * 0.001
7222 if(wslake >= wslmax) runsrf = qinsur*1000.
7223 wslake = wslake + (qinsur-qseva)*1000.*dt -runsrf*dt
7225 call soilwater (parameters,nsoil ,nsnow ,dt ,zsoil ,dzsnso , &
7226 qinsur ,qseva ,etrani ,sice ,iloc , jloc , &
7227 sh2o ,smc ,zwt ,vegtyp , &
7228 smcwtd, deeprech , &
7229 runsrf ,qdrain ,runsub ,wcnd ,fcrmax )
7231 if(opt_run == 1)
then
7232 call groundwater (parameters,nsnow ,nsoil ,dt ,sice ,zsoil , &
7233 stc ,wcnd ,fcrmax ,iloc ,jloc , &
7234 sh2o ,zwt ,wa ,wt , &
7239 if(opt_run == 3 .or. opt_run == 4)
then
7240 runsub = runsub + qdrain
7244 smc(iz) = sh2o(iz) + sice(iz)
7247 if(opt_run == 5)
then
7249 dzsnso ,smceq ,iloc , jloc , &
7250 smc ,zwt ,smcwtd ,rech, qdrain )
7252 sh2o(nsoil) = smc(nsoil) - sice(nsoil)
7253 runsub = runsub + qdrain
7259 runsub = runsub + snoflow
7261 end subroutine water
7268 fcev ,fctr ,elai , & !in
7269 esai ,tg ,fveg ,iloc , jloc , & !in
7270 bdfall ,frozen_canopy , & !in
7271 canliq ,canice ,tv , & !inout
7272 cmc ,ecan ,etran , & !out
7281 type (noahmp_parameters),
intent(in) :: parameters
7282 integer,
intent(in) :: iloc
7283 integer,
intent(in) :: jloc
7284 integer,
intent(in) :: vegtyp
7285 real (kind=kind_phys),
intent(in) :: dt
7286 real (kind=kind_phys),
intent(in) :: fcev
7287 real (kind=kind_phys),
intent(in) :: fctr
7288 real (kind=kind_phys),
intent(in) :: elai
7289 real (kind=kind_phys),
intent(in) :: esai
7290 real (kind=kind_phys),
intent(in) :: tg
7291 real (kind=kind_phys),
intent(in) :: fveg
7292 logical ,
intent(in) :: frozen_canopy
7293 real (kind=kind_phys),
intent(in) :: bdfall
7296 real (kind=kind_phys),
intent(inout) :: canliq
7297 real (kind=kind_phys),
intent(inout) :: canice
7298 real (kind=kind_phys),
intent(inout) :: tv
7301 real (kind=kind_phys),
intent(out) :: cmc
7302 real (kind=kind_phys),
intent(out) :: ecan
7303 real (kind=kind_phys),
intent(out) :: etran
7304 real (kind=kind_phys),
intent(out) :: fwet
7308 real (kind=kind_phys) :: maxsno
7309 real (kind=kind_phys) :: maxliq
7310 real (kind=kind_phys) :: qevac
7311 real (kind=kind_phys) :: qdewc
7312 real (kind=kind_phys) :: qfroc
7313 real (kind=kind_phys) :: qsubc
7314 real (kind=kind_phys) :: qmeltc
7315 real (kind=kind_phys) :: qfrzc
7316 real (kind=kind_phys) :: canmas
7325 maxliq = parameters%ch2op * (elai+ esai)
7329 if (.not.frozen_canopy)
then
7330 etran = max( fctr/hvap, 0. )
7331 qevac = max( fcev/hvap, 0. )
7332 qdewc = abs( min( fcev/hvap, 0. ) )
7336 etran = max( fctr/hsub, 0. )
7339 qsubc = max( fcev/hsub, 0. )
7340 qfroc = abs( min( fcev/hsub, 0. ) )
7346 qevac = min(canliq/dt,qevac)
7347 canliq=max(0.,canliq+(qdewc-qevac)*dt)
7348 if(canliq <= 1.e-06) canliq = 0.0
7353 maxsno = 6.6*(0.27+46./bdfall) * (elai+ esai)
7355 qsubc = min(canice/dt,qsubc)
7356 canice= max(0.,canice + (qfroc-qsubc)*dt)
7357 if(canice.le.1.e-6) canice = 0.
7361 if(canice.gt.0.)
then
7362 fwet = max(0.,canice) / max(maxsno,1.e-06)
7364 fwet = max(0.,canliq) / max(maxliq,1.e-06)
7366 fwet = min(fwet, 1.) ** 0.667
7373 if(canice.gt.1.e-6.and.tv.gt.tfrz)
then
7374 qmeltc = min(canice/dt,(tv-tfrz)*cice*canice/denice/(dt*hfus))
7375 canice = max(0.,canice - qmeltc*dt)
7376 canliq = max(0.,canliq + qmeltc*dt)
7377 tv = fwet*tfrz + (1.-fwet)*tv
7380 if(canliq.gt.1.e-6.and.tv.lt.tfrz)
then
7381 qfrzc = min(canliq/dt,(tfrz-tv)*cwat*canliq/denh2o/(dt*hfus))
7382 canliq = max(0.,canliq - qfrzc*dt)
7383 canice = max(0.,canice + qfrzc*dt)
7384 tv = fwet*tfrz + (1.-fwet)*tv
7389 cmc = canliq + canice
7393 ecan = qevac + qsubc - qdewc - qfroc
7401 subroutine snowwater (parameters,nsnow ,nsoil ,imelt ,dt ,zsoil , & !in
7402 sfctmp ,snowhin,qsnow ,qsnfro ,qsnsub , & !in
7403 qrain ,ficeold,iloc ,jloc , & !in
7404 isnow ,snowh ,sneqv ,snice ,snliq , & !inout
7405 sh2o ,sice ,stc ,zsnso ,dzsnso , & !inout
7406 qsnbot ,snoflow,ponding1 ,ponding2)
7411 type (noahmp_parameters),
intent(in) :: parameters
7412 integer,
intent(in) :: iloc
7413 integer,
intent(in) :: jloc
7414 integer,
intent(in) :: nsnow
7415 integer,
intent(in) :: nsoil
7416 integer,
dimension(-nsnow+1:0) ,
intent(in) :: imelt
7417 real (kind=kind_phys),
intent(in) :: dt
7418 real (kind=kind_phys),
dimension( 1:nsoil),
intent(in) :: zsoil
7419 real (kind=kind_phys),
intent(in) :: sfctmp
7420 real (kind=kind_phys),
intent(in) :: snowhin
7421 real (kind=kind_phys),
intent(in) :: qsnow
7422 real (kind=kind_phys),
intent(in) :: qsnfro
7423 real (kind=kind_phys),
intent(in) :: qsnsub
7424 real (kind=kind_phys),
intent(in) :: qrain
7425 real (kind=kind_phys),
dimension(-nsnow+1:0) ,
intent(in) :: ficeold
7428 integer,
intent(inout) :: isnow
7429 real (kind=kind_phys),
intent(inout) :: snowh
7430 real (kind=kind_phys),
intent(inout) :: sneqv
7431 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(inout) :: snice
7432 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(inout) :: snliq
7433 real (kind=kind_phys),
dimension( 1:nsoil),
intent(inout) :: sh2o
7434 real (kind=kind_phys),
dimension( 1:nsoil),
intent(inout) :: sice
7435 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: stc
7436 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: zsnso
7437 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: dzsnso
7440 real (kind=kind_phys),
intent(out) :: qsnbot
7441 real (kind=kind_phys),
intent(out) :: snoflow
7442 real (kind=kind_phys),
intent(out) :: ponding1
7443 real (kind=kind_phys),
intent(out) :: ponding2
7447 real (kind=kind_phys) :: bdsnow
7453 call snowfall (parameters,nsoil ,nsnow ,dt ,qsnow ,snowhin, &
7454 sfctmp ,iloc ,jloc , &
7455 isnow ,snowh ,dzsnso ,stc ,snice , &
7461 call compact (parameters,nsnow ,nsoil ,dt ,stc ,snice , &
7462 snliq ,zsoil ,imelt ,ficeold,iloc , jloc ,&
7463 isnow ,dzsnso ,zsnso )
7466 call combine (parameters,nsnow ,nsoil ,iloc ,jloc , &
7467 isnow ,sh2o ,stc ,snice ,snliq , &
7468 dzsnso ,sice ,snowh ,sneqv , &
7472 call divide (parameters,nsnow ,nsoil , &
7473 isnow ,stc ,snice ,snliq ,dzsnso )
7475 call snowh2o (parameters,nsnow ,nsoil ,dt ,qsnfro ,qsnsub , &
7476 qrain ,iloc ,jloc , &
7477 isnow ,dzsnso ,snowh ,sneqv ,snice , &
7478 snliq ,sh2o ,sice ,stc , &
7479 qsnbot ,ponding1 ,ponding2)
7483 do iz = -nsnow+1, isnow
7493 if(sneqv > 5000.)
then
7494 bdsnow = snice(0) / dzsnso(0)
7495 snoflow = (sneqv - 5000.)
7496 snice(0) = snice(0) - snoflow
7497 dzsnso(0) = dzsnso(0) - snoflow/bdsnow
7498 snoflow = snoflow / dt
7507 sneqv = sneqv + snice(iz) + snliq(iz)
7508 snowh = snowh + dzsnso(iz)
7515 dzsnso(iz) = -dzsnso(iz)
7518 dzsnso(1) = zsoil(1)
7520 dzsnso(iz) = (zsoil(iz) - zsoil(iz-1))
7523 zsnso(isnow+1) = dzsnso(isnow+1)
7524 do iz = isnow+2 ,nsoil
7525 zsnso(iz) = zsnso(iz-1) + dzsnso(iz)
7528 do iz = isnow+1 ,nsoil
7529 dzsnso(iz) = -dzsnso(iz)
7539 subroutine snowfall (parameters,nsoil ,nsnow ,dt ,qsnow ,snowhin , & !in
7540 sfctmp ,iloc ,jloc , & !in
7541 isnow ,snowh ,dzsnso ,stc ,snice , & !inout
7551 type (noahmp_parameters),
intent(in) :: parameters
7552 integer,
intent(in) :: iloc
7553 integer,
intent(in) :: jloc
7554 integer,
intent(in) :: nsoil
7555 integer,
intent(in) :: nsnow
7556 real (kind=kind_phys),
intent(in) :: dt
7557 real (kind=kind_phys),
intent(in) :: qsnow
7558 real (kind=kind_phys),
intent(in) :: snowhin
7559 real (kind=kind_phys),
intent(in) :: sfctmp
7563 integer,
intent(inout) :: isnow
7564 real (kind=kind_phys),
intent(inout) :: snowh
7565 real (kind=kind_phys),
intent(inout) :: sneqv
7566 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: dzsnso
7567 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: stc
7568 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(inout) :: snice
7569 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(inout) :: snliq
7579 if(isnow == 0 .and. qsnow > 0.)
then
7580 snowh = snowh + snowhin * dt
7581 sneqv = sneqv + qsnow * dt
7586 if(isnow == 0 .and. qsnow>0. .and. snowh >= 0.025)
then
7592 stc(0) = min(273.16, sfctmp)
7599 if(isnow < 0 .and. newnode == 0 .and. qsnow > 0.)
then
7600 snice(isnow+1) = snice(isnow+1) + qsnow * dt
7601 dzsnso(isnow+1) = dzsnso(isnow+1) + snowhin * dt
7611 subroutine combine (parameters,nsnow ,nsoil ,iloc ,jloc , & !in
7612 isnow ,sh2o ,stc ,snice ,snliq , & !inout
7613 dzsnso ,sice ,snowh ,sneqv , & !inout
7620 type (noahmp_parameters),
intent(in) :: parameters
7621 integer,
intent(in) :: iloc
7622 integer,
intent(in) :: jloc
7623 integer,
intent(in) :: nsnow
7624 integer,
intent(in) :: nsoil
7628 integer,
intent(inout) :: isnow
7629 real (kind=kind_phys),
dimension( 1:nsoil),
intent(inout) :: sh2o
7630 real (kind=kind_phys),
dimension( 1:nsoil),
intent(inout) :: sice
7631 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: stc
7632 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(inout) :: snice
7633 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(inout) :: snliq
7634 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: dzsnso
7635 real (kind=kind_phys),
intent(inout) :: sneqv
7636 real (kind=kind_phys),
intent(inout) :: snowh
7637 real (kind=kind_phys),
intent(out) :: ponding1
7638 real (kind=kind_phys),
intent(out) :: ponding2
7643 integer :: isnow_old
7646 real (kind=kind_phys) :: zwice
7647 real (kind=kind_phys) :: zwliq
7649 real (kind=kind_phys) :: dzmin(3)
7651 data dzmin /0.025, 0.025, 0.1/
7656 do j = isnow_old+1,0
7657 if (snice(j) <= .1)
then
7659 snliq(j+1) = snliq(j+1) + snliq(j)
7660 snice(j+1) = snice(j+1) + snice(j)
7661 dzsnso(j+1) = dzsnso(j+1) + dzsnso(j)
7663 if (isnow_old < -1)
then
7664 snliq(j-1) = snliq(j-1) + snliq(j)
7665 snice(j-1) = snice(j-1) + snice(j)
7666 dzsnso(j-1) = dzsnso(j-1) + dzsnso(j)
7668 if(snice(j) >= 0.)
then
7673 ponding1 = snliq(j) + snice(j)
7674 if(ponding1 < 0.)
then
7675 sice(1) = max(0.0,sice(1)+ponding1/(dzsnso(1)*1000.))
7690 if (j > isnow+1 .and. isnow < -1)
then
7691 do i = j, isnow+2, -1
7693 snliq(i) = snliq(i-1)
7694 snice(i) = snice(i-1)
7695 dzsnso(i)= dzsnso(i-1)
7704 if(sice(1) < 0.)
then
7705 sh2o(1) = sh2o(1) + sice(1)
7709 if(isnow ==0)
return
7717 sneqv = sneqv + snice(j) + snliq(j)
7718 snowh = snowh + dzsnso(j)
7719 zwice = zwice + snice(j)
7720 zwliq = zwliq + snliq(j)
7726 if (snowh < 0.025 .and. isnow < 0 )
then
7731 if(sneqv <= 0.) snowh = 0.
7743 if (isnow < -1)
then
7748 do i = isnow_old+1,0
7749 if (dzsnso(i) < dzmin(mssi))
then
7751 if (i == isnow+1)
then
7753 else if (i == 0)
then
7757 if ((dzsnso(i-1)+dzsnso(i)) < (dzsnso(i+1)+dzsnso(i))) neibor = i-1
7761 if (neibor > i)
then
7769 call combo (parameters,dzsnso(j), snliq(j), snice(j), &
7770 stc(j), dzsnso(l), snliq(l), snice(l), stc(l) )
7773 if (j-1 > isnow+1)
then
7774 do k = j-1, isnow+2, -1
7776 snice(k) = snice(k-1)
7777 snliq(k) = snliq(k-1)
7778 dzsnso(k) = dzsnso(k-1)
7784 if (isnow >= -1)
exit
7801 subroutine divide (parameters,nsnow ,nsoil , & !in
7802 isnow ,stc ,snice ,snliq ,dzsnso )
7808 type (noahmp_parameters),
intent(in) :: parameters
7809 integer,
intent(in) :: nsnow
7810 integer,
intent(in) :: nsoil
7814 integer ,
intent(inout) :: isnow
7815 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: stc
7816 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(inout) :: snice
7817 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(inout) :: snliq
7818 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: dzsnso
7824 real (kind=kind_phys) :: drr
7825 real (kind=kind_phys),
dimension( 1:nsnow) :: dz
7826 real (kind=kind_phys),
dimension( 1:nsnow) :: swice
7827 real (kind=kind_phys),
dimension( 1:nsnow) :: swliq
7828 real (kind=kind_phys),
dimension( 1:nsnow) :: tsno
7829 real (kind=kind_phys) :: zwice
7830 real (kind=kind_phys) :: zwliq
7831 real (kind=kind_phys) :: propor
7832 real (kind=kind_phys) :: dtdz
7836 if (j <= abs(isnow))
then
7837 dz(j) = dzsnso(j+isnow)
7838 swice(j) = snice(j+isnow)
7839 swliq(j) = snliq(j+isnow)
7840 tsno(j) = stc(j+isnow)
7848 if (dz(1) > 0.05)
then
7851 swice(1) = swice(1)/2.
7852 swliq(1) = swliq(1)/2.
7861 if (dz(1) > 0.05)
then
7864 zwice = propor*swice(1)
7865 zwliq = propor*swliq(1)
7867 swice(1) = propor*swice(1)
7868 swliq(1) = propor*swliq(1)
7871 call combo (parameters,dz(2), swliq(2), swice(2), tsno(2), drr, &
7872 zwliq, zwice, tsno(1))
7875 if (msno <= 2 .and. dz(2) > 0.20)
then
7878 dtdz = (tsno(1) - tsno(2))/((dz(1)+dz(2))/2.)
7880 swice(2) = swice(2)/2.
7881 swliq(2) = swliq(2)/2.
7885 tsno(3) = tsno(2) - dtdz*dz(2)/2.
7886 if (tsno(3) >= tfrz)
then
7889 tsno(2) = tsno(2) + dtdz*dz(2)/2.
7897 if (dz(2) > 0.2)
then
7900 zwice = propor*swice(2)
7901 zwliq = propor*swliq(2)
7903 swice(2) = propor*swice(2)
7904 swliq(2) = propor*swliq(2)
7906 call combo (parameters,dz(3), swliq(3), swice(3), tsno(3), drr, &
7907 zwliq, zwice, tsno(2))
7914 dzsnso(j) = dz(j-isnow)
7915 snice(j) = swice(j-isnow)
7916 snliq(j) = swliq(j-isnow)
7917 stc(j) = tsno(j-isnow)
7931 subroutine combo(parameters,dz, wliq, wice, t, dz2, wliq2, wice2, t2)
7939 type (noahmp_parameters),
intent(in) :: parameters
7940 real (kind=kind_phys),
intent(in) :: dz2
7941 real (kind=kind_phys),
intent(in) :: wliq2
7942 real (kind=kind_phys),
intent(in) :: wice2
7943 real (kind=kind_phys),
intent(in) :: t2
7944 real (kind=kind_phys),
intent(inout) :: dz
7945 real (kind=kind_phys),
intent(inout) :: wliq
7946 real (kind=kind_phys),
intent(inout) :: wice
7947 real (kind=kind_phys),
intent(inout) :: t
7951 real (kind=kind_phys) :: dzc
7952 real (kind=kind_phys) :: wliqc
7953 real (kind=kind_phys) :: wicec
7954 real (kind=kind_phys) :: tc
7955 real (kind=kind_phys) :: h
7956 real (kind=kind_phys) :: h2
7957 real (kind=kind_phys) :: hc
7962 wicec = (wice+wice2)
7963 wliqc = (wliq+wliq2)
7964 h = (cice*wice+cwat*wliq) * (t-tfrz)+hfus*wliq
7965 h2= (cice*wice2+cwat*wliq2) * (t2-tfrz)+hfus*wliq2
7969 tc = tfrz + hc/(cice*wicec + cwat*wliqc)
7970 else if (hc.le.hfus*wliqc)
then
7973 tc = tfrz + (hc - hfus*wliqc) / (cice*wicec + cwat*wliqc)
7981 end subroutine combo
7987 subroutine compact (parameters,nsnow ,nsoil ,dt ,stc ,snice , & !in
7988 snliq ,zsoil ,imelt ,ficeold,iloc , jloc , & !in
7989 isnow ,dzsnso ,zsnso )
7994 type (noahmp_parameters),
intent(in) :: parameters
7995 integer,
intent(in) :: iloc
7996 integer,
intent(in) :: jloc
7997 integer,
intent(in) :: nsoil
7998 integer,
intent(in) :: nsnow
7999 integer,
dimension(-nsnow+1:0) ,
intent(in) :: imelt
8000 real (kind=kind_phys),
intent(in) :: dt
8001 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: stc
8002 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(in) :: snice
8003 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(in) :: snliq
8004 real (kind=kind_phys),
dimension( 1:nsoil),
intent(in) :: zsoil
8005 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(in) :: ficeold
8008 integer,
intent(inout) :: isnow
8009 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: dzsnso
8010 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: zsnso
8013 real (kind=kind_phys),
parameter :: c2 = 21.e-3
8014 real (kind=kind_phys),
parameter :: c3 = 2.5e-6
8015 real (kind=kind_phys),
parameter :: c4 = 0.04
8016 real (kind=kind_phys),
parameter :: c5 = 2.0
8017 real (kind=kind_phys),
parameter :: dm = 100.0
8018 real (kind=kind_phys),
parameter :: eta0 = 1.8e+6
8020 real (kind=kind_phys) :: burden
8021 real (kind=kind_phys) :: ddz1
8022 real (kind=kind_phys) :: ddz2
8023 real (kind=kind_phys) :: ddz3
8024 real (kind=kind_phys) :: dexpf
8025 real (kind=kind_phys) :: td
8026 real (kind=kind_phys) :: pdzdtc
8027 real (kind=kind_phys) :: void
8028 real (kind=kind_phys) :: wx
8029 real (kind=kind_phys) :: bi
8030 real (kind=kind_phys),
dimension(-nsnow+1:0) :: fice
8039 wx = snice(j) + snliq(j)
8040 fice(j) = snice(j) / wx
8041 void = 1. - (snice(j)/denice + snliq(j)/denh2o) / dzsnso(j)
8044 if (void > 0.001 .and. snice(j) > 0.1)
then
8045 bi = snice(j) / dzsnso(j)
8046 td = max(0.,tfrz-stc(j))
8053 if (bi > dm) ddz1 = ddz1*exp(-46.0e-3*(bi-dm))
8057 if (snliq(j) > 0.01*dzsnso(j)) ddz1=ddz1*c5
8061 ddz2 = -(burden+0.5*wx)*exp(-0.08*td-c2*bi)/eta0
8065 if (imelt(j) == 1)
then
8066 ddz3 = max(0.,(ficeold(j) - fice(j))/max(1.e-6,ficeold(j)))
8074 pdzdtc = (ddz1 + ddz2 + ddz3)*dt
8075 pdzdtc = max(-0.5,pdzdtc)
8079 dzsnso(j) = dzsnso(j)*(1.+pdzdtc)
8080 dzsnso(j) = min(max(dzsnso(j),(snliq(j)+snice(j))/500.0),(snliq(j)+snice(j))/50.0)
8085 burden = burden + wx
8096 subroutine snowh2o (parameters,nsnow ,nsoil ,dt ,qsnfro ,qsnsub , & !in
8097 qrain ,iloc ,jloc , & !in
8098 isnow ,dzsnso ,snowh ,sneqv ,snice , & !inout
8099 snliq ,sh2o ,sice ,stc , & !inout
8100 qsnbot ,ponding1 ,ponding2)
8109 type (noahmp_parameters),
intent(in) :: parameters
8110 integer,
intent(in) :: iloc
8111 integer,
intent(in) :: jloc
8112 integer,
intent(in) :: nsnow
8113 integer,
intent(in) :: nsoil
8114 real (kind=kind_phys),
intent(in) :: dt
8115 real (kind=kind_phys),
intent(in) :: qsnfro
8116 real (kind=kind_phys),
intent(in) :: qsnsub
8117 real (kind=kind_phys),
intent(in) :: qrain
8121 real (kind=kind_phys),
intent(out) :: qsnbot
8125 integer,
intent(inout) :: isnow
8126 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: dzsnso
8127 real (kind=kind_phys),
intent(inout) :: snowh
8128 real (kind=kind_phys),
intent(inout) :: sneqv
8129 real (kind=kind_phys),
dimension(-nsnow+1:0),
intent(inout) :: snice
8130 real (kind=kind_phys),
dimension(-nsnow+1:0),
intent(inout) :: snliq
8131 real (kind=kind_phys),
dimension( 1:nsoil),
intent(inout) :: sh2o
8132 real (kind=kind_phys),
dimension( 1:nsoil),
intent(inout) :: sice
8133 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: stc
8138 real (kind=kind_phys) :: qin
8139 real (kind=kind_phys) :: qout
8140 real (kind=kind_phys) :: wgdif
8141 real (kind=kind_phys),
dimension(-nsnow+1:0) :: vol_liq
8142 real (kind=kind_phys),
dimension(-nsnow+1:0) :: vol_ice
8143 real (kind=kind_phys),
dimension(-nsnow+1:0) :: epore
8144 real (kind=kind_phys) :: propor, temp
8145 real (kind=kind_phys) :: ponding1, ponding2
8146 real (kind=kind_phys),
parameter :: max_liq_mass_fraction = 0.4
8151 if(sneqv == 0.)
then
8152 sice(1) = sice(1) + (qsnfro-qsnsub)*dt/(dzsnso(1)*1000.)
8153 if(sice(1) < 0.)
then
8154 sh2o(1) = sh2o(1) + sice(1)
8164 if(isnow == 0 .and. sneqv > 0.)
then
8166 sneqv = sneqv - qsnsub*dt + qsnfro*dt
8168 snowh = max(0.,propor * snowh)
8169 snowh = min(max(snowh,sneqv/500.0),sneqv/50.0)
8172 sice(1) = sice(1) + sneqv/(dzsnso(1)*1000.)
8176 if(sice(1) < 0.)
then
8177 sh2o(1) = sh2o(1) + sice(1)
8182 if(snowh <= 1.e-6 .or. sneqv <= 1.e-3)
then
8189 if ( isnow < 0 )
then
8191 wgdif = snice(isnow+1) - qsnsub*dt + qsnfro*dt
8192 snice(isnow+1) = wgdif
8193 if (wgdif < 1.e-6 .and. isnow <0)
then
8194 call combine (parameters,nsnow ,nsoil ,iloc, jloc , &
8195 isnow ,sh2o ,stc ,snice ,snliq , &
8196 dzsnso ,sice ,snowh ,sneqv , &
8197 ponding1, ponding2 )
8200 if ( isnow < 0 )
then
8201 snliq(isnow+1) = snliq(isnow+1) + qrain * dt
8202 snliq(isnow+1) = max(0., snliq(isnow+1))
8210 vol_ice(j) = min(1., snice(j)/(dzsnso(j)*denice))
8211 epore(j) = 1. - vol_ice(j)
8218 snliq(j) = snliq(j) + qin
8219 vol_liq(j) = snliq(j)/(dzsnso(j)*denh2o)
8220 qout = max(0.,(vol_liq(j)-parameters%ssi*epore(j))*dzsnso(j))
8222 qout = max((vol_liq(j)- epore(j))*dzsnso(j) , parameters%snow_ret_fac*dt*qout)
8225 snliq(j) = snliq(j) - qout
8226 if((snliq(j)/(snice(j)+snliq(j))) > max_liq_mass_fraction)
then
8227 qout = qout + (snliq(j) - max_liq_mass_fraction/(1.0 - max_liq_mass_fraction)*snice(j))
8228 snliq(j) = max_liq_mass_fraction/(1.0 - max_liq_mass_fraction)*snice(j)
8234 dzsnso(j) = min(max(dzsnso(j),(snliq(j)+snice(j))/500.0),(snliq(j)+snice(j))/50.0)
8247 subroutine soilwater (parameters,nsoil ,nsnow ,dt ,zsoil ,dzsnso , & !in
8248 qinsur ,qseva ,etrani ,sice ,iloc , jloc, & !in
8249 sh2o ,smc ,zwt ,vegtyp ,& !inout
8250 smcwtd, deeprech ,& !inout
8251 runsrf ,qdrain ,runsub ,wcnd ,fcrmax )
8260 type (noahmp_parameters),
intent(in) :: parameters
8261 integer,
intent(in) :: iloc
8262 integer,
intent(in) :: jloc
8263 integer,
intent(in) :: nsoil
8264 integer,
intent(in) :: nsnow
8265 real (kind=kind_phys),
intent(in) :: dt
8266 real (kind=kind_phys),
intent(in) :: qinsur
8267 real (kind=kind_phys),
intent(in) :: qseva
8268 real (kind=kind_phys),
dimension(1:nsoil),
intent(in) :: zsoil
8269 real (kind=kind_phys),
dimension(1:nsoil),
intent(in) :: etrani
8270 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: dzsnso
8271 real (kind=kind_phys),
dimension(1:nsoil),
intent(in) :: sice
8273 integer,
intent(in) :: vegtyp
8276 real (kind=kind_phys),
dimension(1:nsoil),
intent(inout) :: sh2o
8277 real (kind=kind_phys),
dimension(1:nsoil),
intent(inout) :: smc
8278 real (kind=kind_phys),
intent(inout) :: zwt
8279 real (kind=kind_phys),
intent(inout) :: smcwtd
8280 real (kind=kind_phys) ,
intent(inout) :: deeprech
8283 real (kind=kind_phys),
intent(out) :: qdrain
8284 real (kind=kind_phys),
intent(out) :: runsrf
8285 real (kind=kind_phys),
intent(out) :: runsub
8286 real (kind=kind_phys),
intent(out) :: fcrmax
8287 real (kind=kind_phys),
dimension(1:nsoil),
intent(out) :: wcnd
8292 real (kind=kind_phys) :: dtfine
8293 real (kind=kind_phys),
dimension(1:nsoil) :: rhstt
8294 real (kind=kind_phys),
dimension(1:nsoil) :: ai
8295 real (kind=kind_phys),
dimension(1:nsoil) :: bi
8296 real (kind=kind_phys),
dimension(1:nsoil) :: ci
8298 real (kind=kind_phys) :: fff
8299 real (kind=kind_phys) :: rsbmx
8300 real (kind=kind_phys) :: pddum
8301 real (kind=kind_phys) :: fice
8302 real (kind=kind_phys) :: wplus
8303 real (kind=kind_phys) :: rsat
8304 real (kind=kind_phys) :: sicemax
8305 real (kind=kind_phys) :: sh2omin
8306 real (kind=kind_phys) :: wtsub
8307 real (kind=kind_phys) :: mh2o
8308 real (kind=kind_phys) :: fsat
8309 real (kind=kind_phys),
dimension(1:nsoil) :: mliq
8310 real (kind=kind_phys) :: xs
8311 real (kind=kind_phys) :: watmin
8312 real (kind=kind_phys) :: qdrain_save
8313 real (kind=kind_phys) :: runsrf_save
8314 real (kind=kind_phys) :: epore
8315 real (kind=kind_phys),
dimension(1:nsoil) :: fcr
8317 real (kind=kind_phys) :: smctot
8318 real (kind=kind_phys) :: dztot
8319 real (kind=kind_phys),
parameter :: a = 4.0
8328 epore = max( 1.e-4 , ( parameters%smcmax(k) - sice(k) ) )
8329 rsat = rsat + max(0.,sh2o(k)-epore)*dzsnso(k)
8330 sh2o(k) = min(epore,sh2o(k))
8336 fice = min(1.0,sice(k)/parameters%smcmax(k))
8337 fcr(k) = max(0.0,exp(-a*(1.-fice))- exp(-a)) / &
8345 sh2omin = parameters%smcmax(1)
8347 if (sice(k) > sicemax) sicemax = sice(k)
8348 if (fcr(k) > fcrmax) fcrmax = fcr(k)
8349 if (sh2o(k) < sh2omin) sh2omin = sh2o(k)
8354 if(opt_run == 2)
then
8357 call zwteq (parameters,nsoil ,nsnow ,zsoil ,dzsnso ,sh2o ,zwt)
8358 runsub = (1.0-fcrmax) * rsbmx * exp(-parameters%timean) * exp(-fff*zwt)
8364 if ( parameters%urban_flag ) fcr(1)= 0.95
8366 if(opt_run == 1)
then
8368 fff = parameters%bexp(1) / 3.0
8370 fsat = parameters%fsatmx*exp(-0.5*fff*zwt)
8371 if(qinsur > 0.)
then
8372 runsrf = qinsur * ( (1.0-fcr(1))*fsat + fcr(1) )
8373 pddum = qinsur - runsrf
8377 if(opt_run == 5)
then
8379 fsat = parameters%fsatmx*exp(-0.5*fff*max(-2.0-zwt,0.))
8380 if(qinsur > 0.)
then
8381 runsrf = qinsur * ( (1.0-fcr(1))*fsat + fcr(1) )
8382 pddum = qinsur - runsrf
8386 if(opt_run == 2)
then
8388 fsat = parameters%fsatmx*exp(-0.5*fff*zwt)
8389 if(qinsur > 0.)
then
8390 runsrf = qinsur * ( (1.0-fcr(1))*fsat + fcr(1) )
8391 pddum = qinsur - runsrf
8395 if(opt_run == 3)
then
8396 call infil (parameters,nsoil ,dt ,zsoil ,sh2o ,sice , &
8401 if(opt_run == 4)
then
8405 dztot = dztot + dzsnso(k)
8406 smctot = smctot + smc(k)/parameters%smcmax(k)*dzsnso(k)
8407 if(dztot >= 2.0)
exit
8409 smctot = smctot/dztot
8410 fsat = max(0.01,smctot) ** 4.
8412 if(qinsur > 0.)
then
8413 runsrf = qinsur * ((1.0-fcr(1))*fsat+fcr(1))
8414 pddum = qinsur - runsrf
8424 if (pddum*dt>dzsnso(1)*parameters%smcmax(1) )
then
8436 if(qinsur > 0. .and. opt_run == 3)
then
8437 call infil (parameters,nsoil ,dtfine ,zsoil ,sh2o ,sice , &
8442 call srt (parameters,nsoil ,zsoil ,dtfine ,pddum ,etrani , &
8443 qseva ,sh2o ,smc ,zwt ,fcr , &
8444 sicemax,fcrmax ,iloc ,jloc ,smcwtd , &
8445 rhstt ,ai ,bi ,ci ,qdrain , &
8448 call sstep (parameters,nsoil ,nsnow ,dtfine ,zsoil ,dzsnso , &
8449 sice ,iloc ,jloc ,zwt , &
8450 sh2o ,smc ,ai ,bi ,ci , &
8451 rhstt ,smcwtd ,qdrain ,deeprech, &
8454 qdrain_save = qdrain_save + qdrain
8455 runsrf_save = runsrf_save + runsrf
8458 qdrain = qdrain_save/niter
8459 runsrf = runsrf_save/niter
8461 runsrf = runsrf * 1000. + rsat * 1000./dt
8462 qdrain = qdrain * 1000.
8469 if(opt_run == 2)
then
8472 wtsub = wtsub + wcnd(k)*dzsnso(k)
8476 mh2o = runsub*dt*(wcnd(k)*dzsnso(k))/wtsub
8477 sh2o(k) = sh2o(k) - mh2o/(dzsnso(k)*1000.)
8484 if(opt_run /= 1)
then
8486 mliq(iz) = sh2o(iz)*dzsnso(iz)*1000.
8491 if (mliq(iz) .lt. 0.)
then
8492 xs = watmin-mliq(iz)
8496 mliq(iz ) = mliq(iz ) + xs
8497 mliq(iz+1) = mliq(iz+1) - xs
8501 if (mliq(iz) .lt. watmin)
then
8502 xs = watmin-mliq(iz)
8506 mliq(iz) = mliq(iz) + xs
8507 runsub = runsub - xs/dt
8508 if(opt_run == 5)deeprech = deeprech - xs*1.e-3
8511 sh2o(iz) = mliq(iz) / (dzsnso(iz)*1000.)
8521 subroutine zwteq (parameters,nsoil ,nsnow ,zsoil ,dzsnso ,sh2o ,zwt)
8529 type (noahmp_parameters),
intent(in) :: parameters
8530 integer,
intent(in) :: nsoil
8531 integer,
intent(in) :: nsnow
8532 real (kind=kind_phys),
dimension(1:nsoil),
intent(in) :: zsoil
8533 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: dzsnso
8534 real (kind=kind_phys),
dimension(1:nsoil),
intent(in) :: sh2o
8538 real (kind=kind_phys),
intent(out) :: zwt
8543 integer,
parameter :: nfine = 100
8544 real (kind=kind_phys) :: wd1
8545 real (kind=kind_phys) :: wd2
8546 real (kind=kind_phys) :: dzfine
8547 real (kind=kind_phys) :: temp
8548 real (kind=kind_phys),
dimension(1:nfine) :: zfine
8553 wd1 = wd1 + (parameters%smcmax(1)-sh2o(k)) * dzsnso(k)
8556 dzfine = 3.0 * (-zsoil(nsoil)) / nfine
8558 zfine(k) = float(k) * dzfine
8561 zwt = -3.*zsoil(nsoil) - 0.001
8565 temp = 1. + (zwt-zfine(k))/parameters%psisat(1)
8566 wd2 = wd2 + parameters%smcmax(1)*(1.-temp**(-1./parameters%bexp(1)))*dzfine
8567 if(abs(wd2-wd1).le.0.01)
then
8573 end subroutine zwteq
8579 subroutine infil (parameters,nsoil ,dt ,zsoil ,sh2o ,sice , & !in
8580 sicemax,qinsur , & !in
8588 type (noahmp_parameters),
intent(in) :: parameters
8589 integer,
intent(in) :: nsoil
8590 real (kind=kind_phys),
intent(in) :: dt
8591 real (kind=kind_phys),
dimension(1:nsoil),
intent(in) :: zsoil
8592 real (kind=kind_phys),
dimension(1:nsoil),
intent(in) :: sh2o
8593 real (kind=kind_phys),
dimension(1:nsoil),
intent(in) :: sice
8594 real (kind=kind_phys),
intent(in) :: qinsur
8595 real (kind=kind_phys),
intent(in) :: sicemax
8598 real (kind=kind_phys),
intent(out) :: runsrf
8599 real (kind=kind_phys),
intent(out) :: pddum
8602 integer :: ialp1, j, jj, k
8603 real (kind=kind_phys) :: val
8604 real (kind=kind_phys) :: ddt
8605 real (kind=kind_phys) :: px
8606 real (kind=kind_phys) :: dt1, dd, dice
8607 real (kind=kind_phys) :: fcr
8608 real (kind=kind_phys) :: sum
8609 real (kind=kind_phys) :: acrt
8610 real (kind=kind_phys) :: wdf
8611 real (kind=kind_phys) :: wcnd
8612 real (kind=kind_phys) :: smcav
8613 real (kind=kind_phys) :: infmax
8614 real (kind=kind_phys),
dimension(1:nsoil) :: dmax
8615 integer,
parameter :: cvfrz = 3
8618 if (qinsur > 0.0)
then
8620 smcav = parameters%smcmax(1) - parameters%smcwlt(1)
8624 dmax(1)= -zsoil(1) * smcav
8625 dice = -zsoil(1) * sice(1)
8626 dmax(1)= dmax(1)* (1.0-(sh2o(1) + sice(1) - parameters%smcwlt(1))/smcav)
8631 dice = dice + (zsoil(k-1) - zsoil(k) ) * sice(k)
8632 dmax(k) = (zsoil(k-1) - zsoil(k)) * smcav
8633 dmax(k) = dmax(k) * (1.0-(sh2o(k) + sice(k) - parameters%smcwlt(k))/smcav)
8637 val = (1. - exp( - parameters%kdt * dt1))
8639 px = max(0.,qinsur * dt)
8640 infmax = (px * (ddt / (px + ddt)))/ dt
8645 if (dice > 1.e-2)
then
8646 acrt = cvfrz * parameters%frzx / dice
8654 sum = sum + (acrt ** (cvfrz - j)) / float(k)
8656 fcr = 1. - exp(-acrt) * sum
8661 infmax = infmax * fcr
8666 call wdfcnd2 (parameters,wdf,wcnd,sh2o(1),sicemax,1)
8667 infmax = max(infmax,wcnd)
8668 infmax = min(infmax,px/dt)
8670 runsrf= max(0., qinsur - infmax)
8671 pddum = qinsur - runsrf
8675 end subroutine infil
8683 subroutine srt (parameters,nsoil ,zsoil ,dt ,pddum ,etrani , & !in
8684 qseva ,sh2o ,smc ,zwt ,fcr , & !in
8685 sicemax,fcrmax ,iloc ,jloc ,smcwtd , & !in
8686 rhstt ,ai ,bi ,ci ,qdrain , & !out
8697 type (noahmp_parameters),
intent(in) :: parameters
8698 integer,
intent(in) :: iloc
8699 integer,
intent(in) :: jloc
8700 integer,
intent(in) :: nsoil
8701 real (kind=kind_phys),
dimension(1:nsoil),
intent(in) :: zsoil
8702 real (kind=kind_phys),
intent(in) :: dt
8703 real (kind=kind_phys),
intent(in) :: pddum
8704 real (kind=kind_phys),
intent(in) :: qseva
8705 real (kind=kind_phys),
dimension(1:nsoil),
intent(in) :: etrani
8706 real (kind=kind_phys),
dimension(1:nsoil),
intent(in) :: sh2o
8707 real (kind=kind_phys),
dimension(1:nsoil),
intent(in) :: smc
8708 real (kind=kind_phys),
intent(in) :: zwt
8709 real (kind=kind_phys),
dimension(1:nsoil),
intent(in) :: fcr
8710 real (kind=kind_phys),
intent(in) :: fcrmax
8711 real (kind=kind_phys),
intent(in) :: sicemax
8712 real (kind=kind_phys),
intent(in) :: smcwtd
8716 real (kind=kind_phys),
dimension(1:nsoil),
intent(out) :: rhstt
8717 real (kind=kind_phys),
dimension(1:nsoil),
intent(out) :: ai
8718 real (kind=kind_phys),
dimension(1:nsoil),
intent(out) :: bi
8719 real (kind=kind_phys),
dimension(1:nsoil),
intent(out) :: ci
8720 real (kind=kind_phys),
dimension(1:nsoil),
intent(out) :: wcnd
8721 real (kind=kind_phys),
intent(out) :: qdrain
8725 real (kind=kind_phys),
dimension(1:nsoil) :: ddz
8726 real (kind=kind_phys),
dimension(1:nsoil) :: denom
8727 real (kind=kind_phys),
dimension(1:nsoil) :: dsmdz
8728 real (kind=kind_phys),
dimension(1:nsoil) :: wflux
8729 real (kind=kind_phys),
dimension(1:nsoil) :: wdf
8730 real (kind=kind_phys),
dimension(1:nsoil) :: smx
8731 real (kind=kind_phys) :: temp1
8732 real (kind=kind_phys) :: smxwtd
8733 real (kind=kind_phys) :: smxbot
8738 if(opt_inf == 1)
then
8740 call wdfcnd1 (parameters,wdf(k),wcnd(k),smc(k),fcr(k),k)
8743 if(opt_run == 5)smxwtd=smcwtd
8746 if(opt_inf == 2)
then
8748 call wdfcnd2 (parameters,wdf(k),wcnd(k),sh2o(k),sicemax,k)
8751 if(opt_run == 5)smxwtd=smcwtd*sh2o(nsoil)/smc(nsoil)
8756 denom(k) = - zsoil(k)
8757 temp1 = - zsoil(k+1)
8758 ddz(k) = 2.0 / temp1
8759 dsmdz(k) = 2.0 * (smx(k) - smx(k+1)) / temp1
8760 wflux(k) = wdf(k) * dsmdz(k) + wcnd(k) - pddum + etrani(k) + qseva
8761 else if (k < nsoil)
then
8762 denom(k) = (zsoil(k-1) - zsoil(k))
8763 temp1 = (zsoil(k-1) - zsoil(k+1))
8764 ddz(k) = 2.0 / temp1
8765 dsmdz(k) = 2.0 * (smx(k) - smx(k+1)) / temp1
8766 wflux(k) = wdf(k ) * dsmdz(k ) + wcnd(k ) &
8767 - wdf(k-1) * dsmdz(k-1) - wcnd(k-1) + etrani(k)
8769 denom(k) = (zsoil(k-1) - zsoil(k))
8770 if(opt_run == 1 .or. opt_run == 2)
then
8773 if(opt_run == 3)
then
8774 qdrain = parameters%slope*wcnd(k)
8776 if(opt_run == 4)
then
8777 qdrain = (1.0-fcrmax)*wcnd(k)
8779 if(opt_run == 5)
then
8780 temp1 = 2.0 * denom(k)
8781 if(zwt < zsoil(nsoil)-denom(nsoil))
then
8783 smxbot = smx(k) - (smx(k)-smxwtd) * denom(k) * 2./ (denom(k) + zsoil(k) - zwt)
8787 dsmdz(k) = 2.0 * (smx(k) - smxbot) / temp1
8788 qdrain = wdf(k ) * dsmdz(k ) + wcnd(k )
8790 wflux(k) = -(wdf(k-1)*dsmdz(k-1))-wcnd(k-1)+etrani(k) + qdrain
8797 bi(k) = wdf(k ) * ddz(k ) / denom(k)
8799 else if (k < nsoil)
then
8800 ai(k) = - wdf(k-1) * ddz(k-1) / denom(k)
8801 ci(k) = - wdf(k ) * ddz(k ) / denom(k)
8802 bi(k) = - ( ai(k) + ci(k) )
8804 ai(k) = - wdf(k-1) * ddz(k-1) / denom(k)
8806 bi(k) = - ( ai(k) + ci(k) )
8808 rhstt(k) = wflux(k) / (-denom(k))
8818 subroutine sstep (parameters,nsoil ,nsnow ,dt ,zsoil ,dzsnso , & !in
8819 sice ,iloc ,jloc ,zwt , & !in
8820 sh2o ,smc ,ai ,bi ,ci , & !inout
8821 rhstt ,smcwtd ,qdrain ,deeprech, & !inout
8831 type (noahmp_parameters),
intent(in) :: parameters
8832 integer,
intent(in) :: iloc
8833 integer,
intent(in) :: jloc
8834 integer,
intent(in) :: nsoil
8835 integer,
intent(in) :: nsnow
8836 real (kind=kind_phys),
intent(in) :: dt
8837 real (kind=kind_phys),
intent(in) :: zwt
8838 real (kind=kind_phys),
dimension( 1:nsoil),
intent(in) :: zsoil
8839 real (kind=kind_phys),
dimension( 1:nsoil),
intent(in) :: sice
8840 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: dzsnso
8843 real (kind=kind_phys),
dimension(1:nsoil),
intent(inout) :: sh2o
8844 real (kind=kind_phys),
dimension(1:nsoil),
intent(inout) :: smc
8845 real (kind=kind_phys),
dimension(1:nsoil),
intent(inout) :: ai
8846 real (kind=kind_phys),
dimension(1:nsoil),
intent(inout) :: bi
8847 real (kind=kind_phys),
dimension(1:nsoil),
intent(inout) :: ci
8848 real (kind=kind_phys),
dimension(1:nsoil),
intent(inout) :: rhstt
8849 real (kind=kind_phys) ,
intent(inout) :: smcwtd
8850 real (kind=kind_phys) ,
intent(inout) :: qdrain
8851 real (kind=kind_phys) ,
intent(inout) :: deeprech
8854 real (kind=kind_phys),
intent(out) :: wplus
8858 real (kind=kind_phys),
dimension(1:nsoil) :: rhsttin
8859 real (kind=kind_phys),
dimension(1:nsoil) :: ciin
8860 real (kind=kind_phys) :: stot
8861 real (kind=kind_phys) :: epore
8862 real (kind=kind_phys) :: wminus
8867 rhstt(k) = rhstt(k) * dt
8869 bi(k) = 1. + bi(k) * dt
8876 rhsttin(k) = rhstt(k)
8882 call rosr12 (ci,ai,bi,ciin,rhsttin,rhstt,1,nsoil,0)
8885 sh2o(k) = sh2o(k) + ci(k)
8892 if(opt_run == 5)
then
8896 if(zwt < zsoil(nsoil)-dzsnso(nsoil))
then
8898 deeprech = deeprech + dt * qdrain
8900 smcwtd = smcwtd + dt * qdrain / dzsnso(nsoil)
8901 wplus = max((smcwtd-parameters%smcmax(nsoil)), 0.0) * dzsnso(nsoil)
8902 wminus = max((1.e-4-smcwtd), 0.0) * dzsnso(nsoil)
8904 smcwtd = max( min(smcwtd,parameters%smcmax(nsoil)) , 1.e-4)
8905 sh2o(nsoil) = sh2o(nsoil) + wplus/dzsnso(nsoil)
8908 qdrain = qdrain - wplus/dt
8909 deeprech = deeprech - wminus
8915 epore = max( 1.e-4 , ( parameters%smcmax(k) - sice(k) ) )
8916 wplus = max((sh2o(k)-epore), 0.0) * dzsnso(k)
8917 sh2o(k) = min(epore,sh2o(k))
8918 sh2o(k-1) = sh2o(k-1) + wplus/dzsnso(k-1)
8921 epore = max( 1.e-4 , ( parameters%smcmax(1) - sice(1) ) )
8922 wplus = max((sh2o(1)-epore), 0.0) * dzsnso(1)
8923 sh2o(1) = min(epore,sh2o(1))
8925 if(wplus > 0.0)
then
8926 sh2o(2) = sh2o(2) + wplus/dzsnso(2)
8928 epore = max( 1.e-4 , ( parameters%smcmax(k) - sice(k) ) )
8929 wplus = max((sh2o(k)-epore), 0.0) * dzsnso(k)
8930 sh2o(k) = min(epore,sh2o(k))
8931 sh2o(k+1) = sh2o(k+1) + wplus/dzsnso(k+1)
8934 epore = max( 1.e-4 , ( parameters%smcmax(nsoil) - sice(nsoil) ) )
8935 wplus = max((sh2o(nsoil)-epore), 0.0) * dzsnso(nsoil)
8936 sh2o(nsoil) = min(epore,sh2o(nsoil))
8941 end subroutine sstep
8947 subroutine wdfcnd1 (parameters,wdf,wcnd,smc,fcr,isoil)
8954 type (noahmp_parameters),
intent(in) :: parameters
8955 real (kind=kind_phys),
intent(in) :: smc
8956 real (kind=kind_phys),
intent(in) :: fcr
8957 integer,
intent(in) :: isoil
8960 real (kind=kind_phys),
intent(out) :: wcnd
8961 real (kind=kind_phys),
intent(out) :: wdf
8964 real (kind=kind_phys) :: expon
8965 real (kind=kind_phys) :: factr
8966 real (kind=kind_phys) :: vkwgt
8971 factr = max(0.01, smc/parameters%smcmax(isoil))
8972 expon = parameters%bexp(isoil) + 2.0
8973 wdf = parameters%dwsat(isoil) * factr ** expon
8974 wdf = wdf * (1.0 - fcr)
8978 expon = 2.0*parameters%bexp(isoil) + 3.0
8979 wcnd = parameters%dksat(isoil) * factr ** expon
8980 wcnd = wcnd * (1.0 - fcr)
8988 subroutine wdfcnd2 (parameters,wdf,wcnd,smc,sice,isoil)
8995 type (noahmp_parameters),
intent(in) :: parameters
8996 real (kind=kind_phys),
intent(in) :: smc
8997 real (kind=kind_phys),
intent(in) :: sice
8998 integer,
intent(in) :: isoil
9001 real (kind=kind_phys),
intent(out) :: wcnd
9002 real (kind=kind_phys),
intent(out) :: wdf
9005 real (kind=kind_phys) :: expon
9006 real (kind=kind_phys) :: factr1,factr2
9007 real (kind=kind_phys) :: vkwgt
9012 factr1 = 0.05/parameters%smcmax(isoil)
9013 factr2 = max(0.01, smc/parameters%smcmax(isoil))
9014 factr1 = min(factr1,factr2)
9015 expon = parameters%bexp(isoil) + 2.0
9016 wdf = parameters%dwsat(isoil) * factr2 ** expon
9018 if (sice > 0.0)
then
9019 vkwgt = 1./ (1. + (500.* sice)**3.)
9020 wdf = vkwgt * wdf + (1.-vkwgt)*parameters%dwsat(isoil)*(factr1)**expon
9025 expon = 2.0*parameters%bexp(isoil) + 3.0
9026 wcnd = parameters%dksat(isoil) * factr2 ** expon
9034 subroutine groundwater(parameters,nsnow ,nsoil ,dt ,sice ,zsoil , & !in
9035 stc ,wcnd ,fcrmax ,iloc ,jloc , & !in
9036 sh2o ,zwt ,wa ,wt , & !inout
9042 type (noahmp_parameters),
intent(in) :: parameters
9043 integer,
intent(in) :: iloc
9044 integer,
intent(in) :: jloc
9045 integer,
intent(in) :: nsnow
9046 integer,
intent(in) :: nsoil
9047 real (kind=kind_phys),
intent(in) :: dt
9048 real (kind=kind_phys),
intent(in) :: fcrmax
9049 real (kind=kind_phys),
dimension( 1:nsoil),
intent(in) :: sice
9050 real (kind=kind_phys),
dimension( 1:nsoil),
intent(in) :: zsoil
9051 real (kind=kind_phys),
dimension( 1:nsoil),
intent(in) :: wcnd
9052 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: stc
9055 real (kind=kind_phys),
dimension( 1:nsoil),
intent(inout) :: sh2o
9056 real (kind=kind_phys),
intent(inout) :: zwt
9057 real (kind=kind_phys),
intent(inout) :: wa
9058 real (kind=kind_phys),
intent(inout) :: wt
9061 real (kind=kind_phys),
intent(out) :: qin
9062 real (kind=kind_phys),
intent(out) :: qdis
9065 real (kind=kind_phys) :: fff
9066 real (kind=kind_phys) :: rsbmx
9069 real (kind=kind_phys),
dimension( 1:nsoil) :: dzmm
9070 real (kind=kind_phys),
dimension( 1:nsoil) :: znode
9071 real (kind=kind_phys),
dimension( 1:nsoil) :: mliq
9072 real (kind=kind_phys),
dimension( 1:nsoil) :: epore
9073 real (kind=kind_phys),
dimension( 1:nsoil) :: hk
9074 real (kind=kind_phys),
dimension( 1:nsoil) :: smc
9075 real (kind=kind_phys) :: s_node
9076 real (kind=kind_phys) :: dzsum
9077 real (kind=kind_phys) :: smpfz
9078 real (kind=kind_phys) :: ka
9079 real (kind=kind_phys) :: wh_zwt
9080 real (kind=kind_phys) :: wh
9081 real (kind=kind_phys) :: ws
9082 real (kind=kind_phys) :: wtsub
9083 real (kind=kind_phys) :: watmin
9084 real (kind=kind_phys) :: xs
9085 real (kind=kind_phys),
parameter :: rous = 0.2
9088 real (kind=kind_phys),
parameter :: cmic = 0.80
9096 dzmm(1) = -zsoil(1)*1.e3
9098 dzmm(iz) = 1.e3 * (zsoil(iz - 1) - zsoil(iz))
9103 znode(1) = -zsoil(1) / 2.
9105 znode(iz) = -zsoil(iz-1) + 0.5 * (zsoil(iz-1) - zsoil(iz))
9111 smc(iz) = sh2o(iz) + sice(iz)
9112 mliq(iz) = sh2o(iz) * dzmm(iz)
9113 epore(iz) = max(0.01,parameters%smcmax(iz) - sice(iz))
9114 hk(iz) = 1.e3*wcnd(iz)
9122 if(zwt .le. -zsoil(iz) )
then
9132 fff = parameters%bexp(iwt) / 3.0
9133 rsbmx = hk(iwt) * 1.0e3 * exp(3.0)
9136 qdis = (1.0-fcrmax)*rsbmx*exp(-parameters%timean)*exp(-fff*zwt)
9140 s_node = min(1.0,smc(iwt)/parameters%smcmax(iwt) )
9141 s_node = max(s_node,real(0.01,kind=8))
9142 smpfz = -parameters%psisat(iwt)*1000.*s_node**(-parameters%bexp(iwt))
9143 smpfz = max(-120000.0,cmic*smpfz)
9147 ka = 0.5*(hk(iwt)+parameters%dksat(iwt)*1.0e3)
9149 wh_zwt = - zwt * 1.e3
9150 wh = smpfz - znode(iwt)*1.e3
9151 qin = - ka * (wh_zwt-wh) /((zwt-znode(iwt))*1.e3)
9152 qin = max(-10.0/dt,min(10./dt,qin))
9156 wt = wt + (qin - qdis) * dt
9158 if(iwt.eq.nsoil)
then
9159 wa = wa + (qin - qdis) * dt
9161 zwt = (-zsoil(nsoil) + 25.) - wa/1000./rous
9162 mliq(nsoil) = mliq(nsoil) - qin * dt
9164 mliq(nsoil) = mliq(nsoil) + max(0.,(wa - 5000.))
9168 if (iwt.eq.nsoil-1)
then
9169 zwt = -zsoil(nsoil) &
9170 - (wt-rous*1000*25.) / (epore(nsoil))/1000.
9174 ws = ws + epore(iz) * dzmm(iz)
9176 zwt = -zsoil(iwt+1) &
9177 - (wt-rous*1000.*25.-ws) /(epore(iwt+1))/1000.
9182 wtsub = wtsub + hk(iz)*dzmm(iz)
9186 mliq(iz) = mliq(iz) - qdis*dt*hk(iz)*dzmm(iz)/wtsub
9198 if (mliq(iz) .lt. 0.)
then
9199 xs = watmin-mliq(iz)
9203 mliq(iz ) = mliq(iz ) + xs
9204 mliq(iz+1) = mliq(iz+1) - xs
9208 if (mliq(iz) .lt. watmin)
then
9209 xs = watmin-mliq(iz)
9213 mliq(iz) = mliq(iz) + xs
9218 sh2o(iz) = mliq(iz) / dzmm(iz)
9229 dzsnso ,smceq ,iloc ,jloc , & !in
9230 smc ,wtd ,smcwtd ,rech, qdrain )
9238 type (noahmp_parameters),
intent(in) :: parameters
9239 integer,
intent(in) :: nsnow
9240 integer,
intent(in) :: nsoil
9241 integer,
intent(in) :: iloc,jloc
9242 real (kind=kind_phys),
intent(in) :: dt
9243 real (kind=kind_phys),
dimension( 1:nsoil),
intent(in) :: zsoil
9244 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: dzsnso
9245 real (kind=kind_phys),
dimension( 1:nsoil),
intent(in) :: smceq
9248 real (kind=kind_phys),
dimension( 1:nsoil),
intent(inout) :: smc
9249 real (kind=kind_phys),
intent(inout) :: wtd
9250 real (kind=kind_phys),
intent(inout) :: smcwtd
9251 real (kind=kind_phys),
intent(out) :: rech
9252 real (kind=kind_phys),
intent(inout) :: qdrain
9258 real (kind=kind_phys) :: wtdold
9259 real (kind=kind_phys) :: dzup
9260 real (kind=kind_phys) :: smceqdeep
9261 real (kind=kind_phys),
dimension( 0:nsoil) :: zsoil0
9265zsoil0(1:nsoil) = zsoil(1:nsoil)
9270 if(wtd + 1.e-6 < zsoil0(iz))
exit
9276 if(kwtd.le.nsoil)
then
9278 if(smc(kwtd).gt.smceq(kwtd))
then
9280 if(smc(kwtd).eq.parameters%smcmax(kwtd))
then
9282 rech=-(wtdold-wtd) * (parameters%smcmax(kwtd)-smceq(kwtd))
9286 if(smc(kwtd).gt.smceq(kwtd))
then
9288 wtd = min( ( smc(kwtd)*dzsnso(kwtd) &
9289 - smceq(kwtd)*zsoil0(iwtd) + parameters%smcmax(kwtd)*zsoil0(kwtd) ) / &
9290 ( parameters%smcmax(kwtd)-smceq(kwtd) ), zsoil0(iwtd))
9291 rech=rech-(wtdold-wtd) * (parameters%smcmax(kwtd)-smceq(kwtd))
9295 wtd = min( ( smc(kwtd)*dzsnso(kwtd) &
9296 - smceq(kwtd)*zsoil0(iwtd) + parameters%smcmax(kwtd)*zsoil0(kwtd) ) / &
9297 ( parameters%smcmax(kwtd)-smceq(kwtd) ), zsoil0(iwtd))
9298 rech=-(wtdold-wtd) * (parameters%smcmax(kwtd)-smceq(kwtd))
9303 rech=-(wtdold-wtd) * (parameters%smcmax(kwtd)-smceq(kwtd))
9307 if(kwtd.le.nsoil)
then
9309 if(smc(kwtd).gt.smceq(kwtd))
then
9310 wtd = min( ( smc(kwtd)*dzsnso(kwtd) &
9311 - smceq(kwtd)*zsoil0(iwtd) + parameters%smcmax(kwtd)*zsoil0(kwtd) ) / &
9312 ( parameters%smcmax(kwtd)-smceq(kwtd) ) , zsoil0(iwtd) )
9316 rech = rech - (wtdold-wtd) * &
9317 (parameters%smcmax(kwtd)-smceq(kwtd))
9326 smceqdeep = parameters%smcmax(nsoil) * ( -parameters%psisat(nsoil) / ( -parameters%psisat(nsoil) - dzsnso(nsoil) ) ) ** (1./parameters%bexp(nsoil))
9327 wtd = min( ( smcwtd*dzsnso(nsoil) &
9328 - smceqdeep*zsoil0(nsoil) + parameters%smcmax(nsoil)*(zsoil0(nsoil)-dzsnso(nsoil)) ) / &
9329 ( parameters%smcmax(nsoil)-smceqdeep ) , zsoil0(nsoil) )
9330 rech = rech - (wtdold-wtd) * &
9331 (parameters%smcmax(nsoil)-smceqdeep)
9335 elseif(wtd.ge.zsoil0(nsoil)-dzsnso(nsoil))
then
9338 smceqdeep = parameters%smcmax(nsoil) * ( -parameters%psisat(nsoil) / ( -parameters%psisat(nsoil) - dzsnso(nsoil) ) ) ** (1./parameters%bexp(nsoil))
9339 if(smcwtd.gt.smceqdeep)
then
9340 wtd = min( ( smcwtd*dzsnso(nsoil) &
9341 - smceqdeep*zsoil0(nsoil) + parameters%smcmax(nsoil)*(zsoil0(nsoil)-dzsnso(nsoil)) ) / &
9342 ( parameters%smcmax(nsoil)-smceqdeep ) , zsoil0(nsoil) )
9343 rech = -(wtdold-wtd) * (parameters%smcmax(nsoil)-smceqdeep)
9345 rech = -(wtdold-(zsoil0(nsoil)-dzsnso(nsoil))) * (parameters%smcmax(nsoil)-smceqdeep)
9346 wtdold=zsoil0(nsoil)-dzsnso(nsoil)
9348 dzup=(smceqdeep-smcwtd)*dzsnso(nsoil)/(parameters%smcmax(nsoil)-smceqdeep)
9350 rech = rech - (parameters%smcmax(nsoil)-smceqdeep)*dzup
9357if(iwtd.lt.nsoil .and. iwtd.gt.0)
then
9358 smcwtd=parameters%smcmax(iwtd)
9359elseif(iwtd.lt.nsoil .and. iwtd.le.0)
then
9360 smcwtd=parameters%smcmax(1)
9373 subroutine carbon (parameters,nsnow ,nsoil ,vegtyp ,dt ,zsoil , & !in
9374 dzsnso ,stc ,smc ,tv ,tg ,psn , & !in
9375 foln ,btran ,apar ,fveg ,igs , & !in
9376 troot ,ist ,lat ,iloc ,jloc , & !in
9377 lfmass ,rtmass ,stmass ,wood ,stblcp ,fastcp , & !inout
9378 gpp ,npp ,nee ,autors ,heters ,totsc , & !out
9385 type (noahmp_parameters),
intent(in) :: parameters
9386 integer ,
intent(in) :: iloc
9387 integer ,
intent(in) :: jloc
9388 integer ,
intent(in) :: vegtyp
9389 integer ,
intent(in) :: nsnow
9390 integer ,
intent(in) :: nsoil
9391 real (kind=kind_phys) ,
intent(in) :: lat
9392 real (kind=kind_phys) ,
intent(in) :: dt
9393 real (kind=kind_phys),
dimension( 1:nsoil),
intent(in) :: zsoil
9394 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: dzsnso
9395 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: stc
9396 real (kind=kind_phys),
dimension( 1:nsoil),
intent(in) :: smc
9397 real (kind=kind_phys) ,
intent(in) :: tv
9398 real (kind=kind_phys) ,
intent(in) :: tg
9399 real (kind=kind_phys) ,
intent(in) :: foln
9400 real (kind=kind_phys) ,
intent(in) :: btran
9401 real (kind=kind_phys) ,
intent(in) :: psn
9402 real (kind=kind_phys) ,
intent(in) :: apar
9403 real (kind=kind_phys) ,
intent(in) :: igs
9404 real (kind=kind_phys) ,
intent(in) :: fveg
9405 real (kind=kind_phys) ,
intent(in) :: troot
9406 integer ,
intent(in) :: ist
9410 real (kind=kind_phys) ,
intent(inout) :: lfmass
9411 real (kind=kind_phys) ,
intent(inout) :: rtmass
9412 real (kind=kind_phys) ,
intent(inout) :: stmass
9413 real (kind=kind_phys) ,
intent(inout) :: wood
9414 real (kind=kind_phys) ,
intent(inout) :: stblcp
9415 real (kind=kind_phys) ,
intent(inout) :: fastcp
9419 real (kind=kind_phys) ,
intent(out) :: gpp
9420 real (kind=kind_phys) ,
intent(out) :: npp
9421 real (kind=kind_phys) ,
intent(out) :: nee
9422 real (kind=kind_phys) ,
intent(out) :: autors
9423 real (kind=kind_phys) ,
intent(out) :: heters
9424 real (kind=kind_phys) ,
intent(out) :: totsc
9425 real (kind=kind_phys) ,
intent(out) :: totlb
9426 real (kind=kind_phys) ,
intent(out) :: xlai
9427 real (kind=kind_phys) ,
intent(out) :: xsai
9433 real (kind=kind_phys) :: wroot
9434 real (kind=kind_phys) :: wstres
9435 real (kind=kind_phys) :: lapm
9438 if ( ( vegtyp == parameters%iswater ) .or. ( vegtyp == parameters%isbarren ) .or. &
9439 ( vegtyp == parameters%isice ) .or. (parameters%urban_flag) )
then
9459 lapm = parameters%sla / 1000.
9466 do j=1,parameters%nroot
9467 wroot = wroot + smc(j)/parameters%smcmax(j) * dzsnso(j) / (-zsoil(parameters%nroot))
9470 call co2flux (parameters,nsnow ,nsoil ,vegtyp ,igs ,dt , &
9471 dzsnso ,stc ,psn ,troot ,tv , &
9472 wroot ,wstres ,foln ,lapm , &
9473 lat ,iloc ,jloc ,fveg , &
9474 xlai ,xsai ,lfmass ,rtmass ,stmass , &
9475 fastcp ,stblcp ,wood , &
9476 gpp ,npp ,nee ,autors ,heters , &
9489 subroutine co2flux (parameters,nsnow ,nsoil ,vegtyp ,igs ,dt , & !in
9490 dzsnso ,stc ,psn ,troot ,tv , & !in
9491 wroot ,wstres ,foln ,lapm , & !in
9492 lat ,iloc ,jloc ,fveg , & !in
9493 xlai ,xsai ,lfmass ,rtmass ,stmass , & !inout
9494 fastcp ,stblcp ,wood , & !inout
9495 gpp ,npp ,nee ,autors ,heters , & !out
9505 type (noahmp_parameters),
intent(in) :: parameters
9506 integer ,
intent(in) :: iloc
9507 integer ,
intent(in) :: jloc
9508 integer ,
intent(in) :: vegtyp
9509 integer ,
intent(in) :: nsnow
9510 integer ,
intent(in) :: nsoil
9511 real (kind=kind_phys) ,
intent(in) :: dt
9512 real (kind=kind_phys) ,
intent(in) :: lat
9513 real (kind=kind_phys) ,
intent(in) :: igs
9514 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: dzsnso
9515 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: stc
9516 real (kind=kind_phys) ,
intent(in) :: psn
9517 real (kind=kind_phys) ,
intent(in) :: troot
9518 real (kind=kind_phys) ,
intent(in) :: tv
9519 real (kind=kind_phys) ,
intent(in) :: wroot
9520 real (kind=kind_phys) ,
intent(in) :: wstres
9521 real (kind=kind_phys) ,
intent(in) :: foln
9522 real (kind=kind_phys) ,
intent(in) :: lapm
9523 real (kind=kind_phys) ,
intent(in) :: fveg
9527 real (kind=kind_phys) ,
intent(inout) :: xlai
9528 real (kind=kind_phys) ,
intent(inout) :: xsai
9529 real (kind=kind_phys) ,
intent(inout) :: lfmass
9530 real (kind=kind_phys) ,
intent(inout) :: rtmass
9531 real (kind=kind_phys) ,
intent(inout) :: stmass
9532 real (kind=kind_phys) ,
intent(inout) :: fastcp
9533 real (kind=kind_phys) ,
intent(inout) :: stblcp
9534 real (kind=kind_phys) ,
intent(inout) :: wood
9538 real (kind=kind_phys) ,
intent(out) :: gpp
9539 real (kind=kind_phys) ,
intent(out) :: npp
9540 real (kind=kind_phys) ,
intent(out) :: nee
9541 real (kind=kind_phys) ,
intent(out) :: autors
9542 real (kind=kind_phys) ,
intent(out) :: heters
9543 real (kind=kind_phys) ,
intent(out) :: totsc
9544 real (kind=kind_phys) ,
intent(out) :: totlb
9548 real (kind=kind_phys) :: cflux
9549 real (kind=kind_phys) :: lfmsmn
9550 real (kind=kind_phys) :: rswood
9551 real (kind=kind_phys) :: rsleaf
9552 real (kind=kind_phys) :: rsroot
9553 real (kind=kind_phys) :: nppl
9554 real (kind=kind_phys) :: nppr
9555 real (kind=kind_phys) :: nppw
9556 real (kind=kind_phys) :: npps
9557 real (kind=kind_phys) :: dielf
9559 real (kind=kind_phys) :: addnpplf
9560 real (kind=kind_phys) :: addnppst
9561 real (kind=kind_phys) :: carbfx
9562 real (kind=kind_phys) :: grleaf
9563 real (kind=kind_phys) :: grroot
9564 real (kind=kind_phys) :: grwood
9565 real (kind=kind_phys) :: grstem
9566 real (kind=kind_phys) :: leafpt
9567 real (kind=kind_phys) :: lfdel
9568 real (kind=kind_phys) :: lftovr
9569 real (kind=kind_phys) :: sttovr
9570 real (kind=kind_phys) :: wdtovr
9571 real (kind=kind_phys) :: rssoil
9572 real (kind=kind_phys) :: rttovr
9573 real (kind=kind_phys) :: stablc
9574 real (kind=kind_phys) :: woodf
9575 real (kind=kind_phys) :: nonlef
9576 real (kind=kind_phys) :: rootpt
9577 real (kind=kind_phys) :: woodpt
9578 real (kind=kind_phys) :: stempt
9579 real (kind=kind_phys) :: resp
9580 real (kind=kind_phys) :: rsstem
9582 real (kind=kind_phys) :: fsw
9583 real (kind=kind_phys) :: fst
9584 real (kind=kind_phys) :: fnf
9585 real (kind=kind_phys) :: tf
9586 real (kind=kind_phys) :: rf
9587 real (kind=kind_phys) :: stdel
9588 real (kind=kind_phys) :: stmsmn
9589 real (kind=kind_phys) :: sapm
9590 real (kind=kind_phys) :: diest
9592 real (kind=kind_phys) :: bf
9593 real (kind=kind_phys) :: rswoodc
9594 real (kind=kind_phys) :: stovrc
9595 real (kind=kind_phys) :: rsdryc
9596 real (kind=kind_phys) :: rtovrc
9597 real (kind=kind_phys) :: wstrc
9598 real (kind=kind_phys) :: laimin
9599 real (kind=kind_phys) :: xsamin
9600 real (kind=kind_phys) :: sc
9601 real (kind=kind_phys) :: sd
9602 real (kind=kind_phys) :: vegfrac
9606 real (kind=kind_phys) :: r,x
9607 r(x) = exp(0.08*(x-298.16))
9620 lfmsmn = laimin/lapm
9621 stmsmn = xsamin/sapm
9626 if(igs .eq. 0.)
then
9632 fnf = min( foln/max(1.e-06,parameters%folnmx), 1.0 )
9633 tf = parameters%arm**( (tv-298.16)/10. )
9634 resp = parameters%rmf25 * tf * fnf * xlai * rf * (1.-wstres)
9635 rsleaf = min((lfmass-lfmsmn)/dt,resp*12.e-6)
9637 rsroot = parameters%rmr25*(rtmass*1e-3)*tf *rf* 12.e-6
9638 rsstem = parameters%rms25*((stmass-stmsmn)*1e-3)*tf *rf* 12.e-6
9639 rswood = rswoodc * r(tv) * wood*parameters%wdpool
9644 carbfx = psn * 12.e-6
9648 leafpt = exp(0.01*(1.-exp(0.75*xlai))*xlai)
9649 if(vegtyp == parameters%eblforest) leafpt = exp(0.01*(1.-exp(0.50*xlai))*xlai)
9651 nonlef = 1.0 - leafpt
9652 stempt = xlai/10.0*leafpt
9653 leafpt = leafpt - stempt
9657 if(wood > 1.e-6)
then
9658 woodf = (1.-exp(-bf*(parameters%wrrat*rtmass/wood))/bf)*parameters%wdpool
9660 woodf = parameters%wdpool
9663 rootpt = nonlef*(1.-woodf)
9664 woodpt = nonlef*woodf
9668 lftovr = parameters%ltovrc*5.e-7*lfmass
9669 sttovr = parameters%ltovrc*5.e-7*stmass
9670 rttovr = rtovrc*rtmass
9671 wdtovr = 9.5e-10*wood
9676 sc = exp(-0.3*max(0.,tv-parameters%tdlef)) * (lfmass/120.)
9677 sd = exp((wstres-1.)*wstrc)
9678 dielf = lfmass*1.e-6*(parameters%dilefw * sd + parameters%dilefc*sc)
9679 diest = stmass*1.e-6*(parameters%dilefw * sd + parameters%dilefc*sc)
9683 grleaf = max(0.0,parameters%fragr*(leafpt*carbfx - rsleaf))
9684 grstem = max(0.0,parameters%fragr*(stempt*carbfx - rsstem))
9685 grroot = max(0.0,parameters%fragr*(rootpt*carbfx - rsroot))
9686 grwood = max(0.0,parameters%fragr*(woodpt*carbfx - rswood))
9690 addnpplf = max(0.,leafpt*carbfx - grleaf-rsleaf)
9691 addnppst = max(0.,stempt*carbfx - grstem-rsstem)
9694 if(tv.lt.parameters%tmin) addnpplf =0.
9695 if(tv.lt.parameters%tmin) addnppst =0.
9700 lfdel = (lfmass - lfmsmn)/dt
9701 stdel = (stmass - stmsmn)/dt
9702 dielf = min(dielf,lfdel+addnpplf-lftovr)
9703 diest = min(diest,stdel+addnppst-sttovr)
9707 nppl = max(addnpplf,-lfdel)
9708 npps = max(addnppst,-stdel)
9709 nppr = rootpt*carbfx - rsroot - grroot
9710 nppw = woodpt*carbfx - rswood - grwood
9714 lfmass = lfmass + (nppl-lftovr-dielf)*dt
9715 stmass = stmass + (npps-sttovr-diest)*dt
9716 rtmass = rtmass + (nppr-rttovr) *dt
9718 if(rtmass.lt.0.0)
then
9722 wood = (wood+(nppw-wdtovr)*dt)*parameters%wdpool
9726 fastcp = fastcp + (rttovr+lftovr+sttovr+wdtovr+dielf+diest)*dt
9728 fst = 2.0**( (stc(1)-283.16)/10. )
9729 fsw = wroot / (0.20+wroot) * 0.23 / (0.23+wroot)
9730 rssoil = fsw * fst * parameters%mrp* max(0.,fastcp*1.e-3)*12.e-6
9733 fastcp = fastcp - (rssoil + stablc)*dt
9734 stblcp = stblcp + stablc*dt
9738 cflux = - carbfx + rsleaf + rsroot + rswood + rsstem &
9739 + 0.9*rssoil + grleaf + grroot + grwood + grstem
9744 npp = nppl + nppw + nppr +npps
9745 autors = rsroot + rswood + rsleaf + rsstem + &
9746 grleaf + grroot + grwood + grstem
9748 nee = (autors + heters - gpp)*44./12.
9749 totsc = fastcp + stblcp
9750 totlb = lfmass + rtmass +stmass + wood
9754 xlai = max(lfmass*lapm,laimin)
9755 xsai = max(stmass*sapm,xsamin)
9763 subroutine carbon_crop (parameters,nsnow ,nsoil ,vegtyp ,dt ,zsoil ,julian , & !in
9764 dzsnso ,stc ,smc ,tv ,psn ,foln ,btran , & !in
9766 lfmass ,rtmass ,stmass ,wood ,stblcp ,fastcp ,grain , & !inout
9767 xlai ,xsai ,gdd , & !inout
9768 gpp ,npp ,nee ,autors ,heters ,totsc ,totlb, pgs )
9778 type (noahmp_parameters),
intent(in) :: parameters
9779 integer ,
intent(in) :: nsnow
9780 integer ,
intent(in) :: nsoil
9781 integer ,
intent(in) :: vegtyp
9782 real (kind=kind_phys) ,
intent(in) :: dt
9783 real (kind=kind_phys),
dimension( 1:nsoil),
intent(in) :: zsoil
9784 real (kind=kind_phys) ,
intent(in) :: julian
9785 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: dzsnso
9786 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: stc
9787 real (kind=kind_phys),
dimension( 1:nsoil),
intent(in) :: smc
9788 real (kind=kind_phys) ,
intent(in) :: tv
9789 real (kind=kind_phys) ,
intent(in) :: psn
9790 real (kind=kind_phys) ,
intent(in) :: foln
9791 real (kind=kind_phys) ,
intent(in) :: btran
9792 real (kind=kind_phys) ,
intent(in) :: soldn
9793 real (kind=kind_phys) ,
intent(in) :: t2m
9797 real (kind=kind_phys) ,
intent(inout) :: lfmass
9798 real (kind=kind_phys) ,
intent(inout) :: rtmass
9799 real (kind=kind_phys) ,
intent(inout) :: stmass
9800 real (kind=kind_phys) ,
intent(inout) :: wood
9801 real (kind=kind_phys) ,
intent(inout) :: stblcp
9802 real (kind=kind_phys) ,
intent(inout) :: fastcp
9803 real (kind=kind_phys) ,
intent(inout) :: grain
9804 real (kind=kind_phys) ,
intent(inout) :: xlai
9805 real (kind=kind_phys) ,
intent(inout) :: xsai
9806 real (kind=kind_phys) ,
intent(inout) :: gdd
9809 real (kind=kind_phys) ,
intent(out) :: gpp
9810 real (kind=kind_phys) ,
intent(out) :: npp
9811 real (kind=kind_phys) ,
intent(out) :: nee
9812 real (kind=kind_phys) ,
intent(out) :: autors
9813 real (kind=kind_phys) ,
intent(out) :: heters
9814 real (kind=kind_phys) ,
intent(out) :: totsc
9815 real (kind=kind_phys) ,
intent(out) :: totlb
9820 real (kind=kind_phys) :: wroot
9821 real (kind=kind_phys) :: wstres
9824 integer,
intent(out) :: pgs
9826 real (kind=kind_phys) :: psncrop
9829 if ( ( vegtyp == parameters%iswater ) .or. ( vegtyp == parameters%isbarren ) .or. &
9830 ( vegtyp == parameters%isice ) .or. (parameters%urban_flag) )
then
9856 do j=1,parameters%nroot
9857 wroot = wroot + smc(j)/parameters%smcmax(j) * dzsnso(j) / (-zsoil(parameters%nroot))
9870 dt ,stc(1) ,psn ,tv ,wroot ,wstres ,foln , &
9872 xlai ,xsai ,lfmass ,rtmass ,stmass , &
9873 fastcp ,stblcp ,wood ,grain ,gdd , &
9874 gpp ,npp ,nee ,autors ,heters , &
9884 dt ,stc ,psn ,tv ,wroot ,wstres ,foln , & !in
9885 ipa ,iha ,pgs , & !in xing
9886 xlai ,xsai ,lfmass ,rtmass ,stmass , & !inout
9887 fastcp ,stblcp ,wood ,grain ,gdd, & !inout
9888 gpp ,npp ,nee ,autors ,heters , & !out
9900 type (noahmp_parameters),
intent(in) :: parameters
9901 real (kind=kind_phys) ,
intent(in) :: dt
9902 real (kind=kind_phys) ,
intent(in) :: stc
9903 real (kind=kind_phys) ,
intent(in) :: psn
9904 real (kind=kind_phys) ,
intent(in) :: tv
9905 real (kind=kind_phys) ,
intent(in) :: wroot
9906 real (kind=kind_phys) ,
intent(in) :: wstres
9907 real (kind=kind_phys) ,
intent(in) :: foln
9908 integer ,
intent(in) :: ipa
9909 integer ,
intent(in) :: iha
9910 integer ,
intent(in) :: pgs
9914 real (kind=kind_phys) ,
intent(inout) :: xlai
9915 real (kind=kind_phys) ,
intent(inout) :: xsai
9916 real (kind=kind_phys) ,
intent(inout) :: lfmass
9917 real (kind=kind_phys) ,
intent(inout) :: rtmass
9918 real (kind=kind_phys) ,
intent(inout) :: stmass
9919 real (kind=kind_phys) ,
intent(inout) :: fastcp
9920 real (kind=kind_phys) ,
intent(inout) :: stblcp
9921 real (kind=kind_phys) ,
intent(inout) :: wood
9922 real (kind=kind_phys) ,
intent(inout) :: grain
9923 real (kind=kind_phys) ,
intent(inout) :: gdd
9927 real (kind=kind_phys) ,
intent(out) :: gpp
9928 real (kind=kind_phys) ,
intent(out) :: npp
9929 real (kind=kind_phys) ,
intent(out) :: nee
9930 real (kind=kind_phys) ,
intent(out) :: autors
9931 real (kind=kind_phys) ,
intent(out) :: heters
9932 real (kind=kind_phys) ,
intent(out) :: totsc
9933 real (kind=kind_phys) ,
intent(out) :: totlb
9937 real (kind=kind_phys) :: cflux
9938 real (kind=kind_phys) :: lfmsmn
9939 real (kind=kind_phys) :: rswood
9940 real (kind=kind_phys) :: rsleaf
9941 real (kind=kind_phys) :: rsroot
9942 real (kind=kind_phys) :: rsgrain
9943 real (kind=kind_phys) :: nppl
9944 real (kind=kind_phys) :: nppr
9945 real (kind=kind_phys) :: nppw
9946 real (kind=kind_phys) :: npps
9947 real (kind=kind_phys) :: nppg
9948 real (kind=kind_phys) :: dielf
9950 real (kind=kind_phys) :: addnpplf
9951 real (kind=kind_phys) :: addnppst
9952 real (kind=kind_phys) :: carbfx
9953 real (kind=kind_phys) :: cbhydrafx
9954 real (kind=kind_phys) :: grleaf
9955 real (kind=kind_phys) :: grroot
9956 real (kind=kind_phys) :: grwood
9957 real (kind=kind_phys) :: grstem
9958 real (kind=kind_phys) :: grgrain
9959 real (kind=kind_phys) :: leafpt
9960 real (kind=kind_phys) :: lfdel
9961 real (kind=kind_phys) :: lftovr
9962 real (kind=kind_phys) :: sttovr
9963 real (kind=kind_phys) :: wdtovr
9964 real (kind=kind_phys) :: grtovr
9965 real (kind=kind_phys) :: rssoil
9966 real (kind=kind_phys) :: rttovr
9967 real (kind=kind_phys) :: stablc
9968 real (kind=kind_phys) :: woodf
9969 real (kind=kind_phys) :: nonlef
9970 real (kind=kind_phys) :: resp
9971 real (kind=kind_phys) :: rsstem
9973 real (kind=kind_phys) :: fsw
9974 real (kind=kind_phys) :: fst
9975 real (kind=kind_phys) :: fnf
9976 real (kind=kind_phys) :: tf
9977 real (kind=kind_phys) :: stdel
9978 real (kind=kind_phys) :: stmsmn
9979 real (kind=kind_phys) :: sapm
9980 real (kind=kind_phys) :: diest
9981 real (kind=kind_phys) :: stconvert
9982 real (kind=kind_phys) :: rtconvert
9984 real (kind=kind_phys) :: bf
9985 real (kind=kind_phys) :: rswoodc
9986 real (kind=kind_phys) :: stovrc
9987 real (kind=kind_phys) :: rsdryc
9988 real (kind=kind_phys) :: rtovrc
9989 real (kind=kind_phys) :: wstrc
9990 real (kind=kind_phys) :: laimin
9991 real (kind=kind_phys) :: xsamin
9992 real (kind=kind_phys) :: sc
9993 real (kind=kind_phys) :: sd
9994 real (kind=kind_phys) :: vegfrac
9995 real (kind=kind_phys) :: temp
9999 real (kind=kind_phys) :: r,x
10000 r(x) = exp(0.08*(x-298.16))
10012 lfmsmn = laimin/0.035
10013 stmsmn = xsamin/sapm
10019 carbfx = psn*12.e-6
10020 cbhydrafx = psn*30.e-6
10023 fnf = min( foln/max(1.e-06,parameters%foln_mx), 1.0 )
10024 tf = parameters%q10mr**( (tv-298.16)/10. )
10025 resp = parameters%lfmr25 * tf * fnf * xlai * (1.-wstres)
10026 rsleaf = min((lfmass-lfmsmn)/dt,resp*30.e-6)
10027 rsroot = parameters%rtmr25*(rtmass*1e-3)*tf * 30.e-6
10028 rsstem = parameters%stmr25*(stmass*1e-3)*tf * 30.e-6
10029 rsgrain = parameters%grainmr25*(grain*1e-3)*tf * 30.e-6
10033 grleaf = max(0.0,parameters%fra_gr*(parameters%lfpt(pgs)*cbhydrafx - rsleaf))
10034 grstem = max(0.0,parameters%fra_gr*(parameters%stpt(pgs)*cbhydrafx - rsstem))
10035 grroot = max(0.0,parameters%fra_gr*(parameters%rtpt(pgs)*cbhydrafx - rsroot))
10036 grgrain = max(0.0,parameters%fra_gr*(parameters%grainpt(pgs)*cbhydrafx - rsgrain))
10041 lftovr = parameters%lf_ovrc(pgs)*1.e-6*lfmass
10042 rttovr = parameters%rt_ovrc(pgs)*1.e-6*rtmass
10043 sttovr = parameters%st_ovrc(pgs)*1.e-6*stmass
10044 sc = exp(-0.3*max(0.,tv-parameters%lefreez)) * (lfmass/120.)
10045 sd = exp((wstres-1.)*wstrc)
10046 dielf = lfmass*1.e-6*(parameters%dile_fw(pgs) * sd + parameters%dile_fc(pgs)*sc)
10051 addnpplf = max(0.,parameters%lfpt(pgs)*cbhydrafx - grleaf-rsleaf)
10052 addnpplf = parameters%lfpt(pgs)*cbhydrafx - grleaf-rsleaf
10053 addnppst = max(0.,parameters%stpt(pgs)*cbhydrafx - grstem-rsstem)
10054 addnppst = parameters%stpt(pgs)*cbhydrafx - grstem-rsstem
10059 lfdel = (lfmass - lfmsmn)/dt
10060 stdel = (stmass - stmsmn)/dt
10061 lftovr = min(lftovr,lfdel+addnpplf)
10062 sttovr = min(sttovr,stdel+addnppst)
10063 dielf = min(dielf,lfdel+addnpplf-lftovr)
10067 nppl = max(addnpplf,-lfdel)
10069 npps = max(addnppst,-stdel)
10071 nppr = parameters%rtpt(pgs)*cbhydrafx - rsroot - grroot
10072 nppg = parameters%grainpt(pgs)*cbhydrafx - rsgrain - grgrain
10076 lfmass = lfmass + (nppl-lftovr-dielf)*dt
10077 stmass = stmass + (npps-sttovr)*dt
10078 rtmass = rtmass + (nppr-rttovr)*dt
10079 grain = grain + nppg*dt
10081 gpp = cbhydrafx* 0.4
10086 stconvert = stmass*(0.00005*dt/3600.0)
10087 stmass = stmass - stconvert
10088 rtconvert = rtmass*(0.0005*dt/3600.0)
10089 rtmass = rtmass - rtconvert
10090 grain = grain + stconvert + rtconvert
10093 if(rtmass.lt.0.0)
then
10098 if(grain.lt.0.0)
then
10107 fastcp = fastcp + (rttovr+lftovr+sttovr+dielf)*dt
10109 fst = 2.0**( (stc-283.16)/10. )
10110 fsw = wroot / (0.20+wroot) * 0.23 / (0.23+wroot)
10111 rssoil = fsw * fst * parameters%mrp* max(0.,fastcp*1.e-3)*12.e-6
10113 stablc = 0.1*rssoil
10114 fastcp = fastcp - (rssoil + stablc)*dt
10115 stblcp = stblcp + stablc*dt
10119 cflux = - carbfx + rsleaf + rsroot + rsstem &
10120 + rssoil + grleaf + grroot
10125 npp = (nppl + npps+ nppr +nppg)*0.4
10128 autors = rsroot + rsgrain + rsleaf + &
10129 grleaf + grroot + grgrain
10132 nee = (autors + heters - gpp)*44./30.
10133 totsc = fastcp + stblcp
10135 totlb = lfmass + rtmass + grain
10139 xlai = max(lfmass*parameters%bio2lai,laimin)
10140 xsai = max(stmass*sapm,xsamin)
10151 if(pgs == 8 .and. (grain > 0. .or. lfmass > 0 .or. stmass > 0 .or. rtmass > 0))
then
10166 t2m , dt, julian, & !in
10173 type (noahmp_parameters),
intent(in) :: parameters
10174 real (kind=kind_phys) ,
intent(in) :: t2m
10175 real (kind=kind_phys) ,
intent(in) :: dt
10176 real (kind=kind_phys) ,
intent(in) :: julian
10180 real (kind=kind_phys) ,
intent(inout) :: gdd
10184 integer ,
intent(out) :: ipa
10185 integer ,
intent(out) :: iha
10186 integer ,
intent(out) :: pgs
10190 real (kind=kind_phys) :: gddday
10191 real (kind=kind_phys) :: dayofs2
10192 real (kind=kind_phys) :: tdiff
10193 real (kind=kind_phys) :: tc
10204 if(julian < parameters%pltday) ipa = 0
10207 if(julian >= parameters%hsday) iha = 0
10211 if(tc < parameters%gddtbase)
then
10213 elseif(tc >= parameters%gddtcut)
then
10214 tdiff = parameters%gddtcut - parameters%gddtbase
10216 tdiff = tc - parameters%gddtbase
10219 gdd = (gdd + tdiff * dt / 86400.0) * ipa * iha
10242 if(gddday > 0.0) pgs = 2
10244 if(gddday >= parameters%gdds1) pgs = 3
10246 if(gddday >= parameters%gdds2) pgs = 4
10248 if(gddday >= parameters%gdds3) pgs = 5
10250 if(gddday >= parameters%gdds4) pgs = 6
10252 if(gddday >= parameters%gdds5) pgs = 7
10254 if(julian >= parameters%hsday) pgs = 8
10256 if(julian < parameters%pltday) pgs = 1
10264 soldn, xlai,t2m, & !in
10270 type (noahmp_parameters),
intent(in) :: parameters
10271 real (kind=kind_phys) ,
intent(in) :: soldn
10272 real (kind=kind_phys) ,
intent(in) :: xlai
10273 real (kind=kind_phys) ,
intent(in) :: t2m
10274 real (kind=kind_phys) ,
intent(out) :: psncrop
10278 real (kind=kind_phys) :: par
10279 real (kind=kind_phys) :: amax
10280 real (kind=kind_phys) :: l1
10281 real (kind=kind_phys) :: l2
10282 real (kind=kind_phys) :: l3
10283 real (kind=kind_phys) :: i1
10284 real (kind=kind_phys) :: i2
10285 real (kind=kind_phys) :: i3
10286 real (kind=kind_phys) :: a1
10287 real (kind=kind_phys) :: a2
10288 real (kind=kind_phys) :: a3
10289 real (kind=kind_phys) :: a
10290 real (kind=kind_phys) :: tc
10294 par = parameters%i2par * soldn * 0.0036
10296 if(tc < parameters%tassim0)
then
10298 elseif(tc >= parameters%tassim0 .and. tc < parameters%tassim1)
then
10299 amax = (tc - parameters%tassim0) * parameters%aref / (parameters%tassim1 - parameters%tassim0)
10300 elseif(tc >= parameters%tassim1 .and. tc < parameters%tassim2)
then
10301 amax = parameters%aref
10303 amax= parameters%aref - 0.2 * (t2m - parameters%tassim2)
10306 amax = max(amax,0.01)
10308 if(xlai <= 0.05)
then
10318 i1 = parameters%k * par * exp(-parameters%k * l1)
10319 i2 = parameters%k * par * exp(-parameters%k * l2)
10320 i3 = parameters%k * par * exp(-parameters%k * l3)
10326 a1 = amax * (1 - exp(-parameters%epsi * i1 / amax))
10327 a2 = amax * (1 - exp(-parameters%epsi * i2 / amax)) * 1.6
10328 a3 = amax * (1 - exp(-parameters%epsi * i3 / amax))
10330 if (xlai <= 0.05)
then
10331 a = (a1+a2+a3) / 3.6 * 0.05
10332 elseif (xlai > 0.05 .and. xlai <= 4.0)
then
10333 a = (a1+a2+a3) / 3.6 * xlai
10335 a = (a1+a2+a3) / 3.6 * 4
10338 a = a * parameters%psnrf
10340 psncrop = 6.313 * a
10444 subroutine noahmp_options(idveg , iopt_crs , iopt_btr , iopt_run , iopt_sfc , iopt_frz , &
10445 iopt_inf, iopt_rad , iopt_alb , iopt_snf , iopt_tbot, iopt_stc , &
10446 iopt_rsf, iopt_soil, iopt_pedo, iopt_crop, iopt_trs , iopt_diag, &
10451 integer,
intent(in) :: idveg
10452 integer,
intent(in) :: iopt_crs
10453 integer,
intent(in) :: iopt_btr
10454 integer,
intent(in) :: iopt_run
10455 integer,
intent(in) :: iopt_sfc
10456 integer,
intent(in) :: iopt_frz
10457 integer,
intent(in) :: iopt_inf
10458 integer,
intent(in) :: iopt_rad
10459 integer,
intent(in) :: iopt_alb
10460 integer,
intent(in) :: iopt_snf
10461 integer,
intent(in) :: iopt_tbot
10463 integer,
intent(in) :: iopt_stc
10465 integer,
intent(in) :: iopt_rsf
10466 integer,
intent(in) :: iopt_soil
10467 integer,
intent(in) :: iopt_pedo
10468 integer,
intent(in) :: iopt_crop
10469 integer,
intent(in) :: iopt_trs
10470 integer,
intent(in) :: iopt_diag
10471 integer,
intent(in) :: iopt_z0m
10486 opt_tbot = iopt_tbot
10489 opt_soil = iopt_soil
10490 opt_pedo = iopt_pedo
10491 opt_crop = iopt_crop
10493 opt_diag = iopt_diag
10501 p1d ,psfcpa,pblhx ,dx ,znt , &
10503 itime ,snwh ,isice ,psi_opt, &
10504 tsk ,qx ,zlvl ,iz0tlnd,qsfc , &
10505 hfx ,qfx ,cm ,chs ,chs2 , &
10507 rmolx ,ust , rbx, fmx, fhx,stressx,&
10508 fm10x, fh2x, wspdx,flhcx,flqcx)
10518 integer,
intent(in ) :: iloc
10519 integer,
intent(in ) :: jloc
10520 integer,
intent(in) :: itime
10522 integer,
intent(in) :: psi_opt
10524 integer,
intent(in) :: isice
10526 real(kind=kind_phys),
intent(in ) :: pblhx
10527 real(kind=kind_phys),
intent(in ) :: tsk
10528 real(kind=kind_phys),
intent(in ) :: psfcpa
10529 real(kind=kind_phys),
intent(in ) :: p1d
10530 real(kind=kind_phys),
intent(in ) :: t1d
10531 real(kind=kind_phys),
intent(in ) :: qx
10532 real(kind=kind_phys),
intent(in ) :: zlvl
10533 real(kind=kind_phys),
intent(in ) :: hfx
10534 real(kind=kind_phys),
intent(in ) :: qfx
10535 real(kind=kind_phys),
intent(in ) :: dx
10536 real(kind=kind_phys),
intent(in ) :: ux
10537 real(kind=kind_phys),
intent(in ) :: vx
10538 real(kind=kind_phys),
intent(in ) :: znt
10539 real(kind=kind_phys),
intent(in ) :: snwh
10540 real(kind=kind_phys),
intent(in ) :: ep_1
10541 real(kind=kind_phys),
intent(in ) :: ep_2
10542 real(kind=kind_phys),
intent(in ) :: cp
10546 integer,
optional,
intent(in ) :: iz0tlnd
10548 real(kind=kind_phys),
intent(inout) :: qsfc
10549 real(kind=kind_phys),
intent(inout) :: ust
10550 real(kind=kind_phys),
intent(inout) :: chs
10551 real(kind=kind_phys),
intent(inout) :: chs2
10552 real(kind=kind_phys),
intent(inout) :: cqs2
10553 real(kind=kind_phys),
intent(inout) :: cm
10555 real(kind=kind_phys),
intent(inout) :: rmolx
10556 real(kind=kind_phys),
intent(inout) :: rbx
10557 real(kind=kind_phys),
intent(inout) :: fmx
10558 real(kind=kind_phys),
intent(inout) :: fhx
10559 real(kind=kind_phys),
intent(inout) :: stressx
10560 real(kind=kind_phys),
intent(inout) :: fm10x
10561 real(kind=kind_phys),
intent(inout) :: fh2x
10563 real(kind=kind_phys),
intent(inout) :: wspdx
10564 real(kind=kind_phys),
intent(inout) :: flhcx
10565 real(kind=kind_phys),
intent(inout) :: flqcx
10567 real(kind=kind_phys) :: zolx
10568 real(kind=kind_phys) :: molx
10581 real(kind=kind_phys) :: za
10582 real(kind=kind_phys) :: thvx
10583 real(kind=kind_phys) :: zqkl
10584 real(kind=kind_phys) :: zqklp1
10585 real(kind=kind_phys) :: thx
10586 real(kind=kind_phys) :: psih
10587 real(kind=kind_phys) :: psih2
10588 real(kind=kind_phys) :: psih10
10589 real(kind=kind_phys) :: psim
10590 real(kind=kind_phys) :: psim2
10591 real(kind=kind_phys) :: psim10
10593 real(kind=kind_phys) :: gz1oz0
10594 real(kind=kind_phys) :: gz2oz0
10595 real(kind=kind_phys) :: gz10oz0
10597 real(kind=kind_phys) :: rhox
10598 real(kind=kind_phys) :: govrth
10599 real(kind=kind_phys) :: tgdsa
10600 real(kind=kind_phys) :: tvir
10601 real(kind=kind_phys) :: thgb
10602 real(kind=kind_phys) :: psfcx
10603 real(kind=kind_phys) :: cpm
10604 real(kind=kind_phys) :: qgh
10606 integer :: n,i,k,kk,l,nzol,nk,nzol2,nzol10
10608 real(kind=kind_phys) :: zolzt, zolz0, zolza
10609 real(kind=kind_phys) :: gz1ozt,gz2ozt,gz10ozt
10612 real(kind=kind_phys) :: pl,thcon,tvcon,e1
10613 real(kind=kind_phys) :: zl,tskv,dthvdz,dthvm,vconv,rzol,rzol2,rzol10,zol2,zol10
10614 real(kind=kind_phys) :: dtg,psix,dtthx,psix10,psit,psit2,psiq,psiq2,psiq10
10615 real(kind=kind_phys) :: fluxc,vsgd,z0q,visc,restar,czil,restar2
10617 real(kind=kind_phys) :: dqg
10618 real(kind=kind_phys) :: tabs
10619 real(kind=kind_phys) :: qsfcmr
10620 real(kind=kind_phys) :: t1dc
10621 real(kind=kind_phys) :: zt
10622 real(kind=kind_phys) :: zq
10623 real(kind=kind_phys) :: zratio
10624 real(kind=kind_phys) :: qstar
10625 real(kind=kind_phys) :: ep2
10626 real(kind=kind_phys) :: ep_3
10633 if (itime == 1)
then
10634 if (isice == 0)
then
10635 tabs = 0.5*(tsk + t1d)
10636 if (tabs .lt. 273.15)
then
10638 e1=svp1*exp(4648*(1./273.15 - 1./tabs) - &
10639 & 11.64*log(273.15/tabs) + 0.02265*(273.15 - tabs))
10642 e1=svp1*exp(svp2*(tabs-svpt0)/(tabs-svp3))
10645 qsfc =ep2*e1/(psfcx-ep_3*e1)
10646 qsfcmr =qsfc/(1.-qsfc)
10649 if (isice == 1)
then
10650 if (tsk .lt. 273.15)
then
10652 e1=svp1*exp(4648*(1./273.15 - 1./tsk) - &
10653 & 11.64*log(273.15/tsk) + 0.02265*(273.15 - tsk))
10656 e1=svp1*exp(svp2*(tsk-svpt0)/(tsk-svp3))
10659 qsfc=ep2*e1/(psfcx-ep_3*e1)
10660 qsfcmr=ep2*e1/(psfcx-e1)
10666 if (isice == 0)
then
10667 tabs = 0.5*(tsk + t1d)
10668 if (tabs .lt. 273.15)
then
10670 e1=svp1*exp(4648*(1./273.15 - 1./tabs) - &
10671 & 11.64*log(273.15/tabs) + 0.02265*(273.15 - tabs))
10674 e1=svp1*exp(svp2*(tabs-svpt0)/(tabs-svp3))
10677 qsfc =ep2*e1/(psfcx-ep_3*e1)
10678 qsfcmr=qsfc/(1.-qsfc)
10682 if (isice == 1)
then
10683 if (tsk .lt. 273.15)
then
10685 e1=svp1*exp(4648*(1./273.15 - 1./tsk) - &
10686 & 11.64*log(273.15/tsk) + 0.02265*(273.15 - tsk))
10689 e1=svp1*exp(svp2*(tsk-svpt0)/(tsk-svp3))
10692 qsfc=ep2*e1/(psfcx-ep_3*e1)
10693 qsfcmr=qsfc/(1.-qsfc)
10700 thgb = tsk*(p1000mb/psfcpa)**(rair/cpair)
10705 thx = t1d*(p1000mb*0.001/pl)**(rair/cpair)
10706 t1dc = t1d - 273.15
10708 thvx = thx*(1.+ep_1*qx)
10709 tvir = t1d*(1.+ep_1*qx)
10711 rhox=psfcx*1000./(rair*tvir)
10733 if (t1d .lt. 273.15)
then
10735 e1=svp1*exp(4648.*(1./273.15 - 1./t1d) - &
10736 & 11.64*log(273.15/t1d) + 0.02265*(273.15 - t1d))
10739 e1=svp1*exp(svp2*(t1d-svpt0)/(t1d-svp3))
10748 cpm=cp*(1.+0.84*qx/(1.0-qx) )
10750 wspdx=sqrt(ux*ux+vx*vx)
10752 tskv=thgb*(1.+ep_1*qsfc)
10755 fluxc = max(hfx/rhox/cp + ep_1*tskv*qfx/rhox,0.)
10758 vconv = vconvc*(grav/tgdsa*min(1.5*pblhx,4000.0)*fluxc)**.33
10761 vsgd = min(0.32 * (max(dx/5000.-1.,0.))**.33,0.5)
10762 wspdx=sqrt(wspdx*wspdx+vconv*vconv+vsgd*vsgd)
10763 wspdx=max(wspdx,0.1)
10764 rbx=govrth*za*dthvdz/(wspdx*wspdx)
10766 if (itime == 1)
then
10779 visc=1.326e-5*(1. + 6.542e-3*t1dc + 8.301e-6*t1dc*t1dc &
10780 - 4.84e-9*t1dc*t1dc*t1dc)
10785 restar=max(ust*znt/visc,0.1)
10790 if (snwh > 50. .or. isice == 1)
then
10793 if (
present(iz0tlnd) )
then
10794 if ( iz0tlnd .le. 1 )
then
10796 ust,vkc,1.0_kind_phys,iz0tlnd,0,0.0_kind_phys)
10797 elseif ( iz0tlnd .eq. 2 )
then
10800 elseif ( iz0tlnd .eq. 3 )
then
10811 ust,vkc,1.0_kind_phys,0,0,0.0_kind_phys)
10821 gz1oz0= log((za+znt)/znt)
10822 gz1ozt= log((za+znt)/zt)
10823 gz2oz0= log((2.0+znt)/znt)
10824 gz2ozt= log((2.0+znt)/zt)
10825 gz10oz0=log((10.+znt)/znt)
10835 if (rbx .gt. 0.0)
then
10848 zolx=zolrib(rbx,za,znt,zt,gz1oz0,gz1ozt,zolx,psi_opt)
10853 zolz0 = zolx*znt/za
10854 zolza = zolx*(za+znt)/za
10855 zol10 = zolx*(10.+znt)/za
10856 zol2 = zolx*(2.+znt)/za
10865 psim=psim_stable(zolza,psi_opt)-psim_stable(zolz0,psi_opt)
10866 psih=psih_stable(zolza,psi_opt)-psih_stable(zolzt,psi_opt)
10867 psim10=psim_stable(zol10,psi_opt)-psim_stable(zolz0,psi_opt)
10869 psih2=psih_stable(zol2,psi_opt)-psih_stable(zolzt,psi_opt)
10875 elseif(rbx .eq. 0.)
then
10889 elseif(rbx .lt. 0.)
then
10900 zolx=max(zolx,-20.0)
10908 zolx=zolrib(rbx,za,znt,zt,gz1oz0,gz1ozt,zolx,psi_opt)
10909 zolx=max(zolx,-20.0)
10913 zolz0 = zolx*znt/za
10914 zolza = zolx*(za+znt)/za
10915 zol10 = zolx*(10.+znt)/za
10916 zol2 = zolx*(2.+znt)/za
10924 psim=psim_unstable(zolza,psi_opt)-psim_unstable(zolz0,psi_opt)
10925 psih=psih_unstable(zolza,psi_opt)-psih_unstable(zolzt,psi_opt)
10926 psim10=psim_unstable(zol10,psi_opt)-psim_unstable(zolz0,psi_opt)
10928 psih2=psih_unstable(zol2,psi_opt)-psih_unstable(zolzt,psi_opt)
10934 psih=min(psih,0.9*gz1ozt)
10935 psim=min(psim,0.9*gz1oz0)
10936 psih2=min(psih2,0.9*gz2ozt)
10937 psim10=min(psim10,0.9*gz10oz0)
10946 psix =max(gz1oz0-psim, 1.0)
10947 psix10=max(gz10oz0-psim10, 1.0)
10948 psit =max(gz1ozt-psih , 1.0)
10949 psit2 =max(gz2ozt-psih2, 1.0)
10950 psiq =max(log((za+zq)/zq)-psih ,1.0)
10951 psiq2 =max(log((2.0+zq)/zq)-psih2 ,1.0)
10962 ust=0.5*ust+0.5*vkc*wspdx/psix
10981 molx=vkc*dtg/psit/prt
10988 dqg=(qx-qsfc)*1000.
10989 qstar=vkc*dqg/psiq/prt
10991 cm = (vkc/psix)*(vkc/psix)*wspdx
11003 flhcx = rhox*cpm*ust*vkc/psit
11004 flqcx = rhox*1.0*ust*vkc/psiq
11022 & landsea,iz0tlnd2,spp_pbl,rstoch)
11025 real (kind=kind_phys),
intent(in) :: z_0,restar,ustar,vkc,landsea
11026 integer,
optional,
intent(in):: iz0tlnd2
11027 real (kind=kind_phys),
intent(out) :: zt,zq
11028 real (kind=kind_phys) :: czil
11031 integer,
intent(in) :: spp_pbl
11032 real (kind=kind_phys),
intent(in) :: rstoch
11035 if (landsea-1.5 .gt. 0)
then
11039 if (restar .lt. 0.1)
then
11040 zt = z_0*exp(vkc*2.0)
11041 zt = min( zt, 6.0e-5)
11042 zt = max( zt, 2.0e-9)
11043 zq = z_0*exp(vkc*3.0)
11044 zq = min( zq, 6.0e-5)
11045 zq = max( zq, 2.0e-9)
11047 zt = z_0*exp(-vkc*(4.0*sqrt(restar)-3.2))
11048 zt = min( zt, 6.0e-5)
11049 zt = max( zt, 2.0e-9)
11050 zq = z_0*exp(-vkc*(4.0*sqrt(restar)-4.2))
11051 zq = min( zt, 6.0e-5)
11052 zq = max( zt, 2.0e-9)
11058 if ( iz0tlnd2 .eq. 1 )
then
11059 czil = 10.0 ** ( -0.40 * ( z_0 / 0.07 ) )
11064 zt = z_0*exp(-vkc*czil*sqrt(restar))
11065 zt = min( zt, 0.75*z_0)
11067 zq = z_0*exp(-vkc*czil*sqrt(restar))
11068 zq = min( zq, 0.75*z_0)
11073 if (spp_pbl==1)
then
11074 zt = zt + zt * 0.5 * rstoch
11075 zt = max(zt, 0.0001)
11091 real (kind=kind_phys),
intent(in) :: ren, z_0,landsea
11092 real (kind=kind_phys),
intent(out) :: zt,zq
11093 real (kind=kind_phys) :: rq
11094 real (kind=kind_phys),
parameter :: e=2.71828183
11096 if (landsea-1.5 .gt. 0)
then
11098 zt = z_0*exp(2.0 - (2.48*(ren**0.25)))
11099 zq = z_0*exp(2.0 - (2.28*(ren**0.25)))
11101 zq = min( zq, 5.5e-5)
11102 zq = max( zq, 2.0e-9)
11103 zt = min( zt, 5.5e-5)
11104 zt = max( zt, 2.0e-9)
11141 real (kind=kind_phys),
intent(in) :: z_0, ren, ustar, tstar, qst, visc
11142 real (kind=kind_phys) :: ht, &
11147 real (kind=kind_phys),
intent(out) :: zt,zq
11148 real (kind=kind_phys),
parameter :: renc=300., &
11153 z_02 = min(z_0,0.5)
11154 z_02 = max(z_02,0.04)
11155 renc2= b + m*log(z_02)
11156 ht = renc2*visc/max(ustar,0.01)
11157 tstar2 = min(tstar, 0.0)
11158 qstar2 = min(qst,0.0)
11160 zt = ht * exp(-beta*(ustar**0.5)*(abs(tstar2)**1.0))
11161 zq = ht * exp(-beta*(ustar**0.5)*(abs(qstar2)**1.0))
11164 zt = min(zt, z_0/2.0)
11165 zq = min(zq, z_0/2.0)
11179 real (kind=kind_phys),
intent(in) :: z_0, bvisc, ustar
11180 real (kind=kind_phys),
intent(out) :: zt, zq
11181 real (kind=kind_phys):: ren2, zntsno
11183 real (kind=kind_phys),
parameter :: bt0_s=1.25, bt0_t=0.149, bt0_r=0.317, &
11184 bt1_s=0.0, bt1_t=-0.55, bt1_r=-0.565, &
11185 bt2_s=0.0, bt2_t=0.0, bt2_r=-0.183
11187 real (kind=kind_phys),
parameter :: bq0_s=1.61, bq0_t=0.351, bq0_r=0.396, &
11188 bq1_s=0.0, bq1_t=-0.628, bq1_r=-0.512, &
11189 bq2_s=0.0, bq2_t=0.0, bq2_r=-0.180
11192 zntsno = 0.135*bvisc/ustar + &
11193 (0.035*(ustar*ustar)/9.8) * &
11194 (5.*exp(-1.*(((ustar - 0.18)/0.1)*((ustar - 0.18)/0.1))) + 1.)
11195 ren2 = ustar*zntsno/bvisc
11199 if (ren2 .gt. 1000.) ren2 = 1000.
11201 if (ren2 .le. 0.135)
then
11203 zt = zntsno*exp(bt0_s + bt1_s*log(ren2) + bt2_s*log(ren2)**2)
11204 zq = zntsno*exp(bq0_s + bq1_s*log(ren2) + bq2_s*log(ren2)**2)
11206 else if (ren2 .gt. 0.135 .and. ren2 .lt. 2.5)
then
11208 zt = zntsno*exp(bt0_t + bt1_t*log(ren2) + bt2_t*log(ren2)**2)
11209 zq = zntsno*exp(bq0_t + bq1_t*log(ren2) + bq2_t*log(ren2)**2)
11213 zt = zntsno*exp(bt0_r + bt1_r*log(ren2) + bt2_r*log(ren2)**2)
11214 zq = zntsno*exp(bq0_r + bq1_r*log(ren2) + bq2_r*log(ren2)**2)
11229 real (kind=kind_phys),
intent(out) :: zl
11230 real (kind=kind_phys),
intent(in) :: rib, zaz0, z0zt
11231 real (kind=kind_phys) :: alfa, beta, zaz02, z0zt2
11232 real (kind=kind_phys),
parameter :: au11=0.045, bu11=0.003, bu12=0.0059, &
11233 &bu21=-0.0828, bu22=0.8845, bu31=0.1739, &
11234 &bu32=-0.9213, bu33=-0.1057
11235 real (kind=kind_phys),
parameter :: aw11=0.5738, aw12=-0.4399, aw21=-4.901,&
11236 &aw22=52.50, bw11=-0.0539, bw12=1.540, &
11237 &bw21=-0.669, bw22=-3.282
11238 real (kind=kind_phys),
parameter :: as11=0.7529, as21=14.94, bs11=0.1569,&
11239 &bs21=-0.3091, bs22=-1.303
11243 if (zaz0 .lt. 100.0) zaz02=100.
11244 if (zaz0 .gt. 100000.0) zaz02=100000.
11248 if (z0zt .lt. 0.5) z0zt2=0.5
11249 if (z0zt .gt. 100.0) z0zt2=100.
11254 if (rib .le. 0.0)
then
11255 zl = au11*alfa*rib**2 + ( &
11256 & (bu11*beta + bu12)*alfa**2 + &
11257 & (bu21*beta + bu22)*alfa + &
11258 & (bu31*beta**2 + bu32*beta + bu33))*rib
11262 elseif (rib .gt. 0.0 .and. rib .le. 0.2)
then
11263 zl = ((aw11*beta + aw12)*alfa + &
11264 & (aw21*beta + aw22))*rib**2 + &
11265 & ((bw11*beta + bw12)*alfa + &
11266 & (bw21*beta + bw22))*rib
11271 zl = (as11*alfa + as21)*rib + bs11*alfa + &
11285 real*8 function zolri(ri,za,z0,zt,zol1,psi_opt)
11294 real (kind=kind_phys),
intent(in) :: ri,za,z0,zt,zol1
11295 integer,
intent(in) :: psi_opt
11296 real (kind=kind_phys) :: x1,x2,fx1,fx2
11298 integer,
parameter :: nmax = 20
11299 real(kind=kind_phys) zolri_iteration
11312 fx1=zolri2(x1,ri,za,z0,zt,psi_opt)
11313 fx2=zolri2(x2,ri,za,z0,zt,psi_opt)
11315 do while (abs(x1 - x2) > 0.01 .and. n < nmax)
11316 if(abs(fx2).lt.abs(fx1))
then
11317 x1=x1-fx1/(fx2-fx1)*(x2-x1)
11318 fx1=zolri2(x1,ri,za,z0,zt,psi_opt)
11321 x2=x2-fx2/(fx2-fx1)*(x2-x1)
11322 fx2=zolri2(x2,ri,za,z0,zt,psi_opt)
11330 if (n==nmax .and. abs(x1 - x2) >= 0.01)
then
11332 zolri_iteration=
zolri
11334 zolri = zolri_iteration
11344 real*8 function zolri2(zol2,ri2,za,z0,zt,psi_opt)
11356 integer,
intent(in) :: psi_opt
11357 real (kind=kind_phys),
intent(in) :: ri2,za,z0,zt
11358 real (kind=kind_phys),
intent(inout) :: zol2
11359 real (kind=kind_phys) :: zol20,zol3,psim1,psih1,psix2,psit2,zolt
11363 if(zol2*ri2 .lt. 0.)zol2=0.
11372 psit2=max(log((za+z0)/zt)-(psih_unstable(zol3,psi_opt)-psih_unstable(zolt,psi_opt)), 1.0)
11373 psix2=max(log((za+z0)/z0)-(psim_unstable(zol3,psi_opt)-psim_unstable(zol20,psi_opt)),1.0)
11377 psit2=max(log((za+z0)/zt)-(psih_stable(zol3,psi_opt)-psih_stable(zolt,psi_opt)), 1.0)
11378 psix2=max(log((za+z0)/z0)-(psim_stable(zol3,psi_opt)-psim_stable(zol20,psi_opt)),1.0)
11381 zolri2=zol2*psit2/psix2**2 - ri2
11388 real*8 function zolrib(ri,za,z0,zt,logz0,logzt,zol1,psi_opt)
11393 real (kind=kind_phys),
intent(in) :: ri,za,z0,zt,logz0,logzt
11394 integer,
intent(in) :: psi_opt
11395 real (kind=kind_phys),
intent(inout) :: zol1
11396 real (kind=kind_phys) :: zol20,zol3,zolt,zolold
11398 integer,
parameter :: nmax = 20
11399 real (kind=kind_phys),
dimension(nmax):: zlhux
11400 real (kind=kind_phys) :: psit2,psix2,zolrib_iteration
11406 if (zol1*ri .lt. 0.)
then
11411 if (ri .lt. 0.)
then
11420 do while (abs(zolold - zolrib) > 0.01 .and. n < nmax)
11434 psit2=max(logzt-(psih_unstable(zol3,psi_opt)-psih_unstable(zolt,psi_opt)), 1.0)
11435 psix2=max(logz0-(psim_unstable(zol3,psi_opt)-psim_unstable(zol20,psi_opt)), 1.0)
11439 psit2=max(logzt-(psih_stable(zol3,psi_opt)-psih_stable(zolt,psi_opt)), 1.0)
11440 psix2=max(logz0-(psim_stable(zol3,psi_opt)-psim_stable(zol20,psi_opt)), 1.0)
11443 zolrib=ri*psix2**2/psit2
11448 if (n==nmax .and. abs(zolold - zolrib) > 0.01 )
then
11451 zolrib_iteration = zolrib
11453 zolrib = zolrib_iteration
11475 integer :: n,psi_opt
11476 real (kind=kind_phys) :: zolf
11477 character(len=*),
intent(out) :: errmsg
11478 integer,
intent(out) :: errflg
11480 if (psi_opt == 0)
then
11483 zolf = float(n)*0.01
11488 zolf = -float(n)*0.01
11495 zolf = float(n)*0.01
11496 psim_stab(n)=psim_stable_full_gfs(zolf)
11497 psih_stab(n)=psih_stable_full_gfs(zolf)
11500 zolf = -float(n)*0.01
11501 psim_unstab(n)=psim_unstable_full_gfs(zolf)
11502 psih_unstab(n)=psih_unstable_full_gfs(zolf)
11507 if (psim_stab(1) < 0. .and. psih_stab(1) < 0. .and. &
11508 psim_unstab(1) > 0. .and. psih_unstab(1) > 0.)
then
11509 errmsg =
'in mynn sfc, psi tables have been initialized'
11512 errmsg =
'error in mynn sfc: problem initializing psi tables'
11522 real (kind=kind_phys) :: zolf
11532 real (kind=kind_phys) :: zolf
11542 real (kind=kind_phys) :: zolf,x,ym,psimc,psimk
11544 x=(1.-16.*zolf)**.25
11546 psimk=2.*log(0.5*(1+x))+log(0.5*(1+x*x))-2.*atan(x)+2.*atan1
11548 ym=(1.-10.*zolf)**onethird
11550 psimc=1.5*log((ym**2 + ym+1.)*onethird)-sqrt3*atan((2.*ym+1)/sqrt3)+4.*atan1/sqrt3
11559 real (kind=kind_phys) :: zolf,y,yh,psihc,psihk
11561 y=(1.-16.*zolf)**.5
11563 psihk=2.*log((1+y)*0.5)
11565 yh=(1.-34.*zolf)**onethird
11567 psihc=1.5*log((yh**2.+yh+1.)*onethird)-sqrt3*atan((2.*yh+1)/sqrt3)+4.*atan1/sqrt3
11577 real*8 function psim_stable_full_gfs(zolf)
11578 real (kind=kind_phys) :: zolf
11579 real (kind=kind_phys),
parameter :: alpha4 = 20.
11580 real (kind=kind_phys) :: aa
11582 aa = sqrt(1. + alpha4 * zolf)
11583 psim_stable_full_gfs = -1.*aa + log(aa + 1.)
11588 real*8 function psih_stable_full_gfs(zolf)
11589 real (kind=kind_phys) :: zolf
11590 real (kind=kind_phys),
parameter :: alpha4 = 20.
11591 real (kind=kind_phys) :: bb
11593 bb = sqrt(1. + alpha4 * zolf)
11594 psih_stable_full_gfs = -1.*bb + log(bb + 1.)
11599 real*8 function psim_unstable_full_gfs(zolf)
11600 real (kind=kind_phys) :: zolf
11601 real (kind=kind_phys) :: hl1,tem1
11602 real (kind=kind_phys),
parameter :: a0=-3.975, a1=12.32, &
11603 b1=-7.755, b2=6.041
11605 if (zolf .ge. -0.5)
then
11607 psim_unstable_full_gfs = (a0 + a1*hl1) * hl1 / (1.+ (b1+b2*hl1) *hl1)
11610 tem1 = 1.0 / sqrt(hl1)
11611 psim_unstable_full_gfs = log(hl1) + 2. * sqrt(tem1) - .8776
11617 real*8 function psih_unstable_full_gfs(zolf)
11618 real (kind=kind_phys) :: zolf
11619 real (kind=kind_phys) :: hl1,tem1
11620 real (kind=kind_phys),
parameter :: a0p=-7.941, a1p=24.75, &
11621 b1p=-8.705, b2p=7.899
11623 if (zolf .ge. -0.5)
then
11625 psih_unstable_full_gfs = (a0p + a1p*hl1) * hl1 / (1.+ (b1p+b2p*hl1)*hl1)
11628 tem1 = 1.0 / sqrt(hl1)
11629 psih_unstable_full_gfs = log(hl1) + .5 * tem1 + 1.386
11638 real*8 function psim_stable(zolf,psi_opt)
11639 integer :: nzol,psi_opt
11640 real (kind=kind_phys) :: rzol,zolf
11642 nzol = int(zolf*100.)
11643 rzol = zolf*100. - nzol
11644 if(nzol+1 .lt. 1000)
then
11645 psim_stable = psim_stab(nzol) + rzol*(psim_stab(nzol+1)-psim_stab(nzol))
11647 if (psi_opt == 0)
then
11650 psim_stable = psim_stable_full_gfs(zolf)
11657 real*8 function psih_stable(zolf,psi_opt)
11658 integer :: nzol,psi_opt
11659 real (kind=kind_phys) :: rzol,zolf
11661 nzol = int(zolf*100.)
11662 rzol = zolf*100. - nzol
11663 if(nzol+1 .lt. 1000)
then
11664 psih_stable = psih_stab(nzol) + rzol*(psih_stab(nzol+1)-psih_stab(nzol))
11666 if (psi_opt == 0)
then
11669 psih_stable = psih_stable_full_gfs(zolf)
11676 real*8 function psim_unstable(zolf,psi_opt)
11677 integer :: nzol,psi_opt
11678 real (kind=kind_phys) :: rzol,zolf
11680 nzol = int(-zolf*100.)
11681 rzol = -zolf*100. - nzol
11682 if(nzol+1 .lt. 1000)
then
11683 psim_unstable = psim_unstab(nzol) + rzol*(psim_unstab(nzol+1)-psim_unstab(nzol))
11685 if (psi_opt == 0)
then
11688 psim_unstable = psim_unstable_full_gfs(zolf)
11695 real*8 function psih_unstable(zolf,psi_opt)
11696 integer :: nzol,psi_opt
11697 real (kind=kind_phys) :: rzol,zolf
11699 nzol = int(-zolf*100.)
11700 rzol = -zolf*100. - nzol
11701 if(nzol+1 .lt. 1000)
then
11702 psih_unstable = psih_unstab(nzol) + rzol*(psih_unstab(nzol+1)-psih_unstab(nzol))
11704 if (psi_opt == 0)
then
11707 psih_unstable = psih_unstable_full_gfs(zolf)
11714end module module_sf_noahmplsm
subroutine csnow
This subroutine calculates snow termal conductivity.
subroutine sstep(nsoil, sh2oin, rhsct, dt, smcmax, cmcmax, zsoil, sice, cmc, rhstt, ai, bi, ci, sh2oout, runoff3, smc)
This subroutine calculates/updates soil moisture content values and canopy moisture content values.
subroutine rosr12(nsoil, a, b, d, c, p, delta)
This subroutine inverts (solve) the tri-diagonal matrix problem.
subroutine frh2o(tkelv, smc, sh2o, smcmax, bexp, psis, liqwat)
This subroutine calculates amount of supercooled liquid soil water content if temperature is below 27...
subroutine tdfcnd(smc, qz, smcmax, sh2o, df)
This subroutine calculates thermal diffusivity and conductivity of the soil for a given point and tim...
subroutine snowz0
This subroutine calculates total roughness length over snow.
subroutine canres
This subroutine calculates canopy resistance which depends on incoming solar radiation,...
subroutine hrt(nsoil, stc, smc, smcmax, zsoil, yy, zz1, tbot, zbot, psisat, dt, bexp, df1, quartz, csoil, vegtyp, shdfac, lheatstrg, sh2o, rhsts, ai, bi, ci)
This subroutine calculates the right hand side of the time tendency term of the soil thermal diffusio...
subroutine hstep(nsoil, stcin, dt, rhsts, ai, bi, ci, stcout)
This subroutine calculates/updates the soil temperature field.
subroutine srt(nsoil, edir, et, sh2o, sh2oa, pcpdrp, zsoil, dwsat, dksat, smcmax, bexp, dt, smcwlt, slope, kdt, frzx, sice, rhstt, runoff1, runoff2, ai, bi, ci)
This subroutine calculates the right hand side of the time tendency term of the soil water diffusion ...
subroutine shallowwatertable(parameters, nsnow, nsoil, zsoil, dt, dzsnso, smceq, iloc, jloc, smc, wtd, smcwtd, rech, qdrain)
diagnoses water table depth and computes recharge when the water table is within the resolved soil la...
subroutine surrad(parameters, mpe, fsun, fsha, elai, vai, laisun, laisha, solad, solai, fabd, fabi, ftdd, ftid, ftii, albgrd, albgri, albd, albi, iloc, jloc, parsun, parsha, sav, sag, fsa, fsr, frevi, frevd, fregd, fregi, fsrv, fsrg)
surface raditiation
subroutine combine(parameters, nsnow, nsoil, iloc, jloc, isnow, sh2o, stc, snice, snliq, dzsnso, sice, snowh, sneqv, ponding1, ponding2)
subroutine canwater(parameters, vegtyp, dt, fcev, fctr, elai, esai, tg, fveg, iloc, jloc, bdfall, frozen_canopy, canliq, canice, tv, cmc, ecan, etran, fwet)
canopy hydrology
subroutine carbon_crop(parameters, nsnow, nsoil, vegtyp, dt, zsoil, julian, dzsnso, stc, smc, tv, psn, foln, btran, soldn, t2m, lfmass, rtmass, stmass, wood, stblcp, fastcp, grain, xlai, xsai, gdd, gpp, npp, nee, autors, heters, totsc, totlb, pgs)
initial crop version created by xing liu initial crop version added by barlage v3....
subroutine phasechange(parameters, nsnow,nsoil,isnow,dt,fact, dzsnso,hcpct,ist,iloc,jloc, stc,snice,snliq,sneqv,snowh, ifdef ccpp
melting/freezing of snow water and soil water
subroutine snowalb_bats(parameters, nband, fsno, cosz, fage, albsnd, albsni)
bats snow surface albedo
subroutine energy(parameters, ice,vegtyp,ist,nsnow,nsoil, isnow,dt,rhoair,sfcprs,qair, sfctmp,thair,lwdn,uu,vv,zref, co2air,o2air,solad,solai,cosz,igs, eair,tbot,zsnso,zsoil, elai,esai,fwet,foln, fveg,shdfac, pahv,pahg,pahb, qsnow,dzsnso,lat,canliq,canice,iloc, jloc, thsfc_loc, prslkix, prsik1x, prslk1x, garea1, pblhx, iz0tlnd, itime, psi_opt, ep_1, ep_2, epsm1, cp, z0wrf,z0hwrf, imelt,snicev,snliqv,epore,t2m,fsno, sav,sag,qmelt,fsa,fsr,taux, tauy,fira,fsh,fcev,fgev,fctr, trad,psn,apar,ssoil,btrani,btran, ponding, ts,latheav, latheag, frozen_canopy, frozen_ground, tv,tg,stc,snowh,eah,tah, sneqvo,sneqv,sh2o,smc,snice,snliq, albold,cm,ch,dx,dz8w,q2, ustarx, ifdef ccpp
We use different approaches to deal with subgrid features of radiation transfer and turbulent transfe...
subroutine snowfall(parameters, nsoil, nsnow, dt, qsnow, snowhin, sfctmp, iloc, jloc, isnow, snowh, dzsnso, stc, snice, snliq, sneqv)
snow depth and density to account for the new snowfall. new values of snow depth & density returned.
subroutine growing_gdd(parameters, t2m, dt, julian, gdd, ipa, iha, pgs)
subroutine divide(parameters, nsnow, nsoil, isnow, stc, snice, snliq, dzsnso)
subroutine noahmp_options(idveg, iopt_crs, iopt_btr, iopt_run, iopt_sfc, iopt_frz, iopt_inf, iopt_rad, iopt_alb, iopt_snf, iopt_tbot, iopt_stc, iopt_rsf, iopt_soil, iopt_pedo, iopt_crop, iopt_trs, iopt_diag, iopt_z0m)
subroutine water(parameters, vegtyp, nsnow, nsoil, imelt, dt, uu, vv, fcev, fctr, qprecc, qprecl, elai, esai, sfctmp, qvap, qdew, zsoil, btrani, ficeold, ponding, tg, ist, fveg, iloc, jloc, smceq, bdfall, fp, rain, snow, qsnow, qrain, snowhin, latheav, latheag, frozen_canopy, frozen_ground, isnow, canliq, canice, tv, snowh, sneqv, snice, snliq, stc, zsnso, sh2o, smc, sice, zwt, wa, wt, dzsnso, wslake, smcwtd, deeprech, rech, cmc, ecan, etran, fwet, runsrf, runsub, qin, qdis, ponding1, ponding2, qsnbot, esnow)
compute water budgets (water storages, et components, and runoff)
subroutine snowalb_class(parameters, nband, qsnow, dt, alb, albold, albsnd, albsni, iloc, jloc)
class snow surface albedo
subroutine psi_init(psi_opt, errmsg, errflg)
subroutine infil(parameters, nsoil, dt, zsoil, sh2o, sice, sicemax, qinsur, pddum, runsrf)
compute inflitration rate at soil surface and surface runoff
subroutine carbon(parameters, nsnow, nsoil, vegtyp, dt, zsoil, dzsnso, stc, smc, tv, tg, psn, foln, btran, apar, fveg, igs, troot, ist, lat, iloc, jloc, lfmass, rtmass, stmass, wood, stblcp, fastcp, gpp, npp, nee, autors, heters, totsc, totlb, xlai, xsai)
subroutine combo(parameters, dz, wliq, wice, t, dz2, wliq2, wice2, t2)
subroutine groundalb(parameters, nsoil, nband, ice, ist, fsno, smc, albsnd, albsni, cosz, tg, iloc, jloc, albgrd, albgri)
ground surface albedo
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 sfcdif1(parameters, iter,sfctmp,rhoair,h,qair, zlvl,zpd,z0m,z0h,ur, mpe,iloc,jloc, ifdef ccpp
compute surface drag coefficient cm for momentum and ch for heat.
subroutine sfcdif3(parameters, iloc, jloc, iter, sfctmp, qair, ur, zlvl, tgb, thsfc_loc, prslkix, prsik1x, prslk1x, z0m, z0h, zpd, snowh, fveg, garea1, ustarx, fm, fh, fm2, fh2, fv, cm, ch)
compute surface drag coefficient cm for momentum and ch for heat.
subroutine phenology(parameters, vegtyp, croptype, snowh, tv, lat, yearlen, julian, lai, sai, troot, elai, esai, igs, pgs)
vegetation phenology considering vegetation canopy being buried by snow and evolution in time.
subroutine groundwater(parameters, nsnow, nsoil, dt, sice, zsoil, stc, wcnd, fcrmax, iloc, jloc, sh2o, zwt, wa, wt, qin, qdis)
subroutine snow_age(parameters, dt, tg, sneqvo, sneqv, tauss, fage)
subroutine tsnosoi(parameters, ice,nsoil,nsnow,isnow,ist, tbot,zsnso,ssoil,df,hcpct, sag,dt,snowh,dzsnso, tg,iloc,jloc, ifdef ccpp
compute snow (up to 3l) and soil (4l) temperature. note that snow temperatures during melting season ...
subroutine snowwater(parameters, nsnow, nsoil, imelt, dt, zsoil, sfctmp, snowhin, qsnow, qsnfro, qsnsub, qrain, ficeold, iloc, jloc, isnow, snowh, sneqv, snice, snliq, sh2o, sice, stc, zsnso, dzsnso, qsnbot, snoflow, ponding1, ponding2)
subroutine garratt_1992(zt, zq, z_0, ren, landsea)
data. the formula for land uses a constant ratio (z_0/7.4) taken from garratt (1992).
subroutine sfcdif2(parameters, iter, z0, thz0, thlm, sfcspd, zlm, iloc, jloc, akms, akhs, rlmo, wstar2, ustar)
calculate surface layer exchange coefficients via iteractive process (Chen et al. 1997,...
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 calhum(parameters, sfctmp, sfcprs, q2sat, dqsdt2)
subroutine zilitinkevich_1995(z_0, zt, zq, restar, ustar, vkc, landsea, iz0tlnd2, spp_pbl, rstoch)
subroutine twostream(parameters, ib, ic, vegtyp, cosz, vai, fwet, t, albgrd, albgri, rho, tau, fveg, ist, iloc, jloc, fab, fre, ftd, fti, gdir, frev, freg, bgap, wgap)
use two-stream approximation of Dickinson (1983) adv geophysics 25: 305-353 and sellers (1985) int j ...
subroutine atm(parameters, ep_2, epsm1, sfcprs, sfctmp, q2, prcpconv, prcpnonc, prcpshcv, prcpsnow, prcpgrpl, prcphail, soldn, cosz, thair, qair, eair, rhoair, qprecc, qprecl, solad, solai, swdown, bdfall, rain, snow, fp, fpice, prcp)
re-precess atmospheric forcing.
subroutine radiation(parameters, vegtyp, ist, ice, nsoil, sneqvo, sneqv, dt, cosz, snowh, tg, tv, fsno, qsnow, fwet, elai, esai, smc, solad, solai, fveg, iloc, jloc, albold, tauss, fsun, laisun, laisha, parsun, parsha, sav, sag, fsr, fsa, fsrv, fsrg, albd, albi, albsnd, albsni, bgap, wgap)
Calculate solar radiation: absorbed & reflected by the ground and canopy.
subroutine co2flux(parameters, nsnow, nsoil, vegtyp, igs, dt, dzsnso, stc, psn, troot, tv, wroot, wstres, foln, lapm, lat, iloc, jloc, fveg, xlai, xsai, lfmass, rtmass, stmass, fastcp, stblcp, wood, gpp, npp, nee, autors, heters, totsc, totlb)
the original code is from Dickinson et al.(1998), modified by guo-yue niu, 2004
subroutine thermoprop(parameters, nsoil, nsnow, isnow, ist, dzsnso, dt, snowh, snice, snliq, shdfac, smc, sh2o, tg, stc, ur, lat, z0m, zlvl, vegtyp, df, hcpct, snicev, snliqv, epore, fact)
subroutine noahmp_sflx(parameters, iloc, jloc, lat, yearlen, julian, cosz, dt, dx, dz8w, nsoil, zsoil, nsnow, shdfac, shdmax, vegtyp, ice, ist, croptype, smceq, sfctmp, sfcprs, psfc, uu, vv, q2, garea1, qc, soldn, lwdn, thsfc_loc, prslkix, prsik1x, prslk1x, pblhx, iz0tlnd, itime,psi_opt, prcpconv, prcpnonc, prcpshcv, prcpsnow, prcpgrpl, prcphail, tbot, co2air, o2air, foln, ficeold, zlvl, ep_1, ep_2, epsm1, cp, albold, sneqvo, stc, sh2o, smc, tah, eah, fwet, canliq, canice, tv, tg, qsfc, qsnow, qrain, isnow, zsnso, snowh, sneqv, snice, snliq, zwt, wa, wt, wslake, lfmass, rtmass, stmass, wood, stblcp, fastcp, lai, sai, cm, ch, tauss, grain, gdd, pgs, smcwtd,deeprech, rech, ustarx, z0wrf, z0hwrf, ts, fsa, fsr, fira, fsh, ssoil, fcev, fgev, fctr, ecan, etran, edir, trad, tgb, tgv, t2mv, t2mb, q2v, q2b, runsrf, runsub, apar, psn, sav, sag, fsno, nee, gpp, npp, fveg, albedo, qsnbot, ponding, ponding1, ponding2, rssun, rssha, albd, albi, albsnd, albsni, bgap, wgap, chv, chb, emissi, shg, shc, shb, evg, evb, ghv, ghb, irg, irc, irb, tr, evc, chleaf, chuc, chv2, chb2, fpice, pahv, pahg, pahb, pah, esnow, canhs, laisun, laisha, rb, qsfcveg, qsfcbare ifdef ccpp
subroutine compact(parameters, nsnow, nsoil, dt, stc, snice, snliq, zsoil, imelt, ficeold, iloc, jloc, isnow, dzsnso, zsnso)
subroutine wdfcnd2(parameters, wdf, wcnd, smc, sice, isoil)
calculate soil water diffusivity and soil hydraulic conductivity.
subroutine ragrb(parameters, iter, vai, rhoair, hg, tah, zpd, z0mg, z0hg, hcan, uc, z0h, fv, cwp, vegtyp, mpe, tv, mozg, fhg, fhgh, iloc, jloc, ramg, rahg, rawg, rb)
compute under-canopy aerodynamic resistance rag and leaf boundary layer resistance rb.
subroutine error(parameters, swdown,fsa,fsr,fira,fsh,fcev, fgev,fctr,ssoil,beg_wb,canliq,canice, sneqv,wa,smc,dzsnso,prcp,ecan, etran,edir,runsrf,runsub,dt,nsoil, nsnow,ist,errwat, iloc,jloc,fveg, sav,sag,fsrv,fsrg,zwt,pah, ifdef ccpp
check surface energy balance and water balance.
subroutine psn_crop(parameters, soldn, xlai, t2m, psncrop)
subroutine snowh2o(parameters, nsnow, nsoil, dt, qsnfro, qsnsub, qrain, iloc, jloc, isnow, dzsnso, snowh, sneqv, snice, snliq, sh2o, sice, stc, qsnbot, ponding1, ponding2)
renew the mass of ice lens (snice) and liquid (snliq) of the surface snow layer resulting from sublim...
subroutine precip_heat(parameters, iloc, jloc, vegtyp, dt, uu, vv, elai, esai, fveg, ist, bdfall, rain, snow, fp, canliq, canice, tv, sfctmp, tg, qintr, qdripr, qthror, qints, qdrips, qthros, pahv, pahg, pahb, qrain, qsnow, snowhin, fwet, cmc)
Michael Barlage: Oct 2013 - Split canwater to calculate precip movement for tracking of advected heat...
subroutine zwteq(parameters, nsoil, nsnow, zsoil, dzsnso, sh2o, zwt)
calculate equilibrium water table depth (niu et al., 2005)
subroutine soilwater(parameters, nsoil, nsnow, dt, zsoil, dzsnso, qinsur, qseva, etrani, sice, iloc, jloc, sh2o, smc, zwt, vegtyp, smcwtd, deeprech, runsrf, qdrain, runsub, wcnd, fcrmax)
calculate surface runoff and soil moisture.
subroutine co2flux_crop(parameters, dt, stc, psn, tv, wroot, wstres, foln, ipa, iha, pgs, xlai, xsai, lfmass, rtmass, stmass, fastcp, stblcp, wood, grain, gdd, gpp, npp, nee, autors, heters, totsc, totlb)
the original code from re dickinson et al.(1998) and guo-yue niu (2004), modified by xing liu,...
subroutine vege_flux(parameters, nsnow,nsoil,isnow,vegtyp,veg, dt,sav,sag,lwdn,ur, uu,vv,sfctmp,thair,qair, eair,rhoair,snowh,vai,gammav,gammag, fwet,laisun,laisha,cwp,dzsnso, zlvl,zpd,z0m,fveg,shdfac, z0mg,emv,emg,canliq,fsno, canice,stc,df,rssun,rssha, rsurf,latheav,latheag,parsun,parsha,igs, foln,co2air,o2air,btran,sfcprs, rhsur,iloc,jloc,q2,pahv,pahg, thsfc_loc, prslkix, prsik1x, prslk1x, garea1, pblhx,iz0tlnd,itime,psi_opt,ep_1, ep_2, epsm1, cp, eah,tah,tv,tg,cm, ustarx, ifdef ccpp
use newton-raphson iteration to solve for vegetation (tv) and ground (tg) temperatures that balance t...
subroutine thermalz0(parameters, fveg, z0m, z0mg, zlvl, zpd, ezpd, ustarx, vegtyp, vaie, ur, c_sigma_f0, c_sigma_f1, a1, cdmn_v, cdmn_g, surface_flag, z0m_out, z0h_out)
subroutine bare_flux(parameters, nsnow,nsoil,isnow,dt,sag, lwdn,ur,uu,vv,sfctmp, thair,qair,eair,rhoair,snowh, dzsnso,zlvl,zpd,z0m,fsno, emg,stc,df,rsurf,lathea, gamma,rhsur,iloc,jloc,q2,pahb, thsfc_loc, prslkix, prsik1x, prslk1x, vegtyp, fveg, shdfac, garea1, pblhx, iz0tlnd, itime,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 stomata(parameters, vegtyp, mpe, apar, foln, iloc, jloc, tv, ei, ea, sfctmp, sfcprs, o2, co2, igs, btran, rb, rs, psn)
subroutine esat(t, esw, esi, desw, desi)
use polynomials to calculate saturation vapor pressure and derivative with respect to temperature: ov...
real *8 function zolri(ri, za, z0, zt, zol1, psi_opt)
subroutine wdfcnd1(parameters, wdf, wcnd, smc, fcr, isoil)
calculate soil water diffusivity and soil hydraulic conductivity.
subroutine yang_2008(z_0, zt, zq, ustar, tstar, qst, ren, visc)
this is a modified version of yang et al (2002 qjrms, 2008 jamc) and chen et al (2010,...
real *8 function psih_stable_full(zolf)
real *8 function psim_unstable_full(zolf)
subroutine li_etal_2010(zl, rib, zaz0, z0zt)
this subroutine returns a more robust z/l that best matches the z/l from hogstrom (1996) for unstable...
real *8 function psim_stable_full(zolf)
subroutine andreas_2002(z_0, bvisc, ustar, zt, zq)
this is taken from andreas (2002; j. of hydromet) and andreas et al. (2005; blm).
real *8 function psih_unstable_full(zolf)