8module module_sf_noahmplsm
12use machine ,
only : kind_phys
16 public :: noahmp_options
24 private :: precip_heat
32 private :: snowalb_bats
33 private :: snowalb_class
49 private :: phasechange
68 private :: groundwater
69 private :: shallowwatertable
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
953 albedo = fsr / swdown
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
1226 end subroutine phenology
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
1458 end subroutine precip_heat
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
2465 end subroutine energy
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))
2597 end subroutine thermoprop
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
2772 end subroutine tdfcnd
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 , &
2900 end subroutine radiation
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
3091 end subroutine albedo
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)
3218 end subroutine surrad
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.)
3272 end subroutine snow_age
3278 subroutine snowalb_bats (parameters,nband,fsno,cosz,fage,albsnd,albsni)
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))
3329 end subroutine snowalb_bats
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)
3384 end subroutine snowalb_class
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
3450 end subroutine groundalb
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)
3705 end subroutine twostream
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'
4438 end subroutine vege_flux
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
4945 end subroutine bare_flux
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)
5237 end subroutine sfcdif1
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
5446 end subroutine sfcdif2
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)
5540 end subroutine sfcdif3
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
5955 end subroutine thermalz0
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. )
6146 end subroutine stomata
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)
6237 end subroutine canres
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
6270 end subroutine calhum
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))
6410 end subroutine tsnosoi
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)
6638 end subroutine rosr12
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))
6870 end subroutine phasechange
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.
6965 do while ((nlog < 10) .and. (kcount == 0))
6967 df = log( ( parameters%psisat(isoil) * grav / hfus ) * ( ( 1. + ck * swl )**2.) * &
6968 ( parameters%smcmax(isoil) / (smc - swl) )** bx) - log( - ( &
6969 tkelv - tfrz)/ tkelv)
6970 denom = 2. * ck / ( 1. + ck * swl ) + bx / ( smc - swl )
6971 swlk = swl - df / denom
6975 if (swlk > (smc -0.02)) swlk = smc - 0.02
6976 if (swlk < 0.) swlk = 0.
6981 dswl = abs(swlk - swl)
6986 if ( dswl <= error )
then
7005 if (kcount == 0)
then
7006 write(message,
'("flerchinger used in new version. iterations=", i6)') nlog
7008 errmsg = trim(message)
7010 call wrf_message(trim(message))
7012 fk = ( ( (hfus / (grav * ( - parameters%psisat(isoil))))* &
7013 ( (tkelv - tfrz)/ tkelv))** ( -1/ bx))* parameters%smcmax(isoil)
7014 if (fk < 0.02) fk = 0.02
7022 end subroutine frh2o
7032 subroutine water (parameters,vegtyp ,nsnow ,nsoil ,imelt ,dt ,uu , & !in
7033 vv ,fcev ,fctr ,qprecc ,qprecl ,elai , & !in
7034 esai ,sfctmp ,qvap ,qdew ,zsoil ,btrani , & !in
7035 ficeold,ponding,tg ,ist ,fveg ,iloc ,jloc ,smceq , & !in
7036 bdfall ,fp ,rain ,snow, & !in mb/an: v3.7
7037 qsnow ,qrain ,snowhin,latheav,latheag,frozen_canopy,frozen_ground, & !in mb
7038 isnow ,canliq ,canice ,tv ,snowh ,sneqv , & !inout
7039 snice ,snliq ,stc ,zsnso ,sh2o ,smc , & !inout
7040 sice ,zwt ,wa ,wt ,dzsnso ,wslake , & !inout
7041 smcwtd ,deeprech,rech , & !inout
7042 cmc ,ecan ,etran ,fwet ,runsrf ,runsub , & !out
7043 qin ,qdis ,ponding1 ,ponding2, &
7052 type (noahmp_parameters),
intent(in) :: parameters
7053 integer,
intent(in) :: iloc
7054 integer,
intent(in) :: jloc
7055 integer,
intent(in) :: vegtyp
7056 integer,
intent(in) :: nsnow
7057 integer ,
intent(in) :: ist
7058 integer,
intent(in) :: nsoil
7059 integer,
dimension(-nsnow+1:0) ,
intent(in) :: imelt
7060 real (kind=kind_phys),
intent(in) :: dt
7061 real (kind=kind_phys),
intent(in) :: uu
7062 real (kind=kind_phys),
intent(in) :: vv
7063 real (kind=kind_phys),
intent(in) :: fcev
7064 real (kind=kind_phys),
intent(in) :: fctr
7065 real (kind=kind_phys),
intent(in) :: qprecc
7066 real (kind=kind_phys),
intent(in) :: qprecl
7067 real (kind=kind_phys),
intent(in) :: elai
7068 real (kind=kind_phys),
intent(in) :: esai
7069 real (kind=kind_phys),
intent(in) :: sfctmp
7070 real (kind=kind_phys),
intent(in) :: qvap
7071 real (kind=kind_phys),
intent(in) :: qdew
7072 real (kind=kind_phys),
dimension( 1:nsoil),
intent(in) :: zsoil
7073 real (kind=kind_phys),
dimension( 1:nsoil),
intent(in) :: btrani
7074 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(in) :: ficeold
7076 real (kind=kind_phys) ,
intent(in) :: tg
7077 real (kind=kind_phys) ,
intent(in) :: fveg
7078 real (kind=kind_phys) ,
intent(in) :: bdfall
7079 real (kind=kind_phys) ,
intent(in) :: fp
7080 real (kind=kind_phys) ,
intent(in) :: rain
7081 real (kind=kind_phys) ,
intent(in) :: snow
7082 real (kind=kind_phys),
dimension( 1:nsoil),
intent(in) :: smceq
7083 real (kind=kind_phys) ,
intent(in) :: qsnow
7084 real (kind=kind_phys) ,
intent(in) :: qrain
7085 real (kind=kind_phys) ,
intent(in) :: snowhin
7088 integer,
intent(inout) :: isnow
7089 real (kind=kind_phys),
intent(inout) :: canliq
7090 real (kind=kind_phys),
intent(inout) :: canice
7091 real (kind=kind_phys),
intent(inout) :: tv
7092 real (kind=kind_phys),
intent(inout) :: snowh
7093 real (kind=kind_phys),
intent(inout) :: sneqv
7094 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(inout) :: snice
7095 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(inout) :: snliq
7096 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: stc
7097 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: zsnso
7098 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: dzsnso
7099 real (kind=kind_phys),
dimension( 1:nsoil),
intent(inout) :: sh2o
7100 real (kind=kind_phys),
dimension( 1:nsoil),
intent(inout) :: sice
7101 real (kind=kind_phys),
dimension( 1:nsoil),
intent(inout) :: smc
7102 real (kind=kind_phys),
intent(inout) :: zwt
7103 real (kind=kind_phys),
intent(inout) :: wa
7104 real (kind=kind_phys),
intent(inout) :: wt
7106 real (kind=kind_phys),
intent(inout) :: wslake
7107 real (kind=kind_phys) ,
intent(inout) :: ponding
7108 real (kind=kind_phys),
intent(inout) :: smcwtd
7109 real (kind=kind_phys),
intent(inout) :: deeprech
7110 real (kind=kind_phys),
intent(inout) :: rech
7113 real (kind=kind_phys),
intent(out) :: cmc
7114 real (kind=kind_phys),
intent(out) :: ecan
7115 real (kind=kind_phys),
intent(out) :: etran
7116 real (kind=kind_phys),
intent(out) :: fwet
7117 real (kind=kind_phys),
intent(out) :: runsrf
7118 real (kind=kind_phys),
intent(out) :: runsub
7119 real (kind=kind_phys),
intent(out) :: qin
7120 real (kind=kind_phys),
intent(out) :: qdis
7121 real (kind=kind_phys),
intent(out) :: ponding1
7122 real (kind=kind_phys),
intent(out) :: ponding2
7123 real (kind=kind_phys),
intent(out) :: esnow
7124 real (kind=kind_phys),
intent(out) :: qsnbot
7125 real (kind=kind_phys) ,
intent(in) :: latheav
7126 real (kind=kind_phys) ,
intent(in) :: latheag
7127 logical ,
intent(in) :: frozen_ground
7128 logical ,
intent(in) :: frozen_canopy
7133 real (kind=kind_phys) :: qinsur
7134 real (kind=kind_phys) :: qseva
7135 real (kind=kind_phys) :: qsdew
7136 real (kind=kind_phys) :: qsnfro
7137 real (kind=kind_phys) :: qsnsub
7138 real (kind=kind_phys),
dimension( 1:nsoil) :: etrani
7139 real (kind=kind_phys),
dimension( 1:nsoil) :: wcnd
7140 real (kind=kind_phys) :: qdrain
7141 real (kind=kind_phys) :: snoflow
7142 real (kind=kind_phys) :: fcrmax
7144 real (kind=kind_phys),
parameter :: wslmax = 5000.
7150 etrani(1:nsoil) = 0.
7157 call canwater (parameters,vegtyp ,dt , &
7158 fcev ,fctr ,elai , &
7159 esai ,tg ,fveg ,iloc , jloc, &
7160 bdfall ,frozen_canopy , &
7161 canliq ,canice ,tv , &
7162 cmc ,ecan ,etran , &
7168 if (sneqv > 0.)
then
7169 qsnsub = min(qvap, sneqv/dt)
7175 if (sneqv > 0.)
then
7178 qsdew = qdew - qsnfro
7180 call snowwater (parameters,nsnow ,nsoil ,imelt ,dt ,zsoil , &
7181 & sfctmp ,snowhin,qsnow ,qsnfro ,qsnsub , &
7182 & qrain ,ficeold,iloc ,jloc , &
7183 & isnow ,snowh ,sneqv ,snice ,snliq , &
7184 & sh2o ,sice ,stc ,zsnso ,dzsnso , &
7185 & qsnbot ,snoflow,ponding1 ,ponding2)
7187 if(frozen_ground)
then
7188 sice(1) = sice(1) + (qsdew-qseva)*dt/(dzsnso(1)*1000.)
7191 if(sice(1) < 0.)
then
7192 sh2o(1) = sh2o(1) + sice(1)
7200 qinsur = (ponding+ponding1+ponding2)/dt * 0.001
7204 qinsur = qinsur+(qsnbot + qsdew + qrain) * 0.001
7206 qinsur = qinsur+(qsnbot + qsdew) * 0.001
7209 qseva = qseva * 0.001
7211 do iz = 1, parameters%nroot
7212 etrani(iz) = etran * btrani(iz) * 0.001
7220 if(wslake >= wslmax) runsrf = qinsur*1000.
7221 wslake = wslake + (qinsur-qseva)*1000.*dt -runsrf*dt
7223 call soilwater (parameters,nsoil ,nsnow ,dt ,zsoil ,dzsnso , &
7224 qinsur ,qseva ,etrani ,sice ,iloc , jloc , &
7225 sh2o ,smc ,zwt ,vegtyp , &
7226 smcwtd, deeprech , &
7227 runsrf ,qdrain ,runsub ,wcnd ,fcrmax )
7229 if(opt_run == 1)
then
7230 call groundwater (parameters,nsnow ,nsoil ,dt ,sice ,zsoil , &
7231 stc ,wcnd ,fcrmax ,iloc ,jloc , &
7232 sh2o ,zwt ,wa ,wt , &
7237 if(opt_run == 3 .or. opt_run == 4)
then
7238 runsub = runsub + qdrain
7242 smc(iz) = sh2o(iz) + sice(iz)
7245 if(opt_run == 5)
then
7246 call shallowwatertable (parameters,nsnow ,nsoil, zsoil, dt , &
7247 dzsnso ,smceq ,iloc , jloc , &
7248 smc ,zwt ,smcwtd ,rech, qdrain )
7250 sh2o(nsoil) = smc(nsoil) - sice(nsoil)
7251 runsub = runsub + qdrain
7257 runsub = runsub + snoflow
7259 end subroutine water
7265 subroutine canwater (parameters,vegtyp ,dt , & !in
7266 fcev ,fctr ,elai , & !in
7267 esai ,tg ,fveg ,iloc , jloc , & !in
7268 bdfall ,frozen_canopy , & !in
7269 canliq ,canice ,tv , & !inout
7270 cmc ,ecan ,etran , & !out
7279 type (noahmp_parameters),
intent(in) :: parameters
7280 integer,
intent(in) :: iloc
7281 integer,
intent(in) :: jloc
7282 integer,
intent(in) :: vegtyp
7283 real (kind=kind_phys),
intent(in) :: dt
7284 real (kind=kind_phys),
intent(in) :: fcev
7285 real (kind=kind_phys),
intent(in) :: fctr
7286 real (kind=kind_phys),
intent(in) :: elai
7287 real (kind=kind_phys),
intent(in) :: esai
7288 real (kind=kind_phys),
intent(in) :: tg
7289 real (kind=kind_phys),
intent(in) :: fveg
7290 logical ,
intent(in) :: frozen_canopy
7291 real (kind=kind_phys),
intent(in) :: bdfall
7294 real (kind=kind_phys),
intent(inout) :: canliq
7295 real (kind=kind_phys),
intent(inout) :: canice
7296 real (kind=kind_phys),
intent(inout) :: tv
7299 real (kind=kind_phys),
intent(out) :: cmc
7300 real (kind=kind_phys),
intent(out) :: ecan
7301 real (kind=kind_phys),
intent(out) :: etran
7302 real (kind=kind_phys),
intent(out) :: fwet
7306 real (kind=kind_phys) :: maxsno
7307 real (kind=kind_phys) :: maxliq
7308 real (kind=kind_phys) :: qevac
7309 real (kind=kind_phys) :: qdewc
7310 real (kind=kind_phys) :: qfroc
7311 real (kind=kind_phys) :: qsubc
7312 real (kind=kind_phys) :: qmeltc
7313 real (kind=kind_phys) :: qfrzc
7314 real (kind=kind_phys) :: canmas
7323 maxliq = parameters%ch2op * (elai+ esai)
7327 if (.not.frozen_canopy)
then
7328 etran = max( fctr/hvap, 0. )
7329 qevac = max( fcev/hvap, 0. )
7330 qdewc = abs( min( fcev/hvap, 0. ) )
7334 etran = max( fctr/hsub, 0. )
7337 qsubc = max( fcev/hsub, 0. )
7338 qfroc = abs( min( fcev/hsub, 0. ) )
7344 qevac = min(canliq/dt,qevac)
7345 canliq=max(0.,canliq+(qdewc-qevac)*dt)
7346 if(canliq <= 1.e-06) canliq = 0.0
7351 maxsno = 6.6*(0.27+46./bdfall) * (elai+ esai)
7353 qsubc = min(canice/dt,qsubc)
7354 canice= max(0.,canice + (qfroc-qsubc)*dt)
7355 if(canice.le.1.e-6) canice = 0.
7359 if(canice.gt.0.)
then
7360 fwet = max(0.,canice) / max(maxsno,1.e-06)
7362 fwet = max(0.,canliq) / max(maxliq,1.e-06)
7364 fwet = min(fwet, 1.) ** 0.667
7371 if(canice.gt.1.e-6.and.tv.gt.tfrz)
then
7372 qmeltc = min(canice/dt,(tv-tfrz)*cice*canice/denice/(dt*hfus))
7373 canice = max(0.,canice - qmeltc*dt)
7374 canliq = max(0.,canliq + qmeltc*dt)
7375 tv = fwet*tfrz + (1.-fwet)*tv
7378 if(canliq.gt.1.e-6.and.tv.lt.tfrz)
then
7379 qfrzc = min(canliq/dt,(tfrz-tv)*cwat*canliq/denh2o/(dt*hfus))
7380 canliq = max(0.,canliq - qfrzc*dt)
7381 canice = max(0.,canice + qfrzc*dt)
7382 tv = fwet*tfrz + (1.-fwet)*tv
7387 cmc = canliq + canice
7391 ecan = qevac + qsubc - qdewc - qfroc
7393 end subroutine canwater
7399 subroutine snowwater (parameters,nsnow ,nsoil ,imelt ,dt ,zsoil , & !in
7400 sfctmp ,snowhin,qsnow ,qsnfro ,qsnsub , & !in
7401 qrain ,ficeold,iloc ,jloc , & !in
7402 isnow ,snowh ,sneqv ,snice ,snliq , & !inout
7403 sh2o ,sice ,stc ,zsnso ,dzsnso , & !inout
7404 qsnbot ,snoflow,ponding1 ,ponding2)
7409 type (noahmp_parameters),
intent(in) :: parameters
7410 integer,
intent(in) :: iloc
7411 integer,
intent(in) :: jloc
7412 integer,
intent(in) :: nsnow
7413 integer,
intent(in) :: nsoil
7414 integer,
dimension(-nsnow+1:0) ,
intent(in) :: imelt
7415 real (kind=kind_phys),
intent(in) :: dt
7416 real (kind=kind_phys),
dimension( 1:nsoil),
intent(in) :: zsoil
7417 real (kind=kind_phys),
intent(in) :: sfctmp
7418 real (kind=kind_phys),
intent(in) :: snowhin
7419 real (kind=kind_phys),
intent(in) :: qsnow
7420 real (kind=kind_phys),
intent(in) :: qsnfro
7421 real (kind=kind_phys),
intent(in) :: qsnsub
7422 real (kind=kind_phys),
intent(in) :: qrain
7423 real (kind=kind_phys),
dimension(-nsnow+1:0) ,
intent(in) :: ficeold
7426 integer,
intent(inout) :: isnow
7427 real (kind=kind_phys),
intent(inout) :: snowh
7428 real (kind=kind_phys),
intent(inout) :: sneqv
7429 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(inout) :: snice
7430 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(inout) :: snliq
7431 real (kind=kind_phys),
dimension( 1:nsoil),
intent(inout) :: sh2o
7432 real (kind=kind_phys),
dimension( 1:nsoil),
intent(inout) :: sice
7433 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: stc
7434 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: zsnso
7435 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: dzsnso
7438 real (kind=kind_phys),
intent(out) :: qsnbot
7439 real (kind=kind_phys),
intent(out) :: snoflow
7440 real (kind=kind_phys),
intent(out) :: ponding1
7441 real (kind=kind_phys),
intent(out) :: ponding2
7445 real (kind=kind_phys) :: bdsnow
7451 call snowfall (parameters,nsoil ,nsnow ,dt ,qsnow ,snowhin, &
7452 sfctmp ,iloc ,jloc , &
7453 isnow ,snowh ,dzsnso ,stc ,snice , &
7459 call compact (parameters,nsnow ,nsoil ,dt ,stc ,snice , &
7460 snliq ,zsoil ,imelt ,ficeold,iloc , jloc ,&
7461 isnow ,dzsnso ,zsnso )
7464 call combine (parameters,nsnow ,nsoil ,iloc ,jloc , &
7465 isnow ,sh2o ,stc ,snice ,snliq , &
7466 dzsnso ,sice ,snowh ,sneqv , &
7470 call divide (parameters,nsnow ,nsoil , &
7471 isnow ,stc ,snice ,snliq ,dzsnso )
7473 call snowh2o (parameters,nsnow ,nsoil ,dt ,qsnfro ,qsnsub , &
7474 qrain ,iloc ,jloc , &
7475 isnow ,dzsnso ,snowh ,sneqv ,snice , &
7476 snliq ,sh2o ,sice ,stc , &
7477 qsnbot ,ponding1 ,ponding2)
7481 do iz = -nsnow+1, isnow
7491 if(sneqv > 5000.)
then
7492 bdsnow = snice(0) / dzsnso(0)
7493 snoflow = (sneqv - 5000.)
7494 snice(0) = snice(0) - snoflow
7495 dzsnso(0) = dzsnso(0) - snoflow/bdsnow
7496 snoflow = snoflow / dt
7505 sneqv = sneqv + snice(iz) + snliq(iz)
7506 snowh = snowh + dzsnso(iz)
7513 dzsnso(iz) = -dzsnso(iz)
7516 dzsnso(1) = zsoil(1)
7518 dzsnso(iz) = (zsoil(iz) - zsoil(iz-1))
7521 zsnso(isnow+1) = dzsnso(isnow+1)
7522 do iz = isnow+2 ,nsoil
7523 zsnso(iz) = zsnso(iz-1) + dzsnso(iz)
7526 do iz = isnow+1 ,nsoil
7527 dzsnso(iz) = -dzsnso(iz)
7530 end subroutine snowwater
7537 subroutine snowfall (parameters,nsoil ,nsnow ,dt ,qsnow ,snowhin , & !in
7538 sfctmp ,iloc ,jloc , & !in
7539 isnow ,snowh ,dzsnso ,stc ,snice , & !inout
7549 type (noahmp_parameters),
intent(in) :: parameters
7550 integer,
intent(in) :: iloc
7551 integer,
intent(in) :: jloc
7552 integer,
intent(in) :: nsoil
7553 integer,
intent(in) :: nsnow
7554 real (kind=kind_phys),
intent(in) :: dt
7555 real (kind=kind_phys),
intent(in) :: qsnow
7556 real (kind=kind_phys),
intent(in) :: snowhin
7557 real (kind=kind_phys),
intent(in) :: sfctmp
7561 integer,
intent(inout) :: isnow
7562 real (kind=kind_phys),
intent(inout) :: snowh
7563 real (kind=kind_phys),
intent(inout) :: sneqv
7564 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: dzsnso
7565 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: stc
7566 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(inout) :: snice
7567 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(inout) :: snliq
7577 if(isnow == 0 .and. qsnow > 0.)
then
7578 snowh = snowh + snowhin * dt
7579 sneqv = sneqv + qsnow * dt
7584 if(isnow == 0 .and. qsnow>0. .and. snowh >= 0.025)
then
7590 stc(0) = min(273.16, sfctmp)
7597 if(isnow < 0 .and. newnode == 0 .and. qsnow > 0.)
then
7598 snice(isnow+1) = snice(isnow+1) + qsnow * dt
7599 dzsnso(isnow+1) = dzsnso(isnow+1) + snowhin * dt
7603 end subroutine snowfall
7609 subroutine combine (parameters,nsnow ,nsoil ,iloc ,jloc , & !in
7610 isnow ,sh2o ,stc ,snice ,snliq , & !inout
7611 dzsnso ,sice ,snowh ,sneqv , & !inout
7618 type (noahmp_parameters),
intent(in) :: parameters
7619 integer,
intent(in) :: iloc
7620 integer,
intent(in) :: jloc
7621 integer,
intent(in) :: nsnow
7622 integer,
intent(in) :: nsoil
7626 integer,
intent(inout) :: isnow
7627 real (kind=kind_phys),
dimension( 1:nsoil),
intent(inout) :: sh2o
7628 real (kind=kind_phys),
dimension( 1:nsoil),
intent(inout) :: sice
7629 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: stc
7630 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(inout) :: snice
7631 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(inout) :: snliq
7632 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: dzsnso
7633 real (kind=kind_phys),
intent(inout) :: sneqv
7634 real (kind=kind_phys),
intent(inout) :: snowh
7635 real (kind=kind_phys),
intent(out) :: ponding1
7636 real (kind=kind_phys),
intent(out) :: ponding2
7641 integer :: isnow_old
7644 real (kind=kind_phys) :: zwice
7645 real (kind=kind_phys) :: zwliq
7647 real (kind=kind_phys) :: dzmin(3)
7649 data dzmin /0.025, 0.025, 0.1/
7654 do j = isnow_old+1,0
7655 if (snice(j) <= .1)
then
7657 snliq(j+1) = snliq(j+1) + snliq(j)
7658 snice(j+1) = snice(j+1) + snice(j)
7659 dzsnso(j+1) = dzsnso(j+1) + dzsnso(j)
7661 if (isnow_old < -1)
then
7662 snliq(j-1) = snliq(j-1) + snliq(j)
7663 snice(j-1) = snice(j-1) + snice(j)
7664 dzsnso(j-1) = dzsnso(j-1) + dzsnso(j)
7666 if(snice(j) >= 0.)
then
7671 ponding1 = snliq(j) + snice(j)
7672 if(ponding1 < 0.)
then
7673 sice(1) = max(0.0,sice(1)+ponding1/(dzsnso(1)*1000.))
7688 if (j > isnow+1 .and. isnow < -1)
then
7689 do i = j, isnow+2, -1
7691 snliq(i) = snliq(i-1)
7692 snice(i) = snice(i-1)
7693 dzsnso(i)= dzsnso(i-1)
7702 if(sice(1) < 0.)
then
7703 sh2o(1) = sh2o(1) + sice(1)
7707 if(isnow ==0)
return
7715 sneqv = sneqv + snice(j) + snliq(j)
7716 snowh = snowh + dzsnso(j)
7717 zwice = zwice + snice(j)
7718 zwliq = zwliq + snliq(j)
7724 if (snowh < 0.025 .and. isnow < 0 )
then
7729 if(sneqv <= 0.) snowh = 0.
7741 if (isnow < -1)
then
7746 do i = isnow_old+1,0
7747 if (dzsnso(i) < dzmin(mssi))
then
7749 if (i == isnow+1)
then
7751 else if (i == 0)
then
7755 if ((dzsnso(i-1)+dzsnso(i)) < (dzsnso(i+1)+dzsnso(i))) neibor = i-1
7759 if (neibor > i)
then
7767 call combo (parameters,dzsnso(j), snliq(j), snice(j), &
7768 stc(j), dzsnso(l), snliq(l), snice(l), stc(l) )
7771 if (j-1 > isnow+1)
then
7772 do k = j-1, isnow+2, -1
7774 snice(k) = snice(k-1)
7775 snliq(k) = snliq(k-1)
7776 dzsnso(k) = dzsnso(k-1)
7782 if (isnow >= -1)
exit
7793 end subroutine combine
7799 subroutine divide (parameters,nsnow ,nsoil , & !in
7800 isnow ,stc ,snice ,snliq ,dzsnso )
7806 type (noahmp_parameters),
intent(in) :: parameters
7807 integer,
intent(in) :: nsnow
7808 integer,
intent(in) :: nsoil
7812 integer ,
intent(inout) :: isnow
7813 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: stc
7814 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(inout) :: snice
7815 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(inout) :: snliq
7816 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: dzsnso
7822 real (kind=kind_phys) :: drr
7823 real (kind=kind_phys),
dimension( 1:nsnow) :: dz
7824 real (kind=kind_phys),
dimension( 1:nsnow) :: swice
7825 real (kind=kind_phys),
dimension( 1:nsnow) :: swliq
7826 real (kind=kind_phys),
dimension( 1:nsnow) :: tsno
7827 real (kind=kind_phys) :: zwice
7828 real (kind=kind_phys) :: zwliq
7829 real (kind=kind_phys) :: propor
7830 real (kind=kind_phys) :: dtdz
7834 if (j <= abs(isnow))
then
7835 dz(j) = dzsnso(j+isnow)
7836 swice(j) = snice(j+isnow)
7837 swliq(j) = snliq(j+isnow)
7838 tsno(j) = stc(j+isnow)
7846 if (dz(1) > 0.05)
then
7849 swice(1) = swice(1)/2.
7850 swliq(1) = swliq(1)/2.
7859 if (dz(1) > 0.05)
then
7862 zwice = propor*swice(1)
7863 zwliq = propor*swliq(1)
7865 swice(1) = propor*swice(1)
7866 swliq(1) = propor*swliq(1)
7869 call combo (parameters,dz(2), swliq(2), swice(2), tsno(2), drr, &
7870 zwliq, zwice, tsno(1))
7873 if (msno <= 2 .and. dz(2) > 0.20)
then
7876 dtdz = (tsno(1) - tsno(2))/((dz(1)+dz(2))/2.)
7878 swice(2) = swice(2)/2.
7879 swliq(2) = swliq(2)/2.
7883 tsno(3) = tsno(2) - dtdz*dz(2)/2.
7884 if (tsno(3) >= tfrz)
then
7887 tsno(2) = tsno(2) + dtdz*dz(2)/2.
7895 if (dz(2) > 0.2)
then
7898 zwice = propor*swice(2)
7899 zwliq = propor*swliq(2)
7901 swice(2) = propor*swice(2)
7902 swliq(2) = propor*swliq(2)
7904 call combo (parameters,dz(3), swliq(3), swice(3), tsno(3), drr, &
7905 zwliq, zwice, tsno(2))
7912 dzsnso(j) = dz(j-isnow)
7913 snice(j) = swice(j-isnow)
7914 snliq(j) = swliq(j-isnow)
7915 stc(j) = tsno(j-isnow)
7923 end subroutine divide
7929 subroutine combo(parameters,dz, wliq, wice, t, dz2, wliq2, wice2, t2)
7937 type (noahmp_parameters),
intent(in) :: parameters
7938 real (kind=kind_phys),
intent(in) :: dz2
7939 real (kind=kind_phys),
intent(in) :: wliq2
7940 real (kind=kind_phys),
intent(in) :: wice2
7941 real (kind=kind_phys),
intent(in) :: t2
7942 real (kind=kind_phys),
intent(inout) :: dz
7943 real (kind=kind_phys),
intent(inout) :: wliq
7944 real (kind=kind_phys),
intent(inout) :: wice
7945 real (kind=kind_phys),
intent(inout) :: t
7949 real (kind=kind_phys) :: dzc
7950 real (kind=kind_phys) :: wliqc
7951 real (kind=kind_phys) :: wicec
7952 real (kind=kind_phys) :: tc
7953 real (kind=kind_phys) :: h
7954 real (kind=kind_phys) :: h2
7955 real (kind=kind_phys) :: hc
7960 wicec = (wice+wice2)
7961 wliqc = (wliq+wliq2)
7962 h = (cice*wice+cwat*wliq) * (t-tfrz)+hfus*wliq
7963 h2= (cice*wice2+cwat*wliq2) * (t2-tfrz)+hfus*wliq2
7967 tc = tfrz + hc/(cice*wicec + cwat*wliqc)
7968 else if (hc.le.hfus*wliqc)
then
7971 tc = tfrz + (hc - hfus*wliqc) / (cice*wicec + cwat*wliqc)
7979 end subroutine combo
7985 subroutine compact (parameters,nsnow ,nsoil ,dt ,stc ,snice , & !in
7986 snliq ,zsoil ,imelt ,ficeold,iloc , jloc , & !in
7987 isnow ,dzsnso ,zsnso )
7992 type (noahmp_parameters),
intent(in) :: parameters
7993 integer,
intent(in) :: iloc
7994 integer,
intent(in) :: jloc
7995 integer,
intent(in) :: nsoil
7996 integer,
intent(in) :: nsnow
7997 integer,
dimension(-nsnow+1:0) ,
intent(in) :: imelt
7998 real (kind=kind_phys),
intent(in) :: dt
7999 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: stc
8000 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(in) :: snice
8001 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(in) :: snliq
8002 real (kind=kind_phys),
dimension( 1:nsoil),
intent(in) :: zsoil
8003 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(in) :: ficeold
8006 integer,
intent(inout) :: isnow
8007 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: dzsnso
8008 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: zsnso
8011 real (kind=kind_phys),
parameter :: c2 = 21.e-3
8012 real (kind=kind_phys),
parameter :: c3 = 2.5e-6
8013 real (kind=kind_phys),
parameter :: c4 = 0.04
8014 real (kind=kind_phys),
parameter :: c5 = 2.0
8015 real (kind=kind_phys),
parameter :: dm = 100.0
8016 real (kind=kind_phys),
parameter :: eta0 = 1.8e+6
8018 real (kind=kind_phys) :: burden
8019 real (kind=kind_phys) :: ddz1
8020 real (kind=kind_phys) :: ddz2
8021 real (kind=kind_phys) :: ddz3
8022 real (kind=kind_phys) :: dexpf
8023 real (kind=kind_phys) :: td
8024 real (kind=kind_phys) :: pdzdtc
8025 real (kind=kind_phys) :: void
8026 real (kind=kind_phys) :: wx
8027 real (kind=kind_phys) :: bi
8028 real (kind=kind_phys),
dimension(-nsnow+1:0) :: fice
8037 wx = snice(j) + snliq(j)
8038 fice(j) = snice(j) / wx
8039 void = 1. - (snice(j)/denice + snliq(j)/denh2o) / dzsnso(j)
8042 if (void > 0.001 .and. snice(j) > 0.1)
then
8043 bi = snice(j) / dzsnso(j)
8044 td = max(0.,tfrz-stc(j))
8051 if (bi > dm) ddz1 = ddz1*exp(-46.0e-3*(bi-dm))
8055 if (snliq(j) > 0.01*dzsnso(j)) ddz1=ddz1*c5
8059 ddz2 = -(burden+0.5*wx)*exp(-0.08*td-c2*bi)/eta0
8063 if (imelt(j) == 1)
then
8064 ddz3 = max(0.,(ficeold(j) - fice(j))/max(1.e-6,ficeold(j)))
8072 pdzdtc = (ddz1 + ddz2 + ddz3)*dt
8073 pdzdtc = max(-0.5,pdzdtc)
8077 dzsnso(j) = dzsnso(j)*(1.+pdzdtc)
8078 dzsnso(j) = min(max(dzsnso(j),(snliq(j)+snice(j))/500.0),(snliq(j)+snice(j))/50.0)
8083 burden = burden + wx
8087 end subroutine compact
8094 subroutine snowh2o (parameters,nsnow ,nsoil ,dt ,qsnfro ,qsnsub , & !in
8095 qrain ,iloc ,jloc , & !in
8096 isnow ,dzsnso ,snowh ,sneqv ,snice , & !inout
8097 snliq ,sh2o ,sice ,stc , & !inout
8098 qsnbot ,ponding1 ,ponding2)
8107 type (noahmp_parameters),
intent(in) :: parameters
8108 integer,
intent(in) :: iloc
8109 integer,
intent(in) :: jloc
8110 integer,
intent(in) :: nsnow
8111 integer,
intent(in) :: nsoil
8112 real (kind=kind_phys),
intent(in) :: dt
8113 real (kind=kind_phys),
intent(in) :: qsnfro
8114 real (kind=kind_phys),
intent(in) :: qsnsub
8115 real (kind=kind_phys),
intent(in) :: qrain
8119 real (kind=kind_phys),
intent(out) :: qsnbot
8123 integer,
intent(inout) :: isnow
8124 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: dzsnso
8125 real (kind=kind_phys),
intent(inout) :: snowh
8126 real (kind=kind_phys),
intent(inout) :: sneqv
8127 real (kind=kind_phys),
dimension(-nsnow+1:0),
intent(inout) :: snice
8128 real (kind=kind_phys),
dimension(-nsnow+1:0),
intent(inout) :: snliq
8129 real (kind=kind_phys),
dimension( 1:nsoil),
intent(inout) :: sh2o
8130 real (kind=kind_phys),
dimension( 1:nsoil),
intent(inout) :: sice
8131 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: stc
8136 real (kind=kind_phys) :: qin
8137 real (kind=kind_phys) :: qout
8138 real (kind=kind_phys) :: wgdif
8139 real (kind=kind_phys),
dimension(-nsnow+1:0) :: vol_liq
8140 real (kind=kind_phys),
dimension(-nsnow+1:0) :: vol_ice
8141 real (kind=kind_phys),
dimension(-nsnow+1:0) :: epore
8142 real (kind=kind_phys) :: propor, temp
8143 real (kind=kind_phys) :: ponding1, ponding2
8144 real (kind=kind_phys),
parameter :: max_liq_mass_fraction = 0.4
8149 if(sneqv == 0.)
then
8150 sice(1) = sice(1) + (qsnfro-qsnsub)*dt/(dzsnso(1)*1000.)
8151 if(sice(1) < 0.)
then
8152 sh2o(1) = sh2o(1) + sice(1)
8162 if(isnow == 0 .and. sneqv > 0.)
then
8164 sneqv = sneqv - qsnsub*dt + qsnfro*dt
8166 snowh = max(0.,propor * snowh)
8167 snowh = min(max(snowh,sneqv/500.0),sneqv/50.0)
8170 sice(1) = sice(1) + sneqv/(dzsnso(1)*1000.)
8174 if(sice(1) < 0.)
then
8175 sh2o(1) = sh2o(1) + sice(1)
8180 if(snowh <= 1.e-6 .or. sneqv <= 1.e-3)
then
8187 if ( isnow < 0 )
then
8189 wgdif = snice(isnow+1) - qsnsub*dt + qsnfro*dt
8190 snice(isnow+1) = wgdif
8191 if (wgdif < 1.e-6 .and. isnow <0)
then
8192 call combine (parameters,nsnow ,nsoil ,iloc, jloc , &
8193 isnow ,sh2o ,stc ,snice ,snliq , &
8194 dzsnso ,sice ,snowh ,sneqv , &
8195 ponding1, ponding2 )
8198 if ( isnow < 0 )
then
8199 snliq(isnow+1) = snliq(isnow+1) + qrain * dt
8200 snliq(isnow+1) = max(0., snliq(isnow+1))
8208 vol_ice(j) = min(1., snice(j)/(dzsnso(j)*denice))
8209 epore(j) = 1. - vol_ice(j)
8216 snliq(j) = snliq(j) + qin
8217 vol_liq(j) = snliq(j)/(dzsnso(j)*denh2o)
8218 qout = max(0.,(vol_liq(j)-parameters%ssi*epore(j))*dzsnso(j))
8220 qout = max((vol_liq(j)- epore(j))*dzsnso(j) , parameters%snow_ret_fac*dt*qout)
8223 snliq(j) = snliq(j) - qout
8224 if((snliq(j)/(snice(j)+snliq(j))) > max_liq_mass_fraction)
then
8225 qout = qout + (snliq(j) - max_liq_mass_fraction/(1.0 - max_liq_mass_fraction)*snice(j))
8226 snliq(j) = max_liq_mass_fraction/(1.0 - max_liq_mass_fraction)*snice(j)
8232 dzsnso(j) = min(max(dzsnso(j),(snliq(j)+snice(j))/500.0),(snliq(j)+snice(j))/50.0)
8239 end subroutine snowh2o
8245 subroutine soilwater (parameters,nsoil ,nsnow ,dt ,zsoil ,dzsnso , & !in
8246 qinsur ,qseva ,etrani ,sice ,iloc , jloc, & !in
8247 sh2o ,smc ,zwt ,vegtyp ,& !inout
8248 smcwtd, deeprech ,& !inout
8249 runsrf ,qdrain ,runsub ,wcnd ,fcrmax )
8258 type (noahmp_parameters),
intent(in) :: parameters
8259 integer,
intent(in) :: iloc
8260 integer,
intent(in) :: jloc
8261 integer,
intent(in) :: nsoil
8262 integer,
intent(in) :: nsnow
8263 real (kind=kind_phys),
intent(in) :: dt
8264 real (kind=kind_phys),
intent(in) :: qinsur
8265 real (kind=kind_phys),
intent(in) :: qseva
8266 real (kind=kind_phys),
dimension(1:nsoil),
intent(in) :: zsoil
8267 real (kind=kind_phys),
dimension(1:nsoil),
intent(in) :: etrani
8268 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: dzsnso
8269 real (kind=kind_phys),
dimension(1:nsoil),
intent(in) :: sice
8271 integer,
intent(in) :: vegtyp
8274 real (kind=kind_phys),
dimension(1:nsoil),
intent(inout) :: sh2o
8275 real (kind=kind_phys),
dimension(1:nsoil),
intent(inout) :: smc
8276 real (kind=kind_phys),
intent(inout) :: zwt
8277 real (kind=kind_phys),
intent(inout) :: smcwtd
8278 real (kind=kind_phys) ,
intent(inout) :: deeprech
8281 real (kind=kind_phys),
intent(out) :: qdrain
8282 real (kind=kind_phys),
intent(out) :: runsrf
8283 real (kind=kind_phys),
intent(out) :: runsub
8284 real (kind=kind_phys),
intent(out) :: fcrmax
8285 real (kind=kind_phys),
dimension(1:nsoil),
intent(out) :: wcnd
8290 real (kind=kind_phys) :: dtfine
8291 real (kind=kind_phys),
dimension(1:nsoil) :: rhstt
8292 real (kind=kind_phys),
dimension(1:nsoil) :: ai
8293 real (kind=kind_phys),
dimension(1:nsoil) :: bi
8294 real (kind=kind_phys),
dimension(1:nsoil) :: ci
8296 real (kind=kind_phys) :: fff
8297 real (kind=kind_phys) :: rsbmx
8298 real (kind=kind_phys) :: pddum
8299 real (kind=kind_phys) :: fice
8300 real (kind=kind_phys) :: wplus
8301 real (kind=kind_phys) :: rsat
8302 real (kind=kind_phys) :: sicemax
8303 real (kind=kind_phys) :: sh2omin
8304 real (kind=kind_phys) :: wtsub
8305 real (kind=kind_phys) :: mh2o
8306 real (kind=kind_phys) :: fsat
8307 real (kind=kind_phys),
dimension(1:nsoil) :: mliq
8308 real (kind=kind_phys) :: xs
8309 real (kind=kind_phys) :: watmin
8310 real (kind=kind_phys) :: qdrain_save
8311 real (kind=kind_phys) :: runsrf_save
8312 real (kind=kind_phys) :: epore
8313 real (kind=kind_phys),
dimension(1:nsoil) :: fcr
8315 real (kind=kind_phys) :: smctot
8316 real (kind=kind_phys) :: dztot
8317 real (kind=kind_phys),
parameter :: a = 4.0
8326 epore = max( 1.e-4 , ( parameters%smcmax(k) - sice(k) ) )
8327 rsat = rsat + max(0.,sh2o(k)-epore)*dzsnso(k)
8328 sh2o(k) = min(epore,sh2o(k))
8334 fice = min(1.0,sice(k)/parameters%smcmax(k))
8335 fcr(k) = max(0.0,exp(-a*(1.-fice))- exp(-a)) / &
8343 sh2omin = parameters%smcmax(1)
8345 if (sice(k) > sicemax) sicemax = sice(k)
8346 if (fcr(k) > fcrmax) fcrmax = fcr(k)
8347 if (sh2o(k) < sh2omin) sh2omin = sh2o(k)
8352 if(opt_run == 2)
then
8355 call zwteq (parameters,nsoil ,nsnow ,zsoil ,dzsnso ,sh2o ,zwt)
8356 runsub = (1.0-fcrmax) * rsbmx * exp(-parameters%timean) * exp(-fff*zwt)
8362 if ( parameters%urban_flag ) fcr(1)= 0.95
8364 if(opt_run == 1)
then
8366 fff = parameters%bexp(1) / 3.0
8368 fsat = parameters%fsatmx*exp(-0.5*fff*zwt)
8369 if(qinsur > 0.)
then
8370 runsrf = qinsur * ( (1.0-fcr(1))*fsat + fcr(1) )
8371 pddum = qinsur - runsrf
8375 if(opt_run == 5)
then
8377 fsat = parameters%fsatmx*exp(-0.5*fff*max(-2.0-zwt,0.))
8378 if(qinsur > 0.)
then
8379 runsrf = qinsur * ( (1.0-fcr(1))*fsat + fcr(1) )
8380 pddum = qinsur - runsrf
8384 if(opt_run == 2)
then
8386 fsat = parameters%fsatmx*exp(-0.5*fff*zwt)
8387 if(qinsur > 0.)
then
8388 runsrf = qinsur * ( (1.0-fcr(1))*fsat + fcr(1) )
8389 pddum = qinsur - runsrf
8393 if(opt_run == 3)
then
8394 call infil (parameters,nsoil ,dt ,zsoil ,sh2o ,sice , &
8399 if(opt_run == 4)
then
8403 dztot = dztot + dzsnso(k)
8404 smctot = smctot + smc(k)/parameters%smcmax(k)*dzsnso(k)
8405 if(dztot >= 2.0)
exit
8407 smctot = smctot/dztot
8408 fsat = max(0.01,smctot) ** 4.
8410 if(qinsur > 0.)
then
8411 runsrf = qinsur * ((1.0-fcr(1))*fsat+fcr(1))
8412 pddum = qinsur - runsrf
8422 if (pddum*dt>dzsnso(1)*parameters%smcmax(1) )
then
8434 if(qinsur > 0. .and. opt_run == 3)
then
8435 call infil (parameters,nsoil ,dtfine ,zsoil ,sh2o ,sice , &
8440 call srt (parameters,nsoil ,zsoil ,dtfine ,pddum ,etrani , &
8441 qseva ,sh2o ,smc ,zwt ,fcr , &
8442 sicemax,fcrmax ,iloc ,jloc ,smcwtd , &
8443 rhstt ,ai ,bi ,ci ,qdrain , &
8446 call sstep (parameters,nsoil ,nsnow ,dtfine ,zsoil ,dzsnso , &
8447 sice ,iloc ,jloc ,zwt , &
8448 sh2o ,smc ,ai ,bi ,ci , &
8449 rhstt ,smcwtd ,qdrain ,deeprech, &
8452 qdrain_save = qdrain_save + qdrain
8453 runsrf_save = runsrf_save + runsrf
8456 qdrain = qdrain_save/niter
8457 runsrf = runsrf_save/niter
8459 runsrf = runsrf * 1000. + rsat * 1000./dt
8460 qdrain = qdrain * 1000.
8467 if(opt_run == 2)
then
8470 wtsub = wtsub + wcnd(k)*dzsnso(k)
8474 mh2o = runsub*dt*(wcnd(k)*dzsnso(k))/wtsub
8475 sh2o(k) = sh2o(k) - mh2o/(dzsnso(k)*1000.)
8482 if(opt_run /= 1)
then
8484 mliq(iz) = sh2o(iz)*dzsnso(iz)*1000.
8489 if (mliq(iz) .lt. 0.)
then
8490 xs = watmin-mliq(iz)
8494 mliq(iz ) = mliq(iz ) + xs
8495 mliq(iz+1) = mliq(iz+1) - xs
8499 if (mliq(iz) .lt. watmin)
then
8500 xs = watmin-mliq(iz)
8504 mliq(iz) = mliq(iz) + xs
8505 runsub = runsub - xs/dt
8506 if(opt_run == 5)deeprech = deeprech - xs*1.e-3
8509 sh2o(iz) = mliq(iz) / (dzsnso(iz)*1000.)
8513 end subroutine soilwater
8519 subroutine zwteq (parameters,nsoil ,nsnow ,zsoil ,dzsnso ,sh2o ,zwt)
8527 type (noahmp_parameters),
intent(in) :: parameters
8528 integer,
intent(in) :: nsoil
8529 integer,
intent(in) :: nsnow
8530 real (kind=kind_phys),
dimension(1:nsoil),
intent(in) :: zsoil
8531 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: dzsnso
8532 real (kind=kind_phys),
dimension(1:nsoil),
intent(in) :: sh2o
8536 real (kind=kind_phys),
intent(out) :: zwt
8541 integer,
parameter :: nfine = 100
8542 real (kind=kind_phys) :: wd1
8543 real (kind=kind_phys) :: wd2
8544 real (kind=kind_phys) :: dzfine
8545 real (kind=kind_phys) :: temp
8546 real (kind=kind_phys),
dimension(1:nfine) :: zfine
8551 wd1 = wd1 + (parameters%smcmax(1)-sh2o(k)) * dzsnso(k)
8554 dzfine = 3.0 * (-zsoil(nsoil)) / nfine
8556 zfine(k) = float(k) * dzfine
8559 zwt = -3.*zsoil(nsoil) - 0.001
8563 temp = 1. + (zwt-zfine(k))/parameters%psisat(1)
8564 wd2 = wd2 + parameters%smcmax(1)*(1.-temp**(-1./parameters%bexp(1)))*dzfine
8565 if(abs(wd2-wd1).le.0.01)
then
8571 end subroutine zwteq
8577 subroutine infil (parameters,nsoil ,dt ,zsoil ,sh2o ,sice , & !in
8578 sicemax,qinsur , & !in
8586 type (noahmp_parameters),
intent(in) :: parameters
8587 integer,
intent(in) :: nsoil
8588 real (kind=kind_phys),
intent(in) :: dt
8589 real (kind=kind_phys),
dimension(1:nsoil),
intent(in) :: zsoil
8590 real (kind=kind_phys),
dimension(1:nsoil),
intent(in) :: sh2o
8591 real (kind=kind_phys),
dimension(1:nsoil),
intent(in) :: sice
8592 real (kind=kind_phys),
intent(in) :: qinsur
8593 real (kind=kind_phys),
intent(in) :: sicemax
8596 real (kind=kind_phys),
intent(out) :: runsrf
8597 real (kind=kind_phys),
intent(out) :: pddum
8600 integer :: ialp1, j, jj, k
8601 real (kind=kind_phys) :: val
8602 real (kind=kind_phys) :: ddt
8603 real (kind=kind_phys) :: px
8604 real (kind=kind_phys) :: dt1, dd, dice
8605 real (kind=kind_phys) :: fcr
8606 real (kind=kind_phys) :: sum
8607 real (kind=kind_phys) :: acrt
8608 real (kind=kind_phys) :: wdf
8609 real (kind=kind_phys) :: wcnd
8610 real (kind=kind_phys) :: smcav
8611 real (kind=kind_phys) :: infmax
8612 real (kind=kind_phys),
dimension(1:nsoil) :: dmax
8613 integer,
parameter :: cvfrz = 3
8616 if (qinsur > 0.0)
then
8618 smcav = parameters%smcmax(1) - parameters%smcwlt(1)
8622 dmax(1)= -zsoil(1) * smcav
8623 dice = -zsoil(1) * sice(1)
8624 dmax(1)= dmax(1)* (1.0-(sh2o(1) + sice(1) - parameters%smcwlt(1))/smcav)
8629 dice = dice + (zsoil(k-1) - zsoil(k) ) * sice(k)
8630 dmax(k) = (zsoil(k-1) - zsoil(k)) * smcav
8631 dmax(k) = dmax(k) * (1.0-(sh2o(k) + sice(k) - parameters%smcwlt(k))/smcav)
8635 val = (1. - exp( - parameters%kdt * dt1))
8637 px = max(0.,qinsur * dt)
8638 infmax = (px * (ddt / (px + ddt)))/ dt
8643 if (dice > 1.e-2)
then
8644 acrt = cvfrz * parameters%frzx / dice
8652 sum = sum + (acrt ** (cvfrz - j)) / float(k)
8654 fcr = 1. - exp(-acrt) * sum
8659 infmax = infmax * fcr
8664 call wdfcnd2 (parameters,wdf,wcnd,sh2o(1),sicemax,1)
8665 infmax = max(infmax,wcnd)
8666 infmax = min(infmax,px/dt)
8668 runsrf= max(0., qinsur - infmax)
8669 pddum = qinsur - runsrf
8673 end subroutine infil
8681 subroutine srt (parameters,nsoil ,zsoil ,dt ,pddum ,etrani , & !in
8682 qseva ,sh2o ,smc ,zwt ,fcr , & !in
8683 sicemax,fcrmax ,iloc ,jloc ,smcwtd , & !in
8684 rhstt ,ai ,bi ,ci ,qdrain , & !out
8695 type (noahmp_parameters),
intent(in) :: parameters
8696 integer,
intent(in) :: iloc
8697 integer,
intent(in) :: jloc
8698 integer,
intent(in) :: nsoil
8699 real (kind=kind_phys),
dimension(1:nsoil),
intent(in) :: zsoil
8700 real (kind=kind_phys),
intent(in) :: dt
8701 real (kind=kind_phys),
intent(in) :: pddum
8702 real (kind=kind_phys),
intent(in) :: qseva
8703 real (kind=kind_phys),
dimension(1:nsoil),
intent(in) :: etrani
8704 real (kind=kind_phys),
dimension(1:nsoil),
intent(in) :: sh2o
8705 real (kind=kind_phys),
dimension(1:nsoil),
intent(in) :: smc
8706 real (kind=kind_phys),
intent(in) :: zwt
8707 real (kind=kind_phys),
dimension(1:nsoil),
intent(in) :: fcr
8708 real (kind=kind_phys),
intent(in) :: fcrmax
8709 real (kind=kind_phys),
intent(in) :: sicemax
8710 real (kind=kind_phys),
intent(in) :: smcwtd
8714 real (kind=kind_phys),
dimension(1:nsoil),
intent(out) :: rhstt
8715 real (kind=kind_phys),
dimension(1:nsoil),
intent(out) :: ai
8716 real (kind=kind_phys),
dimension(1:nsoil),
intent(out) :: bi
8717 real (kind=kind_phys),
dimension(1:nsoil),
intent(out) :: ci
8718 real (kind=kind_phys),
dimension(1:nsoil),
intent(out) :: wcnd
8719 real (kind=kind_phys),
intent(out) :: qdrain
8723 real (kind=kind_phys),
dimension(1:nsoil) :: ddz
8724 real (kind=kind_phys),
dimension(1:nsoil) :: denom
8725 real (kind=kind_phys),
dimension(1:nsoil) :: dsmdz
8726 real (kind=kind_phys),
dimension(1:nsoil) :: wflux
8727 real (kind=kind_phys),
dimension(1:nsoil) :: wdf
8728 real (kind=kind_phys),
dimension(1:nsoil) :: smx
8729 real (kind=kind_phys) :: temp1
8730 real (kind=kind_phys) :: smxwtd
8731 real (kind=kind_phys) :: smxbot
8736 if(opt_inf == 1)
then
8738 call wdfcnd1 (parameters,wdf(k),wcnd(k),smc(k),fcr(k),k)
8741 if(opt_run == 5)smxwtd=smcwtd
8744 if(opt_inf == 2)
then
8746 call wdfcnd2 (parameters,wdf(k),wcnd(k),sh2o(k),sicemax,k)
8749 if(opt_run == 5)smxwtd=smcwtd*sh2o(nsoil)/smc(nsoil)
8754 denom(k) = - zsoil(k)
8755 temp1 = - zsoil(k+1)
8756 ddz(k) = 2.0 / temp1
8757 dsmdz(k) = 2.0 * (smx(k) - smx(k+1)) / temp1
8758 wflux(k) = wdf(k) * dsmdz(k) + wcnd(k) - pddum + etrani(k) + qseva
8759 else if (k < nsoil)
then
8760 denom(k) = (zsoil(k-1) - zsoil(k))
8761 temp1 = (zsoil(k-1) - zsoil(k+1))
8762 ddz(k) = 2.0 / temp1
8763 dsmdz(k) = 2.0 * (smx(k) - smx(k+1)) / temp1
8764 wflux(k) = wdf(k ) * dsmdz(k ) + wcnd(k ) &
8765 - wdf(k-1) * dsmdz(k-1) - wcnd(k-1) + etrani(k)
8767 denom(k) = (zsoil(k-1) - zsoil(k))
8768 if(opt_run == 1 .or. opt_run == 2)
then
8771 if(opt_run == 3)
then
8772 qdrain = parameters%slope*wcnd(k)
8774 if(opt_run == 4)
then
8775 qdrain = (1.0-fcrmax)*wcnd(k)
8777 if(opt_run == 5)
then
8778 temp1 = 2.0 * denom(k)
8779 if(zwt < zsoil(nsoil)-denom(nsoil))
then
8781 smxbot = smx(k) - (smx(k)-smxwtd) * denom(k) * 2./ (denom(k) + zsoil(k) - zwt)
8785 dsmdz(k) = 2.0 * (smx(k) - smxbot) / temp1
8786 qdrain = wdf(k ) * dsmdz(k ) + wcnd(k )
8788 wflux(k) = -(wdf(k-1)*dsmdz(k-1))-wcnd(k-1)+etrani(k) + qdrain
8795 bi(k) = wdf(k ) * ddz(k ) / denom(k)
8797 else if (k < nsoil)
then
8798 ai(k) = - wdf(k-1) * ddz(k-1) / denom(k)
8799 ci(k) = - wdf(k ) * ddz(k ) / denom(k)
8800 bi(k) = - ( ai(k) + ci(k) )
8802 ai(k) = - wdf(k-1) * ddz(k-1) / denom(k)
8804 bi(k) = - ( ai(k) + ci(k) )
8806 rhstt(k) = wflux(k) / (-denom(k))
8816 subroutine sstep (parameters,nsoil ,nsnow ,dt ,zsoil ,dzsnso , & !in
8817 sice ,iloc ,jloc ,zwt , & !in
8818 sh2o ,smc ,ai ,bi ,ci , & !inout
8819 rhstt ,smcwtd ,qdrain ,deeprech, & !inout
8829 type (noahmp_parameters),
intent(in) :: parameters
8830 integer,
intent(in) :: iloc
8831 integer,
intent(in) :: jloc
8832 integer,
intent(in) :: nsoil
8833 integer,
intent(in) :: nsnow
8834 real (kind=kind_phys),
intent(in) :: dt
8835 real (kind=kind_phys),
intent(in) :: zwt
8836 real (kind=kind_phys),
dimension( 1:nsoil),
intent(in) :: zsoil
8837 real (kind=kind_phys),
dimension( 1:nsoil),
intent(in) :: sice
8838 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: dzsnso
8841 real (kind=kind_phys),
dimension(1:nsoil),
intent(inout) :: sh2o
8842 real (kind=kind_phys),
dimension(1:nsoil),
intent(inout) :: smc
8843 real (kind=kind_phys),
dimension(1:nsoil),
intent(inout) :: ai
8844 real (kind=kind_phys),
dimension(1:nsoil),
intent(inout) :: bi
8845 real (kind=kind_phys),
dimension(1:nsoil),
intent(inout) :: ci
8846 real (kind=kind_phys),
dimension(1:nsoil),
intent(inout) :: rhstt
8847 real (kind=kind_phys) ,
intent(inout) :: smcwtd
8848 real (kind=kind_phys) ,
intent(inout) :: qdrain
8849 real (kind=kind_phys) ,
intent(inout) :: deeprech
8852 real (kind=kind_phys),
intent(out) :: wplus
8856 real (kind=kind_phys),
dimension(1:nsoil) :: rhsttin
8857 real (kind=kind_phys),
dimension(1:nsoil) :: ciin
8858 real (kind=kind_phys) :: stot
8859 real (kind=kind_phys) :: epore
8860 real (kind=kind_phys) :: wminus
8865 rhstt(k) = rhstt(k) * dt
8867 bi(k) = 1. + bi(k) * dt
8874 rhsttin(k) = rhstt(k)
8880 call rosr12 (ci,ai,bi,ciin,rhsttin,rhstt,1,nsoil,0)
8883 sh2o(k) = sh2o(k) + ci(k)
8890 if(opt_run == 5)
then
8894 if(zwt < zsoil(nsoil)-dzsnso(nsoil))
then
8896 deeprech = deeprech + dt * qdrain
8898 smcwtd = smcwtd + dt * qdrain / dzsnso(nsoil)
8899 wplus = max((smcwtd-parameters%smcmax(nsoil)), 0.0) * dzsnso(nsoil)
8900 wminus = max((1.e-4-smcwtd), 0.0) * dzsnso(nsoil)
8902 smcwtd = max( min(smcwtd,parameters%smcmax(nsoil)) , 1.e-4)
8903 sh2o(nsoil) = sh2o(nsoil) + wplus/dzsnso(nsoil)
8906 qdrain = qdrain - wplus/dt
8907 deeprech = deeprech - wminus
8913 epore = max( 1.e-4 , ( parameters%smcmax(k) - sice(k) ) )
8914 wplus = max((sh2o(k)-epore), 0.0) * dzsnso(k)
8915 sh2o(k) = min(epore,sh2o(k))
8916 sh2o(k-1) = sh2o(k-1) + wplus/dzsnso(k-1)
8919 epore = max( 1.e-4 , ( parameters%smcmax(1) - sice(1) ) )
8920 wplus = max((sh2o(1)-epore), 0.0) * dzsnso(1)
8921 sh2o(1) = min(epore,sh2o(1))
8923 if(wplus > 0.0)
then
8924 sh2o(2) = sh2o(2) + wplus/dzsnso(2)
8926 epore = max( 1.e-4 , ( parameters%smcmax(k) - sice(k) ) )
8927 wplus = max((sh2o(k)-epore), 0.0) * dzsnso(k)
8928 sh2o(k) = min(epore,sh2o(k))
8929 sh2o(k+1) = sh2o(k+1) + wplus/dzsnso(k+1)
8932 epore = max( 1.e-4 , ( parameters%smcmax(nsoil) - sice(nsoil) ) )
8933 wplus = max((sh2o(nsoil)-epore), 0.0) * dzsnso(nsoil)
8934 sh2o(nsoil) = min(epore,sh2o(nsoil))
8939 end subroutine sstep
8945 subroutine wdfcnd1 (parameters,wdf,wcnd,smc,fcr,isoil)
8952 type (noahmp_parameters),
intent(in) :: parameters
8953 real (kind=kind_phys),
intent(in) :: smc
8954 real (kind=kind_phys),
intent(in) :: fcr
8955 integer,
intent(in) :: isoil
8958 real (kind=kind_phys),
intent(out) :: wcnd
8959 real (kind=kind_phys),
intent(out) :: wdf
8962 real (kind=kind_phys) :: expon
8963 real (kind=kind_phys) :: factr
8964 real (kind=kind_phys) :: vkwgt
8969 factr = max(0.01, smc/parameters%smcmax(isoil))
8970 expon = parameters%bexp(isoil) + 2.0
8971 wdf = parameters%dwsat(isoil) * factr ** expon
8972 wdf = wdf * (1.0 - fcr)
8976 expon = 2.0*parameters%bexp(isoil) + 3.0
8977 wcnd = parameters%dksat(isoil) * factr ** expon
8978 wcnd = wcnd * (1.0 - fcr)
8980 end subroutine wdfcnd1
8986 subroutine wdfcnd2 (parameters,wdf,wcnd,smc,sice,isoil)
8993 type (noahmp_parameters),
intent(in) :: parameters
8994 real (kind=kind_phys),
intent(in) :: smc
8995 real (kind=kind_phys),
intent(in) :: sice
8996 integer,
intent(in) :: isoil
8999 real (kind=kind_phys),
intent(out) :: wcnd
9000 real (kind=kind_phys),
intent(out) :: wdf
9003 real (kind=kind_phys) :: expon
9004 real (kind=kind_phys) :: factr1,factr2
9005 real (kind=kind_phys) :: vkwgt
9010 factr1 = 0.05/parameters%smcmax(isoil)
9011 factr2 = max(0.01, smc/parameters%smcmax(isoil))
9012 factr1 = min(factr1,factr2)
9013 expon = parameters%bexp(isoil) + 2.0
9014 wdf = parameters%dwsat(isoil) * factr2 ** expon
9016 if (sice > 0.0)
then
9017 vkwgt = 1./ (1. + (500.* sice)**3.)
9018 wdf = vkwgt * wdf + (1.-vkwgt)*parameters%dwsat(isoil)*(factr1)**expon
9023 expon = 2.0*parameters%bexp(isoil) + 3.0
9024 wcnd = parameters%dksat(isoil) * factr2 ** expon
9026 end subroutine wdfcnd2
9032 subroutine groundwater(parameters,nsnow ,nsoil ,dt ,sice ,zsoil , & !in
9033 stc ,wcnd ,fcrmax ,iloc ,jloc , & !in
9034 sh2o ,zwt ,wa ,wt , & !inout
9040 type (noahmp_parameters),
intent(in) :: parameters
9041 integer,
intent(in) :: iloc
9042 integer,
intent(in) :: jloc
9043 integer,
intent(in) :: nsnow
9044 integer,
intent(in) :: nsoil
9045 real (kind=kind_phys),
intent(in) :: dt
9046 real (kind=kind_phys),
intent(in) :: fcrmax
9047 real (kind=kind_phys),
dimension( 1:nsoil),
intent(in) :: sice
9048 real (kind=kind_phys),
dimension( 1:nsoil),
intent(in) :: zsoil
9049 real (kind=kind_phys),
dimension( 1:nsoil),
intent(in) :: wcnd
9050 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: stc
9053 real (kind=kind_phys),
dimension( 1:nsoil),
intent(inout) :: sh2o
9054 real (kind=kind_phys),
intent(inout) :: zwt
9055 real (kind=kind_phys),
intent(inout) :: wa
9056 real (kind=kind_phys),
intent(inout) :: wt
9059 real (kind=kind_phys),
intent(out) :: qin
9060 real (kind=kind_phys),
intent(out) :: qdis
9063 real (kind=kind_phys) :: fff
9064 real (kind=kind_phys) :: rsbmx
9067 real (kind=kind_phys),
dimension( 1:nsoil) :: dzmm
9068 real (kind=kind_phys),
dimension( 1:nsoil) :: znode
9069 real (kind=kind_phys),
dimension( 1:nsoil) :: mliq
9070 real (kind=kind_phys),
dimension( 1:nsoil) :: epore
9071 real (kind=kind_phys),
dimension( 1:nsoil) :: hk
9072 real (kind=kind_phys),
dimension( 1:nsoil) :: smc
9073 real (kind=kind_phys) :: s_node
9074 real (kind=kind_phys) :: dzsum
9075 real (kind=kind_phys) :: smpfz
9076 real (kind=kind_phys) :: ka
9077 real (kind=kind_phys) :: wh_zwt
9078 real (kind=kind_phys) :: wh
9079 real (kind=kind_phys) :: ws
9080 real (kind=kind_phys) :: wtsub
9081 real (kind=kind_phys) :: watmin
9082 real (kind=kind_phys) :: xs
9083 real (kind=kind_phys),
parameter :: rous = 0.2
9086 real (kind=kind_phys),
parameter :: cmic = 0.80
9094 dzmm(1) = -zsoil(1)*1.e3
9096 dzmm(iz) = 1.e3 * (zsoil(iz - 1) - zsoil(iz))
9101 znode(1) = -zsoil(1) / 2.
9103 znode(iz) = -zsoil(iz-1) + 0.5 * (zsoil(iz-1) - zsoil(iz))
9109 smc(iz) = sh2o(iz) + sice(iz)
9110 mliq(iz) = sh2o(iz) * dzmm(iz)
9111 epore(iz) = max(0.01,parameters%smcmax(iz) - sice(iz))
9112 hk(iz) = 1.e3*wcnd(iz)
9120 if(zwt .le. -zsoil(iz) )
then
9130 fff = parameters%bexp(iwt) / 3.0
9131 rsbmx = hk(iwt) * 1.0e3 * exp(3.0)
9134 qdis = (1.0-fcrmax)*rsbmx*exp(-parameters%timean)*exp(-fff*zwt)
9138 s_node = min(1.0,smc(iwt)/parameters%smcmax(iwt) )
9139 s_node = max(s_node,real(0.01,kind=8))
9140 smpfz = -parameters%psisat(iwt)*1000.*s_node**(-parameters%bexp(iwt))
9141 smpfz = max(-120000.0,cmic*smpfz)
9145 ka = 0.5*(hk(iwt)+parameters%dksat(iwt)*1.0e3)
9147 wh_zwt = - zwt * 1.e3
9148 wh = smpfz - znode(iwt)*1.e3
9149 qin = - ka * (wh_zwt-wh) /((zwt-znode(iwt))*1.e3)
9150 qin = max(-10.0/dt,min(10./dt,qin))
9154 wt = wt + (qin - qdis) * dt
9156 if(iwt.eq.nsoil)
then
9157 wa = wa + (qin - qdis) * dt
9159 zwt = (-zsoil(nsoil) + 25.) - wa/1000./rous
9160 mliq(nsoil) = mliq(nsoil) - qin * dt
9162 mliq(nsoil) = mliq(nsoil) + max(0.,(wa - 5000.))
9166 if (iwt.eq.nsoil-1)
then
9167 zwt = -zsoil(nsoil) &
9168 - (wt-rous*1000*25.) / (epore(nsoil))/1000.
9172 ws = ws + epore(iz) * dzmm(iz)
9174 zwt = -zsoil(iwt+1) &
9175 - (wt-rous*1000.*25.-ws) /(epore(iwt+1))/1000.
9180 wtsub = wtsub + hk(iz)*dzmm(iz)
9184 mliq(iz) = mliq(iz) - qdis*dt*hk(iz)*dzmm(iz)/wtsub
9196 if (mliq(iz) .lt. 0.)
then
9197 xs = watmin-mliq(iz)
9201 mliq(iz ) = mliq(iz ) + xs
9202 mliq(iz+1) = mliq(iz+1) - xs
9206 if (mliq(iz) .lt. watmin)
then
9207 xs = watmin-mliq(iz)
9211 mliq(iz) = mliq(iz) + xs
9216 sh2o(iz) = mliq(iz) / dzmm(iz)
9219 end subroutine groundwater
9226 subroutine shallowwatertable (parameters,nsnow ,nsoil ,zsoil, dt , & !in
9227 dzsnso ,smceq ,iloc ,jloc , & !in
9228 smc ,wtd ,smcwtd ,rech, qdrain )
9236 type (noahmp_parameters),
intent(in) :: parameters
9237 integer,
intent(in) :: nsnow
9238 integer,
intent(in) :: nsoil
9239 integer,
intent(in) :: iloc,jloc
9240 real (kind=kind_phys),
intent(in) :: dt
9241 real (kind=kind_phys),
dimension( 1:nsoil),
intent(in) :: zsoil
9242 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: dzsnso
9243 real (kind=kind_phys),
dimension( 1:nsoil),
intent(in) :: smceq
9246 real (kind=kind_phys),
dimension( 1:nsoil),
intent(inout) :: smc
9247 real (kind=kind_phys),
intent(inout) :: wtd
9248 real (kind=kind_phys),
intent(inout) :: smcwtd
9249 real (kind=kind_phys),
intent(out) :: rech
9250 real (kind=kind_phys),
intent(inout) :: qdrain
9256 real (kind=kind_phys) :: wtdold
9257 real (kind=kind_phys) :: dzup
9258 real (kind=kind_phys) :: smceqdeep
9259 real (kind=kind_phys),
dimension( 0:nsoil) :: zsoil0
9263zsoil0(1:nsoil) = zsoil(1:nsoil)
9268 if(wtd + 1.e-6 < zsoil0(iz))
exit
9274 if(kwtd.le.nsoil)
then
9276 if(smc(kwtd).gt.smceq(kwtd))
then
9278 if(smc(kwtd).eq.parameters%smcmax(kwtd))
then
9280 rech=-(wtdold-wtd) * (parameters%smcmax(kwtd)-smceq(kwtd))
9284 if(smc(kwtd).gt.smceq(kwtd))
then
9286 wtd = min( ( smc(kwtd)*dzsnso(kwtd) &
9287 - smceq(kwtd)*zsoil0(iwtd) + parameters%smcmax(kwtd)*zsoil0(kwtd) ) / &
9288 ( parameters%smcmax(kwtd)-smceq(kwtd) ), zsoil0(iwtd))
9289 rech=rech-(wtdold-wtd) * (parameters%smcmax(kwtd)-smceq(kwtd))
9293 wtd = min( ( smc(kwtd)*dzsnso(kwtd) &
9294 - smceq(kwtd)*zsoil0(iwtd) + parameters%smcmax(kwtd)*zsoil0(kwtd) ) / &
9295 ( parameters%smcmax(kwtd)-smceq(kwtd) ), zsoil0(iwtd))
9296 rech=-(wtdold-wtd) * (parameters%smcmax(kwtd)-smceq(kwtd))
9301 rech=-(wtdold-wtd) * (parameters%smcmax(kwtd)-smceq(kwtd))
9305 if(kwtd.le.nsoil)
then
9307 if(smc(kwtd).gt.smceq(kwtd))
then
9308 wtd = min( ( smc(kwtd)*dzsnso(kwtd) &
9309 - smceq(kwtd)*zsoil0(iwtd) + parameters%smcmax(kwtd)*zsoil0(kwtd) ) / &
9310 ( parameters%smcmax(kwtd)-smceq(kwtd) ) , zsoil0(iwtd) )
9314 rech = rech - (wtdold-wtd) * &
9315 (parameters%smcmax(kwtd)-smceq(kwtd))
9324 smceqdeep = parameters%smcmax(nsoil) * ( -parameters%psisat(nsoil) / ( -parameters%psisat(nsoil) - dzsnso(nsoil) ) ) ** (1./parameters%bexp(nsoil))
9325 wtd = min( ( smcwtd*dzsnso(nsoil) &
9326 - smceqdeep*zsoil0(nsoil) + parameters%smcmax(nsoil)*(zsoil0(nsoil)-dzsnso(nsoil)) ) / &
9327 ( parameters%smcmax(nsoil)-smceqdeep ) , zsoil0(nsoil) )
9328 rech = rech - (wtdold-wtd) * &
9329 (parameters%smcmax(nsoil)-smceqdeep)
9333 elseif(wtd.ge.zsoil0(nsoil)-dzsnso(nsoil))
then
9336 smceqdeep = parameters%smcmax(nsoil) * ( -parameters%psisat(nsoil) / ( -parameters%psisat(nsoil) - dzsnso(nsoil) ) ) ** (1./parameters%bexp(nsoil))
9337 if(smcwtd.gt.smceqdeep)
then
9338 wtd = min( ( smcwtd*dzsnso(nsoil) &
9339 - smceqdeep*zsoil0(nsoil) + parameters%smcmax(nsoil)*(zsoil0(nsoil)-dzsnso(nsoil)) ) / &
9340 ( parameters%smcmax(nsoil)-smceqdeep ) , zsoil0(nsoil) )
9341 rech = -(wtdold-wtd) * (parameters%smcmax(nsoil)-smceqdeep)
9343 rech = -(wtdold-(zsoil0(nsoil)-dzsnso(nsoil))) * (parameters%smcmax(nsoil)-smceqdeep)
9344 wtdold=zsoil0(nsoil)-dzsnso(nsoil)
9346 dzup=(smceqdeep-smcwtd)*dzsnso(nsoil)/(parameters%smcmax(nsoil)-smceqdeep)
9348 rech = rech - (parameters%smcmax(nsoil)-smceqdeep)*dzup
9355if(iwtd.lt.nsoil .and. iwtd.gt.0)
then
9356 smcwtd=parameters%smcmax(iwtd)
9357elseif(iwtd.lt.nsoil .and. iwtd.le.0)
then
9358 smcwtd=parameters%smcmax(1)
9361end subroutine shallowwatertable
9371 subroutine carbon (parameters,nsnow ,nsoil ,vegtyp ,dt ,zsoil , & !in
9372 dzsnso ,stc ,smc ,tv ,tg ,psn , & !in
9373 foln ,btran ,apar ,fveg ,igs , & !in
9374 troot ,ist ,lat ,iloc ,jloc , & !in
9375 lfmass ,rtmass ,stmass ,wood ,stblcp ,fastcp , & !inout
9376 gpp ,npp ,nee ,autors ,heters ,totsc , & !out
9383 type (noahmp_parameters),
intent(in) :: parameters
9384 integer ,
intent(in) :: iloc
9385 integer ,
intent(in) :: jloc
9386 integer ,
intent(in) :: vegtyp
9387 integer ,
intent(in) :: nsnow
9388 integer ,
intent(in) :: nsoil
9389 real (kind=kind_phys) ,
intent(in) :: lat
9390 real (kind=kind_phys) ,
intent(in) :: dt
9391 real (kind=kind_phys),
dimension( 1:nsoil),
intent(in) :: zsoil
9392 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: dzsnso
9393 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: stc
9394 real (kind=kind_phys),
dimension( 1:nsoil),
intent(in) :: smc
9395 real (kind=kind_phys) ,
intent(in) :: tv
9396 real (kind=kind_phys) ,
intent(in) :: tg
9397 real (kind=kind_phys) ,
intent(in) :: foln
9398 real (kind=kind_phys) ,
intent(in) :: btran
9399 real (kind=kind_phys) ,
intent(in) :: psn
9400 real (kind=kind_phys) ,
intent(in) :: apar
9401 real (kind=kind_phys) ,
intent(in) :: igs
9402 real (kind=kind_phys) ,
intent(in) :: fveg
9403 real (kind=kind_phys) ,
intent(in) :: troot
9404 integer ,
intent(in) :: ist
9408 real (kind=kind_phys) ,
intent(inout) :: lfmass
9409 real (kind=kind_phys) ,
intent(inout) :: rtmass
9410 real (kind=kind_phys) ,
intent(inout) :: stmass
9411 real (kind=kind_phys) ,
intent(inout) :: wood
9412 real (kind=kind_phys) ,
intent(inout) :: stblcp
9413 real (kind=kind_phys) ,
intent(inout) :: fastcp
9417 real (kind=kind_phys) ,
intent(out) :: gpp
9418 real (kind=kind_phys) ,
intent(out) :: npp
9419 real (kind=kind_phys) ,
intent(out) :: nee
9420 real (kind=kind_phys) ,
intent(out) :: autors
9421 real (kind=kind_phys) ,
intent(out) :: heters
9422 real (kind=kind_phys) ,
intent(out) :: totsc
9423 real (kind=kind_phys) ,
intent(out) :: totlb
9424 real (kind=kind_phys) ,
intent(out) :: xlai
9425 real (kind=kind_phys) ,
intent(out) :: xsai
9431 real (kind=kind_phys) :: wroot
9432 real (kind=kind_phys) :: wstres
9433 real (kind=kind_phys) :: lapm
9436 if ( ( vegtyp == parameters%iswater ) .or. ( vegtyp == parameters%isbarren ) .or. &
9437 ( vegtyp == parameters%isice ) .or. (parameters%urban_flag) )
then
9457 lapm = parameters%sla / 1000.
9464 do j=1,parameters%nroot
9465 wroot = wroot + smc(j)/parameters%smcmax(j) * dzsnso(j) / (-zsoil(parameters%nroot))
9468 call co2flux (parameters,nsnow ,nsoil ,vegtyp ,igs ,dt , &
9469 dzsnso ,stc ,psn ,troot ,tv , &
9470 wroot ,wstres ,foln ,lapm , &
9471 lat ,iloc ,jloc ,fveg , &
9472 xlai ,xsai ,lfmass ,rtmass ,stmass , &
9473 fastcp ,stblcp ,wood , &
9474 gpp ,npp ,nee ,autors ,heters , &
9480 end subroutine carbon
9487 subroutine co2flux (parameters,nsnow ,nsoil ,vegtyp ,igs ,dt , & !in
9488 dzsnso ,stc ,psn ,troot ,tv , & !in
9489 wroot ,wstres ,foln ,lapm , & !in
9490 lat ,iloc ,jloc ,fveg , & !in
9491 xlai ,xsai ,lfmass ,rtmass ,stmass , & !inout
9492 fastcp ,stblcp ,wood , & !inout
9493 gpp ,npp ,nee ,autors ,heters , & !out
9503 type (noahmp_parameters),
intent(in) :: parameters
9504 integer ,
intent(in) :: iloc
9505 integer ,
intent(in) :: jloc
9506 integer ,
intent(in) :: vegtyp
9507 integer ,
intent(in) :: nsnow
9508 integer ,
intent(in) :: nsoil
9509 real (kind=kind_phys) ,
intent(in) :: dt
9510 real (kind=kind_phys) ,
intent(in) :: lat
9511 real (kind=kind_phys) ,
intent(in) :: igs
9512 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: dzsnso
9513 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: stc
9514 real (kind=kind_phys) ,
intent(in) :: psn
9515 real (kind=kind_phys) ,
intent(in) :: troot
9516 real (kind=kind_phys) ,
intent(in) :: tv
9517 real (kind=kind_phys) ,
intent(in) :: wroot
9518 real (kind=kind_phys) ,
intent(in) :: wstres
9519 real (kind=kind_phys) ,
intent(in) :: foln
9520 real (kind=kind_phys) ,
intent(in) :: lapm
9521 real (kind=kind_phys) ,
intent(in) :: fveg
9525 real (kind=kind_phys) ,
intent(inout) :: xlai
9526 real (kind=kind_phys) ,
intent(inout) :: xsai
9527 real (kind=kind_phys) ,
intent(inout) :: lfmass
9528 real (kind=kind_phys) ,
intent(inout) :: rtmass
9529 real (kind=kind_phys) ,
intent(inout) :: stmass
9530 real (kind=kind_phys) ,
intent(inout) :: fastcp
9531 real (kind=kind_phys) ,
intent(inout) :: stblcp
9532 real (kind=kind_phys) ,
intent(inout) :: wood
9536 real (kind=kind_phys) ,
intent(out) :: gpp
9537 real (kind=kind_phys) ,
intent(out) :: npp
9538 real (kind=kind_phys) ,
intent(out) :: nee
9539 real (kind=kind_phys) ,
intent(out) :: autors
9540 real (kind=kind_phys) ,
intent(out) :: heters
9541 real (kind=kind_phys) ,
intent(out) :: totsc
9542 real (kind=kind_phys) ,
intent(out) :: totlb
9546 real (kind=kind_phys) :: cflux
9547 real (kind=kind_phys) :: lfmsmn
9548 real (kind=kind_phys) :: rswood
9549 real (kind=kind_phys) :: rsleaf
9550 real (kind=kind_phys) :: rsroot
9551 real (kind=kind_phys) :: nppl
9552 real (kind=kind_phys) :: nppr
9553 real (kind=kind_phys) :: nppw
9554 real (kind=kind_phys) :: npps
9555 real (kind=kind_phys) :: dielf
9557 real (kind=kind_phys) :: addnpplf
9558 real (kind=kind_phys) :: addnppst
9559 real (kind=kind_phys) :: carbfx
9560 real (kind=kind_phys) :: grleaf
9561 real (kind=kind_phys) :: grroot
9562 real (kind=kind_phys) :: grwood
9563 real (kind=kind_phys) :: grstem
9564 real (kind=kind_phys) :: leafpt
9565 real (kind=kind_phys) :: lfdel
9566 real (kind=kind_phys) :: lftovr
9567 real (kind=kind_phys) :: sttovr
9568 real (kind=kind_phys) :: wdtovr
9569 real (kind=kind_phys) :: rssoil
9570 real (kind=kind_phys) :: rttovr
9571 real (kind=kind_phys) :: stablc
9572 real (kind=kind_phys) :: woodf
9573 real (kind=kind_phys) :: nonlef
9574 real (kind=kind_phys) :: rootpt
9575 real (kind=kind_phys) :: woodpt
9576 real (kind=kind_phys) :: stempt
9577 real (kind=kind_phys) :: resp
9578 real (kind=kind_phys) :: rsstem
9580 real (kind=kind_phys) :: fsw
9581 real (kind=kind_phys) :: fst
9582 real (kind=kind_phys) :: fnf
9583 real (kind=kind_phys) :: tf
9584 real (kind=kind_phys) :: rf
9585 real (kind=kind_phys) :: stdel
9586 real (kind=kind_phys) :: stmsmn
9587 real (kind=kind_phys) :: sapm
9588 real (kind=kind_phys) :: diest
9590 real (kind=kind_phys) :: bf
9591 real (kind=kind_phys) :: rswoodc
9592 real (kind=kind_phys) :: stovrc
9593 real (kind=kind_phys) :: rsdryc
9594 real (kind=kind_phys) :: rtovrc
9595 real (kind=kind_phys) :: wstrc
9596 real (kind=kind_phys) :: laimin
9597 real (kind=kind_phys) :: xsamin
9598 real (kind=kind_phys) :: sc
9599 real (kind=kind_phys) :: sd
9600 real (kind=kind_phys) :: vegfrac
9604 real (kind=kind_phys) :: r,x
9605 r(x) = exp(0.08*(x-298.16))
9618 lfmsmn = laimin/lapm
9619 stmsmn = xsamin/sapm
9624 if(igs .eq. 0.)
then
9630 fnf = min( foln/max(1.e-06,parameters%folnmx), 1.0 )
9631 tf = parameters%arm**( (tv-298.16)/10. )
9632 resp = parameters%rmf25 * tf * fnf * xlai * rf * (1.-wstres)
9633 rsleaf = min((lfmass-lfmsmn)/dt,resp*12.e-6)
9635 rsroot = parameters%rmr25*(rtmass*1e-3)*tf *rf* 12.e-6
9636 rsstem = parameters%rms25*((stmass-stmsmn)*1e-3)*tf *rf* 12.e-6
9637 rswood = rswoodc * r(tv) * wood*parameters%wdpool
9642 carbfx = psn * 12.e-6
9646 leafpt = exp(0.01*(1.-exp(0.75*xlai))*xlai)
9647 if(vegtyp == parameters%eblforest) leafpt = exp(0.01*(1.-exp(0.50*xlai))*xlai)
9649 nonlef = 1.0 - leafpt
9650 stempt = xlai/10.0*leafpt
9651 leafpt = leafpt - stempt
9655 if(wood > 1.e-6)
then
9656 woodf = (1.-exp(-bf*(parameters%wrrat*rtmass/wood))/bf)*parameters%wdpool
9658 woodf = parameters%wdpool
9661 rootpt = nonlef*(1.-woodf)
9662 woodpt = nonlef*woodf
9666 lftovr = parameters%ltovrc*5.e-7*lfmass
9667 sttovr = parameters%ltovrc*5.e-7*stmass
9668 rttovr = rtovrc*rtmass
9669 wdtovr = 9.5e-10*wood
9674 sc = exp(-0.3*max(0.,tv-parameters%tdlef)) * (lfmass/120.)
9675 sd = exp((wstres-1.)*wstrc)
9676 dielf = lfmass*1.e-6*(parameters%dilefw * sd + parameters%dilefc*sc)
9677 diest = stmass*1.e-6*(parameters%dilefw * sd + parameters%dilefc*sc)
9681 grleaf = max(0.0,parameters%fragr*(leafpt*carbfx - rsleaf))
9682 grstem = max(0.0,parameters%fragr*(stempt*carbfx - rsstem))
9683 grroot = max(0.0,parameters%fragr*(rootpt*carbfx - rsroot))
9684 grwood = max(0.0,parameters%fragr*(woodpt*carbfx - rswood))
9688 addnpplf = max(0.,leafpt*carbfx - grleaf-rsleaf)
9689 addnppst = max(0.,stempt*carbfx - grstem-rsstem)
9692 if(tv.lt.parameters%tmin) addnpplf =0.
9693 if(tv.lt.parameters%tmin) addnppst =0.
9698 lfdel = (lfmass - lfmsmn)/dt
9699 stdel = (stmass - stmsmn)/dt
9700 dielf = min(dielf,lfdel+addnpplf-lftovr)
9701 diest = min(diest,stdel+addnppst-sttovr)
9705 nppl = max(addnpplf,-lfdel)
9706 npps = max(addnppst,-stdel)
9707 nppr = rootpt*carbfx - rsroot - grroot
9708 nppw = woodpt*carbfx - rswood - grwood
9712 lfmass = lfmass + (nppl-lftovr-dielf)*dt
9713 stmass = stmass + (npps-sttovr-diest)*dt
9714 rtmass = rtmass + (nppr-rttovr) *dt
9716 if(rtmass.lt.0.0)
then
9720 wood = (wood+(nppw-wdtovr)*dt)*parameters%wdpool
9724 fastcp = fastcp + (rttovr+lftovr+sttovr+wdtovr+dielf+diest)*dt
9726 fst = 2.0**( (stc(1)-283.16)/10. )
9727 fsw = wroot / (0.20+wroot) * 0.23 / (0.23+wroot)
9728 rssoil = fsw * fst * parameters%mrp* max(0.,fastcp*1.e-3)*12.e-6
9731 fastcp = fastcp - (rssoil + stablc)*dt
9732 stblcp = stblcp + stablc*dt
9736 cflux = - carbfx + rsleaf + rsroot + rswood + rsstem &
9737 + 0.9*rssoil + grleaf + grroot + grwood + grstem
9742 npp = nppl + nppw + nppr +npps
9743 autors = rsroot + rswood + rsleaf + rsstem + &
9744 grleaf + grroot + grwood + grstem
9746 nee = (autors + heters - gpp)*44./12.
9747 totsc = fastcp + stblcp
9748 totlb = lfmass + rtmass +stmass + wood
9752 xlai = max(lfmass*lapm,laimin)
9753 xsai = max(stmass*sapm,xsamin)
9755 end subroutine co2flux
9761 subroutine carbon_crop (parameters,nsnow ,nsoil ,vegtyp ,dt ,zsoil ,julian , & !in
9762 dzsnso ,stc ,smc ,tv ,psn ,foln ,btran , & !in
9764 lfmass ,rtmass ,stmass ,wood ,stblcp ,fastcp ,grain , & !inout
9765 xlai ,xsai ,gdd , & !inout
9766 gpp ,npp ,nee ,autors ,heters ,totsc ,totlb, pgs )
9776 type (noahmp_parameters),
intent(in) :: parameters
9777 integer ,
intent(in) :: nsnow
9778 integer ,
intent(in) :: nsoil
9779 integer ,
intent(in) :: vegtyp
9780 real (kind=kind_phys) ,
intent(in) :: dt
9781 real (kind=kind_phys),
dimension( 1:nsoil),
intent(in) :: zsoil
9782 real (kind=kind_phys) ,
intent(in) :: julian
9783 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: dzsnso
9784 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: stc
9785 real (kind=kind_phys),
dimension( 1:nsoil),
intent(in) :: smc
9786 real (kind=kind_phys) ,
intent(in) :: tv
9787 real (kind=kind_phys) ,
intent(in) :: psn
9788 real (kind=kind_phys) ,
intent(in) :: foln
9789 real (kind=kind_phys) ,
intent(in) :: btran
9790 real (kind=kind_phys) ,
intent(in) :: soldn
9791 real (kind=kind_phys) ,
intent(in) :: t2m
9795 real (kind=kind_phys) ,
intent(inout) :: lfmass
9796 real (kind=kind_phys) ,
intent(inout) :: rtmass
9797 real (kind=kind_phys) ,
intent(inout) :: stmass
9798 real (kind=kind_phys) ,
intent(inout) :: wood
9799 real (kind=kind_phys) ,
intent(inout) :: stblcp
9800 real (kind=kind_phys) ,
intent(inout) :: fastcp
9801 real (kind=kind_phys) ,
intent(inout) :: grain
9802 real (kind=kind_phys) ,
intent(inout) :: xlai
9803 real (kind=kind_phys) ,
intent(inout) :: xsai
9804 real (kind=kind_phys) ,
intent(inout) :: gdd
9807 real (kind=kind_phys) ,
intent(out) :: gpp
9808 real (kind=kind_phys) ,
intent(out) :: npp
9809 real (kind=kind_phys) ,
intent(out) :: nee
9810 real (kind=kind_phys) ,
intent(out) :: autors
9811 real (kind=kind_phys) ,
intent(out) :: heters
9812 real (kind=kind_phys) ,
intent(out) :: totsc
9813 real (kind=kind_phys) ,
intent(out) :: totlb
9818 real (kind=kind_phys) :: wroot
9819 real (kind=kind_phys) :: wstres
9822 integer,
intent(out) :: pgs
9824 real (kind=kind_phys) :: psncrop
9827 if ( ( vegtyp == parameters%iswater ) .or. ( vegtyp == parameters%isbarren ) .or. &
9828 ( vegtyp == parameters%isice ) .or. (parameters%urban_flag) )
then
9854 do j=1,parameters%nroot
9855 wroot = wroot + smc(j)/parameters%smcmax(j) * dzsnso(j) / (-zsoil(parameters%nroot))
9858 call psn_crop ( parameters, &
9862 call growing_gdd (parameters, &
9867 call co2flux_crop (parameters, &
9868 dt ,stc(1) ,psn ,tv ,wroot ,wstres ,foln , &
9870 xlai ,xsai ,lfmass ,rtmass ,stmass , &
9871 fastcp ,stblcp ,wood ,grain ,gdd , &
9872 gpp ,npp ,nee ,autors ,heters , &
9875 end subroutine carbon_crop
9881 subroutine co2flux_crop (parameters, & !in
9882 dt ,stc ,psn ,tv ,wroot ,wstres ,foln , & !in
9883 ipa ,iha ,pgs , & !in xing
9884 xlai ,xsai ,lfmass ,rtmass ,stmass , & !inout
9885 fastcp ,stblcp ,wood ,grain ,gdd, & !inout
9886 gpp ,npp ,nee ,autors ,heters , & !out
9898 type (noahmp_parameters),
intent(in) :: parameters
9899 real (kind=kind_phys) ,
intent(in) :: dt
9900 real (kind=kind_phys) ,
intent(in) :: stc
9901 real (kind=kind_phys) ,
intent(in) :: psn
9902 real (kind=kind_phys) ,
intent(in) :: tv
9903 real (kind=kind_phys) ,
intent(in) :: wroot
9904 real (kind=kind_phys) ,
intent(in) :: wstres
9905 real (kind=kind_phys) ,
intent(in) :: foln
9906 integer ,
intent(in) :: ipa
9907 integer ,
intent(in) :: iha
9908 integer ,
intent(in) :: pgs
9912 real (kind=kind_phys) ,
intent(inout) :: xlai
9913 real (kind=kind_phys) ,
intent(inout) :: xsai
9914 real (kind=kind_phys) ,
intent(inout) :: lfmass
9915 real (kind=kind_phys) ,
intent(inout) :: rtmass
9916 real (kind=kind_phys) ,
intent(inout) :: stmass
9917 real (kind=kind_phys) ,
intent(inout) :: fastcp
9918 real (kind=kind_phys) ,
intent(inout) :: stblcp
9919 real (kind=kind_phys) ,
intent(inout) :: wood
9920 real (kind=kind_phys) ,
intent(inout) :: grain
9921 real (kind=kind_phys) ,
intent(inout) :: gdd
9925 real (kind=kind_phys) ,
intent(out) :: gpp
9926 real (kind=kind_phys) ,
intent(out) :: npp
9927 real (kind=kind_phys) ,
intent(out) :: nee
9928 real (kind=kind_phys) ,
intent(out) :: autors
9929 real (kind=kind_phys) ,
intent(out) :: heters
9930 real (kind=kind_phys) ,
intent(out) :: totsc
9931 real (kind=kind_phys) ,
intent(out) :: totlb
9935 real (kind=kind_phys) :: cflux
9936 real (kind=kind_phys) :: lfmsmn
9937 real (kind=kind_phys) :: rswood
9938 real (kind=kind_phys) :: rsleaf
9939 real (kind=kind_phys) :: rsroot
9940 real (kind=kind_phys) :: rsgrain
9941 real (kind=kind_phys) :: nppl
9942 real (kind=kind_phys) :: nppr
9943 real (kind=kind_phys) :: nppw
9944 real (kind=kind_phys) :: npps
9945 real (kind=kind_phys) :: nppg
9946 real (kind=kind_phys) :: dielf
9948 real (kind=kind_phys) :: addnpplf
9949 real (kind=kind_phys) :: addnppst
9950 real (kind=kind_phys) :: carbfx
9951 real (kind=kind_phys) :: cbhydrafx
9952 real (kind=kind_phys) :: grleaf
9953 real (kind=kind_phys) :: grroot
9954 real (kind=kind_phys) :: grwood
9955 real (kind=kind_phys) :: grstem
9956 real (kind=kind_phys) :: grgrain
9957 real (kind=kind_phys) :: leafpt
9958 real (kind=kind_phys) :: lfdel
9959 real (kind=kind_phys) :: lftovr
9960 real (kind=kind_phys) :: sttovr
9961 real (kind=kind_phys) :: wdtovr
9962 real (kind=kind_phys) :: grtovr
9963 real (kind=kind_phys) :: rssoil
9964 real (kind=kind_phys) :: rttovr
9965 real (kind=kind_phys) :: stablc
9966 real (kind=kind_phys) :: woodf
9967 real (kind=kind_phys) :: nonlef
9968 real (kind=kind_phys) :: resp
9969 real (kind=kind_phys) :: rsstem
9971 real (kind=kind_phys) :: fsw
9972 real (kind=kind_phys) :: fst
9973 real (kind=kind_phys) :: fnf
9974 real (kind=kind_phys) :: tf
9975 real (kind=kind_phys) :: stdel
9976 real (kind=kind_phys) :: stmsmn
9977 real (kind=kind_phys) :: sapm
9978 real (kind=kind_phys) :: diest
9979 real (kind=kind_phys) :: stconvert
9980 real (kind=kind_phys) :: rtconvert
9982 real (kind=kind_phys) :: bf
9983 real (kind=kind_phys) :: rswoodc
9984 real (kind=kind_phys) :: stovrc
9985 real (kind=kind_phys) :: rsdryc
9986 real (kind=kind_phys) :: rtovrc
9987 real (kind=kind_phys) :: wstrc
9988 real (kind=kind_phys) :: laimin
9989 real (kind=kind_phys) :: xsamin
9990 real (kind=kind_phys) :: sc
9991 real (kind=kind_phys) :: sd
9992 real (kind=kind_phys) :: vegfrac
9993 real (kind=kind_phys) :: temp
9997 real (kind=kind_phys) :: r,x
9998 r(x) = exp(0.08*(x-298.16))
10010 lfmsmn = laimin/0.035
10011 stmsmn = xsamin/sapm
10017 carbfx = psn*12.e-6
10018 cbhydrafx = psn*30.e-6
10021 fnf = min( foln/max(1.e-06,parameters%foln_mx), 1.0 )
10022 tf = parameters%q10mr**( (tv-298.16)/10. )
10023 resp = parameters%lfmr25 * tf * fnf * xlai * (1.-wstres)
10024 rsleaf = min((lfmass-lfmsmn)/dt,resp*30.e-6)
10025 rsroot = parameters%rtmr25*(rtmass*1e-3)*tf * 30.e-6
10026 rsstem = parameters%stmr25*(stmass*1e-3)*tf * 30.e-6
10027 rsgrain = parameters%grainmr25*(grain*1e-3)*tf * 30.e-6
10031 grleaf = max(0.0,parameters%fra_gr*(parameters%lfpt(pgs)*cbhydrafx - rsleaf))
10032 grstem = max(0.0,parameters%fra_gr*(parameters%stpt(pgs)*cbhydrafx - rsstem))
10033 grroot = max(0.0,parameters%fra_gr*(parameters%rtpt(pgs)*cbhydrafx - rsroot))
10034 grgrain = max(0.0,parameters%fra_gr*(parameters%grainpt(pgs)*cbhydrafx - rsgrain))
10039 lftovr = parameters%lf_ovrc(pgs)*1.e-6*lfmass
10040 rttovr = parameters%rt_ovrc(pgs)*1.e-6*rtmass
10041 sttovr = parameters%st_ovrc(pgs)*1.e-6*stmass
10042 sc = exp(-0.3*max(0.,tv-parameters%lefreez)) * (lfmass/120.)
10043 sd = exp((wstres-1.)*wstrc)
10044 dielf = lfmass*1.e-6*(parameters%dile_fw(pgs) * sd + parameters%dile_fc(pgs)*sc)
10049 addnpplf = max(0.,parameters%lfpt(pgs)*cbhydrafx - grleaf-rsleaf)
10050 addnpplf = parameters%lfpt(pgs)*cbhydrafx - grleaf-rsleaf
10051 addnppst = max(0.,parameters%stpt(pgs)*cbhydrafx - grstem-rsstem)
10052 addnppst = parameters%stpt(pgs)*cbhydrafx - grstem-rsstem
10057 lfdel = (lfmass - lfmsmn)/dt
10058 stdel = (stmass - stmsmn)/dt
10059 lftovr = min(lftovr,lfdel+addnpplf)
10060 sttovr = min(sttovr,stdel+addnppst)
10061 dielf = min(dielf,lfdel+addnpplf-lftovr)
10065 nppl = max(addnpplf,-lfdel)
10067 npps = max(addnppst,-stdel)
10069 nppr = parameters%rtpt(pgs)*cbhydrafx - rsroot - grroot
10070 nppg = parameters%grainpt(pgs)*cbhydrafx - rsgrain - grgrain
10074 lfmass = lfmass + (nppl-lftovr-dielf)*dt
10075 stmass = stmass + (npps-sttovr)*dt
10076 rtmass = rtmass + (nppr-rttovr)*dt
10077 grain = grain + nppg*dt
10079 gpp = cbhydrafx* 0.4
10084 stconvert = stmass*(0.00005*dt/3600.0)
10085 stmass = stmass - stconvert
10086 rtconvert = rtmass*(0.0005*dt/3600.0)
10087 rtmass = rtmass - rtconvert
10088 grain = grain + stconvert + rtconvert
10091 if(rtmass.lt.0.0)
then
10096 if(grain.lt.0.0)
then
10105 fastcp = fastcp + (rttovr+lftovr+sttovr+dielf)*dt
10107 fst = 2.0**( (stc-283.16)/10. )
10108 fsw = wroot / (0.20+wroot) * 0.23 / (0.23+wroot)
10109 rssoil = fsw * fst * parameters%mrp* max(0.,fastcp*1.e-3)*12.e-6
10111 stablc = 0.1*rssoil
10112 fastcp = fastcp - (rssoil + stablc)*dt
10113 stblcp = stblcp + stablc*dt
10117 cflux = - carbfx + rsleaf + rsroot + rsstem &
10118 + rssoil + grleaf + grroot
10123 npp = (nppl + npps+ nppr +nppg)*0.4
10126 autors = rsroot + rsgrain + rsleaf + &
10127 grleaf + grroot + grgrain
10130 nee = (autors + heters - gpp)*44./30.
10131 totsc = fastcp + stblcp
10133 totlb = lfmass + rtmass + grain
10137 xlai = max(lfmass*parameters%bio2lai,laimin)
10138 xsai = max(stmass*sapm,xsamin)
10149 if(pgs == 8 .and. (grain > 0. .or. lfmass > 0 .or. stmass > 0 .or. rtmass > 0))
then
10158end subroutine co2flux_crop
10163 subroutine growing_gdd (parameters, & !in
10164 t2m , dt, julian, & !in
10171 type (noahmp_parameters),
intent(in) :: parameters
10172 real (kind=kind_phys) ,
intent(in) :: t2m
10173 real (kind=kind_phys) ,
intent(in) :: dt
10174 real (kind=kind_phys) ,
intent(in) :: julian
10178 real (kind=kind_phys) ,
intent(inout) :: gdd
10182 integer ,
intent(out) :: ipa
10183 integer ,
intent(out) :: iha
10184 integer ,
intent(out) :: pgs
10188 real (kind=kind_phys) :: gddday
10189 real (kind=kind_phys) :: dayofs2
10190 real (kind=kind_phys) :: tdiff
10191 real (kind=kind_phys) :: tc
10202 if(julian < parameters%pltday) ipa = 0
10205 if(julian >= parameters%hsday) iha = 0
10209 if(tc < parameters%gddtbase)
then
10211 elseif(tc >= parameters%gddtcut)
then
10212 tdiff = parameters%gddtcut - parameters%gddtbase
10214 tdiff = tc - parameters%gddtbase
10217 gdd = (gdd + tdiff * dt / 86400.0) * ipa * iha
10240 if(gddday > 0.0) pgs = 2
10242 if(gddday >= parameters%gdds1) pgs = 3
10244 if(gddday >= parameters%gdds2) pgs = 4
10246 if(gddday >= parameters%gdds3) pgs = 5
10248 if(gddday >= parameters%gdds4) pgs = 6
10250 if(gddday >= parameters%gdds5) pgs = 7
10252 if(julian >= parameters%hsday) pgs = 8
10254 if(julian < parameters%pltday) pgs = 1
10256end subroutine growing_gdd
10261subroutine psn_crop ( parameters, & !in
10262 soldn, xlai,t2m, & !in
10268 type (noahmp_parameters),
intent(in) :: parameters
10269 real (kind=kind_phys) ,
intent(in) :: soldn
10270 real (kind=kind_phys) ,
intent(in) :: xlai
10271 real (kind=kind_phys) ,
intent(in) :: t2m
10272 real (kind=kind_phys) ,
intent(out) :: psncrop
10276 real (kind=kind_phys) :: par
10277 real (kind=kind_phys) :: amax
10278 real (kind=kind_phys) :: l1
10279 real (kind=kind_phys) :: l2
10280 real (kind=kind_phys) :: l3
10281 real (kind=kind_phys) :: i1
10282 real (kind=kind_phys) :: i2
10283 real (kind=kind_phys) :: i3
10284 real (kind=kind_phys) :: a1
10285 real (kind=kind_phys) :: a2
10286 real (kind=kind_phys) :: a3
10287 real (kind=kind_phys) :: a
10288 real (kind=kind_phys) :: tc
10292 par = parameters%i2par * soldn * 0.0036
10294 if(tc < parameters%tassim0)
then
10296 elseif(tc >= parameters%tassim0 .and. tc < parameters%tassim1)
then
10297 amax = (tc - parameters%tassim0) * parameters%aref / (parameters%tassim1 - parameters%tassim0)
10298 elseif(tc >= parameters%tassim1 .and. tc < parameters%tassim2)
then
10299 amax = parameters%aref
10301 amax= parameters%aref - 0.2 * (t2m - parameters%tassim2)
10304 amax = max(amax,0.01)
10306 if(xlai <= 0.05)
then
10316 i1 = parameters%k * par * exp(-parameters%k * l1)
10317 i2 = parameters%k * par * exp(-parameters%k * l2)
10318 i3 = parameters%k * par * exp(-parameters%k * l3)
10324 a1 = amax * (1 - exp(-parameters%epsi * i1 / amax))
10325 a2 = amax * (1 - exp(-parameters%epsi * i2 / amax)) * 1.6
10326 a3 = amax * (1 - exp(-parameters%epsi * i3 / amax))
10328 if (xlai <= 0.05)
then
10329 a = (a1+a2+a3) / 3.6 * 0.05
10330 elseif (xlai > 0.05 .and. xlai <= 4.0)
then
10331 a = (a1+a2+a3) / 3.6 * xlai
10333 a = (a1+a2+a3) / 3.6 * 4
10336 a = a * parameters%psnrf
10338 psncrop = 6.313 * a
10340end subroutine psn_crop
10442 subroutine noahmp_options(idveg , iopt_crs , iopt_btr , iopt_run , iopt_sfc , iopt_frz , &
10443 iopt_inf, iopt_rad , iopt_alb , iopt_snf , iopt_tbot, iopt_stc , &
10444 iopt_rsf, iopt_soil, iopt_pedo, iopt_crop, iopt_trs , iopt_diag, &
10449 integer,
intent(in) :: idveg
10450 integer,
intent(in) :: iopt_crs
10451 integer,
intent(in) :: iopt_btr
10452 integer,
intent(in) :: iopt_run
10453 integer,
intent(in) :: iopt_sfc
10454 integer,
intent(in) :: iopt_frz
10455 integer,
intent(in) :: iopt_inf
10456 integer,
intent(in) :: iopt_rad
10457 integer,
intent(in) :: iopt_alb
10458 integer,
intent(in) :: iopt_snf
10459 integer,
intent(in) :: iopt_tbot
10461 integer,
intent(in) :: iopt_stc
10463 integer,
intent(in) :: iopt_rsf
10464 integer,
intent(in) :: iopt_soil
10465 integer,
intent(in) :: iopt_pedo
10466 integer,
intent(in) :: iopt_crop
10467 integer,
intent(in) :: iopt_trs
10468 integer,
intent(in) :: iopt_diag
10469 integer,
intent(in) :: iopt_z0m
10484 opt_tbot = iopt_tbot
10487 opt_soil = iopt_soil
10488 opt_pedo = iopt_pedo
10489 opt_crop = iopt_crop
10491 opt_diag = iopt_diag
10494 end subroutine noahmp_options
10498 subroutine sfcdif4(iloc ,jloc ,ux ,vx ,t1d , &
10499 p1d ,psfcpa,pblhx ,dx ,znt , &
10501 itime ,snwh ,isice ,psi_opt, &
10502 tsk ,qx ,zlvl ,iz0tlnd,qsfc , &
10503 hfx ,qfx ,cm ,chs ,chs2 , &
10505 rmolx ,ust , rbx, fmx, fhx,stressx,&
10506 fm10x, fh2x, wspdx,flhcx,flqcx)
10516 integer,
intent(in ) :: iloc
10517 integer,
intent(in ) :: jloc
10518 integer,
intent(in) :: itime
10520 integer,
intent(in) :: psi_opt
10522 integer,
intent(in) :: isice
10524 real(kind=kind_phys),
intent(in ) :: pblhx
10525 real(kind=kind_phys),
intent(in ) :: tsk
10526 real(kind=kind_phys),
intent(in ) :: psfcpa
10527 real(kind=kind_phys),
intent(in ) :: p1d
10528 real(kind=kind_phys),
intent(in ) :: t1d
10529 real(kind=kind_phys),
intent(in ) :: qx
10530 real(kind=kind_phys),
intent(in ) :: zlvl
10531 real(kind=kind_phys),
intent(in ) :: hfx
10532 real(kind=kind_phys),
intent(in ) :: qfx
10533 real(kind=kind_phys),
intent(in ) :: dx
10534 real(kind=kind_phys),
intent(in ) :: ux
10535 real(kind=kind_phys),
intent(in ) :: vx
10536 real(kind=kind_phys),
intent(in ) :: znt
10537 real(kind=kind_phys),
intent(in ) :: snwh
10538 real(kind=kind_phys),
intent(in ) :: ep_1
10539 real(kind=kind_phys),
intent(in ) :: ep_2
10540 real(kind=kind_phys),
intent(in ) :: cp
10544 integer,
optional,
intent(in ) :: iz0tlnd
10546 real(kind=kind_phys),
intent(inout) :: qsfc
10547 real(kind=kind_phys),
intent(inout) :: ust
10548 real(kind=kind_phys),
intent(inout) :: chs
10549 real(kind=kind_phys),
intent(inout) :: chs2
10550 real(kind=kind_phys),
intent(inout) :: cqs2
10551 real(kind=kind_phys),
intent(inout) :: cm
10553 real(kind=kind_phys),
intent(inout) :: rmolx
10554 real(kind=kind_phys),
intent(inout) :: rbx
10555 real(kind=kind_phys),
intent(inout) :: fmx
10556 real(kind=kind_phys),
intent(inout) :: fhx
10557 real(kind=kind_phys),
intent(inout) :: stressx
10558 real(kind=kind_phys),
intent(inout) :: fm10x
10559 real(kind=kind_phys),
intent(inout) :: fh2x
10561 real(kind=kind_phys),
intent(inout) :: wspdx
10562 real(kind=kind_phys),
intent(inout) :: flhcx
10563 real(kind=kind_phys),
intent(inout) :: flqcx
10565 real(kind=kind_phys) :: zolx
10566 real(kind=kind_phys) :: molx
10579 real(kind=kind_phys) :: za
10580 real(kind=kind_phys) :: thvx
10581 real(kind=kind_phys) :: zqkl
10582 real(kind=kind_phys) :: zqklp1
10583 real(kind=kind_phys) :: thx
10584 real(kind=kind_phys) :: psih
10585 real(kind=kind_phys) :: psih2
10586 real(kind=kind_phys) :: psih10
10587 real(kind=kind_phys) :: psim
10588 real(kind=kind_phys) :: psim2
10589 real(kind=kind_phys) :: psim10
10591 real(kind=kind_phys) :: gz1oz0
10592 real(kind=kind_phys) :: gz2oz0
10593 real(kind=kind_phys) :: gz10oz0
10595 real(kind=kind_phys) :: rhox
10596 real(kind=kind_phys) :: govrth
10597 real(kind=kind_phys) :: tgdsa
10598 real(kind=kind_phys) :: tvir
10599 real(kind=kind_phys) :: thgb
10600 real(kind=kind_phys) :: psfcx
10601 real(kind=kind_phys) :: cpm
10602 real(kind=kind_phys) :: qgh
10604 integer :: n,i,k,kk,l,nzol,nk,nzol2,nzol10
10606 real(kind=kind_phys) :: zolzt, zolz0, zolza
10607 real(kind=kind_phys) :: gz1ozt,gz2ozt,gz10ozt
10610 real(kind=kind_phys) :: pl,thcon,tvcon,e1
10611 real(kind=kind_phys) :: zl,tskv,dthvdz,dthvm,vconv,rzol,rzol2,rzol10,zol2,zol10
10612 real(kind=kind_phys) :: dtg,psix,dtthx,psix10,psit,psit2,psiq,psiq2,psiq10
10613 real(kind=kind_phys) :: fluxc,vsgd,z0q,visc,restar,czil,restar2
10615 real(kind=kind_phys) :: dqg
10616 real(kind=kind_phys) :: tabs
10617 real(kind=kind_phys) :: qsfcmr
10618 real(kind=kind_phys) :: t1dc
10619 real(kind=kind_phys) :: zt
10620 real(kind=kind_phys) :: zq
10621 real(kind=kind_phys) :: zratio
10622 real(kind=kind_phys) :: qstar
10623 real(kind=kind_phys) :: ep2
10624 real(kind=kind_phys) :: ep_3
10631 if (itime == 1)
then
10632 if (isice == 0)
then
10633 tabs = 0.5*(tsk + t1d)
10634 if (tabs .lt. 273.15)
then
10636 e1=svp1*exp(4648*(1./273.15 - 1./tabs) - &
10637 & 11.64*log(273.15/tabs) + 0.02265*(273.15 - tabs))
10640 e1=svp1*exp(svp2*(tabs-svpt0)/(tabs-svp3))
10643 qsfc =ep2*e1/(psfcx-ep_3*e1)
10644 qsfcmr =qsfc/(1.-qsfc)
10647 if (isice == 1)
then
10648 if (tsk .lt. 273.15)
then
10650 e1=svp1*exp(4648*(1./273.15 - 1./tsk) - &
10651 & 11.64*log(273.15/tsk) + 0.02265*(273.15 - tsk))
10654 e1=svp1*exp(svp2*(tsk-svpt0)/(tsk-svp3))
10657 qsfc=ep2*e1/(psfcx-ep_3*e1)
10658 qsfcmr=ep2*e1/(psfcx-e1)
10664 if (isice == 0)
then
10665 tabs = 0.5*(tsk + t1d)
10666 if (tabs .lt. 273.15)
then
10668 e1=svp1*exp(4648*(1./273.15 - 1./tabs) - &
10669 & 11.64*log(273.15/tabs) + 0.02265*(273.15 - tabs))
10672 e1=svp1*exp(svp2*(tabs-svpt0)/(tabs-svp3))
10675 qsfc =ep2*e1/(psfcx-ep_3*e1)
10676 qsfcmr=qsfc/(1.-qsfc)
10680 if (isice == 1)
then
10681 if (tsk .lt. 273.15)
then
10683 e1=svp1*exp(4648*(1./273.15 - 1./tsk) - &
10684 & 11.64*log(273.15/tsk) + 0.02265*(273.15 - tsk))
10687 e1=svp1*exp(svp2*(tsk-svpt0)/(tsk-svp3))
10690 qsfc=ep2*e1/(psfcx-ep_3*e1)
10691 qsfcmr=qsfc/(1.-qsfc)
10698 thgb = tsk*(p1000mb/psfcpa)**(rair/cpair)
10703 thx = t1d*(p1000mb*0.001/pl)**(rair/cpair)
10704 t1dc = t1d - 273.15
10706 thvx = thx*(1.+ep_1*qx)
10707 tvir = t1d*(1.+ep_1*qx)
10709 rhox=psfcx*1000./(rair*tvir)
10731 if (t1d .lt. 273.15)
then
10733 e1=svp1*exp(4648.*(1./273.15 - 1./t1d) - &
10734 & 11.64*log(273.15/t1d) + 0.02265*(273.15 - t1d))
10737 e1=svp1*exp(svp2*(t1d-svpt0)/(t1d-svp3))
10746 cpm=cp*(1.+0.84*qx/(1.0-qx) )
10748 wspdx=sqrt(ux*ux+vx*vx)
10750 tskv=thgb*(1.+ep_1*qsfc)
10753 fluxc = max(hfx/rhox/cp + ep_1*tskv*qfx/rhox,0.)
10756 vconv = vconvc*(grav/tgdsa*min(1.5*pblhx,4000.0)*fluxc)**.33
10759 vsgd = min(0.32 * (max(dx/5000.-1.,0.))**.33,0.5)
10760 wspdx=sqrt(wspdx*wspdx+vconv*vconv+vsgd*vsgd)
10761 wspdx=max(wspdx,0.1)
10762 rbx=govrth*za*dthvdz/(wspdx*wspdx)
10764 if (itime == 1)
then
10777 visc=1.326e-5*(1. + 6.542e-3*t1dc + 8.301e-6*t1dc*t1dc &
10778 - 4.84e-9*t1dc*t1dc*t1dc)
10783 restar=max(ust*znt/visc,0.1)
10788 if (snwh > 50. .or. isice == 1)
then
10789 call andreas_2002(znt,visc,ust,zt,zq)
10791 if (
present(iz0tlnd) )
then
10792 if ( iz0tlnd .le. 1 )
then
10793 call zilitinkevich_1995(znt,zt,zq,restar,&
10794 ust,vkc,1.0_kind_phys,iz0tlnd,0,0.0_kind_phys)
10795 elseif ( iz0tlnd .eq. 2 )
then
10796 call yang_2008(znt,zt,zq,ust,molx,&
10798 elseif ( iz0tlnd .eq. 3 )
then
10800 call garratt_1992(zt,zq,znt,restar,1.0_kind_phys)
10808 call zilitinkevich_1995(znt,zt,zq,restar,&
10809 ust,vkc,1.0_kind_phys,0,0,0.0_kind_phys)
10819 gz1oz0= log((za+znt)/znt)
10820 gz1ozt= log((za+znt)/zt)
10821 gz2oz0= log((2.0+znt)/znt)
10822 gz2ozt= log((2.0+znt)/zt)
10823 gz10oz0=log((10.+znt)/znt)
10833 if (rbx .gt. 0.0)
then
10836 call li_etal_2010(zolx,rbx,za/znt,zratio)
10846 zolx=zolrib(rbx,za,znt,zt,gz1oz0,gz1ozt,zolx,psi_opt)
10851 zolz0 = zolx*znt/za
10852 zolza = zolx*(za+znt)/za
10853 zol10 = zolx*(10.+znt)/za
10854 zol2 = zolx*(2.+znt)/za
10863 psim=psim_stable(zolza,psi_opt)-psim_stable(zolz0,psi_opt)
10864 psih=psih_stable(zolza,psi_opt)-psih_stable(zolzt,psi_opt)
10865 psim10=psim_stable(zol10,psi_opt)-psim_stable(zolz0,psi_opt)
10867 psih2=psih_stable(zol2,psi_opt)-psih_stable(zolzt,psi_opt)
10873 elseif(rbx .eq. 0.)
then
10887 elseif(rbx .lt. 0.)
then
10894 call li_etal_2010(zolx,rbx,za/znt,zratio)
10898 zolx=max(zolx,-20.0)
10906 zolx=zolrib(rbx,za,znt,zt,gz1oz0,gz1ozt,zolx,psi_opt)
10907 zolx=max(zolx,-20.0)
10911 zolz0 = zolx*znt/za
10912 zolza = zolx*(za+znt)/za
10913 zol10 = zolx*(10.+znt)/za
10914 zol2 = zolx*(2.+znt)/za
10922 psim=psim_unstable(zolza,psi_opt)-psim_unstable(zolz0,psi_opt)
10923 psih=psih_unstable(zolza,psi_opt)-psih_unstable(zolzt,psi_opt)
10924 psim10=psim_unstable(zol10,psi_opt)-psim_unstable(zolz0,psi_opt)
10926 psih2=psih_unstable(zol2,psi_opt)-psih_unstable(zolzt,psi_opt)
10932 psih=min(psih,0.9*gz1ozt)
10933 psim=min(psim,0.9*gz1oz0)
10934 psih2=min(psih2,0.9*gz2ozt)
10935 psim10=min(psim10,0.9*gz10oz0)
10944 psix =max(gz1oz0-psim, 1.0)
10945 psix10=max(gz10oz0-psim10, 1.0)
10946 psit =max(gz1ozt-psih , 1.0)
10947 psit2 =max(gz2ozt-psih2, 1.0)
10948 psiq =max(log((za+zq)/zq)-psih ,1.0)
10949 psiq2 =max(log((2.0+zq)/zq)-psih2 ,1.0)
10960 ust=0.5*ust+0.5*vkc*wspdx/psix
10979 molx=vkc*dtg/psit/prt
10986 dqg=(qx-qsfc)*1000.
10987 qstar=vkc*dqg/psiq/prt
10989 cm = (vkc/psix)*(vkc/psix)*wspdx
11001 flhcx = rhox*cpm*ust*vkc/psit
11002 flqcx = rhox*1.0*ust*vkc/psiq
11015 end subroutine sfcdif4
11019 subroutine zilitinkevich_1995(z_0,zt,zq,restar,ustar,vkc,&
11020 & landsea,iz0tlnd2,spp_pbl,rstoch)
11023 real (kind=kind_phys),
intent(in) :: z_0,restar,ustar,vkc,landsea
11024 integer,
optional,
intent(in):: iz0tlnd2
11025 real (kind=kind_phys),
intent(out) :: zt,zq
11026 real (kind=kind_phys) :: czil
11029 integer,
intent(in) :: spp_pbl
11030 real (kind=kind_phys),
intent(in) :: rstoch
11033 if (landsea-1.5 .gt. 0)
then
11037 if (restar .lt. 0.1)
then
11038 zt = z_0*exp(vkc*2.0)
11039 zt = min( zt, 6.0e-5)
11040 zt = max( zt, 2.0e-9)
11041 zq = z_0*exp(vkc*3.0)
11042 zq = min( zq, 6.0e-5)
11043 zq = max( zq, 2.0e-9)
11045 zt = z_0*exp(-vkc*(4.0*sqrt(restar)-3.2))
11046 zt = min( zt, 6.0e-5)
11047 zt = max( zt, 2.0e-9)
11048 zq = z_0*exp(-vkc*(4.0*sqrt(restar)-4.2))
11049 zq = min( zt, 6.0e-5)
11050 zq = max( zt, 2.0e-9)
11056 if ( iz0tlnd2 .eq. 1 )
then
11057 czil = 10.0 ** ( -0.40 * ( z_0 / 0.07 ) )
11062 zt = z_0*exp(-vkc*czil*sqrt(restar))
11063 zt = min( zt, 0.75*z_0)
11065 zq = z_0*exp(-vkc*czil*sqrt(restar))
11066 zq = min( zq, 0.75*z_0)
11071 if (spp_pbl==1)
then
11072 zt = zt + zt * 0.5 * rstoch
11073 zt = max(zt, 0.0001)
11081 end subroutine zilitinkevich_1995
11086 subroutine garratt_1992(zt,zq,z_0,ren,landsea)
11089 real (kind=kind_phys),
intent(in) :: ren, z_0,landsea
11090 real (kind=kind_phys),
intent(out) :: zt,zq
11091 real (kind=kind_phys) :: rq
11092 real (kind=kind_phys),
parameter :: e=2.71828183
11094 if (landsea-1.5 .gt. 0)
then
11096 zt = z_0*exp(2.0 - (2.48*(ren**0.25)))
11097 zq = z_0*exp(2.0 - (2.28*(ren**0.25)))
11099 zq = min( zq, 5.5e-5)
11100 zq = max( zq, 2.0e-9)
11101 zt = min( zt, 5.5e-5)
11102 zt = max( zt, 2.0e-9)
11110 end subroutine garratt_1992
11136 subroutine yang_2008(z_0,zt,zq,ustar,tstar,qst,ren,visc)
11139 real (kind=kind_phys),
intent(in) :: z_0, ren, ustar, tstar, qst, visc
11140 real (kind=kind_phys) :: ht, &
11145 real (kind=kind_phys),
intent(out) :: zt,zq
11146 real (kind=kind_phys),
parameter :: renc=300., &
11151 z_02 = min(z_0,0.5)
11152 z_02 = max(z_02,0.04)
11153 renc2= b + m*log(z_02)
11154 ht = renc2*visc/max(ustar,0.01)
11155 tstar2 = min(tstar, 0.0)
11156 qstar2 = min(qst,0.0)
11158 zt = ht * exp(-beta*(ustar**0.5)*(abs(tstar2)**1.0))
11159 zq = ht * exp(-beta*(ustar**0.5)*(abs(qstar2)**1.0))
11162 zt = min(zt, z_0/2.0)
11163 zq = min(zq, z_0/2.0)
11167 end subroutine yang_2008
11174 subroutine andreas_2002(z_0,bvisc,ustar,zt,zq)
11177 real (kind=kind_phys),
intent(in) :: z_0, bvisc, ustar
11178 real (kind=kind_phys),
intent(out) :: zt, zq
11179 real (kind=kind_phys):: ren2, zntsno
11181 real (kind=kind_phys),
parameter :: bt0_s=1.25, bt0_t=0.149, bt0_r=0.317, &
11182 bt1_s=0.0, bt1_t=-0.55, bt1_r=-0.565, &
11183 bt2_s=0.0, bt2_t=0.0, bt2_r=-0.183
11185 real (kind=kind_phys),
parameter :: bq0_s=1.61, bq0_t=0.351, bq0_r=0.396, &
11186 bq1_s=0.0, bq1_t=-0.628, bq1_r=-0.512, &
11187 bq2_s=0.0, bq2_t=0.0, bq2_r=-0.180
11190 zntsno = 0.135*bvisc/ustar + &
11191 (0.035*(ustar*ustar)/9.8) * &
11192 (5.*exp(-1.*(((ustar - 0.18)/0.1)*((ustar - 0.18)/0.1))) + 1.)
11193 ren2 = ustar*zntsno/bvisc
11197 if (ren2 .gt. 1000.) ren2 = 1000.
11199 if (ren2 .le. 0.135)
then
11201 zt = zntsno*exp(bt0_s + bt1_s*log(ren2) + bt2_s*log(ren2)**2)
11202 zq = zntsno*exp(bq0_s + bq1_s*log(ren2) + bq2_s*log(ren2)**2)
11204 else if (ren2 .gt. 0.135 .and. ren2 .lt. 2.5)
then
11206 zt = zntsno*exp(bt0_t + bt1_t*log(ren2) + bt2_t*log(ren2)**2)
11207 zq = zntsno*exp(bq0_t + bq1_t*log(ren2) + bq2_t*log(ren2)**2)
11211 zt = zntsno*exp(bt0_r + bt1_r*log(ren2) + bt2_r*log(ren2)**2)
11212 zq = zntsno*exp(bq0_r + bq1_r*log(ren2) + bq2_r*log(ren2)**2)
11218 end subroutine andreas_2002
11224 subroutine li_etal_2010(zl, rib, zaz0, z0zt)
11227 real (kind=kind_phys),
intent(out) :: zl
11228 real (kind=kind_phys),
intent(in) :: rib, zaz0, z0zt
11229 real (kind=kind_phys) :: alfa, beta, zaz02, z0zt2
11230 real (kind=kind_phys),
parameter :: au11=0.045, bu11=0.003, bu12=0.0059, &
11231 &bu21=-0.0828, bu22=0.8845, bu31=0.1739, &
11232 &bu32=-0.9213, bu33=-0.1057
11233 real (kind=kind_phys),
parameter :: aw11=0.5738, aw12=-0.4399, aw21=-4.901,&
11234 &aw22=52.50, bw11=-0.0539, bw12=1.540, &
11235 &bw21=-0.669, bw22=-3.282
11236 real (kind=kind_phys),
parameter :: as11=0.7529, as21=14.94, bs11=0.1569,&
11237 &bs21=-0.3091, bs22=-1.303
11241 if (zaz0 .lt. 100.0) zaz02=100.
11242 if (zaz0 .gt. 100000.0) zaz02=100000.
11246 if (z0zt .lt. 0.5) z0zt2=0.5
11247 if (z0zt .gt. 100.0) z0zt2=100.
11252 if (rib .le. 0.0)
then
11253 zl = au11*alfa*rib**2 + ( &
11254 & (bu11*beta + bu12)*alfa**2 + &
11255 & (bu21*beta + bu22)*alfa + &
11256 & (bu31*beta**2 + bu32*beta + bu33))*rib
11260 elseif (rib .gt. 0.0 .and. rib .le. 0.2)
then
11261 zl = ((aw11*beta + aw12)*alfa + &
11262 & (aw21*beta + aw22))*rib**2 + &
11263 & ((bw11*beta + bw12)*alfa + &
11264 & (bw21*beta + bw22))*rib
11269 zl = (as11*alfa + as21)*rib + bs11*alfa + &
11279 end subroutine li_etal_2010
11283 real*8 function zolri(ri,za,z0,zt,zol1,psi_opt)
11292 real (kind=kind_phys),
intent(in) :: ri,za,z0,zt,zol1
11293 integer,
intent(in) :: psi_opt
11294 real (kind=kind_phys) :: x1,x2,fx1,fx2
11296 integer,
parameter :: nmax = 20
11297 real(kind=kind_phys) zolri_iteration
11310 fx1=zolri2(x1,ri,za,z0,zt,psi_opt)
11311 fx2=zolri2(x2,ri,za,z0,zt,psi_opt)
11313 do while (abs(x1 - x2) > 0.01 .and. n < nmax)
11314 if(abs(fx2).lt.abs(fx1))
then
11315 x1=x1-fx1/(fx2-fx1)*(x2-x1)
11316 fx1=zolri2(x1,ri,za,z0,zt,psi_opt)
11319 x2=x2-fx2/(fx2-fx1)*(x2-x1)
11320 fx2=zolri2(x2,ri,za,z0,zt,psi_opt)
11328 if (n==nmax .and. abs(x1 - x2) >= 0.01)
then
11330 zolri_iteration= zolri
11331 call li_etal_2010(zolri_iteration, ri, za/z0, z0/zt)
11332 zolri = zolri_iteration
11342 real*8 function zolri2(zol2,ri2,za,z0,zt,psi_opt)
11354 integer,
intent(in) :: psi_opt
11355 real (kind=kind_phys),
intent(in) :: ri2,za,z0,zt
11356 real (kind=kind_phys),
intent(inout) :: zol2
11357 real (kind=kind_phys) :: zol20,zol3,psim1,psih1,psix2,psit2,zolt
11361 if(zol2*ri2 .lt. 0.)zol2=0.
11370 psit2=max(log((za+z0)/zt)-(psih_unstable(zol3,psi_opt)-psih_unstable(zolt,psi_opt)), 1.0)
11371 psix2=max(log((za+z0)/z0)-(psim_unstable(zol3,psi_opt)-psim_unstable(zol20,psi_opt)),1.0)
11375 psit2=max(log((za+z0)/zt)-(psih_stable(zol3,psi_opt)-psih_stable(zolt,psi_opt)), 1.0)
11376 psix2=max(log((za+z0)/z0)-(psim_stable(zol3,psi_opt)-psim_stable(zol20,psi_opt)),1.0)
11379 zolri2=zol2*psit2/psix2**2 - ri2
11386 real*8 function zolrib(ri,za,z0,zt,logz0,logzt,zol1,psi_opt)
11391 real (kind=kind_phys),
intent(in) :: ri,za,z0,zt,logz0,logzt
11392 integer,
intent(in) :: psi_opt
11393 real (kind=kind_phys),
intent(inout) :: zol1
11394 real (kind=kind_phys) :: zol20,zol3,zolt,zolold
11396 integer,
parameter :: nmax = 20
11397 real (kind=kind_phys),
dimension(nmax):: zlhux
11398 real (kind=kind_phys) :: psit2,psix2,zolrib_iteration
11404 if (zol1*ri .lt. 0.)
then
11409 if (ri .lt. 0.)
then
11418 do while (abs(zolold - zolrib) > 0.01 .and. n < nmax)
11432 psit2=max(logzt-(psih_unstable(zol3,psi_opt)-psih_unstable(zolt,psi_opt)), 1.0)
11433 psix2=max(logz0-(psim_unstable(zol3,psi_opt)-psim_unstable(zol20,psi_opt)), 1.0)
11437 psit2=max(logzt-(psih_stable(zol3,psi_opt)-psih_stable(zolt,psi_opt)), 1.0)
11438 psix2=max(logz0-(psim_stable(zol3,psi_opt)-psim_stable(zol20,psi_opt)), 1.0)
11441 zolrib=ri*psix2**2/psit2
11446 if (n==nmax .and. abs(zolold - zolrib) > 0.01 )
then
11449 zolrib_iteration = zolrib
11450 call li_etal_2010(zolrib_iteration, ri, za/z0, z0/zt)
11451 zolrib = zolrib_iteration
11471 subroutine psi_init(psi_opt,errmsg,errflg)
11473 integer :: n,psi_opt
11474 real (kind=kind_phys) :: zolf
11475 character(len=*),
intent(out) :: errmsg
11476 integer,
intent(out) :: errflg
11478 if (psi_opt == 0)
then
11481 zolf = float(n)*0.01
11482 psim_stab(n)=psim_stable_full(zolf)
11483 psih_stab(n)=psih_stable_full(zolf)
11486 zolf = -float(n)*0.01
11487 psim_unstab(n)=psim_unstable_full(zolf)
11488 psih_unstab(n)=psih_unstable_full(zolf)
11493 zolf = float(n)*0.01
11494 psim_stab(n)=psim_stable_full_gfs(zolf)
11495 psih_stab(n)=psih_stable_full_gfs(zolf)
11498 zolf = -float(n)*0.01
11499 psim_unstab(n)=psim_unstable_full_gfs(zolf)
11500 psih_unstab(n)=psih_unstable_full_gfs(zolf)
11505 if (psim_stab(1) < 0. .and. psih_stab(1) < 0. .and. &
11506 psim_unstab(1) > 0. .and. psih_unstab(1) > 0.)
then
11507 errmsg =
'in mynn sfc, psi tables have been initialized'
11510 errmsg =
'error in mynn sfc: problem initializing psi tables'
11514 end subroutine psi_init
11519 real*8 function psim_stable_full(zolf)
11520 real (kind=kind_phys) :: zolf
11523 psim_stable_full=-6.1*log(zolf+(1+zolf**2.5)**0.4)
11529 real*8 function psih_stable_full(zolf)
11530 real (kind=kind_phys) :: zolf
11533 psih_stable_full=-5.3*log(zolf+(1+zolf**1.1)**0.9090909090909090909)
11539 real*8 function psim_unstable_full(zolf)
11540 real (kind=kind_phys) :: zolf,x,ym,psimc,psimk
11542 x=(1.-16.*zolf)**.25
11544 psimk=2.*log(0.5*(1+x))+log(0.5*(1+x*x))-2.*atan(x)+2.*atan1
11546 ym=(1.-10.*zolf)**onethird
11548 psimc=1.5*log((ym**2 + ym+1.)*onethird)-sqrt3*atan((2.*ym+1)/sqrt3)+4.*atan1/sqrt3
11550 psim_unstable_full=(psimk+zolf**2*(psimc))/(1+zolf**2.)
11556 real*8 function psih_unstable_full(zolf)
11557 real (kind=kind_phys) :: zolf,y,yh,psihc,psihk
11559 y=(1.-16.*zolf)**.5
11561 psihk=2.*log((1+y)*0.5)
11563 yh=(1.-34.*zolf)**onethird
11565 psihc=1.5*log((yh**2.+yh+1.)*onethird)-sqrt3*atan((2.*yh+1)/sqrt3)+4.*atan1/sqrt3
11567 psih_unstable_full=(psihk+zolf**2*(psihc))/(1+zolf**2)
11575 real*8 function psim_stable_full_gfs(zolf)
11576 real (kind=kind_phys) :: zolf
11577 real (kind=kind_phys),
parameter :: alpha4 = 20.
11578 real (kind=kind_phys) :: aa
11580 aa = sqrt(1. + alpha4 * zolf)
11581 psim_stable_full_gfs = -1.*aa + log(aa + 1.)
11586 real*8 function psih_stable_full_gfs(zolf)
11587 real (kind=kind_phys) :: zolf
11588 real (kind=kind_phys),
parameter :: alpha4 = 20.
11589 real (kind=kind_phys) :: bb
11591 bb = sqrt(1. + alpha4 * zolf)
11592 psih_stable_full_gfs = -1.*bb + log(bb + 1.)
11597 real*8 function psim_unstable_full_gfs(zolf)
11598 real (kind=kind_phys) :: zolf
11599 real (kind=kind_phys) :: hl1,tem1
11600 real (kind=kind_phys),
parameter :: a0=-3.975, a1=12.32, &
11601 b1=-7.755, b2=6.041
11603 if (zolf .ge. -0.5)
then
11605 psim_unstable_full_gfs = (a0 + a1*hl1) * hl1 / (1.+ (b1+b2*hl1) *hl1)
11608 tem1 = 1.0 / sqrt(hl1)
11609 psim_unstable_full_gfs = log(hl1) + 2. * sqrt(tem1) - .8776
11615 real*8 function psih_unstable_full_gfs(zolf)
11616 real (kind=kind_phys) :: zolf
11617 real (kind=kind_phys) :: hl1,tem1
11618 real (kind=kind_phys),
parameter :: a0p=-7.941, a1p=24.75, &
11619 b1p=-8.705, b2p=7.899
11621 if (zolf .ge. -0.5)
then
11623 psih_unstable_full_gfs = (a0p + a1p*hl1) * hl1 / (1.+ (b1p+b2p*hl1)*hl1)
11626 tem1 = 1.0 / sqrt(hl1)
11627 psih_unstable_full_gfs = log(hl1) + .5 * tem1 + 1.386
11636 real*8 function psim_stable(zolf,psi_opt)
11637 integer :: nzol,psi_opt
11638 real (kind=kind_phys) :: rzol,zolf
11640 nzol = int(zolf*100.)
11641 rzol = zolf*100. - nzol
11642 if(nzol+1 .lt. 1000)
then
11643 psim_stable = psim_stab(nzol) + rzol*(psim_stab(nzol+1)-psim_stab(nzol))
11645 if (psi_opt == 0)
then
11646 psim_stable = psim_stable_full(zolf)
11648 psim_stable = psim_stable_full_gfs(zolf)
11655 real*8 function psih_stable(zolf,psi_opt)
11656 integer :: nzol,psi_opt
11657 real (kind=kind_phys) :: rzol,zolf
11659 nzol = int(zolf*100.)
11660 rzol = zolf*100. - nzol
11661 if(nzol+1 .lt. 1000)
then
11662 psih_stable = psih_stab(nzol) + rzol*(psih_stab(nzol+1)-psih_stab(nzol))
11664 if (psi_opt == 0)
then
11665 psih_stable = psih_stable_full(zolf)
11667 psih_stable = psih_stable_full_gfs(zolf)
11674 real*8 function psim_unstable(zolf,psi_opt)
11675 integer :: nzol,psi_opt
11676 real (kind=kind_phys) :: rzol,zolf
11678 nzol = int(-zolf*100.)
11679 rzol = -zolf*100. - nzol
11680 if(nzol+1 .lt. 1000)
then
11681 psim_unstable = psim_unstab(nzol) + rzol*(psim_unstab(nzol+1)-psim_unstab(nzol))
11683 if (psi_opt == 0)
then
11684 psim_unstable = psim_unstable_full(zolf)
11686 psim_unstable = psim_unstable_full_gfs(zolf)
11693 real*8 function psih_unstable(zolf,psi_opt)
11694 integer :: nzol,psi_opt
11695 real (kind=kind_phys) :: rzol,zolf
11697 nzol = int(-zolf*100.)
11698 rzol = -zolf*100. - nzol
11699 if(nzol+1 .lt. 1000)
then
11700 psih_unstable = psih_unstab(nzol) + rzol*(psih_unstab(nzol+1)-psih_unstab(nzol))
11702 if (psi_opt == 0)
then
11703 psih_unstable = psih_unstable_full(zolf)
11705 psih_unstable = psih_unstable_full_gfs(zolf)
11712end module module_sf_noahmplsm
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