6module module_sf_noahmplsm
10use machine ,
only : kind_phys
182 real (kind=kind_phys),
parameter :: grav = 9.80616
183 real (kind=kind_phys),
parameter :: sb = 5.67e-08
184 real (kind=kind_phys),
parameter :: vkc = 0.40
185 real (kind=kind_phys),
parameter :: tfrz = 273.16
186 real (kind=kind_phys),
parameter :: hsub = 2.8440e06
187 real (kind=kind_phys),
parameter :: hvap = 2.5104e06
188 real (kind=kind_phys),
parameter :: hfus = 0.3336e06
189 real (kind=kind_phys),
parameter :: cwat = 4.188e06
190 real (kind=kind_phys),
parameter :: cice = 2.094e06
191 real (kind=kind_phys),
parameter :: cpair = 1004.64
192 real (kind=kind_phys),
parameter :: tkwat = 0.6
193 real (kind=kind_phys),
parameter :: tkice = 2.2
194 real (kind=kind_phys),
parameter :: tkair = 0.023
195 real (kind=kind_phys),
parameter :: rair = 287.04
196 real (kind=kind_phys),
parameter :: rw = 461.269
197 real (kind=kind_phys),
parameter :: denh2o = 1000.
198 real (kind=kind_phys),
parameter :: denice = 917.
200 integer,
private,
parameter :: mband = 2
201 integer,
private,
parameter :: nsoil = 4
202 integer,
private,
parameter :: nstage = 8
210 logical :: urban_flag
217 real (kind=kind_phys) :: ch2op
218 real (kind=kind_phys) :: dleaf
219 real (kind=kind_phys) :: z0mvt
220 real (kind=kind_phys) :: hvt
221 real (kind=kind_phys) :: hvb
222 real (kind=kind_phys) :: z0mhvt
223 real (kind=kind_phys) :: den
224 real (kind=kind_phys) :: rc
225 real (kind=kind_phys) :: mfsno
226 real (kind=kind_phys) :: scffac
227 real (kind=kind_phys) :: cbiom
228 real (kind=kind_phys) :: saim(12)
229 real (kind=kind_phys) :: laim(12)
230 real (kind=kind_phys) :: sla
231 real (kind=kind_phys) :: prcpiceden
232 real (kind=kind_phys) :: dilefc
233 real (kind=kind_phys) :: dilefw
234 real (kind=kind_phys) :: fragr
235 real (kind=kind_phys) :: ltovrc
237 real (kind=kind_phys) :: c3psn
238 real (kind=kind_phys) :: kc25
239 real (kind=kind_phys) :: akc
240 real (kind=kind_phys) :: ko25
241 real (kind=kind_phys) :: ako
242 real (kind=kind_phys) :: vcmx25
243 real (kind=kind_phys) :: avcmx
244 real (kind=kind_phys) :: bp
245 real (kind=kind_phys) :: mp
246 real (kind=kind_phys) :: qe25
247 real (kind=kind_phys) :: aqe
248 real (kind=kind_phys) :: rmf25
249 real (kind=kind_phys) :: rms25
250 real (kind=kind_phys) :: rmr25
251 real (kind=kind_phys) :: arm
252 real (kind=kind_phys) :: folnmx
253 real (kind=kind_phys) :: tmin
255 real (kind=kind_phys) :: xl
256 real (kind=kind_phys) :: rhol(mband)
257 real (kind=kind_phys) :: rhos(mband)
258 real (kind=kind_phys) :: taul(mband)
259 real (kind=kind_phys) :: taus(mband)
261 real (kind=kind_phys) :: mrp
262 real (kind=kind_phys) :: cwpvt
264 real (kind=kind_phys) :: wrrat
265 real (kind=kind_phys) :: wdpool
266 real (kind=kind_phys) :: tdlef
269 real (kind=kind_phys) :: rgl
270 real (kind=kind_phys) :: rsmin
271 real (kind=kind_phys) :: hs
272 real (kind=kind_phys) :: topt
273 real (kind=kind_phys) :: rsmax
275 real (kind=kind_phys) :: slarea
276 real (kind=kind_phys) :: eps(5)
282 real (kind=kind_phys) :: albsat(mband)
283 real (kind=kind_phys) :: albdry(mband)
284 real (kind=kind_phys) :: albice(mband)
285 real (kind=kind_phys) :: alblak(mband)
286 real (kind=kind_phys) :: omegas(mband)
287 real (kind=kind_phys) :: betads
288 real (kind=kind_phys) :: betais
289 real (kind=kind_phys) :: eg(2)
295 real (kind=kind_phys) :: co2
296 real (kind=kind_phys) :: o2
297 real (kind=kind_phys) :: timean
298 real (kind=kind_phys) :: fsatmx
299 real (kind=kind_phys) :: z0sno
300 real (kind=kind_phys) :: ssi
301 real (kind=kind_phys) :: snow_ret_fac
302 real (kind=kind_phys) :: swemx
303 real (kind=kind_phys) :: snow_emis
304 real (kind=kind_phys) :: tau0
305 real (kind=kind_phys) :: grain_growth
306 real (kind=kind_phys) :: extra_growth
307 real (kind=kind_phys) :: dirt_soot
308 real (kind=kind_phys) :: bats_cosz
309 real (kind=kind_phys) :: bats_vis_new
310 real (kind=kind_phys) :: bats_nir_new
311 real (kind=kind_phys) :: bats_vis_age
312 real (kind=kind_phys) :: bats_nir_age
313 real (kind=kind_phys) :: bats_vis_dir
314 real (kind=kind_phys) :: bats_nir_dir
315 real (kind=kind_phys) :: rsurf_snow
316 real (kind=kind_phys) :: rsurf_exp
324 real (kind=kind_phys) :: plantpop
325 real (kind=kind_phys) :: irri
326 real (kind=kind_phys) :: gddtbase
327 real (kind=kind_phys) :: gddtcut
328 real (kind=kind_phys) :: gdds1
329 real (kind=kind_phys) :: gdds2
330 real (kind=kind_phys) :: gdds3
331 real (kind=kind_phys) :: gdds4
332 real (kind=kind_phys) :: gdds5
334 real (kind=kind_phys) :: aref
335 real (kind=kind_phys) :: psnrf
336 real (kind=kind_phys) :: i2par
337 real (kind=kind_phys) :: tassim0
338 real (kind=kind_phys) :: tassim1
339 real (kind=kind_phys) :: tassim2
340 real (kind=kind_phys) :: k
341 real (kind=kind_phys) :: epsi
342 real (kind=kind_phys) :: q10mr
343 real (kind=kind_phys) :: foln_mx
344 real (kind=kind_phys) :: lefreez
345 real (kind=kind_phys) :: dile_fc(nstage)
346 real (kind=kind_phys) :: dile_fw(nstage)
347 real (kind=kind_phys) :: fra_gr
348 real (kind=kind_phys) :: lf_ovrc(nstage)
349 real (kind=kind_phys) :: st_ovrc(nstage)
350 real (kind=kind_phys) :: rt_ovrc(nstage)
351 real (kind=kind_phys) :: lfmr25
352 real (kind=kind_phys) :: stmr25
353 real (kind=kind_phys) :: rtmr25
354 real (kind=kind_phys) :: grainmr25
355 real (kind=kind_phys) :: lfpt(nstage)
356 real (kind=kind_phys) :: stpt(nstage)
357 real (kind=kind_phys) :: rtpt(nstage)
358 real (kind=kind_phys) :: grainpt(nstage)
359 real (kind=kind_phys) :: bio2lai
364 real (kind=kind_phys) :: bexp(nsoil)
365 real (kind=kind_phys) :: smcdry(nsoil)
367 real (kind=kind_phys) :: smcwlt(nsoil)
368 real (kind=kind_phys) :: smcref(nsoil)
369 real (kind=kind_phys) :: smcmax(nsoil)
370 real (kind=kind_phys) :: psisat(nsoil)
371 real (kind=kind_phys) :: dksat(nsoil)
372 real (kind=kind_phys) :: dwsat(nsoil)
373 real (kind=kind_phys) :: quartz(nsoil)
374 real (kind=kind_phys) :: f1
378 real (kind=kind_phys) :: slope
379 real (kind=kind_phys) :: csoil
380 real (kind=kind_phys) :: zbot
381 real (kind=kind_phys) :: czil
382 real (kind=kind_phys) :: refdk
383 real (kind=kind_phys) :: refkdt
385 real (kind=kind_phys) :: kdt
386 real (kind=kind_phys) :: frzx
393 real(kind=kind_phys),
parameter :: prt=1.
394 real(kind=kind_phys),
parameter :: p1000mb = 100000.
396 real(kind=kind_phys),
parameter :: svp1 = 0.6112
397 real(kind=kind_phys),
parameter :: svp2 = 17.67
398 real(kind=kind_phys),
parameter :: svp3 = 29.65
399 real(kind=kind_phys),
parameter :: svpt0 = 273.15
400 real(kind=kind_phys),
parameter :: onethird = 1./3.
401 real(kind=kind_phys),
parameter :: sqrt3 = 1.7320508075688773
402 real(kind=kind_phys),
parameter :: atan1 = 0.785398163397
404 real(kind=kind_phys),
parameter :: vconvc=1.25
406 real(kind=kind_phys),
parameter ::
snowz0 = 0.011
407 real(kind=kind_phys),
parameter :: wmin = 0.1
409 real(kind=kind_phys),
dimension(0:1000 ),
save :: psim_stab,psim_unstab, &
410 psih_stab,psih_unstab
420 iloc , jloc , lat , yearlen , julian , cosz , & ! in : time/space-related
421 dt , dx , dz8w , nsoil , zsoil , nsnow , & ! in : model configuration
422 shdfac , shdmax , vegtyp , ice , ist , croptype, & ! in : vegetation/soil characteristics
423 smceq , & ! in : vegetation/soil characteristics
424 sfctmp , sfcprs , psfc , uu , vv , q2, garea1 , & ! in : forcing
425 qc , soldn , lwdn,thsfc_loc, prslkix,prsik1x,prslk1x,& ! in : forcing
426 pblhx , iz0tlnd , itime ,psi_opt ,&
427 prcpconv, prcpnonc, prcpshcv, prcpsnow, prcpgrpl, prcphail, & ! in : forcing
428 tbot , co2air , o2air , foln , ficeold , zlvl , & ! in : forcing
429 ep_1 , ep_2 , epsm1 , cp , & ! in : constants
430 albold , sneqvo , & ! in/out :
431 stc , sh2o , smc , tah , eah , fwet , & ! in/out :
432 canliq , canice , tv , tg , qsfc, qsnow, qrain, & ! in/out :
433 isnow , zsnso , snowh , sneqv , snice , snliq , & ! in/out :
434 zwt , wa , wt , wslake , lfmass , rtmass , & ! in/out :
435 stmass , wood , stblcp , fastcp , lai , sai , & ! in/out :
436 cm , ch , tauss , & ! in/out :
437 grain , gdd , pgs , & ! in/out
438 smcwtd ,deeprech , rech , ustarx , & ! in/out :
439 z0wrf , z0hwrf , ts , & ! out :
440 fsa , fsr , fira , fsh , ssoil , fcev , & ! out :
441 fgev , fctr , ecan , etran , edir , trad , & ! out :
442 tgb , tgv , t2mv , t2mb , q2v , q2b , & ! out :
443 runsrf , runsub , apar , psn , sav , sag , & ! out :
444 fsno , nee , gpp , npp , fveg , albedo , & ! out :
445 qsnbot , ponding , ponding1, ponding2, rssun , rssha , & ! out :
446 albd , albi , albsnd , albsni , & ! out :
447 bgap , wgap , chv , chb , emissi , & ! out :
448 shg , shc , shb , evg , evb , ghv , & ! out :
449 ghb , irg , irc , irb , tr , evc , & ! out :
450 chleaf , chuc , chv2 , chb2 , fpice , pahv , &
451 pahg , pahb , pah , esnow , canhs , laisun , &
452 laisha , rb , qsfcveg , qsfcbare &
466 type (noahmp_parameters),
intent(in) :: parameters
468 integer ,
intent(in) :: ice
469 integer ,
intent(in) :: ist
470 integer ,
intent(in) :: vegtyp
471 INTEGER ,
INTENT(IN) :: CROPTYPE
472 integer ,
intent(in) :: nsnow
473 integer ,
intent(in) :: nsoil
474 integer ,
intent(in) :: iloc
475 integer ,
intent(in) :: jloc
476 real (kind=kind_phys) ,
intent(in) :: ep_1
477 real (kind=kind_phys) ,
intent(in) :: ep_2
478 real (kind=kind_phys) ,
intent(in) :: epsm1
479 real (kind=kind_phys) ,
intent(in) :: cp
480 real (kind=kind_phys) ,
intent(in) :: dt
481 real (kind=kind_phys),
dimension( 1:nsoil),
intent(in) :: zsoil
482 real (kind=kind_phys) ,
intent(in) :: q2
483 real (kind=kind_phys) ,
intent(in) :: sfctmp
484 real (kind=kind_phys) ,
intent(in) :: uu
485 real (kind=kind_phys) ,
intent(in) :: vv
486 real (kind=kind_phys) ,
intent(in) :: soldn
487 real (kind=kind_phys) ,
intent(in) :: lwdn
488 real (kind=kind_phys) ,
intent(in) :: sfcprs
490 logical ,
intent(in) :: thsfc_loc
491 real (kind=kind_phys) ,
intent(in) :: prslkix
492 real (kind=kind_phys) ,
intent(in) :: prsik1x
493 real (kind=kind_phys) ,
intent(in) :: prslk1x
494 real (kind=kind_phys) ,
intent(in) :: garea1
496 real (kind=kind_phys) ,
intent(in) :: pblhx
497 integer ,
intent(in) :: iz0tlnd
498 integer ,
intent(in) :: itime
499 integer ,
intent(in) :: psi_opt
501 real (kind=kind_phys) ,
intent(inout) :: zlvl
502 real (kind=kind_phys) ,
intent(in) :: cosz
503 real (kind=kind_phys) ,
intent(in) :: tbot
504 real (kind=kind_phys) ,
intent(in) :: foln
505 real (kind=kind_phys) ,
intent(in) :: shdfac
506 integer ,
intent(in) :: yearlen
507 real (kind=kind_phys) ,
intent(in) :: julian
508 real (kind=kind_phys) ,
intent(in) :: lat
509 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(in) :: ficeold
510 real (kind=kind_phys),
dimension( 1:nsoil),
intent(in) :: smceq
511 real (kind=kind_phys) ,
intent(in) :: prcpconv
512 real (kind=kind_phys) ,
intent(in) :: prcpnonc
513 real (kind=kind_phys) ,
intent(in) :: prcpshcv
514 real (kind=kind_phys) ,
intent(in) :: prcpsnow
515 real (kind=kind_phys) ,
intent(in) :: prcpgrpl
516 real (kind=kind_phys) ,
intent(in) :: prcphail
519 real (kind=kind_phys) ,
intent(in) :: qc
520 real (kind=kind_phys) ,
intent(inout) :: qsfc
521 real (kind=kind_phys) ,
intent(in) :: psfc
522 real (kind=kind_phys) ,
intent(in) :: dz8w
523 real (kind=kind_phys) ,
intent(in) :: dx
524 real (kind=kind_phys) ,
intent(in) :: shdmax
529 real (kind=kind_phys) ,
intent(inout) :: qsnow
530 REAL (kind=kind_phys) ,
INTENT(INOUT) :: qrain
531 real (kind=kind_phys) ,
intent(inout) :: fwet
532 real (kind=kind_phys) ,
intent(inout) :: sneqvo
533 real (kind=kind_phys) ,
intent(inout) :: eah
534 real (kind=kind_phys) ,
intent(inout) :: tah
535 real (kind=kind_phys) ,
intent(inout) :: albold
536 real (kind=kind_phys) ,
intent(inout) :: cm
537 real (kind=kind_phys) ,
intent(inout) :: ch
538 real (kind=kind_phys) ,
intent(inout) :: tauss
539 real (kind=kind_phys) ,
intent(inout) :: ustarx
542 integer ,
intent(inout) :: isnow
543 real (kind=kind_phys) ,
intent(inout) :: canliq
544 real (kind=kind_phys) ,
intent(inout) :: canice
545 real (kind=kind_phys) ,
intent(inout) :: sneqv
546 real (kind=kind_phys),
dimension( 1:nsoil),
intent(inout) :: smc
547 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: zsnso
548 real (kind=kind_phys) ,
intent(inout) :: snowh
549 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(inout) :: snice
550 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(inout) :: snliq
551 real (kind=kind_phys) ,
intent(inout) :: tv
552 real (kind=kind_phys) ,
intent(inout) :: tg
553 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: stc
554 real (kind=kind_phys),
dimension( 1:nsoil),
intent(inout) :: sh2o
555 real (kind=kind_phys) ,
intent(inout) :: zwt
556 real (kind=kind_phys) ,
intent(inout) :: wa
557 real (kind=kind_phys) ,
intent(inout) :: wt
558 real (kind=kind_phys) ,
intent(inout) :: wslake
559 real (kind=kind_phys),
intent(inout) :: smcwtd
560 real (kind=kind_phys),
intent(inout) :: deeprech
561 real (kind=kind_phys),
intent(inout) :: rech
564 real (kind=kind_phys) ,
intent(out) :: z0wrf
565 real (kind=kind_phys) ,
intent(out) :: z0hwrf
566 real (kind=kind_phys) ,
intent(out) :: fsa
567 real (kind=kind_phys) ,
intent(out) :: fsr
568 real (kind=kind_phys) ,
intent(out) :: fira
569 real (kind=kind_phys) ,
intent(out) :: fsh
570 real (kind=kind_phys) ,
intent(out) :: fcev
571 real (kind=kind_phys) ,
intent(out) :: fgev
572 real (kind=kind_phys) ,
intent(out) :: fctr
573 real (kind=kind_phys) ,
intent(out) :: ssoil
574 real (kind=kind_phys) ,
intent(out) :: trad
575 real (kind=kind_phys) ,
intent(out) :: ts
576 real (kind=kind_phys) ,
intent(out) :: ecan
577 real (kind=kind_phys) ,
intent(out) :: etran
578 real (kind=kind_phys) ,
intent(out) :: edir
579 real (kind=kind_phys) ,
intent(out) :: runsrf
580 real (kind=kind_phys) ,
intent(out) :: runsub
581 real (kind=kind_phys) ,
intent(out) :: psn
582 real (kind=kind_phys) ,
intent(out) :: apar
583 real (kind=kind_phys) ,
intent(out) :: sav
584 real (kind=kind_phys) ,
intent(out) :: sag
585 real (kind=kind_phys) ,
intent(out) :: fsno
586 real (kind=kind_phys) ,
intent(out) :: fveg
587 real (kind=kind_phys) ,
intent(out) ::
albedo
588 real (kind=kind_phys) :: errwat
589 real (kind=kind_phys) ,
intent(out) :: qsnbot
590 real (kind=kind_phys) ,
intent(out) :: ponding
591 real (kind=kind_phys) ,
intent(out) :: ponding1
592 real (kind=kind_phys) ,
intent(out) :: ponding2
593 real (kind=kind_phys) ,
intent(out) :: esnow
594 real (kind=kind_phys) ,
intent(out) :: rb
595 real (kind=kind_phys) ,
intent(out) :: laisun
596 real (kind=kind_phys) ,
intent(out) :: laisha
597 real (kind=kind_phys) ,
intent(out) :: qsfcveg
598 real (kind=kind_phys) ,
intent(out) :: qsfcbare
601 real (kind=kind_phys) ,
intent(out) :: t2mv
602 real (kind=kind_phys) ,
intent(out) :: t2mb
603 real (kind=kind_phys),
intent(out) :: rssun
604 real (kind=kind_phys),
intent(out) :: rssha
605 real (kind=kind_phys),
intent(out) :: bgap
606 real (kind=kind_phys),
intent(out) :: wgap
607 real (kind=kind_phys),
dimension(1:2) ,
intent(out) :: albd
608 real (kind=kind_phys),
dimension(1:2) ,
intent(out) :: albi
609 real (kind=kind_phys),
dimension(1:2) ,
intent(out) :: albsnd
610 real (kind=kind_phys),
dimension(1:2) ,
intent(out) :: albsni
611 real (kind=kind_phys),
intent(out) :: tgv
612 real (kind=kind_phys),
intent(out) :: tgb
613 real (kind=kind_phys) :: q1
614 real (kind=kind_phys),
intent(out) :: emissi
617 character(len=*),
intent(inout) :: errmsg
618 integer,
intent(inout) :: errflg
623 integer,
dimension(-nsnow+1:nsoil) :: imelt
624 real (kind=kind_phys) :: cmc
625 real (kind=kind_phys) :: taux
626 real (kind=kind_phys) :: tauy
627 real (kind=kind_phys) :: rhoair
629 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: dzsnso
630 real (kind=kind_phys) :: thair
631 real (kind=kind_phys) :: qair
632 real (kind=kind_phys) :: eair
633 real (kind=kind_phys),
dimension( 1: 2) :: solad
634 real (kind=kind_phys),
dimension( 1: 2) :: solai
635 real (kind=kind_phys) :: qprecc
636 real (kind=kind_phys) :: qprecl
637 real (kind=kind_phys) :: igs
638 real (kind=kind_phys) :: elai
639 real (kind=kind_phys) :: esai
640 real (kind=kind_phys) :: bevap
641 real (kind=kind_phys),
dimension( 1:nsoil) :: btrani
642 real (kind=kind_phys) :: btran
643 real (kind=kind_phys) :: qin
644 real (kind=kind_phys) :: qdis
645 real (kind=kind_phys),
dimension( 1:nsoil) :: sice
646 real (kind=kind_phys),
dimension(-nsnow+1: 0) :: snicev
647 real (kind=kind_phys),
dimension(-nsnow+1: 0) :: snliqv
648 real (kind=kind_phys),
dimension(-nsnow+1: 0) :: epore
649 real (kind=kind_phys) :: totsc
650 real (kind=kind_phys) :: totlb
651 real (kind=kind_phys) :: t2m
652 real (kind=kind_phys) :: qdew
653 real (kind=kind_phys) :: qvap
654 real (kind=kind_phys) :: lathea
655 real (kind=kind_phys) :: swdown
656 real (kind=kind_phys) :: qmelt
657 real (kind=kind_phys) :: beg_wb
658 real (kind=kind_phys),
intent(out) :: irc
659 real (kind=kind_phys),
intent(out) :: irg
660 real (kind=kind_phys),
intent(out) :: shc
661 real (kind=kind_phys),
intent(out) :: shg
662 real (kind=kind_phys),
intent(out) :: evg
663 real (kind=kind_phys),
intent(out) :: ghv
664 real (kind=kind_phys),
intent(out) :: irb
665 real (kind=kind_phys),
intent(out) :: shb
666 real (kind=kind_phys),
intent(out) :: evb
667 real (kind=kind_phys),
intent(out) :: ghb
668 real (kind=kind_phys),
intent(out) :: evc
669 real (kind=kind_phys),
intent(out) :: tr
670 real (kind=kind_phys),
intent(out) :: fpice
671 real (kind=kind_phys),
intent(out) :: pahv
672 real (kind=kind_phys),
intent(out) :: pahg
673 real (kind=kind_phys),
intent(out) :: pahb
674 real (kind=kind_phys),
intent(out) :: pah
677 real (kind=kind_phys) :: fsrv
678 real (kind=kind_phys) :: fsrg
679 real (kind=kind_phys),
intent(out) :: q2v
680 real (kind=kind_phys),
intent(out) :: q2b
681 real (kind=kind_phys) :: q2e
682 real (kind=kind_phys) :: qfx
683 real (kind=kind_phys),
intent(out) :: chv
684 real (kind=kind_phys),
intent(out) :: chb
685 real (kind=kind_phys),
intent(out) :: chleaf
686 real (kind=kind_phys),
intent(out) :: chuc
687 real (kind=kind_phys),
intent(out) :: chv2
688 real (kind=kind_phys),
intent(out) :: chb2
693 real (kind=kind_phys) ,
intent(in) :: co2air
694 real (kind=kind_phys) ,
intent(in) :: o2air
697 real (kind=kind_phys) ,
intent(inout) :: lfmass
698 real (kind=kind_phys) ,
intent(inout) :: rtmass
699 real (kind=kind_phys) ,
intent(inout) :: stmass
700 real (kind=kind_phys) ,
intent(inout) :: wood
701 real (kind=kind_phys) ,
intent(inout) :: stblcp
702 real (kind=kind_phys) ,
intent(inout) :: fastcp
703 real (kind=kind_phys) ,
intent(inout) :: lai
704 real (kind=kind_phys) ,
intent(inout) :: sai
705 real (kind=kind_phys) ,
intent(inout) :: grain
706 real (kind=kind_phys) ,
intent(inout) :: gdd
707 integer ,
intent(inout) :: pgs
710 real (kind=kind_phys) ,
intent(out) :: nee
711 real (kind=kind_phys) ,
intent(out) :: gpp
712 real (kind=kind_phys) ,
intent(out) :: npp
713 real (kind=kind_phys) :: autors
714 real (kind=kind_phys) :: heters
715 real (kind=kind_phys) :: troot
716 real (kind=kind_phys) :: bdfall
717 real (kind=kind_phys) :: rain
718 real (kind=kind_phys) :: snow
719 real (kind=kind_phys) :: fp
720 real (kind=kind_phys) :: prcp
722 real (kind=kind_phys) :: qintr
723 real (kind=kind_phys) :: qdripr
724 real (kind=kind_phys) :: qthror
725 real (kind=kind_phys) :: qints
726 real (kind=kind_phys) :: qdrips
727 real (kind=kind_phys) :: qthros
728 real (kind=kind_phys) :: snowhin
729 real (kind=kind_phys) :: latheav
730 real (kind=kind_phys) :: latheag
731 logical :: frozen_ground
732 logical :: frozen_canopy
733 logical :: dveg_active
734 logical :: crop_active
736 real (kind=kind_phys) ,
intent(out) :: canhs
752 call atm (parameters,ep_2, epsm1, sfcprs ,sfctmp ,q2 , &
753 prcpconv, prcpnonc,prcpshcv,prcpsnow,prcpgrpl,prcphail, &
754 soldn ,cosz ,thair ,qair , &
755 eair ,rhoair ,qprecc ,qprecl ,solad ,solai , &
756 swdown ,bdfall ,rain ,snow ,fp ,fpice , prcp )
760 do iz = isnow+1, nsoil
761 if(iz == isnow+1)
then
762 dzsnso(iz) = - zsnso(iz)
764 dzsnso(iz) = zsnso(iz-1) - zsnso(iz)
771 do iz=1,parameters%nroot
772 troot = troot + stc(iz)*dzsnso(iz)/(-zsoil(parameters%nroot))
778 beg_wb = canliq + canice + sneqv + wa
780 beg_wb = beg_wb + smc(iz) * dzsnso(iz) * 1000.
786 call phenology (parameters,vegtyp ,croptype, snowh , tv , lat , yearlen , julian , &
787 lai , sai , troot , elai , esai ,igs, pgs)
790 if(dveg == 1 .or. dveg == 6 .or. dveg == 7)
then
792 if(fveg <= 0.05) fveg = 0.05
793 else if (dveg == 2 .or. dveg == 3 .or. dveg == 8)
then
794 fveg = 1.-exp(-0.52*(lai+sai))
795 if(fveg <= 0.05) fveg = 0.05
796 else if (dveg == 4 .or. dveg == 5 .or. dveg == 9)
then
798 if(fveg <= 0.05) fveg = 0.05
800 write(*,*)
"-------- fatal called in sflx -----------"
803 errmsg =
"namelist parameter dveg unknown"
806 call wrf_error_fatal(
"namelist parameter dveg unknown")
809 if(opt_crop > 0 .and. croptype > 0)
then
811 if(fveg <= 0.05) fveg = 0.05
813 if(parameters%urban_flag .or. vegtyp == parameters%isbarren) fveg = 0.0
814 if(elai+esai == 0.0) fveg = 0.0
816 call precip_heat(parameters,iloc ,jloc ,vegtyp ,dt ,uu ,vv , &
817 elai ,esai ,fveg ,ist , &
818 bdfall ,rain ,snow ,fp , &
819 canliq ,canice ,tv ,sfctmp ,tg , &
820 qintr ,qdripr ,qthror ,qints ,qdrips ,qthros , &
821 pahv ,pahg ,pahb ,qrain ,qsnow ,snowhin, &
826 call energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , &
827 isnow ,dt ,rhoair ,sfcprs ,qair , &
828 sfctmp ,thair ,lwdn ,uu ,vv ,zlvl , &
829 co2air ,o2air ,solad ,solai ,cosz ,igs , &
830 eair ,tbot ,zsnso ,zsoil , &
831 elai ,esai ,fwet ,foln , &
832 fveg ,shdfac, pahv ,pahg ,pahb , &
833 qsnow ,dzsnso ,lat ,canliq ,canice ,iloc, jloc , &
834 thsfc_loc, prslkix,prsik1x,prslk1x,garea1, &
835 pblhx ,iz0tlnd, itime ,psi_opt, ep_1, ep_2, epsm1,cp, &
837 imelt ,snicev ,snliqv ,epore ,t2m ,fsno , &
838 sav ,sag ,qmelt ,fsa ,fsr ,taux , &
839 tauy ,fira ,fsh ,fcev ,fgev ,fctr , &
840 trad ,psn ,apar ,ssoil ,btrani ,btran , &
841 ponding,ts ,latheav , latheag , frozen_canopy,frozen_ground, &
842 tv ,tg ,stc ,snowh ,eah ,tah , &
843 sneqvo ,sneqv ,sh2o ,smc ,snice ,snliq , &
844 albold ,cm ,ch ,dx ,dz8w ,q2 , &
847 tauss ,laisun ,laisha ,rb , errmsg ,errflg , &
849 tauss ,laisun ,laisha ,rb , &
854 fsrg ,rssun ,rssha ,albd ,albi ,albsnd,albsni, bgap ,wgap, tgv,tgb,&
855 q1 ,q2v ,q2b ,q2e ,chv ,chb , &
856 emissi ,pah ,canhs, &
857 shg,shc,shb,evg,evb,ghv,ghb,irg,irc,irb,tr,evc,chleaf,chuc,chv2,chb2 )
859 qsfcveg = eah*ep_2/(sfcprs + epsm1*eah)
864 if (errflg /= 0)
return
866 sice(:) = max(0.0, smc(:) - sh2o(:))
869 qvap = max( fgev/latheag, 0.)
870 qdew = abs( min(fgev/latheag, 0.))
875 call water (parameters,vegtyp ,nsnow ,nsoil ,imelt ,dt ,uu , &
876 vv ,fcev ,fctr ,qprecc ,qprecl ,elai , &
877 esai ,sfctmp ,qvap ,qdew ,zsoil ,btrani , &
878 ficeold,ponding,tg ,ist ,fveg ,iloc,jloc , smceq , &
879 bdfall ,fp ,rain ,snow , &
880 qsnow ,qrain ,snowhin,latheav,latheag,frozen_canopy,frozen_ground, &
881 isnow ,canliq ,canice ,tv ,snowh ,sneqv , &
882 snice ,snliq ,stc ,zsnso ,sh2o ,smc , &
883 sice ,zwt ,wa ,wt ,dzsnso ,wslake , &
884 smcwtd ,deeprech,rech , &
885 cmc ,ecan ,etran ,fwet ,runsrf ,runsub , &
886 qin ,qdis ,ponding1 ,ponding2,&
893 crop_active = .false.
894 dveg_active = .false.
895 if (dveg == 2 .or. dveg == 5 .or. dveg == 6) dveg_active = .true.
896 if (opt_crop > 0 .and. croptype > 0)
then
898 dveg_active = .false.
901 IF (dveg_active)
THEN
902 call carbon (parameters,nsnow ,nsoil ,vegtyp ,dt ,zsoil , &
903 dzsnso ,stc ,smc ,tv ,tg ,psn , &
904 foln ,btran ,apar ,fveg ,igs , &
905 troot ,ist ,lat ,iloc ,jloc , &
906 lfmass ,rtmass ,stmass ,wood ,stblcp ,fastcp , &
907 gpp ,npp ,nee ,autors ,heters ,totsc , &
911 if (opt_crop == 1 .and. crop_active)
then
912 call carbon_crop (parameters,nsnow ,nsoil ,vegtyp ,dt ,zsoil ,julian , &
913 dzsnso ,stc ,smc ,tv ,psn ,foln ,btran , &
915 lfmass ,rtmass ,stmass ,wood ,stblcp ,fastcp ,grain , &
917 gpp ,npp ,nee ,autors ,heters ,totsc ,totlb, pgs )
922 call error (parameters,swdown ,fsa ,fsr ,fira ,fsh ,fcev , &
923 fgev ,fctr ,ssoil ,beg_wb ,canliq ,canice , &
924 sneqv ,wa ,smc ,dzsnso ,prcp ,ecan , &
925 etran ,edir ,runsrf ,runsub ,dt ,nsoil , &
926 nsnow ,ist ,errwat ,iloc , jloc ,fveg , &
927 sav ,sag ,fsrv ,fsrg ,zwt ,pah , &
929 pahv ,pahg ,pahb ,canhs,errmsg, errflg)
931 pahv ,pahg ,pahb, canhs )
935 if (errflg /= 0)
return
939 qfx = etran + ecan + edir
940 if ( parameters%urban_flag )
then
941 qsfc = qfx/(rhoair*ch) + qair
945 if(snowh <= 1.e-6 .or. sneqv <= 1.e-3)
then
950 if(swdown.ne.0.)
then
963 subroutine atm (parameters,ep_2,epsm1,sfcprs ,sfctmp ,q2 , &
964 prcpconv,prcpnonc ,prcpshcv,prcpsnow,prcpgrpl,prcphail , &
965 soldn ,cosz ,thair ,qair , &
966 eair ,rhoair ,qprecc ,qprecl ,solad , solai , &
967 swdown ,bdfall ,rain ,snow ,fp , fpice ,prcp )
975 type (noahmp_parameters),
intent(in) :: parameters
976 real (kind=kind_phys) ,
intent(in) :: ep_2
977 real (kind=kind_phys) ,
intent(in) :: epsm1
978 real (kind=kind_phys) ,
intent(in) :: sfcprs
979 real (kind=kind_phys) ,
intent(in) :: sfctmp
980 real (kind=kind_phys) ,
intent(in) :: q2
981 real (kind=kind_phys) ,
intent(in) :: prcpconv
982 real (kind=kind_phys) ,
intent(in) :: prcpnonc
983 real (kind=kind_phys) ,
intent(in) :: prcpshcv
984 real (kind=kind_phys) ,
intent(in) :: prcpsnow
985 real (kind=kind_phys) ,
intent(in) :: prcpgrpl
986 real (kind=kind_phys) ,
intent(in) :: prcphail
987 real (kind=kind_phys) ,
intent(in) :: soldn
988 real (kind=kind_phys) ,
intent(in) :: cosz
992 real (kind=kind_phys) ,
intent(out) :: thair
993 real (kind=kind_phys) ,
intent(out) :: qair
994 real (kind=kind_phys) ,
intent(out) :: eair
995 real (kind=kind_phys) ,
intent(out) :: rhoair
996 real (kind=kind_phys) ,
intent(out) :: qprecc
997 real (kind=kind_phys) ,
intent(out) :: qprecl
998 real (kind=kind_phys),
dimension( 1: 2),
intent(out) :: solad
999 real (kind=kind_phys),
dimension( 1: 2),
intent(out) :: solai
1000 real (kind=kind_phys) ,
intent(out) :: swdown
1001 real (kind=kind_phys) ,
intent(out) :: bdfall
1002 real (kind=kind_phys) ,
intent(out) :: rain
1003 real (kind=kind_phys) ,
intent(out) :: snow
1004 real (kind=kind_phys) ,
intent(out) :: fp
1005 real (kind=kind_phys) ,
intent(out) :: fpice
1006 real (kind=kind_phys) ,
intent(out) :: prcp
1010 real (kind=kind_phys) :: pair
1011 real (kind=kind_phys) :: prcp_frozen
1012 real (kind=kind_phys),
parameter :: rho_grpl = 500.0
1013 real (kind=kind_phys),
parameter :: rho_hail = 917.0
1018 thair = sfctmp * (sfcprs/pair)**(rair/cpair)
1022 eair = qair*sfcprs / (ep_2-epsm1*qair)
1023 rhoair = (sfcprs+epsm1*eair) / (rair*sfctmp)
1031 solad(1) = swdown*0.7*0.5
1032 solad(2) = swdown*0.7*0.5
1033 solai(1) = swdown*0.3*0.5
1034 solai(2) = swdown*0.3*0.5
1036 prcp = prcpconv + prcpnonc + prcpshcv
1038 if(opt_snf == 4)
then
1039 qprecc = prcpconv + prcpshcv
1042 qprecc = 0.10 * prcp
1043 qprecl = 0.90 * prcp
1049 if(qprecc + qprecl > 0.) &
1050 fp = (qprecc + qprecl) / (10.*qprecc + qprecl)
1056 if(opt_snf == 1)
then
1057 if(sfctmp > tfrz+2.5)
then
1060 if(sfctmp <= tfrz+0.5)
then
1062 else if(sfctmp <= tfrz+2.)
then
1063 fpice = 1.-(-54.632 + 0.2*sfctmp)
1070 if(opt_snf == 2)
then
1071 if(sfctmp >= tfrz+2.2)
then
1078 if(opt_snf == 3)
then
1079 if(sfctmp >= tfrz)
then
1089 bdfall = min(120.,67.92+51.25*exp((sfctmp-tfrz)/2.59))
1090 if(opt_snf == 4 .or. opt_snf == 5)
then
1091 prcp_frozen = prcpsnow + prcpgrpl + prcphail
1092 if(prcpnonc > 0. .and. prcp_frozen > 0.)
then
1093 fpice = min(1.0,prcp_frozen/prcpnonc)
1094 fpice = max(0.0,fpice)
1095 if(opt_snf==4) bdfall = bdfall*(prcpsnow/prcp_frozen) + rho_grpl*(prcpgrpl/prcp_frozen) + &
1096 rho_hail*(prcphail/prcp_frozen)
1097 if(opt_snf==5) bdfall = parameters%prcpiceden
1104 rain = prcp * (1.-fpice)
1115 subroutine phenology (parameters,vegtyp ,croptype, snowh , tv , lat , yearlen , julian , & !in
1116 lai , sai , troot , elai , esai , igs, pgs)
1124 type (noahmp_parameters),
intent(in) :: parameters
1125 integer ,
intent(in ) :: vegtyp
1126 integer ,
intent(in ) :: croptype
1127 real (kind=kind_phys) ,
intent(in ) :: snowh
1128 real (kind=kind_phys) ,
intent(in ) :: tv
1129 real (kind=kind_phys) ,
intent(in ) :: lat
1130 integer ,
intent(in ) :: yearlen
1131 real (kind=kind_phys) ,
intent(in ) :: julian
1132 real (kind=kind_phys) ,
intent(in ) :: troot
1133 real (kind=kind_phys) ,
intent(inout) :: lai
1134 real (kind=kind_phys) ,
intent(inout) :: sai
1137 real (kind=kind_phys) ,
intent(out ) :: elai
1138 real (kind=kind_phys) ,
intent(out ) :: esai
1139 real (kind=kind_phys) ,
intent(out ) :: igs
1140 integer ,
intent(in ) :: pgs
1144 real (kind=kind_phys) :: db
1145 real (kind=kind_phys) :: fb
1146 real (kind=kind_phys) :: snowhc
1151 real (kind=kind_phys) :: day
1152 real (kind=kind_phys) :: wt1,wt2
1153 real (kind=kind_phys) :: t
1156if (croptype == 0)
then
1158 if ( dveg == 1 .or. dveg == 3 .or. dveg == 4 )
then
1165 day = mod( julian + ( 0.5 * yearlen ) , real(yearlen) )
1168 t = 12. * day / real(yearlen)
1173 if (it1 .lt. 1) it1 = 12
1174 if (it2 .gt. 12) it2 = 1
1176 lai = wt1*parameters%laim(it1) + wt2*parameters%laim(it2)
1177 sai = wt1*parameters%saim(it1) + wt2*parameters%saim(it2)
1180 if(dveg == 7 .or. dveg == 8 .or. dveg == 9)
then
1181 sai = max(0.05,0.1 * lai)
1182 if (lai < 0.05) sai = 0.0
1185 if (sai < 0.05) sai = 0.0
1186 if (lai < 0.05 .or. sai == 0.0) lai = 0.0
1188 if ( ( vegtyp == parameters%iswater ) .or. ( vegtyp == parameters%isbarren ) .or. &
1189 ( vegtyp == parameters%isice ) .or. ( parameters%urban_flag ) )
then
1198 db = min( max(snowh - parameters%hvb,0.), parameters%hvt-parameters%hvb )
1199 fb = db / max(1.e-06,parameters%hvt-parameters%hvb)
1201 if(parameters%hvt> 0. .and. parameters%hvt <= 1.0)
then
1202 snowhc = parameters%hvt*exp(-snowh/0.2)
1204 if (snowh < snowhc)
then
1213 if (esai < 0.05 .and. croptype == 0) esai = 0.0
1214 if ((elai < 0.05 .or. esai == 0.0) .and. croptype == 0) elai = 0.0
1218 if ((tv .gt. parameters%tmin .and. croptype == 0).or.(pgs > 2 .and. pgs < 7 .and. croptype > 0))
then
1231 subroutine precip_heat (parameters,iloc ,jloc ,vegtyp ,dt ,uu ,vv , & !in
1232 elai ,esai ,fveg ,ist , & !in
1233 bdfall ,rain ,snow ,fp , & !in
1234 canliq ,canice ,tv ,sfctmp ,tg , & !in
1235 qintr ,qdripr ,qthror ,qints ,qdrips ,qthros , & !out
1236 pahv ,pahg ,pahb ,qrain ,qsnow ,snowhin, & !out
1246 type (noahmp_parameters),
intent(in) :: parameters
1247 integer,
intent(in) :: iloc
1248 integer,
intent(in) :: jloc
1249 integer,
intent(in) :: vegtyp
1250 integer,
intent(in) :: ist
1251 real (kind=kind_phys),
intent(in) :: dt
1252 real (kind=kind_phys),
intent(in) :: uu
1253 real (kind=kind_phys),
intent(in) :: vv
1254 real (kind=kind_phys),
intent(in) :: elai
1255 real (kind=kind_phys),
intent(in) :: esai
1256 real (kind=kind_phys),
intent(in) :: fveg
1257 real (kind=kind_phys),
intent(in) :: bdfall
1258 real (kind=kind_phys),
intent(in) :: rain
1259 real (kind=kind_phys),
intent(in) :: snow
1260 real (kind=kind_phys),
intent(in) :: fp
1261 real (kind=kind_phys),
intent(in) :: tv
1262 real (kind=kind_phys),
intent(in) :: sfctmp
1263 real (kind=kind_phys),
intent(in) :: tg
1266 real (kind=kind_phys),
intent(inout) :: canliq
1267 real (kind=kind_phys),
intent(inout) :: canice
1270 real (kind=kind_phys),
intent(out) :: qintr
1271 real (kind=kind_phys),
intent(out) :: qdripr
1272 real (kind=kind_phys),
intent(out) :: qthror
1273 real (kind=kind_phys),
intent(out) :: qints
1274 real (kind=kind_phys),
intent(out) :: qdrips
1275 real (kind=kind_phys),
intent(out) :: qthros
1276 real (kind=kind_phys),
intent(out) :: pahv
1277 real (kind=kind_phys),
intent(out) :: pahg
1278 real (kind=kind_phys),
intent(out) :: pahb
1279 real (kind=kind_phys),
intent(out) :: qrain
1280 real (kind=kind_phys),
intent(out) :: qsnow
1281 real (kind=kind_phys),
intent(out) :: snowhin
1282 real (kind=kind_phys),
intent(out) :: fwet
1283 real (kind=kind_phys),
intent(out) :: cmc
1287 real (kind=kind_phys) :: maxsno
1288 real (kind=kind_phys) :: maxliq
1289 real (kind=kind_phys) :: ft
1290 real (kind=kind_phys) :: fv
1291 real (kind=kind_phys) :: pah_ac
1292 real (kind=kind_phys) :: pah_cg
1293 real (kind=kind_phys) :: pah_ag
1294 real (kind=kind_phys) :: icedrip
1324 maxliq = parameters%ch2op * (elai+ esai)
1328 if((elai+ esai).gt.0.)
then
1329 qintr = fveg * rain * fp
1330 qintr = min(qintr, (maxliq - canliq)/dt * (1.-exp(-rain*dt/maxliq)) )
1331 qintr = max(qintr, 0.)
1332 qdripr = fveg * rain - qintr
1333 qthror = (1.-fveg) * rain
1334 canliq=max(0.,canliq+qintr*dt)
1339 if(canliq > 0.)
then
1340 qdripr = qdripr + canliq/dt
1347 pah_ac = fveg * rain * (cwat/1000.0) * (sfctmp - tv)
1348 pah_cg = qdripr * (cwat/1000.0) * (tv - tg)
1349 pah_ag = qthror * (cwat/1000.0) * (sfctmp - tg)
1357 maxsno = 6.6*(0.27+46./bdfall) * (elai+ esai)
1359 if((elai+ esai).gt.0.)
then
1360 qints = fveg * snow * fp
1361 qints = min(qints, (maxsno - canice)/dt * (1.-exp(-snow*dt/maxsno)) )
1362 qints = max(qints, 0.)
1363 ft = max(0.0,(tv - 270.15) / 1.87e5)
1364 fv = sqrt(uu*uu + vv*vv) / 1.56e5
1366 icedrip = max(0.,canice) * (fv+ft)
1367 qdrips = (fveg * snow - qints) + icedrip
1368 qthros = (1.0-fveg) * snow
1369 canice= max(0.,canice + (qints - icedrip)*dt)
1374 if(canice > 0.)
then
1375 qdrips = qdrips + canice/dt
1384 if(canice.gt.0.)
then
1385 fwet = max(0.,canice) / max(maxsno,1.e-06)
1387 fwet = max(0.,canliq) / max(maxliq,1.e-06)
1389 fwet = min(fwet, 1.) ** 0.667
1393 cmc = canliq + canice
1397 pah_ac = pah_ac + fveg * snow * (cice/1000.0) * (sfctmp - tv)
1398 pah_cg = pah_cg + qdrips * (cice/1000.0) * (tv - tg)
1399 pah_ag = pah_ag + qthros * (cice/1000.0) * (sfctmp - tg)
1401 pahv = pah_ac - pah_cg
1405 if (fveg > 0.0 .and. fveg < 1.0)
then
1407 pahb = pahb / (1.0-fveg)
1408 elseif (fveg <= 0.0)
then
1412 elseif (fveg >= 1.0)
then
1416 pahv = max(pahv,-20.0)
1417 pahv = min(pahv,20.0)
1418 pahg = max(pahg,-20.0)
1419 pahg = min(pahg,20.0)
1420 pahb = max(pahb,-20.0)
1421 pahb = min(pahb,20.0)
1440 qrain = qdripr + qthror
1441 qsnow = qdrips + qthros
1442 snowhin = qsnow/bdfall
1444 if (ist == 2 .and. tg > tfrz)
then
1462 subroutine error (parameters,swdown ,fsa ,fsr ,fira ,fsh ,fcev , &
1463 fgev ,fctr ,ssoil ,beg_wb ,canliq ,canice , &
1464 sneqv ,wa ,smc ,dzsnso ,prcp ,ecan , &
1465 etran ,edir ,runsrf ,runsub ,dt ,nsoil , &
1466 nsnow ,ist ,errwat, iloc ,jloc ,fveg , &
1467 sav ,sag ,fsrv ,fsrg ,zwt ,pah , &
1469 pahv ,pahg ,pahb ,canhs,errmsg, errflg)
1471 pahv ,pahg ,pahb ,canhs)
1479 type (noahmp_parameters),
intent(in) :: parameters
1480 integer ,
intent(in) :: nsnow
1481 integer ,
intent(in) :: nsoil
1482 integer ,
intent(in) :: ist
1483 integer ,
intent(in) :: iloc
1484 integer ,
intent(in) :: jloc
1485 real (kind=kind_phys) ,
intent(in) :: swdown
1486 real (kind=kind_phys) ,
intent(in) :: fsa
1487 real (kind=kind_phys) ,
intent(in) :: fsr
1488 real (kind=kind_phys) ,
intent(in) :: fira
1489 real (kind=kind_phys) ,
intent(in) :: fsh
1490 real (kind=kind_phys) ,
intent(in) :: fcev
1491 real (kind=kind_phys) ,
intent(in) :: fgev
1492 real (kind=kind_phys) ,
intent(in) :: fctr
1493 real (kind=kind_phys) ,
intent(in) :: ssoil
1494 real (kind=kind_phys) ,
intent(in) :: fveg
1495 real (kind=kind_phys) ,
intent(in) :: sav
1496 real (kind=kind_phys) ,
intent(in) :: sag
1497 real (kind=kind_phys) ,
intent(in) :: fsrv
1498 real (kind=kind_phys) ,
intent(in) :: fsrg
1499 real (kind=kind_phys) ,
intent(in) :: zwt
1501 real (kind=kind_phys) ,
intent(in) :: prcp
1502 real (kind=kind_phys) ,
intent(in) :: ecan
1503 real (kind=kind_phys) ,
intent(in) :: etran
1504 real (kind=kind_phys) ,
intent(in) :: edir
1505 real (kind=kind_phys) ,
intent(in) :: runsrf
1506 real (kind=kind_phys) ,
intent(in) :: runsub
1507 real (kind=kind_phys) ,
intent(in) :: canliq
1508 real (kind=kind_phys) ,
intent(in) :: canice
1509 real (kind=kind_phys) ,
intent(in) :: sneqv
1510 real (kind=kind_phys),
dimension( 1:nsoil),
intent(in) :: smc
1511 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: dzsnso
1512 real (kind=kind_phys) ,
intent(in) :: wa
1513 real (kind=kind_phys) ,
intent(in) :: dt
1514 real (kind=kind_phys) ,
intent(in) :: beg_wb
1515 real (kind=kind_phys) ,
intent(out) :: errwat
1516 real (kind=kind_phys),
intent(in) :: pah
1517 real (kind=kind_phys),
intent(in) :: pahv
1518 real (kind=kind_phys),
intent(in) :: pahg
1519 real (kind=kind_phys),
intent(in) :: pahb
1520 real (kind=kind_phys),
intent(in) :: canhs
1523 character(len=*) ,
intent(inout) :: errmsg
1524 integer ,
intent(inout) :: errflg
1528 real (kind=kind_phys) :: end_wb
1530 real (kind=kind_phys) :: erreng
1531 real (kind=kind_phys) :: errsw
1532 real (kind=kind_phys) :: fsrvg
1533 character(len=256) :: message
1536 errsw = swdown - (fsa + fsr)
1539 if (abs(errsw) > 0.01)
then
1540 write(*,*)
"vegetation!"
1541 write(*,*)
"swdown*fveg =",swdown*fveg
1542 write(*,*)
"fveg*(sav+sag) =",fveg*sav + sag
1543 write(*,*)
"fveg*(fsrv +fsrg)=",fveg*fsrv + fsrg
1544 write(*,*)
"ground!"
1545 write(*,*)
"(1-.fveg)*swdown =",(1.-fveg)*swdown
1546 write(*,*)
"(1.-fveg)*sag =",(1.-fveg)*sag
1547 write(*,*)
"(1.-fveg)*fsrg=",(1.-fveg)*fsrg
1548 write(*,*)
"fsrv =",fsrv
1549 write(*,*)
"fsrg =",fsrg
1550 write(*,*)
"fsr =",fsr
1551 write(*,*)
"sav =",sav
1552 write(*,*)
"sag =",sag
1553 write(*,*)
"fsa =",fsa
1555 write(message,*)
'errsw =',errsw
1558 errmsg = trim(message)//new_line(
'A')//
"stop in noah-mp"
1561 call wrf_message(trim(message))
1562 call wrf_error_fatal(
"stop in noah-mp")
1566 erreng = sav+sag-(fira+fsh+fcev+fgev+fctr+ssoil+canhs) +pah
1568 if(abs(erreng) > 0.01)
then
1569 write(message,*)
'erreng =',erreng,
' at i,j: ',iloc,jloc
1571 errmsg = trim(message)
1573 call wrf_message(trim(message))
1575 write(message,
'(a17,f10.4)')
"net solar: ",fsa
1577 errmsg = trim(errmsg)//new_line(
'A')//trim(message)
1579 call wrf_message(trim(message))
1581 write(message,
'(a17,f10.4)')
"net longwave: ",fira
1583 errmsg = trim(errmsg)//new_line(
'A')//trim(message)
1585 call wrf_message(trim(message))
1587 write(message,
'(a17,f10.4)')
"total sensible: ",fsh
1589 errmsg = trim(errmsg)//new_line(
'A')//trim(message)
1591 call wrf_message(trim(message))
1593 write(message,
'(a17,f10.4)')
"canopy evap: ",fcev
1595 errmsg = trim(errmsg)//new_line(
'A')//trim(message)
1597 call wrf_message(trim(message))
1599 write(message,
'(a17,f10.4)')
"ground evap: ",fgev
1601 errmsg = trim(errmsg)//new_line(
'A')//trim(message)
1603 call wrf_message(trim(message))
1605 write(message,
'(a17,f10.4)')
"transpiration: ",fctr
1607 errmsg = trim(errmsg)//new_line(
'A')//trim(message)
1609 call wrf_message(trim(message))
1611 write(message,
'(a17,f10.4)')
"total ground: ",ssoil
1613 errmsg = trim(errmsg)//new_line(
'A')//trim(message)
1615 call wrf_message(trim(message))
1617 write(message,
'(a17,f10.4)')
"canopy heat storage: ",canhs
1619 errmsg = trim(errmsg)//new_line(
'A')//trim(message)
1621 call wrf_message(trim(message))
1623 write(message,
'(a17,4f10.4)')
"precip advected: ",pah,pahv,pahg,pahb
1625 errmsg = trim(errmsg)//new_line(
'A')//trim(message)
1627 call wrf_message(trim(message))
1629 write(message,
'(a17,f10.4)')
"precip: ",prcp
1631 errmsg = trim(errmsg)//new_line(
'A')//trim(message)
1633 call wrf_message(trim(message))
1635 write(message,
'(a17,f10.4)')
"veg fraction: ",fveg
1638 errmsg = trim(errmsg)//new_line(
'A')//trim(message)//new_line(
'A')//
"energy budget problem in noahmp lsm"
1641 call wrf_message(trim(message))
1642 call wrf_error_fatal(
"energy budget problem in noahmp lsm")
1648 end_wb = canliq + canice + sneqv + wa
1650 end_wb = end_wb + smc(iz) * dzsnso(iz) * 1000.
1652 errwat = end_wb-beg_wb-(prcp-ecan-etran-edir-runsrf-runsub)*dt
1658 end subroutine error
1670 subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in
1671 isnow ,dt ,rhoair ,sfcprs ,qair , & !in
1672 sfctmp ,thair ,lwdn ,uu ,vv ,zref , & !in
1673 co2air ,o2air ,solad ,solai ,cosz ,igs , & !in
1674 eair ,tbot ,zsnso ,zsoil , & !in
1675 elai ,esai ,fwet ,foln , & !in
1676 fveg ,shdfac, pahv ,pahg ,pahb , & !in
1677 qsnow ,dzsnso ,lat ,canliq ,canice ,iloc , jloc, & !in
1678 thsfc_loc, prslkix,prsik1x,prslk1x,garea1, & !in
1679 pblhx , iz0tlnd, itime,psi_opt,ep_1, ep_2, epsm1, cp, &
1680 z0wrf ,z0hwrf , & !out
1681 imelt ,snicev ,snliqv ,epore ,t2m ,fsno , & !out
1682 sav ,sag ,qmelt ,fsa ,fsr ,taux , & !out
1683 tauy ,fira ,fsh ,fcev ,fgev ,fctr , & !out
1684 trad ,psn ,apar ,ssoil ,btrani ,btran , & !out
1685 ponding,ts ,latheav , latheag , frozen_canopy,frozen_ground, & !out
1686 tv ,tg ,stc ,snowh ,eah ,tah , & !inout
1687 sneqvo ,sneqv ,sh2o ,smc ,snice ,snliq , & !inout
1688 albold ,cm ,ch ,dx ,dz8w ,q2 , & !inout
1691 tauss ,laisun ,laisha ,rb ,errmsg ,errflg, & !inout
1693 tauss ,laisun ,laisha ,rb , & !inout
1696 qc ,qsfc ,psfc , & !in
1697 t2mv ,t2mb ,fsrv , &
1698 fsrg ,rssun ,rssha ,albd ,albi,albsnd ,albsni,bgap ,wgap,tgv,tgb,&
1699 q1 ,q2v ,q2b ,q2e ,chv ,chb, emissi,pah,canhs,&
1700 shg,shc,shb,evg,evb,ghv,ghb,irg,irc,irb,tr,evc,chleaf,chuc,chv2,chb2 )
1739 type (noahmp_parameters),
intent(in) :: parameters
1740 integer ,
intent(in) :: iloc
1741 integer ,
intent(in) :: jloc
1742 integer ,
intent(in) :: ice
1743 integer ,
intent(in) :: vegtyp
1744 integer ,
intent(in) :: ist
1745 integer ,
intent(in) :: nsnow
1746 integer ,
intent(in) :: nsoil
1747 integer ,
intent(in) :: isnow
1748 real (kind=kind_phys) ,
intent(in) :: dt
1749 real (kind=kind_phys) ,
intent(in) :: qsnow
1750 real (kind=kind_phys) ,
intent(in) :: rhoair
1751 real (kind=kind_phys) ,
intent(in) :: eair
1752 real (kind=kind_phys) ,
intent(in) :: sfcprs
1754 logical ,
intent(in) :: thsfc_loc
1755 real (kind=kind_phys) ,
intent(in) :: prslkix
1756 real (kind=kind_phys) ,
intent(in) :: prsik1x
1757 real (kind=kind_phys) ,
intent(in) :: prslk1x
1758 real (kind=kind_phys) ,
intent(in) :: garea1
1760 real (kind=kind_phys) ,
intent(in) :: pblhx
1761 real (kind=kind_phys) ,
intent(in) :: ep_1
1762 real (kind=kind_phys) ,
intent(in) :: ep_2
1763 real (kind=kind_phys) ,
intent(in) :: epsm1
1764 real (kind=kind_phys) ,
intent(in) :: cp
1765 integer ,
intent(in) :: iz0tlnd
1766 integer ,
intent(in) :: itime
1767 integer ,
intent(in) :: psi_opt
1769 real (kind=kind_phys) ,
intent(in) :: qair
1770 real (kind=kind_phys) ,
intent(in) :: sfctmp
1771 real (kind=kind_phys) ,
intent(in) :: thair
1772 real (kind=kind_phys) ,
intent(in) :: lwdn
1773 real (kind=kind_phys) ,
intent(in) :: uu
1774 real (kind=kind_phys) ,
intent(in) :: vv
1775 real (kind=kind_phys) ,
dimension( 1: 2),
intent(in) :: solad
1776 real (kind=kind_phys) ,
dimension( 1: 2),
intent(in) :: solai
1777 real (kind=kind_phys) ,
intent(in) :: cosz
1778 real (kind=kind_phys) ,
intent(in) :: elai
1779 real (kind=kind_phys) ,
intent(in) :: esai
1780 real (kind=kind_phys) ,
intent(in) :: fwet
1781 real (kind=kind_phys) ,
intent(in) :: fveg
1782 real (kind=kind_phys) ,
intent(in) :: shdfac
1783 real (kind=kind_phys) ,
intent(in) :: lat
1784 real (kind=kind_phys) ,
intent(in) :: canliq
1785 real (kind=kind_phys) ,
intent(in) :: canice
1786 real (kind=kind_phys) ,
intent(in) :: foln
1787 real (kind=kind_phys) ,
intent(in) :: co2air
1788 real (kind=kind_phys) ,
intent(in) :: o2air
1789 real (kind=kind_phys) ,
intent(in) :: igs
1791 real (kind=kind_phys) ,
intent(in) :: zref
1792 real (kind=kind_phys) ,
intent(in) :: tbot
1793 real (kind=kind_phys) ,
dimension(-nsnow+1:nsoil),
intent(in) :: zsnso
1794 real (kind=kind_phys) ,
dimension( 1:nsoil),
intent(in) :: zsoil
1795 real (kind=kind_phys) ,
dimension(-nsnow+1:nsoil),
intent(in) :: dzsnso
1796 real (kind=kind_phys),
intent(in) :: pahv
1797 real (kind=kind_phys),
intent(in) :: pahg
1798 real (kind=kind_phys),
intent(in) :: pahb
1801 real (kind=kind_phys) ,
intent(in) :: qc
1802 real (kind=kind_phys) ,
intent(inout) :: qsfc
1803 real (kind=kind_phys) ,
intent(in) :: psfc
1804 real (kind=kind_phys) ,
intent(in) :: dx
1805 real (kind=kind_phys) ,
intent(in) :: dz8w
1806 real (kind=kind_phys) ,
intent(in) :: q2
1810 real (kind=kind_phys) ,
intent(out) :: z0wrf
1811 real (kind=kind_phys) ,
intent(out) :: z0hwrf
1812 integer,
dimension(-nsnow+1:nsoil),
intent(out) :: imelt
1813 real (kind=kind_phys) ,
dimension(-nsnow+1: 0),
intent(out) :: snicev
1814 real (kind=kind_phys) ,
dimension(-nsnow+1: 0),
intent(out) :: snliqv
1815 real (kind=kind_phys) ,
dimension(-nsnow+1: 0),
intent(out) :: epore
1816 real (kind=kind_phys) ,
intent(out) :: fsno
1817 real (kind=kind_phys) ,
intent(out) :: qmelt
1818 real (kind=kind_phys) ,
intent(out) :: ponding
1819 real (kind=kind_phys) ,
intent(out) :: sav
1820 real (kind=kind_phys) ,
intent(out) :: sag
1821 real (kind=kind_phys) ,
intent(out) :: fsa
1822 real (kind=kind_phys) ,
intent(out) :: fsr
1823 real (kind=kind_phys) ,
intent(out) :: taux
1824 real (kind=kind_phys) ,
intent(out) :: tauy
1825 real (kind=kind_phys) ,
intent(out) :: fira
1826 real (kind=kind_phys) ,
intent(out) :: fsh
1827 real (kind=kind_phys) ,
intent(out) :: fcev
1828 real (kind=kind_phys) ,
intent(out) :: fgev
1829 real (kind=kind_phys) ,
intent(out) :: fctr
1830 real (kind=kind_phys) ,
intent(out) :: trad
1831 real (kind=kind_phys) ,
intent(out) :: t2m
1832 real (kind=kind_phys) ,
intent(out) :: psn
1833 real (kind=kind_phys) ,
intent(out) :: apar
1834 real (kind=kind_phys) ,
intent(out) :: ssoil
1835 real (kind=kind_phys) ,
dimension( 1:nsoil),
intent(out) :: btrani
1836 real (kind=kind_phys) ,
intent(out) :: btran
1838 real (kind=kind_phys) ,
intent(out) :: latheav
1839 real (kind=kind_phys) ,
intent(out) :: latheag
1840 real (kind=kind_phys) ,
intent(out) :: ts
1841 logical ,
intent(out) :: frozen_ground
1842 logical ,
intent(out) :: frozen_canopy
1845 real (kind=kind_phys) ,
intent(out) :: fsrv
1846 real (kind=kind_phys) ,
intent(out) :: fsrg
1847 real (kind=kind_phys),
intent(out) :: rssun
1848 real (kind=kind_phys),
intent(out) :: rssha
1852 real (kind=kind_phys) ,
intent(out) :: t2mv
1853 real (kind=kind_phys) ,
intent(out) :: t2mb
1854 real (kind=kind_phys) ,
intent(out) :: bgap
1855 real (kind=kind_phys) ,
intent(out) :: wgap
1856 real (kind=kind_phys) ,
intent(out) :: canhs
1857 real (kind=kind_phys),
dimension(1:2) ,
intent(out) :: albd
1858 real (kind=kind_phys),
dimension(1:2) ,
intent(out) :: albi
1859 real (kind=kind_phys),
dimension(1:2) ,
intent(out) :: albsnd
1860 real (kind=kind_phys),
dimension(1:2) ,
intent(out) :: albsni
1864 real (kind=kind_phys) ,
intent(inout) :: tv
1865 real (kind=kind_phys) ,
intent(inout) :: tg
1866 real (kind=kind_phys) ,
dimension(-nsnow+1:nsoil),
intent(inout) :: stc
1867 real (kind=kind_phys) ,
intent(inout) :: snowh
1868 real (kind=kind_phys) ,
intent(inout) :: sneqv
1869 real (kind=kind_phys) ,
intent(inout) :: sneqvo
1870 real (kind=kind_phys) ,
dimension( 1:nsoil),
intent(inout) :: sh2o
1871 real (kind=kind_phys) ,
dimension( 1:nsoil),
intent(inout) :: smc
1872 real (kind=kind_phys) ,
dimension(-nsnow+1: 0),
intent(inout) :: snice
1873 real (kind=kind_phys) ,
dimension(-nsnow+1: 0),
intent(inout) :: snliq
1874 real (kind=kind_phys) ,
intent(inout) :: eah
1875 real (kind=kind_phys) ,
intent(inout) :: tah
1876 real (kind=kind_phys) ,
intent(inout) :: albold
1877 real (kind=kind_phys) ,
intent(inout) :: tauss
1878 real (kind=kind_phys) ,
intent(inout) :: cm
1879 real (kind=kind_phys) ,
intent(inout) :: ch
1880 real (kind=kind_phys) ,
intent(inout) :: q1
1881 real (kind=kind_phys) ,
intent(inout) :: ustarx
1882 real (kind=kind_phys) ,
intent(inout) :: rb
1883 real (kind=kind_phys) ,
intent(inout) :: laisun
1884 real (kind=kind_phys) ,
intent(inout) :: laisha
1886 character(len=*) ,
intent(inout) :: errmsg
1887 integer ,
intent(inout) :: errflg
1890 real (kind=kind_phys),
intent(out) :: emissi
1891 real (kind=kind_phys),
intent(out) :: pah
1896 real (kind=kind_phys) :: ur
1897 real (kind=kind_phys) :: zlvl
1898 real (kind=kind_phys) :: fsun
1899 real (kind=kind_phys) :: rsurf
1900 real (kind=kind_phys) :: l_rsurf
1901 real (kind=kind_phys) :: d_rsurf
1902 real (kind=kind_phys) :: bevap
1903 real (kind=kind_phys) :: mol
1904 real (kind=kind_phys) :: vai
1905 real (kind=kind_phys) :: cwp
1906 real (kind=kind_phys) :: zpd
1907 real (kind=kind_phys) :: z0m
1908 real (kind=kind_phys) :: zpdg
1909 real (kind=kind_phys) :: z0mg
1910 real (kind=kind_phys) :: emv
1911 real (kind=kind_phys) :: emg
1912 real (kind=kind_phys) :: fire
1914 real (kind=kind_phys) :: psnsun
1915 real (kind=kind_phys) :: psnsha
1920 real (kind=kind_phys) :: parsun
1921 real (kind=kind_phys) :: parsha
1923 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: fact
1924 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: df
1925 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: hcpct
1926 real (kind=kind_phys) :: bdsno
1927 real (kind=kind_phys) :: fmelt
1928 real (kind=kind_phys) :: gx
1929 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: phi
1931 real (kind=kind_phys) :: gammav
1932 real (kind=kind_phys) :: gammag
1933 real (kind=kind_phys) :: psi
1934 real (kind=kind_phys) :: rhsur
1938 real (kind=kind_phys) :: tauxv
1939 real (kind=kind_phys) :: tauyv
1940 real (kind=kind_phys),
intent(out) :: irc
1941 real (kind=kind_phys),
intent(out) :: irg
1942 real (kind=kind_phys),
intent(out) :: shc
1943 real (kind=kind_phys),
intent(out) :: shg
1945 real (kind=kind_phys),
intent(out) :: q2v
1946 real (kind=kind_phys),
intent(out) :: q2b
1947 real (kind=kind_phys),
intent(out) :: q2e
1949 real (kind=kind_phys),
intent(out) :: evc
1950 real (kind=kind_phys),
intent(out) :: evg
1951 real (kind=kind_phys),
intent(out) :: tr
1952 real (kind=kind_phys),
intent(out) :: ghv
1953 real (kind=kind_phys),
intent(out) :: tgv
1954 real (kind=kind_phys) :: cmv
1955 real (kind=kind_phys),
intent(out) :: chv
1959 real (kind=kind_phys) :: tauxb
1960 real (kind=kind_phys) :: tauyb
1961 real (kind=kind_phys),
intent(out) :: irb
1962 real (kind=kind_phys),
intent(out) :: shb
1963 real (kind=kind_phys),
intent(out) :: evb
1964 real (kind=kind_phys),
intent(out) :: ghb
1965 real (kind=kind_phys),
intent(out) :: tgb
1966 real (kind=kind_phys) :: cmb
1967 real (kind=kind_phys),
intent(out) :: chb
1968 real (kind=kind_phys),
intent(out) :: chleaf
1969 real (kind=kind_phys),
intent(out) :: chuc
1971 real (kind=kind_phys),
intent(out) :: chv2
1972 real (kind=kind_phys),
intent(out) :: chb2
1973 real (kind=kind_phys) :: noahmpres
1975 real (kind=kind_phys) :: csigmaf0
1976 real (kind=kind_phys) :: csigmaf1
1978 real (kind=kind_phys) :: cdmnv
1979 real (kind=kind_phys) :: ezpdv
1980 real (kind=kind_phys) :: cdmng
1981 real (kind=kind_phys) :: ezpdg
1982 real (kind=kind_phys) :: ezpd
1983 real (kind=kind_phys) :: aone
1985 real (kind=kind_phys) :: canopy_density_factor
1986 real (kind=kind_phys) :: vai_limited
1990 real (kind=kind_phys),
parameter :: mpe = 1.e-6
1991 real (kind=kind_phys),
parameter :: psiwlt = -150.
1992 real (kind=kind_phys),
parameter :: z0 = 0.002
2029 canopy_density_factor = 1.0
2036 ur = max( sqrt(uu**2.+vv**2.), 1. )
2042 if(vai > 0.) veg = .true.
2047 if(snowh <= 1.e-6 .or. sneqv <= 1.e-3)
then
2051 if(snowh.gt.0.)
then
2052 bdsno = sneqv / snowh
2053 fmelt = (bdsno/100.)**parameters%mfsno
2054 fsno = tanh( snowh /(parameters%scffac * fmelt))
2060 if(tg .le. tfrz)
then
2061 z0mg = 0.01 * (1.0-fsno) + fsno * parameters%z0sno
2066 z0mg = z0 * (1.0-fsno) + fsno * parameters%z0sno
2074 if(opt_z0m == 1)
then
2076 z0m = parameters%z0mvt
2077 zpd = 0.65 * parameters%hvt
2079 elseif(opt_z0m == 2)
then
2081 z0m = parameters%z0mhvt * parameters%hvt
2082 zpd = 0.65 * parameters%hvt
2083 if(vegtyp /= 13)
then
2084 vai_limited = min(vai, 2.0)
2085 canopy_density_factor = (1.0 - exp(-vai_limited)) / (1.0 - exp(-2.0))
2086 z0m = exp(canopy_density_factor * log(z0m) + (1.0 - canopy_density_factor) * log(z0mg))
2087 zpd = canopy_density_factor * zpd
2092 if(snowh.gt.zpd) zpd = snowh
2103 IF (parameters%urban_flag)
THEN
2104 z0mg = parameters%Z0MVT
2105 zpdg = 0.65 * parameters%HVT
2110 zlvl = max(zpd,parameters%hvt) + zref
2111 if(zpdg >= zlvl) zlvl = zpdg + zref
2116 cwp = parameters%cwpvt
2120 call thermoprop (parameters,nsoil ,nsnow ,isnow ,ist ,dzsnso , &
2121 dt ,snowh ,snice ,snliq , shdfac, &
2122 smc ,sh2o ,tg ,stc ,ur , &
2123 lat ,z0m ,zlvl ,vegtyp , &
2124 df ,hcpct ,snicev ,snliqv ,epore , &
2129 call radiation (parameters,vegtyp ,ist ,ice ,nsoil , &
2130 sneqvo ,sneqv ,dt ,cosz ,snowh , &
2131 tg ,tv ,fsno ,qsnow ,fwet , &
2132 elai ,esai ,smc ,solad ,solai , &
2133 fveg ,iloc ,jloc , &
2135 fsun ,laisun ,laisha ,parsun ,parsha , &
2136 sav ,sag ,fsr ,fsa ,fsrv , &
2137 fsrg ,albd ,albi ,albsnd ,albsni ,bgap ,wgap )
2141 emv = 1. - exp(-(elai+esai)/1.0)
2143 emg = 0.98*(1.-fsno) + parameters%snow_emis*fsno
2145 emg = parameters%eg(ist)*(1.-fsno) + parameters%snow_emis*fsno
2153 do iz = 1, parameters%nroot
2154 if(opt_btr == 1)
then
2155 gx = (sh2o(iz)-parameters%smcwlt(iz)) / (parameters%smcref(iz)-parameters%smcwlt(iz))
2157 if(opt_btr == 2)
then
2158 psi = max(psiwlt,-parameters%psisat(iz)*(max(0.01,sh2o(iz))/parameters%smcmax(iz))**(-parameters%bexp(iz)) )
2159 gx = (1.-psi/psiwlt)/(1.+parameters%psisat(iz)/psiwlt)
2161 if(opt_btr == 3)
then
2162 psi = max(psiwlt,-parameters%psisat(iz)*(max(0.01,sh2o(iz))/parameters%smcmax(iz))**(-parameters%bexp(iz)) )
2163 gx = 1.-exp(-5.8*(log(psiwlt/psi)))
2166 gx = min(1.,max(0.,gx))
2167 btrani(iz) = max(mpe,dzsnso(iz) / (-zsoil(parameters%nroot)) * gx)
2168 btran = btran + btrani(iz)
2170 btran = max(mpe,btran)
2172 btrani(1:parameters%nroot) = btrani(1:parameters%nroot)/btran
2177 bevap = max(0.0,sh2o(1)/parameters%smcmax(1))
2183 if(opt_rsf == 1 .or. opt_rsf == 4)
then
2187 l_rsurf = (-zsoil(1)) * ( exp( (1.0 - min(1.0,sh2o(1)/parameters%smcmax(1))) ** parameters%rsurf_exp ) - 1.0 ) / ( 2.71828 - 1.0 )
2188 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))
2189 rsurf = l_rsurf / d_rsurf
2190 elseif(opt_rsf == 2)
then
2191 rsurf = fsno * 1. + (1.-fsno)* exp(8.25-4.225*bevap)
2192 elseif(opt_rsf == 3)
then
2193 rsurf = fsno * 1. + (1.-fsno)* exp(8.25-6.0 *bevap)
2196 if(opt_rsf == 4)
then
2197 rsurf = 1. / (fsno * (1./parameters%rsurf_snow) + (1.-fsno) * (1./max(rsurf, 0.001)))
2200 if(sh2o(1) < 0.01 .and. snowh == 0.) rsurf = 1.e6
2201 psi = -parameters%psisat(1)*(max(0.01,sh2o(1))/parameters%smcmax(1))**(-parameters%bexp(1))
2202 rhsur = fsno + (1.-fsno) * exp(psi*grav/(rw*tg))
2206 if (parameters%urban_flag .and. snowh == 0. )
then
2212 if (tv .gt. tfrz)
then
2214 frozen_canopy = .false.
2217 frozen_canopy = .true.
2219 gammav = cpair*sfcprs/(ep_2*latheav)
2221 if (tg .gt. tfrz)
then
2223 frozen_ground = .false.
2226 frozen_ground = .true.
2228 gammag = cpair*sfcprs/(ep_2*latheag)
2239 if (veg .and. fveg > 0)
then
2243 call vege_flux (parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , &
2244 dt ,sav ,sag ,lwdn ,ur , &
2245 uu ,vv ,sfctmp ,thair ,qair , &
2246 eair ,rhoair ,snowh ,vai ,gammav ,gammag , &
2247 fwet ,laisun ,laisha ,cwp ,dzsnso , &
2248 zlvl ,zpd ,z0m ,fveg ,shdfac, &
2249 z0mg ,emv ,emg ,canliq ,fsno, &
2250 canice ,stc ,df ,rssun ,rssha , &
2251 rsurf ,latheav ,latheag ,parsun ,parsha ,igs , &
2252 foln ,co2air ,o2air ,btran ,sfcprs , &
2253 rhsur ,iloc ,jloc ,q2 ,pahv ,pahg , &
2254 thsfc_loc, prslkix,prsik1x,prslk1x, garea1, &
2255 pblhx ,iz0tlnd ,itime ,psi_opt ,ep_1, ep_2, epsm1, cp, &
2256 eah ,tah ,tv ,tgv ,cmv, ustarx , &
2258 chv ,dx ,dz8w ,errmsg ,errflg , &
2262 tauxv ,tauyv ,irg ,irc ,shg , &
2263 shc ,evg ,evc ,tr ,ghv , &
2264 t2mv ,psnsun ,psnsha ,canhs , &
2268 q2v ,chv2 ,chleaf ,chuc , &
2273 cdmnv = 0.4*0.4/log((zlvl-zpd)/z0m)**2
2274 aone = 2.6*(10.0*parameters%hvt/(zlvl-zpd))**0.355
2279 if (errflg /= 0)
return
2286 call bare_flux (parameters,nsnow ,nsoil ,isnow ,dt ,sag , &
2287 lwdn ,ur ,uu ,vv ,sfctmp , &
2288 thair ,qair ,eair ,rhoair ,snowh , &
2289 dzsnso ,zlvl ,zpdg ,z0mg ,fsno, &
2290 emg ,stc ,df ,rsurf ,latheag , &
2291 gammag ,rhsur ,iloc ,jloc ,q2 ,pahb , &
2292 thsfc_loc, prslkix,prsik1x,prslk1x,vegtyp,fveg,shdfac,garea1, &
2293 pblhx ,iz0tlnd ,itime ,psi_opt ,ep_1, ep_2, epsm1, cp, &
2295 tgb ,cmb ,chb, ustarx,errmsg ,errflg , &
2297 tgb ,cmb ,chb, ustarx, &
2299 tauxb ,tauyb ,irb ,shb ,evb,csigmaf0,&
2300 ghb ,t2mb ,dx ,dz8w , &
2307 cdmng = 0.4*0.4/log((zlvl-zpdg)/z0mg)**2
2312 if (ezpdv .ge. ezpdg )
then
2314 elseif (ezpdv .gt. 0.0 .and. ezpdv .lt. ezpdg)
then
2315 ezpd = (1.0 -fveg)*ezpdg
2322 if (errflg /= 0)
return
2328 if (veg .and. fveg > 0)
then
2329 taux = fveg * tauxv + (1.0 - fveg) * tauxb
2330 tauy = fveg * tauyv + (1.0 - fveg) * tauyb
2331 fira = fveg * irg + (1.0 - fveg) * irb + irc
2332 fsh = fveg * shg + (1.0 - fveg) * shb + shc
2333 fgev = fveg * evg + (1.0 - fveg) * evb
2334 ssoil = fveg * ghv + (1.0 - fveg) * ghb
2337 pah = fveg * pahg + (1.0 - fveg) * pahb + pahv
2338 tg = fveg * tgv + (1.0 - fveg) * tgb
2339 t2m = fveg * t2mv + (1.0 - fveg) * t2mb
2340 ts = fveg * tah + (1.0 - fveg) * tgb
2341 cm = fveg * cmv + (1.0 - fveg) * cmb
2342 ch = fveg * chv + (1.0 - fveg) * chb
2343 q1 = fveg * (eah*ep_2/(sfcprs + epsm1*eah)) + (1.0 - fveg)*qsfc
2344 q2e = fveg * q2v + (1.0 - fveg) * q2b
2348 ts = (fveg*chv*tah + (1.0-fveg)*chb*tgb ) / ch
2353 call thermalz0(parameters,fveg,z0m,z0mg,zlvl,zpd,ezpd,ustarx, &
2354 vegtyp,vai,ur,csigmaf0,csigmaf1,aone,cdmnv,cdmng,2, &
2378 call thermalz0(parameters,fveg,z0m,z0mg,zlvl,zpd,ezpd,ustarx, &
2379 vegtyp,vai,ur,csigmaf0,csigmaf1,aone,cdmnv,cdmng,0, &
2387 write(6,*)
'emitted longwave <0; skin t may be wrong due to inconsistent'
2388 write(6,*)
'input of shdfac with lai'
2389 write(6,*) iloc, jloc,
'shdfac=',fveg,
'vai=',vai,
'tv=',tv,
'tg=',tg
2390 write(6,*)
'lwdn=',lwdn,
'fira=',fira,
'snowh=',snowh
2393 errmsg =
"stop in noah-mp"
2396 call wrf_error_fatal(
"stop in noah-mp")
2402 emissi = fveg * ( emg*(1-emv) + emv + emv*(1-emv)*(1-emg) ) + &
2409 trad = ( ( fire - (1-emissi)*lwdn ) / (emissi*sb) ) ** 0.25
2414 apar = parsun*laisun + parsha*laisha
2415 psn = psnsun*laisun + psnsha*laisha
2419 call tsnosoi (parameters,ice ,nsoil ,nsnow ,isnow ,ist , &
2420 tbot ,zsnso ,ssoil ,df ,hcpct , &
2421 sag ,dt ,snowh ,dzsnso , &
2424 stc ,errmsg ,errflg )
2430 if (errflg /= 0)
return
2434 if(opt_stc == 2)
then
2435 if (snowh > 0.05 .and. tg > tfrz)
then
2438 if (veg .and. fveg > 0)
then
2439 tg = fveg * tgv + (1.0 - fveg) * tgb
2440 ts = fveg * tv + (1.0 - fveg) * tgb
2450 call phasechange (parameters,nsnow ,nsoil ,isnow ,dt ,fact , &
2451 dzsnso ,hcpct ,ist ,iloc ,jloc , &
2452 stc ,snice ,snliq ,sneqv ,snowh , &
2454 smc ,sh2o ,errmsg ,errflg , &
2458 qmelt ,imelt ,ponding )
2460 if (errflg /= 0)
return
2468 subroutine thermoprop (parameters,nsoil ,nsnow ,isnow ,ist ,dzsnso , & !in
2469 dt ,snowh ,snice ,snliq , shdfac, & !in
2470 smc ,sh2o ,tg ,stc ,ur , & !in
2471 lat ,z0m ,zlvl ,vegtyp , & !in
2472 df ,hcpct ,snicev ,snliqv ,epore , & !out
2478 type (noahmp_parameters),
intent(in) :: parameters
2479 integer ,
intent(in) :: nsoil
2480 integer ,
intent(in) :: nsnow
2481 integer ,
intent(in) :: isnow
2482 integer ,
intent(in) :: ist
2483 real (kind=kind_phys) ,
intent(in) :: dt
2484 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(in) :: snice
2485 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(in) :: snliq
2486 real (kind=kind_phys) ,
intent(in) :: shdfac
2487 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: dzsnso
2488 real (kind=kind_phys),
dimension( 1:nsoil),
intent(in) :: smc
2489 real (kind=kind_phys),
dimension( 1:nsoil),
intent(in) :: sh2o
2490 real (kind=kind_phys) ,
intent(in) :: snowh
2491 real (kind=kind_phys),
intent(in) :: tg
2492 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: stc
2493 real (kind=kind_phys),
intent(in) :: ur
2494 real (kind=kind_phys),
intent(in) :: lat
2495 real (kind=kind_phys),
intent(in) :: z0m
2496 real (kind=kind_phys),
intent(in) :: zlvl
2497 integer ,
intent(in) :: vegtyp
2500 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(out) :: df
2501 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(out) :: hcpct
2502 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(out) :: snicev
2503 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(out) :: snliqv
2504 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(out) :: epore
2505 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(out) :: fact
2510 real (kind=kind_phys),
dimension(-nsnow+1: 0) :: cvsno
2511 real (kind=kind_phys),
dimension(-nsnow+1: 0) :: tksno
2512 real (kind=kind_phys),
dimension( 1:nsoil) :: sice
2513 real (kind=kind_phys),
parameter :: sbeta = -2.0
2518 call csnow (parameters,isnow ,nsnow ,nsoil ,snice ,snliq ,dzsnso , &
2519 tksno ,cvsno ,snicev ,snliqv ,epore )
2523 hcpct(iz) = cvsno(iz)
2529 sice(iz) = smc(iz) - sh2o(iz)
2530 hcpct(iz) = sh2o(iz)*cwat + (1.0-parameters%smcmax(iz))*parameters%csoil &
2531 + (parameters%smcmax(iz)-smc(iz))*cpair + sice(iz)*cice
2532 call tdfcnd (parameters,iz,df(iz), smc(iz), sh2o(iz))
2535 if ( parameters%urban_flag )
then
2546 df(1) = df(1) * exp(sbeta * shdfac)
2553 if(stc(iz) > tfrz)
then
2565 do iz = isnow+1,nsoil
2566 fact(iz) = dt/(hcpct(iz)*dzsnso(iz))
2572 df(1) = (df(1)*dzsnso(1)+0.35*snowh) / (snowh +dzsnso(1))
2574 df(1) = (df(1)*dzsnso(1)+df(0)*dzsnso(0)) / (dzsnso(0)+dzsnso(1))
2584 subroutine csnow (parameters,isnow ,nsnow ,nsoil ,snice ,snliq ,dzsnso , & !in
2585 tksno ,cvsno ,snicev ,snliqv ,epore )
2593 type (noahmp_parameters),
intent(in) :: parameters
2594 integer,
intent(in) :: isnow
2595 integer ,
intent(in) :: nsnow
2596 integer ,
intent(in) :: nsoil
2597 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(in) :: snice
2598 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(in) :: snliq
2599 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: dzsnso
2603 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(out) :: cvsno
2604 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(out) :: tksno
2605 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(out) :: snicev
2606 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(out) :: snliqv
2607 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(out) :: epore
2612 real (kind=kind_phys),
dimension(-nsnow+1: 0) :: bdsnoi
2618 snicev(iz) = min(1., snice(iz)/(dzsnso(iz)*denice) )
2619 epore(iz) = 1. - snicev(iz)
2620 snliqv(iz) = min(epore(iz),snliq(iz)/(dzsnso(iz)*denh2o))
2624 bdsnoi(iz) = (snice(iz)+snliq(iz))/dzsnso(iz)
2625 cvsno(iz) = cice*snicev(iz)+cwat*snliqv(iz)
2635 tksno(iz) = 2.576e-6*bdsnoi(iz)**2. + 0.074
2639 end subroutine csnow
2646 subroutine tdfcnd (parameters, isoil, df, smc, sh2o)
2655 type (noahmp_parameters),
intent(in) :: parameters
2656 integer,
intent(in) :: isoil
2657 real (kind=kind_phys),
intent(in) :: smc
2658 real (kind=kind_phys),
intent(in) :: sh2o
2659 real (kind=kind_phys),
intent(out) :: df
2662 real (kind=kind_phys) :: ake
2663 real (kind=kind_phys) :: gammd
2664 real (kind=kind_phys) :: thkdry
2665 real (kind=kind_phys) :: thko
2666 real (kind=kind_phys) :: thkqtz
2667 real (kind=kind_phys) :: thksat
2668 real (kind=kind_phys) :: thks
2669 real (kind=kind_phys) :: thkw
2670 real (kind=kind_phys) :: satratio
2671 real (kind=kind_phys) :: xu
2672 real (kind=kind_phys) :: xunfroz
2701 satratio = smc / parameters%smcmax(isoil)
2710 thks = (thkqtz ** parameters%quartz(isoil))* (thko ** (1. - parameters%quartz(isoil)))
2714 if(smc > 0.) xunfroz = sh2o / smc
2716 xu = xunfroz * parameters%smcmax(isoil)
2719 thksat = thks ** (1. - parameters%smcmax(isoil))* tkice ** (parameters%smcmax(isoil) - xu)* thkw ** &
2723 gammd = (1. - parameters%smcmax(isoil))*2700.
2725 thkdry = (0.135* gammd+ 64.7)/ (2700. - 0.947* gammd)
2727 if ( (sh2o + 0.0005) < smc )
then
2737 if ( satratio > 0.1 )
then
2739 ake = log10(satratio) + 1.0
2750 df = ake * (thksat - thkdry) + thkdry
2759 subroutine radiation (parameters,vegtyp ,ist ,ice ,nsoil , & !in
2760 sneqvo ,sneqv ,dt ,cosz ,snowh , & !in
2761 tg ,tv ,fsno ,qsnow ,fwet , & !in
2762 elai ,esai ,smc ,solad ,solai , & !in
2763 fveg ,iloc ,jloc , & !in
2764 albold ,tauss , & !inout
2765 fsun ,laisun ,laisha ,parsun ,parsha , & !out
2766 sav ,sag ,fsr ,fsa ,fsrv , &
2767 fsrg ,albd ,albi ,albsnd ,albsni ,bgap ,wgap)
2772 type (noahmp_parameters),
intent(in) :: parameters
2773 integer,
intent(in) :: iloc
2774 integer,
intent(in) :: jloc
2775 integer,
intent(in) :: vegtyp
2776 integer,
intent(in) :: ist
2777 integer,
intent(in) :: ice
2778 integer,
intent(in) :: nsoil
2780 real (kind=kind_phys),
intent(in) :: dt
2781 real (kind=kind_phys),
intent(in) :: qsnow
2782 real (kind=kind_phys),
intent(in) :: sneqvo
2783 real (kind=kind_phys),
intent(in) :: sneqv
2784 real (kind=kind_phys),
intent(in) :: snowh
2785 real (kind=kind_phys),
intent(in) :: cosz
2786 real (kind=kind_phys),
intent(in) :: tg
2787 real (kind=kind_phys),
intent(in) :: tv
2788 real (kind=kind_phys),
intent(in) :: elai
2789 real (kind=kind_phys),
intent(in) :: esai
2790 real (kind=kind_phys),
intent(in) :: fwet
2791 real (kind=kind_phys),
dimension(1:nsoil),
intent(in) :: smc
2792 real (kind=kind_phys),
dimension(1:2) ,
intent(in) :: solad
2793 real (kind=kind_phys),
dimension(1:2) ,
intent(in) :: solai
2794 real (kind=kind_phys),
intent(in) :: fsno
2795 real (kind=kind_phys),
intent(in) :: fveg
2798 real (kind=kind_phys),
intent(inout) :: albold
2799 real (kind=kind_phys),
intent(inout) :: tauss
2802 real (kind=kind_phys),
intent(out) :: fsun
2803 real (kind=kind_phys),
intent(out) :: laisun
2804 real (kind=kind_phys),
intent(out) :: laisha
2805 real (kind=kind_phys),
intent(out) :: parsun
2806 real (kind=kind_phys),
intent(out) :: parsha
2807 real (kind=kind_phys),
intent(out) :: sav
2808 real (kind=kind_phys),
intent(out) :: sag
2809 real (kind=kind_phys),
intent(out) :: fsa
2810 real (kind=kind_phys),
intent(out) :: fsr
2813 real (kind=kind_phys),
intent(out) :: fsrv
2814 real (kind=kind_phys),
intent(out) :: fsrg
2815 real (kind=kind_phys),
intent(out) :: bgap
2816 real (kind=kind_phys),
intent(out) :: wgap
2817 real (kind=kind_phys),
dimension(1:2),
intent(out) :: albsnd
2818 real (kind=kind_phys),
dimension(1:2),
intent(out) :: albsni
2822 real (kind=kind_phys) :: fage
2823 real (kind=kind_phys),
dimension(1:2) :: albgrd
2824 real (kind=kind_phys),
dimension(1:2) :: albgri
2825 real (kind=kind_phys),
dimension(1:2) :: albd
2826 real (kind=kind_phys),
dimension(1:2) :: albi
2827 real (kind=kind_phys),
dimension(1:2) :: fabd
2828 real (kind=kind_phys),
dimension(1:2) :: fabi
2829 real (kind=kind_phys),
dimension(1:2) :: ftdd
2830 real (kind=kind_phys),
dimension(1:2) :: ftid
2831 real (kind=kind_phys),
dimension(1:2) :: ftii
2833 real (kind=kind_phys),
dimension(1:2) :: frevi
2834 real (kind=kind_phys),
dimension(1:2) :: frevd
2835 real (kind=kind_phys),
dimension(1:2) :: fregi
2836 real (kind=kind_phys),
dimension(1:2) :: fregd
2839 real (kind=kind_phys) :: fsha
2840 real (kind=kind_phys) :: vai
2842 real (kind=kind_phys),
parameter :: mpe = 1.e-6
2849 call albedo (parameters,vegtyp ,ist ,ice ,nsoil , &
2850 dt ,cosz ,fage ,elai ,esai , &
2851 tg ,tv ,snowh ,fsno ,fwet , &
2852 smc ,sneqvo ,sneqv ,qsnow ,fveg , &
2855 albgrd ,albgri ,albd ,albi ,fabd , &
2856 fabi ,ftdd ,ftid ,ftii ,fsun , &
2857 frevi ,frevd ,fregd ,fregi ,bgap , &
2858 wgap ,albsnd ,albsni )
2866 if (vai .gt. 0.)
then
2872 call surrad (parameters,mpe ,fsun ,fsha ,elai ,vai , &
2873 laisun ,laisha ,solad ,solai ,fabd , &
2874 fabi ,ftdd ,ftid ,ftii ,albgrd , &
2875 albgri ,albd ,albi ,iloc ,jloc , &
2876 parsun ,parsha ,sav ,sag ,fsa , &
2878 frevi ,frevd ,fregd ,fregi ,fsrv , &
2889 subroutine albedo (parameters,vegtyp ,ist ,ice ,nsoil , & !in
2890 dt ,cosz ,fage ,elai ,esai , & !in
2891 tg ,tv ,snowh ,fsno ,fwet , & !in
2892 smc ,sneqvo ,sneqv ,qsnow ,fveg , & !in
2894 albold ,tauss , & !inout
2895 albgrd ,albgri ,albd ,albi ,fabd , & !out
2896 fabi ,ftdd ,ftid ,ftii ,fsun , & !out
2897 frevi ,frevd ,fregd ,fregi ,bgap , & !out
2898 wgap ,albsnd ,albsni )
2908 type (noahmp_parameters),
intent(in) :: parameters
2909 integer,
intent(in) :: iloc
2910 integer,
intent(in) :: jloc
2911 integer,
intent(in) :: nsoil
2912 integer,
intent(in) :: vegtyp
2913 integer,
intent(in) :: ist
2914 integer,
intent(in) :: ice
2916 real (kind=kind_phys),
intent(in) :: dt
2917 real (kind=kind_phys),
intent(in) :: qsnow
2918 real (kind=kind_phys),
intent(in) :: cosz
2919 real (kind=kind_phys),
intent(in) :: snowh
2920 real (kind=kind_phys),
intent(in) :: tg
2921 real (kind=kind_phys),
intent(in) :: tv
2922 real (kind=kind_phys),
intent(in) :: elai
2923 real (kind=kind_phys),
intent(in) :: esai
2924 real (kind=kind_phys),
intent(in) :: fsno
2925 real (kind=kind_phys),
intent(in) :: fwet
2926 real (kind=kind_phys),
intent(in) :: sneqvo
2927 real (kind=kind_phys),
intent(in) :: sneqv
2928 real (kind=kind_phys),
intent(in) :: fveg
2929 real (kind=kind_phys),
dimension(1:nsoil),
intent(in) :: smc
2932 real (kind=kind_phys),
intent(inout) :: albold
2933 real (kind=kind_phys),
intent(inout) :: tauss
2936 real (kind=kind_phys),
dimension(1: 2),
intent(out) :: albgrd
2937 real (kind=kind_phys),
dimension(1: 2),
intent(out) :: albgri
2938 real (kind=kind_phys),
dimension(1: 2),
intent(out) :: albd
2939 real (kind=kind_phys),
dimension(1: 2),
intent(out) :: albi
2940 real (kind=kind_phys),
dimension(1: 2),
intent(out) :: fabd
2941 real (kind=kind_phys),
dimension(1: 2),
intent(out) :: fabi
2942 real (kind=kind_phys),
dimension(1: 2),
intent(out) :: ftdd
2943 real (kind=kind_phys),
dimension(1: 2),
intent(out) :: ftid
2944 real (kind=kind_phys),
dimension(1: 2),
intent(out) :: ftii
2945 real (kind=kind_phys),
intent(out) :: fsun
2947 real (kind=kind_phys),
dimension(1: 2),
intent(out) :: frevd
2948 real (kind=kind_phys),
dimension(1: 2),
intent(out) :: frevi
2949 real (kind=kind_phys),
dimension(1: 2),
intent(out) :: fregd
2950 real (kind=kind_phys),
dimension(1: 2),
intent(out) :: fregi
2951 real (kind=kind_phys),
intent(out) :: bgap
2952 real (kind=kind_phys),
intent(out) :: wgap
2958 real (kind=kind_phys) :: fage
2959 real (kind=kind_phys) :: alb
2964 real (kind=kind_phys) :: wl
2965 real (kind=kind_phys) :: ws
2966 real (kind=kind_phys) :: mpe
2968 real (kind=kind_phys),
dimension(1:2) :: rho
2969 real (kind=kind_phys),
dimension(1:2) :: tau
2970 real (kind=kind_phys),
dimension(1:2) :: ftdi
2971 real (kind=kind_phys),
dimension(1:2) :: albsnd
2972 real (kind=kind_phys),
dimension(1:2) :: albsni
2974 real (kind=kind_phys) :: vai
2975 real (kind=kind_phys) :: gdir
2976 real (kind=kind_phys) :: ext
3003 if (ib.eq.1) fsun = 0.
3006 if(cosz <= 0)
goto 100
3012 wl = elai / max(vai,mpe)
3013 ws = esai / max(vai,mpe)
3014 rho(ib) = max(parameters%rhol(ib)*wl+parameters%rhos(ib)*ws, mpe)
3015 tau(ib) = max(parameters%taul(ib)*wl+parameters%taus(ib)*ws, mpe)
3020 call snow_age (parameters,dt,tg,sneqvo,sneqv,tauss,fage)
3025 call snowalb_bats (parameters,nband, fsno,cosz,fage,albsnd,albsni)
3026 if(opt_alb == 2)
then
3027 call snowalb_class (parameters,nband,qsnow,dt,alb,albold,albsnd,albsni,iloc,jloc)
3033 call groundalb (parameters,nsoil ,nband ,ice ,ist , &
3034 fsno ,smc ,albsnd ,albsni ,cosz , &
3043 call twostream (parameters,ib ,ic ,vegtyp ,cosz ,vai , &
3044 fwet ,tv ,albgrd ,albgri ,rho , &
3045 tau ,fveg ,ist ,iloc ,jloc , &
3046 fabd ,albd ,ftdd ,ftid ,gdir , &
3047 frevd ,fregd ,bgap ,wgap)
3050 call twostream (parameters,ib ,ic ,vegtyp ,cosz ,vai , &
3051 fwet ,tv ,albgrd ,albgri ,rho , &
3052 tau ,fveg ,ist ,iloc ,jloc , &
3053 fabi ,albi ,ftdi ,ftii ,gdir , &
3054 frevi ,fregi ,bgap ,wgap)
3060 ext = gdir/cosz * sqrt(1.-rho(1)-tau(1))
3061 fsun = (1.-exp(-ext*vai)) / max(ext*vai,mpe)
3064 if (ext .lt. 0.01)
then
3079 subroutine surrad (parameters,mpe ,fsun ,fsha ,elai ,vai , & !in
3080 laisun ,laisha ,solad ,solai ,fabd , & !in
3081 fabi ,ftdd ,ftid ,ftii ,albgrd , & !in
3082 albgri ,albd ,albi ,iloc ,jloc , & !in
3083 parsun ,parsha ,sav ,sag ,fsa , & !out
3085 frevi ,frevd ,fregd ,fregi ,fsrv , &
3093 type (noahmp_parameters),
intent(in) :: parameters
3094 integer,
intent(in) :: iloc
3095 integer,
intent(in) :: jloc
3096 real (kind=kind_phys),
intent(in) :: mpe
3098 real (kind=kind_phys),
intent(in) :: fsun
3099 real (kind=kind_phys),
intent(in) :: fsha
3100 real (kind=kind_phys),
intent(in) :: elai
3101 real (kind=kind_phys),
intent(in) :: vai
3102 real (kind=kind_phys),
intent(in) :: laisun
3103 real (kind=kind_phys),
intent(in) :: laisha
3105 real (kind=kind_phys),
dimension(1:2),
intent(in) :: solad
3106 real (kind=kind_phys),
dimension(1:2),
intent(in) :: solai
3107 real (kind=kind_phys),
dimension(1:2),
intent(in) :: fabd
3108 real (kind=kind_phys),
dimension(1:2),
intent(in) :: fabi
3109 real (kind=kind_phys),
dimension(1:2),
intent(in) :: ftdd
3110 real (kind=kind_phys),
dimension(1:2),
intent(in) :: ftid
3111 real (kind=kind_phys),
dimension(1:2),
intent(in) :: ftii
3112 real (kind=kind_phys),
dimension(1:2),
intent(in) :: albgrd
3113 real (kind=kind_phys),
dimension(1:2),
intent(in) :: albgri
3114 real (kind=kind_phys),
dimension(1:2),
intent(in) :: albd
3115 real (kind=kind_phys),
dimension(1:2),
intent(in) :: albi
3117 real (kind=kind_phys),
dimension(1:2),
intent(in) :: frevd
3118 real (kind=kind_phys),
dimension(1:2),
intent(in) :: frevi
3119 real (kind=kind_phys),
dimension(1:2),
intent(in) :: fregd
3120 real (kind=kind_phys),
dimension(1:2),
intent(in) :: fregi
3124 real (kind=kind_phys),
intent(out) :: parsun
3125 real (kind=kind_phys),
intent(out) :: parsha
3126 real (kind=kind_phys),
intent(out) :: sav
3127 real (kind=kind_phys),
intent(out) :: sag
3128 real (kind=kind_phys),
intent(out) :: fsa
3129 real (kind=kind_phys),
intent(out) :: fsr
3130 real (kind=kind_phys),
intent(out) :: fsrv
3131 real (kind=kind_phys),
intent(out) :: fsrg
3137 real (kind=kind_phys) :: abs
3138 real (kind=kind_phys) :: rnir
3139 real (kind=kind_phys) :: rvis
3140 real (kind=kind_phys) :: laifra
3141 real (kind=kind_phys) :: trd
3142 real (kind=kind_phys) :: tri
3143 real (kind=kind_phys),
dimension(1:2) :: cad
3144 real (kind=kind_phys),
dimension(1:2) :: cai
3160 cad(ib) = solad(ib)*fabd(ib)
3161 cai(ib) = solai(ib)*fabi(ib)
3162 sav = sav + cad(ib) + cai(ib)
3163 fsa = fsa + cad(ib) + cai(ib)
3167 trd = solad(ib)*ftdd(ib)
3168 tri = solad(ib)*ftid(ib) + solai(ib)*ftii(ib)
3172 abs = trd*(1.-albgrd(ib)) + tri*(1.-albgri(ib))
3180 laifra = elai / max(vai,mpe)
3181 if (fsun .gt. 0.)
then
3182 parsun = (cad(1)+fsun*cai(1)) * laifra / max(laisun,mpe)
3183 parsha = (fsha*cai(1))*laifra / max(laisha,mpe)
3186 parsha = (cad(1)+cai(1))*laifra /max(laisha,mpe)
3191 rvis = albd(1)*solad(1) + albi(1)*solai(1)
3192 rnir = albd(2)*solad(2) + albi(2)*solai(2)
3196 fsrv = frevd(1)*solad(1)+frevi(1)*solai(1)+frevd(2)*solad(2)+frevi(2)*solai(2)
3197 fsrg = fregd(1)*solad(1)+fregi(1)*solai(1)+fregd(2)*solad(2)+fregi(2)*solai(2)
3206 subroutine snow_age (parameters,dt,tg,sneqvo,sneqv,tauss,fage)
3213 type (noahmp_parameters),
intent(in) :: parameters
3214 real (kind=kind_phys),
intent(in) :: dt
3215 real (kind=kind_phys),
intent(in) :: tg
3216 real (kind=kind_phys),
intent(in) :: sneqvo
3217 real (kind=kind_phys),
intent(in) :: sneqv
3220 real (kind=kind_phys),
intent(out) :: fage
3223 real (kind=kind_phys),
intent(inout) :: tauss
3225 real (kind=kind_phys) :: tage
3226 real (kind=kind_phys) :: age1
3227 real (kind=kind_phys) :: age2
3228 real (kind=kind_phys) :: age3
3229 real (kind=kind_phys) :: dela
3230 real (kind=kind_phys) :: sge
3231 real (kind=kind_phys) :: dels
3232 real (kind=kind_phys) :: dela0
3233 real (kind=kind_phys) :: arg
3237 if(sneqv.le.0.0)
then
3240 dela0 = dt/parameters%tau0
3241 arg = parameters%grain_growth*(1./tfrz-1./tg)
3243 age2 = exp(amin1(0.,parameters%extra_growth*arg))
3244 age3 = parameters%dirt_soot
3245 tage = age1+age2+age3
3247 dels = amax1(0.0,sneqv-sneqvo) / parameters%swemx
3248 sge = (tauss+dela)*(1.0-dels)
3249 tauss = amax1(0.,sge)
3252 fage= tauss/(tauss+1.)
3266 type (noahmp_parameters),
intent(in) :: parameters
3267 integer,
intent(in) :: nband
3269 real (kind=kind_phys),
intent(in) :: cosz
3270 real (kind=kind_phys),
intent(in) :: fsno
3271 real (kind=kind_phys),
intent(in) :: fage
3275 real (kind=kind_phys),
dimension(1:2),
intent(out) :: albsnd
3276 real (kind=kind_phys),
dimension(1:2),
intent(out) :: albsni
3282 real (kind=kind_phys) :: fzen
3283 real (kind=kind_phys) :: cf1
3284 real (kind=kind_phys) :: sl2
3285 real (kind=kind_phys) :: sl1
3286 real (kind=kind_phys) :: sl
3294 albsnd(1: nband) = 0.
3295 albsni(1: nband) = 0.
3299 sl=parameters%bats_cosz
3302 cf1=((1.+sl1)/(1.+sl2*cosz)-sl1)
3305 albsni(1)=parameters%bats_vis_new*(1.-parameters%bats_vis_age*fage)
3306 albsni(2)=parameters%bats_nir_new*(1.-parameters%bats_nir_age*fage)
3308 albsnd(1)=albsni(1)+parameters%bats_vis_dir*fzen*(1.-albsni(1))
3309 albsnd(2)=albsni(2)+parameters%bats_vis_dir*fzen*(1.-albsni(2))
3317 subroutine snowalb_class (parameters,nband,qsnow,dt,alb,albold,albsnd,albsni,iloc,jloc)
3323 type (noahmp_parameters),
intent(in) :: parameters
3324 integer,
intent(in) :: iloc
3325 integer,
intent(in) :: jloc
3326 integer,
intent(in) :: nband
3328 real (kind=kind_phys),
intent(in) :: qsnow
3329 real (kind=kind_phys),
intent(in) :: dt
3330 real (kind=kind_phys),
intent(in) :: albold
3334 real (kind=kind_phys),
intent(inout) :: alb
3337 real (kind=kind_phys),
dimension(1:2),
intent(out) :: albsnd
3338 real (kind=kind_phys),
dimension(1:2),
intent(out) :: albsni
3347 albsnd(1: nband) = 0.
3348 albsni(1: nband) = 0.
3352 alb = 0.55 + (albold-0.55) * exp(-0.01*dt/3600.)
3357 if (qsnow > 0.)
then
3358 alb = alb + min(qsnow,parameters%swemx/dt) * (0.84-alb)/(parameters%swemx/dt)
3372 subroutine groundalb (parameters,nsoil ,nband ,ice ,ist , & !in
3373 fsno ,smc ,albsnd ,albsni ,cosz , & !in
3374 tg ,iloc ,jloc , & !in
3381 type (noahmp_parameters),
intent(in) :: parameters
3382 integer,
intent(in) :: iloc
3383 integer,
intent(in) :: jloc
3384 integer,
intent(in) :: nsoil
3385 integer,
intent(in) :: nband
3386 integer,
intent(in) :: ice
3387 integer,
intent(in) :: ist
3388 real (kind=kind_phys),
intent(in) :: fsno
3389 real (kind=kind_phys),
intent(in) :: tg
3390 real (kind=kind_phys),
intent(in) :: cosz
3391 real (kind=kind_phys),
dimension(1:nsoil),
intent(in) :: smc
3392 real (kind=kind_phys),
dimension(1: 2),
intent(in) :: albsnd
3393 real (kind=kind_phys),
dimension(1: 2),
intent(in) :: albsni
3397 real (kind=kind_phys),
dimension(1: 2),
intent(out) :: albgrd
3398 real (kind=kind_phys),
dimension(1: 2),
intent(out) :: albgri
3403 real (kind=kind_phys) :: inc
3404 real (kind=kind_phys) :: albsod
3405 real (kind=kind_phys) :: albsoi
3409 inc = max(0.11-0.40*smc(1), 0.)
3410 if (ist .eq. 1)
then
3411 albsod = min(parameters%albsat(ib)+inc,parameters%albdry(ib))
3413 else if (tg .gt. tfrz)
then
3414 albsod = 0.06/(max(0.01,cosz)**1.7 + 0.15)
3417 albsod = parameters%alblak(ib)
3428 albgrd(ib) = albsod*(1.-fsno) + albsnd(ib)*fsno
3429 albgri(ib) = albsoi*(1.-fsno) + albsni(ib)*fsno
3442 subroutine twostream (parameters,ib ,ic ,vegtyp ,cosz ,vai , & !in
3443 fwet ,t ,albgrd ,albgri ,rho , & !in
3444 tau ,fveg ,ist ,iloc ,jloc , & !in
3445 fab ,fre ,ftd ,fti ,gdir , & !)
3446 frev ,freg ,bgap ,wgap)
3459 type (noahmp_parameters),
intent(in) :: parameters
3460 integer,
intent(in) :: iloc
3461 integer,
intent(in) :: jloc
3462 integer,
intent(in) :: ist
3463 integer,
intent(in) :: ib
3464 integer,
intent(in) :: ic
3465 integer,
intent(in) :: vegtyp
3467 real (kind=kind_phys),
intent(in) :: cosz
3468 real (kind=kind_phys),
intent(in) :: vai
3469 real (kind=kind_phys),
intent(in) :: fwet
3470 real (kind=kind_phys),
intent(in) :: t
3472 real (kind=kind_phys),
dimension(1:2),
intent(in) :: albgrd
3473 real (kind=kind_phys),
dimension(1:2),
intent(in) :: albgri
3474 real (kind=kind_phys),
dimension(1:2),
intent(in) :: rho
3475 real (kind=kind_phys),
dimension(1:2),
intent(in) :: tau
3476 real (kind=kind_phys),
intent(in) :: fveg
3480 real (kind=kind_phys),
dimension(1:2),
intent(out) :: fab
3481 real (kind=kind_phys),
dimension(1:2),
intent(out) :: fre
3482 real (kind=kind_phys),
dimension(1:2),
intent(out) :: ftd
3483 real (kind=kind_phys),
dimension(1:2),
intent(out) :: fti
3484 real (kind=kind_phys),
intent(out) :: gdir
3485 real (kind=kind_phys),
dimension(1:2),
intent(out) :: frev
3486 real (kind=kind_phys),
dimension(1:2),
intent(out) :: freg
3489 real (kind=kind_phys) :: omega
3490 real (kind=kind_phys) :: omegal
3491 real (kind=kind_phys) :: betai
3492 real (kind=kind_phys) :: betail
3493 real (kind=kind_phys) :: betad
3494 real (kind=kind_phys) :: betadl
3495 real (kind=kind_phys) :: ext
3496 real (kind=kind_phys) :: avmu
3498 real (kind=kind_phys) :: coszi
3499 real (kind=kind_phys) :: asu
3500 real (kind=kind_phys) :: chil
3502 real (kind=kind_phys) :: tmp0,tmp1,tmp2,tmp3,tmp4,tmp5,tmp6,tmp7,tmp8,tmp9
3503 real (kind=kind_phys) :: p1,p2,p3,p4,s1,s2,u1,u2,u3
3504 real (kind=kind_phys) :: b,c,d,d1,d2,f,h,h1,h2,h3,h4,h5,h6,h7,h8,h9,h10
3505 real (kind=kind_phys) :: phi1,phi2,sigma
3506 real (kind=kind_phys) :: ftds,ftis,fres
3507 real (kind=kind_phys) :: denfveg
3508 real (kind=kind_phys) :: vai_spread
3510 real (kind=kind_phys) :: freveg,frebar,ftdveg,ftiveg,ftdbar,ftibar
3511 real (kind=kind_phys) :: thetaz
3517 real (kind=kind_phys),
parameter :: pai = 3.14159265
3518 real (kind=kind_phys) :: hd
3519 real (kind=kind_phys) :: bb
3520 real (kind=kind_phys) :: thetap
3521 real (kind=kind_phys) :: fa
3522 real (kind=kind_phys) :: newvai
3524 real (kind=kind_phys),
intent(inout) :: bgap
3525 real (kind=kind_phys),
intent(inout) :: wgap
3527 real (kind=kind_phys) :: kopen
3528 real (kind=kind_phys) :: gap
3537 if(opt_rad == 1)
then
3538 denfveg = -log(max(1.0-fveg,0.01))/(pai*parameters%rc**2)
3539 hd = parameters%hvt - parameters%hvb
3541 thetap = atan(bb/parameters%rc * tan(acos(max(0.01,cosz))) )
3543 bgap = exp(-denfveg * pai * parameters%rc**2/cos(thetap) )
3544 fa = vai/(1.33 * pai * parameters%rc**3.0 *(bb/parameters%rc)*denfveg)
3546 wgap = (1.0-bgap) * exp(-0.5*newvai/cosz)
3547 gap = min(1.0-fveg, bgap+wgap)
3552 if(opt_rad == 2)
then
3557 if(opt_rad == 3)
then
3570 coszi = max(0.001, cosz)
3571 chil = min( max(parameters%xl, -0.4), 0.6)
3572 if (abs(chil) .le. 0.01) chil = 0.01
3573 phi1 = 0.5 - 0.633*chil - 0.330*chil*chil
3574 phi2 = 0.877 * (1.-2.*phi1)
3575 gdir = phi1 + phi2*coszi
3577 avmu = ( 1. - phi1/phi2 * log((phi1+phi2)/phi1) ) / phi2
3578 omegal = rho(ib) + tau(ib)
3579 tmp0 = gdir + phi2*coszi
3581 asu = 0.5*omegal*gdir/tmp0 * ( 1.-tmp1/tmp0*log((tmp1+tmp0)/tmp1) )
3582 betadl = (1.+avmu*ext)/(omegal*avmu*ext)*asu
3583 betail = 0.5 * ( rho(ib)+tau(ib) + (rho(ib)-tau(ib)) &
3584 * ((1.+chil)/2.)**2 ) / omegal
3588 if (t .gt. tfrz)
then
3593 tmp0 = (1.-fwet)*omegal + fwet*parameters%omegas(ib)
3594 tmp1 = ( (1.-fwet)*omegal*betadl + fwet*parameters%omegas(ib)*parameters%betads ) / tmp0
3595 tmp2 = ( (1.-fwet)*omegal*betail + fwet*parameters%omegas(ib)*parameters%betais ) / tmp0
3604 b = 1. - omega + omega*betai
3607 d = tmp0 * omega*betad
3608 f = tmp0 * omega*(1.-betad)
3610 h = sqrt(tmp1) / avmu
3611 sigma = tmp0*tmp0 - tmp1
3612 if ( abs(sigma) < 1.e-6 ) sigma = sign(1.e-6_kind_phys,sigma)
3620 u1 = b - c/albgrd(ib)
3621 u2 = b - c*albgrd(ib)
3622 u3 = f + c*albgrd(ib)
3624 u1 = b - c/albgri(ib)
3625 u2 = b - c*albgri(ib)
3626 u3 = f + c*albgri(ib)
3630 d1 = p1*tmp2/s1 - p2*tmp3*s1
3633 d2 = tmp4/s1 - tmp5*s1
3635 tmp6 = d - h1*p3/sigma
3636 tmp7 = ( d - c - h1/sigma*(u1+tmp0) ) * s2
3637 h2 = ( tmp6*tmp2/s1 - p2*tmp7 ) / d1
3638 h3 = - ( tmp6*tmp3*s1 - p1*tmp7 ) / d1
3641 tmp9 = ( u3 - tmp8*(u2-tmp0) ) * s2
3642 h5 = - ( tmp8*tmp4/s1 + tmp9 ) / d2
3643 h6 = ( tmp8*tmp5*s1 + tmp9 ) / d2
3644 h7 = (c*tmp2) / (d1*s1)
3645 h8 = (-c*tmp3*s1) / d1
3647 h10 = (-tmp5*s1) / d2
3653 ftds = s2 *(1.0-gap) + gap
3654 ftis = (h4*s2/sigma + h5*s1 + h6/s1)*(1.0-gap)
3657 ftis = (h9*s1 + h10/s1)*(1.0-kopen) + kopen
3665 fres = (h1/sigma + h2 + h3)*(1.0-gap ) + albgrd(ib)*gap
3666 freveg = (h1/sigma + h2 + h3)*(1.0-gap )
3667 frebar = albgrd(ib)*gap
3669 fres = (h7 + h8) *(1.0-kopen) + albgri(ib)*kopen
3670 freveg = (h7 + h8) *(1.0-kopen) + albgri(ib)*kopen
3679 fab(ib) = 1. - fre(ib) - (1.-albgrd(ib))*ftd(ib) &
3680 - (1.-albgri(ib))*fti(ib)
3694 subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & !in
3695 dt ,sav ,sag ,lwdn ,ur , & !in
3696 uu ,vv ,sfctmp ,thair ,qair , & !in
3697 eair ,rhoair ,snowh ,vai ,gammav ,gammag, & !in
3698 fwet ,laisun ,laisha ,cwp ,dzsnso , & !in
3699 zlvl ,zpd ,z0m ,fveg ,shdfac, & !in
3700 z0mg ,emv ,emg ,canliq ,fsno, & !in
3701 canice ,stc ,df ,rssun ,rssha , & !in
3702 rsurf ,latheav ,latheag ,parsun ,parsha ,igs , & !in
3703 foln ,co2air ,o2air ,btran ,sfcprs , & !in
3704 rhsur ,iloc ,jloc ,q2 ,pahv ,pahg , & !in
3705 thsfc_loc, prslkix,prsik1x,prslk1x, garea1, & !in
3706 pblhx ,iz0tlnd ,itime ,psi_opt ,ep_1, ep_2, epsm1, cp, &
3707 eah ,tah ,tv ,tg ,cm,ustarx,& !inout
3709 ch ,dx ,dz8w ,errmsg ,errflg , & !inout
3711 ch ,dx ,dz8w , & !inout
3713 tauxv ,tauyv ,irg ,irc ,shg , & !out
3714 shc ,evg ,evc ,tr ,gh , & !out
3715 t2mv ,psnsun ,psnsha ,canhs , & !out
3717 qc ,qsfc ,psfc , & !in
3718 q2v ,cah2 ,chleaf ,chuc , & !inout
3729 use funcphys,
only : fpvs
3733 type (noahmp_parameters),
intent(in) :: parameters
3734 integer,
intent(in) :: iloc
3735 integer,
intent(in) :: jloc
3736 logical,
intent(in) :: veg
3737 integer,
intent(in) :: nsnow
3738 integer,
intent(in) :: nsoil
3739 integer,
intent(in) :: isnow
3740 integer,
intent(in) :: vegtyp
3741 real (kind=kind_phys),
intent(in) :: fveg
3742 real (kind=kind_phys),
intent(in) :: sav
3743 real (kind=kind_phys),
intent(in) :: sag
3744 real (kind=kind_phys),
intent(in) :: lwdn
3745 real (kind=kind_phys),
intent(in) :: ur
3746 real (kind=kind_phys),
intent(in) :: uu
3747 real (kind=kind_phys),
intent(in) :: vv
3748 real (kind=kind_phys),
intent(in) :: sfctmp
3749 real (kind=kind_phys),
intent(in) :: thair
3750 real (kind=kind_phys),
intent(in) :: eair
3751 real (kind=kind_phys),
intent(in) :: qair
3752 real (kind=kind_phys),
intent(in) :: rhoair
3753 real (kind=kind_phys),
intent(in) :: dt
3754 real (kind=kind_phys),
intent(in) :: fsno
3756 real (kind=kind_phys) ,
intent(in) :: pblhx
3757 real (kind=kind_phys) ,
intent(in) :: ep_1
3758 real (kind=kind_phys) ,
intent(in) :: ep_2
3759 real (kind=kind_phys) ,
intent(in) :: epsm1
3760 real (kind=kind_phys) ,
intent(in) :: cp
3761 integer ,
intent(in) :: iz0tlnd
3762 integer ,
intent(in) :: itime
3763 integer ,
intent(in) :: psi_opt
3766 real (kind=kind_phys),
intent(in) :: snowh
3767 real (kind=kind_phys),
intent(in) :: fwet
3768 real (kind=kind_phys),
intent(in) :: cwp
3770 real (kind=kind_phys),
intent(in) :: vai
3771 real (kind=kind_phys),
intent(in) :: laisun
3772 real (kind=kind_phys),
intent(in) :: laisha
3773 real (kind=kind_phys),
intent(in) :: zlvl
3774 real (kind=kind_phys),
intent(in) :: zpd
3775 real (kind=kind_phys),
intent(in) :: z0m
3776 real (kind=kind_phys),
intent(in) :: z0mg
3777 real (kind=kind_phys),
intent(in) :: emv
3778 real (kind=kind_phys),
intent(in) :: emg
3780 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: stc
3781 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: df
3782 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: dzsnso
3783 real (kind=kind_phys),
intent(in) :: canliq
3784 real (kind=kind_phys),
intent(in) :: canice
3785 real (kind=kind_phys),
intent(in) :: rsurf
3788 real (kind=kind_phys),
intent(in) :: gammav
3789 real (kind=kind_phys),
intent(in) :: latheav
3790 real (kind=kind_phys),
intent(in) :: gammag
3791 real (kind=kind_phys),
intent(in) :: latheag
3792 real (kind=kind_phys),
intent(in) :: parsun
3793 real (kind=kind_phys),
intent(in) :: parsha
3794 real (kind=kind_phys),
intent(in) :: foln
3795 real (kind=kind_phys),
intent(in) :: co2air
3796 real (kind=kind_phys),
intent(in) :: o2air
3797 real (kind=kind_phys),
intent(in) :: igs
3798 real (kind=kind_phys),
intent(in) :: sfcprs
3799 real (kind=kind_phys),
intent(in) :: btran
3800 real (kind=kind_phys),
intent(in) :: rhsur
3802 real (kind=kind_phys) ,
intent(in) :: qc
3803 real (kind=kind_phys) ,
intent(in) :: psfc
3804 real (kind=kind_phys) ,
intent(in) :: dx
3805 real (kind=kind_phys) ,
intent(in) :: q2
3806 real (kind=kind_phys) ,
intent(in) :: dz8w
3807 real (kind=kind_phys) ,
intent(inout) :: qsfc
3808 real (kind=kind_phys),
intent(in) :: pahv
3809 real (kind=kind_phys),
intent(in) :: pahg
3812 real (kind=kind_phys),
intent(inout) :: eah
3813 real (kind=kind_phys),
intent(inout) :: tah
3814 real (kind=kind_phys),
intent(inout) :: tv
3815 real (kind=kind_phys),
intent(inout) :: tg
3816 real (kind=kind_phys),
intent(inout) :: cm
3817 real (kind=kind_phys),
intent(inout) :: ch
3820 character(len=*),
intent(inout) :: errmsg
3821 integer,
intent(inout) :: errflg
3826 real (kind=kind_phys),
intent(out) :: tauxv
3827 real (kind=kind_phys),
intent(out) :: tauyv
3828 real (kind=kind_phys),
intent(out) :: irc
3829 real (kind=kind_phys),
intent(out) :: shc
3830 real (kind=kind_phys),
intent(out) :: evc
3831 real (kind=kind_phys),
intent(out) :: irg
3832 real (kind=kind_phys),
intent(out) :: shg
3833 real (kind=kind_phys),
intent(out) :: evg
3834 real (kind=kind_phys),
intent(out) :: tr
3835 real (kind=kind_phys),
intent(out) :: gh
3836 real (kind=kind_phys),
intent(out) :: t2mv
3837 real (kind=kind_phys),
intent(out) :: psnsun
3838 real (kind=kind_phys),
intent(out) :: psnsha
3839 real (kind=kind_phys),
intent(out) :: chleaf
3840 real (kind=kind_phys),
intent(out) :: chuc
3841 real (kind=kind_phys),
intent(out) :: canhs
3842 real (kind=kind_phys),
intent(out) :: q2v
3843 real (kind=kind_phys),
intent(out) :: rb
3844 real (kind=kind_phys) :: cah
3845 real (kind=kind_phys) :: u10v
3846 real (kind=kind_phys) :: v10v
3847 real (kind=kind_phys) :: wspd
3850 real (kind=kind_phys) :: gdx
3851 real (kind=kind_phys) :: snwd
3854 real (kind=kind_phys) :: cw
3855 real (kind=kind_phys) :: fv
3856 real (kind=kind_phys) :: wstar
3857 real (kind=kind_phys) :: z0mo
3858 real (kind=kind_phys) :: z0h
3859 real (kind=kind_phys) :: z0hg
3860 real (kind=kind_phys) :: ramc
3861 real (kind=kind_phys) :: rahc
3862 real (kind=kind_phys) :: rawc
3863 real (kind=kind_phys) :: ramg
3864 real (kind=kind_phys) :: rahg
3865 real (kind=kind_phys) :: rawg
3867 real (kind=kind_phys),
intent(out) :: rssun
3868 real (kind=kind_phys),
intent(out) :: rssha
3870 real (kind=kind_phys) :: mol
3871 real (kind=kind_phys) :: dtv
3872 real (kind=kind_phys) :: dtg
3874 real (kind=kind_phys) :: air,cir
3875 real (kind=kind_phys) :: csh
3876 real (kind=kind_phys) :: cev
3877 real (kind=kind_phys) :: cgh
3878 real (kind=kind_phys) :: atr,ctr
3879 real (kind=kind_phys) :: ata,bta
3880 real (kind=kind_phys) :: aea,bea
3882 real (kind=kind_phys) :: estv
3883 real (kind=kind_phys) :: estg
3884 real (kind=kind_phys) :: destv
3885 real (kind=kind_phys) :: destg
3886 real (kind=kind_phys) :: esatw
3887 real (kind=kind_phys) :: esati
3888 real (kind=kind_phys) :: dsatw
3889 real (kind=kind_phys) :: dsati
3891 real (kind=kind_phys) :: fm
3892 real (kind=kind_phys) :: fh
3893 real (kind=kind_phys) :: fhg
3894 real (kind=kind_phys) :: fhgh
3895 real (kind=kind_phys) :: hcan
3897 real (kind=kind_phys) :: a
3898 real (kind=kind_phys) :: b
3899 real (kind=kind_phys) :: cvh
3900 real (kind=kind_phys) :: caw
3901 real (kind=kind_phys) :: ctw
3902 real (kind=kind_phys) :: cew
3903 real (kind=kind_phys) :: cgw
3904 real (kind=kind_phys) :: cond
3905 real (kind=kind_phys) :: uc
3906 real (kind=kind_phys) :: kh
3907 real (kind=kind_phys) :: h
3908 real (kind=kind_phys) :: hg
3909 real (kind=kind_phys) :: moz
3910 real (kind=kind_phys) :: mozg
3911 real (kind=kind_phys) :: mozold
3912 real (kind=kind_phys) :: fm2
3913 real (kind=kind_phys) :: fh2
3914 real (kind=kind_phys) :: ch2
3915 real (kind=kind_phys) :: thstar
3917 real (kind=kind_phys) :: fm10
3918 real (kind=kind_phys) :: rb1v
3919 real (kind=kind_phys) :: stress1v
3922 real (kind=kind_phys) :: flhcv
3923 real (kind=kind_phys) :: flqcv
3924 real (kind=kind_phys) :: wspdv
3926 real (kind=kind_phys) :: thvair
3927 real (kind=kind_phys) :: thah
3928 real (kind=kind_phys) :: rahc2
3929 real (kind=kind_phys) :: rawc2
3930 real (kind=kind_phys),
intent(out):: cah2
3931 real (kind=kind_phys) :: ch2v
3932 real (kind=kind_phys) :: cq2v
3933 real (kind=kind_phys) :: eah2
3934 real (kind=kind_phys) :: qfx
3935 real (kind=kind_phys) :: e1
3936 real (kind=kind_phys) :: hcv
3938 real (kind=kind_phys) :: vaie
3939 real (kind=kind_phys) :: laisune
3940 real (kind=kind_phys) :: laishae
3946 integer,
parameter :: niterc = 20
3948 integer,
parameter :: niterg = 5
3950 real (kind=kind_phys) :: mpe
3956 logical ,
intent(in ) :: thsfc_loc
3957 real (kind=kind_phys),
intent(in ) :: prslkix
3958 real (kind=kind_phys),
intent(in ) :: prsik1x
3959 real (kind=kind_phys),
intent(in ) :: prslk1x
3960 real (kind=kind_phys),
intent(in ) :: garea1
3961 real (kind=kind_phys),
intent(in ) :: shdfac
3962 real (kind=kind_phys),
intent(inout) :: ustarx
3963 real (kind=kind_phys),
intent( out) :: csigmaf1
3964 real (kind=kind_phys) :: csigmaf0
3966 real (kind=kind_phys) :: temptrs
3969 real (kind=kind_phys) :: t, tdc
3971 real(kind=kind_phys) :: evpot
3972 real(kind=kind_phys) :: fhi, qss, wrk
3973 real(kind=kind_phys),
parameter :: qmin=1.0e-8
3975 character(len=80) :: message
3977 tdc(t) = min( 50., max(-50.,(t-tfrz)) )
4001 laisune = min(6.,laisun)
4002 laishae = min(6.,laisha)
4007 call esat(t, esatw, esati, dsatw, dsati)
4016 qsfc = ep_2*eair/(psfc+epsm1*eair)
4019 hcan = parameters%hvt
4020 uc = ur*log(hcan/z0m)/log(zlvl/z0m)
4021 uc = ur*log((hcan-zpd+z0m)/z0m)/log(zlvl/z0m)
4022 if((hcan-zpd) <= 0.)
then
4023 write(message,*)
"critical problem: hcan <= zpd"
4025 errmsg = trim(message)
4027 call wrf_message ( message )
4029 write(message,*)
'i,j point=',iloc, jloc
4031 errmsg = trim(errmsg)//new_line(
'A')//trim(message)
4033 call wrf_message ( message )
4035 write(message,*)
'hcan =',hcan
4037 errmsg = trim(errmsg)//new_line(
'A')//trim(message)
4039 call wrf_message ( message )
4041 write(message,*)
'zpd =',zpd
4043 errmsg = trim(errmsg)//new_line(
'A')//trim(message)
4045 call wrf_message ( message )
4047 write (message, *)
'snowh =',snowh
4050 errmsg = trim(errmsg)//new_line(
'A')//trim(message)//new_line(
'A')//
"critical problem in module_sf_noahmplsm:vegeflux"
4053 call wrf_message ( message )
4054 call wrf_error_fatal (
"critical problem in module_sf_noahmplsm:vegeflux" )
4061 air = -emv*(1.+(1.-emv)*(1.-emg))*lwdn - emv*emg*sb*tg**4
4062 cir = (2.-emv*(1.-emg))*emv*sb
4064 if(opt_sfc == 4)
then
4067 snwd = snowh * 1000.0
4070 if (snowh .gt. 0.1)
then
4079 loop1:
do iter = 1, niterc
4088 call thermalz0(parameters,fveg,z0m,z0mg,zlvl,zpd,zpd,ustarx, &
4089 vegtyp,vaie,ur,csigmaf0,csigmaf1,temptrs,temptrs,temptrs,0, &
4092 call thermalz0(parameters,fveg,z0m,z0mg,zlvl,zpd,zpd,ustarx, &
4093 vegtyp,vaie,ur,csigmaf0,csigmaf1,temptrs,temptrs,temptrs,1, &
4098 if(opt_sfc == 1)
then
4099 call sfcdif1(parameters,iter ,sfctmp ,rhoair ,h ,qair , &
4100 zlvl ,zpd ,z0m ,z0h ,ur , &
4103 moz ,mozsgn ,fm ,fh ,fm2 ,fh2 ,fv, errmsg ,errflg ,&
4105 moz ,mozsgn ,fm ,fh ,fm2,fh2, fv, &
4109 if (errflg /= 0)
return
4113 if(opt_sfc == 2)
then
4114 call sfcdif2(parameters,iter ,z0m ,tah ,thair ,ur , &
4115 zlvl ,iloc ,jloc , &
4116 cm ,ch ,moz ,wstar , &
4124 if(opt_sfc == 3)
then
4125 call sfcdif3(parameters,iloc ,jloc ,iter ,sfctmp ,qair ,ur , &
4126 zlvl ,tah ,thsfc_loc,prslkix,prsik1x ,prslk1x ,z0m , &
4127 z0h, zpd ,snowh ,shdfac ,garea1 , &
4128 ustarx ,fm ,fh ,fm2 ,fh2 , &
4133 if(opt_sfc == 4)
then
4135 call sfcdif4(iloc ,jloc ,uu ,vv ,sfctmp , &
4136 sfcprs ,psfc ,pblhx ,gdx ,z0m , &
4138 itime ,snwd ,mnice ,psi_opt, &
4139 tah ,qair ,zlvl ,iz0tlnd,qsfc , &
4140 h ,qfx ,cm ,ch ,ch2v , &
4141 cq2v ,moz ,fv ,rb1v, fm, fh, &
4142 stress1v,fm10 ,fh2 ,wspdv ,flhcv ,flqcv)
4155 if(opt_sfc == 1 .or. opt_sfc == 2 .or. opt_sfc == 3)
then
4156 ramc = max(1.,1./(cm*ur))
4157 rahc = max(1.,1./(ch*ur))
4158 elseif(opt_sfc == 4)
then
4159 ramc = max(1.,1./(cm*wspdv) )
4160 rahc = max(1.,1./(ch*wspdv) )
4168 call ragrb(parameters,iter ,vaie ,rhoair ,hg ,tah , &
4169 zpd ,z0mg ,z0hg ,hcan ,uc , &
4170 z0h ,fv ,cwp ,vegtyp ,mpe , &
4171 tv ,mozg ,fhg ,fhgh ,iloc ,jloc , &
4172 ramg ,rahg ,rawg ,rb )
4177 call esat(t, esatw, esati, dsatw, dsati)
4189 if (opt_crs == 1)
then
4190 call stomata (parameters,vegtyp,mpe ,parsun ,foln ,iloc , jloc , &
4191 tv ,estv ,eah ,sfctmp,sfcprs, &
4192 o2air ,co2air,igs ,btran ,rb , &
4195 call stomata (parameters,vegtyp,mpe ,parsha ,foln ,iloc , jloc , &
4196 tv ,estv ,eah ,sfctmp,sfcprs, &
4197 o2air ,co2air,igs ,btran ,rb , &
4201 if (opt_crs == 2)
then
4202 call canres (parameters,ep_2, epsm1,parsun,tv ,btran ,eah ,sfcprs, &
4203 rssun ,psnsun,iloc ,jloc )
4205 call canres (parameters,ep_2, epsm1,parsha,tv ,btran ,eah ,sfcprs, &
4206 rssha ,psnsha,iloc ,jloc )
4215 cond = cah + cvh + cgh
4216 ata = (sfctmp*cah + tg*cgh) / cond
4218 csh = (1.-bta)*rhoair*cpair*cvh
4222 evpot= fveg*rhoair*cpair*vaie/rb * (estv-eah) / gammav
4224 if(evpot > 0. .and. fwet > 0.)
then
4226 cew = min(fwet,canliq*latheav/dt/evpot) * vaie/rb
4228 cew = min(fwet,canice*latheav/dt/evpot) * vaie/rb
4233 ctw = (1.-fwet)*(laisune/(rb+rssun) + laishae/(rb+rssha))
4234 cgw = 1./(rawg+rsurf)
4235 cond = caw + cew + ctw + cgw
4236 aea = (eair*caw + estg*cgw) / cond
4237 bea = (cew+ctw)/cond
4238 cev = (1.-bea)*cew*rhoair*cpair/gammav
4239 ctr = (1.-bea)*ctw*rhoair*cpair/gammav
4244 eah = aea + bea*estv
4246 irc = fveg*(air + cir*tv**4)
4247 shc = fveg*rhoair*cpair*cvh * ( tv-tah)
4248 evc = fveg*rhoair*cpair*cew * (estv-eah) / gammav
4249 tr = fveg*rhoair*cpair*ctw * (estv-eah) / gammav
4251 evc = min(canliq*latheav/dt,evc)
4253 evc = min(canice*latheav/dt,evc)
4257 hcv = fveg*(parameters%cbiom*vaie*cwat + canliq*cwat/denh2o + canice*cice/denice)
4259 b = sav-irc-shc-evc-tr+pahv
4261 a = fveg*(4.*cir*tv**3 + csh + (cev+ctr)*destv) + hcv/dt
4264 irc = irc + fveg*4.*cir*tv**3*dtv
4265 shc = shc + fveg*csh*dtv
4266 evc = evc + fveg*cev*destv*dtv
4267 tr = tr + fveg*ctr*destv*dtv
4275 h = rhoair*cpair*(tah - sfctmp) /rahc
4276 hg = rhoair*cpair*(tg - tah) /rahg
4279 qsfc = (ep_2*eah)/(sfcprs+epsm1*eah)
4281 if ( opt_sfc == 4 )
then
4282 qfx = (qsfc-qair)*rhoair*caw
4286 if (liter == 1)
then
4289 if (iter >= 5 .and. abs(dtv) <= 0.01 .and. liter == 0)
then
4297 air = - emg*(1.-emv)*lwdn - emg*emv*sb*tv**4
4299 csh = rhoair*cpair/rahg
4300 cev = rhoair*cpair / (gammag*(rawg+rsurf))
4301 cgh = 2.*df(isnow+1)/dzsnso(isnow+1)
4303 loop2:
do iter = 1, niterg
4306 call esat(t, esatw, esati, dsatw, dsati)
4315 irg = cir*tg**4 + air
4316 shg = csh * (tg - tah )
4317 evg = cev * (estg*rhsur - eah )
4318 gh = cgh * (tg - stc(isnow+1))
4320 b = sag-irg-shg-evg-gh+pahg
4321 a = 4.*cir*tg**3+csh+cev*destg+cgh
4324 irg = irg + 4.*cir*tg**3*dtg
4326 evg = evg + cev*destg*dtg
4336 if(opt_stc == 1 .or. opt_stc == 3)
then
4337 if (snowh > 0.05 .and. tg > tfrz)
then
4338 if(opt_stc == 1) tg = tfrz
4339 if(opt_stc == 3) tg = (1.-fsno)*tg + fsno*tfrz
4340 irg = cir*tg**4 - emg*(1.-emv)*lwdn - emg*emv*sb*tv**4
4341 shg = csh * (tg - tah)
4342 evg = cev * (estg*rhsur - eah)
4343 gh = sag+pahg - (irg+shg+evg)
4349 tauxv = -rhoair*cm*ur*uu
4350 tauyv = -rhoair*cm*ur*vv
4360 if (opt_sfc == 1 .or. opt_sfc == 2 )
then
4362 cah2 = fv*vkc/log((2.+z0h)/z0h)
4363 cah2 = fv*vkc/(log((2.+z0h)/z0h)-fh2)
4368 if (opt_sfc ==3)
then
4373 if (opt_sfc == 4 )
then
4374 rahc2 = max(1.,1./(ch2v*wspdv))
4377 cq2v = 1./max(1.,1./(cq2v*wspdv))
4380 if (cah2 .lt. 1.e-5 )
then
4385 t2mv = tah - (shg+shc/fveg)/(rhoair*cpair) * 1./cah2
4387 q2v = qsfc - ((evc+tr)/fveg+evg)/(latheav*rhoair) * 1./cq2v
4391 if(opt_diag ==3)
then
4392 if(opt_sfc == 1 .or. opt_sfc == 3)
then
4397 t2mv = tah*wrk + sfctmp*prslkix*fhi - (grav+grav)/cp
4399 t2mv = tah*wrk + sfctmp*fhi - (grav+grav)/cp
4402 if((evc+tr)/fveg+evg >= 0.)
then
4403 q2v = qsfc*wrk + max(qmin,qair)*fhi
4406 qss = ep_2 * qss / (psfc + epsm1 * qss)
4407 q2v= qss*wrk + max(qmin,qair)*fhi
4410 qss = ep_2 * qss / (psfc + epsm1 * qss)
4413 errmsg =
'Problem :opt_diag=3 is only applied for opt_sfc=1&3'
4430 subroutine bare_flux (parameters,nsnow ,nsoil ,isnow ,dt ,sag , & !in
4431 lwdn ,ur ,uu ,vv ,sfctmp , & !in
4432 thair ,qair ,eair ,rhoair ,snowh , & !in
4433 dzsnso ,zlvl ,zpd ,z0m ,fsno , & !in
4434 emg ,stc ,df ,rsurf ,lathea , & !in
4435 gamma ,rhsur ,iloc ,jloc ,q2 ,pahb , & !in
4436 thsfc_loc, prslkix,prsik1x,prslk1x,vegtyp,fveg,shdfac,garea1, & !in
4437 pblhx , iz0tlnd , itime ,psi_opt,ep_1,ep_2,epsm1,cp ,&
4439 tgb ,cm ,ch,ustarx,errmsg ,errflg , & !inout
4441 tgb ,cm ,ch,ustarx, & !inout
4443 tauxb ,tauyb ,irb ,shb ,evb , & !out
4445 ghb ,t2mb ,dx ,dz8w , & !out
4446 qc ,qsfc ,psfc , & !in
4456 use funcphys,
only : fpvs
4460 type (noahmp_parameters),
intent(in) :: parameters
4461 integer ,
intent(in) :: iloc
4462 integer ,
intent(in) :: jloc
4463 integer,
intent(in) :: nsnow
4464 integer,
intent(in) :: nsoil
4465 integer,
intent(in) :: isnow
4466 real (kind=kind_phys),
intent(in) :: dt
4467 real (kind=kind_phys),
intent(in) :: sag
4468 real (kind=kind_phys),
intent(in) :: lwdn
4469 real (kind=kind_phys),
intent(in) :: ur
4470 real (kind=kind_phys),
intent(in) :: uu
4471 real (kind=kind_phys),
intent(in) :: vv
4472 real (kind=kind_phys),
intent(in) :: sfctmp
4473 real (kind=kind_phys),
intent(in) :: thair
4474 real (kind=kind_phys),
intent(in) :: qair
4475 real (kind=kind_phys),
intent(in) :: eair
4476 real (kind=kind_phys),
intent(in) :: rhoair
4477 real (kind=kind_phys),
intent(in) :: snowh
4478 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: dzsnso
4479 real (kind=kind_phys),
intent(in) :: zlvl
4480 real (kind=kind_phys),
intent(in) :: zpd
4481 real (kind=kind_phys),
intent(in) :: z0m
4482 real (kind=kind_phys),
intent(in) :: emg
4483 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: stc
4484 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: df
4485 real (kind=kind_phys),
intent(in) :: rsurf
4486 real (kind=kind_phys),
intent(in) :: lathea
4487 real (kind=kind_phys),
intent(in) :: gamma
4488 real (kind=kind_phys),
intent(in) :: rhsur
4489 real (kind=kind_phys),
intent(in) :: fsno
4491 real (kind=kind_phys),
intent(in) :: pblhx
4492 real (kind=kind_phys),
intent(in) :: ep_1
4493 real (kind=kind_phys),
intent(in) :: ep_2
4494 real (kind=kind_phys),
intent(in) :: epsm1
4495 real (kind=kind_phys),
intent(in) :: cp
4496 integer,
intent(in) :: iz0tlnd
4497 integer,
intent(in) :: itime
4498 integer,
intent(in) :: psi_opt
4502 real (kind=kind_phys) ,
intent(in) :: qc
4503 real (kind=kind_phys) ,
intent(inout) :: qsfc
4504 real (kind=kind_phys) ,
intent(in) :: psfc
4505 real (kind=kind_phys) ,
intent(in) :: sfcprs
4506 real (kind=kind_phys) ,
intent(in) :: dx
4507 real (kind=kind_phys) ,
intent(in) :: q2
4508 real (kind=kind_phys) ,
intent(in) :: dz8w
4510 real (kind=kind_phys),
intent(in) :: pahb
4513 real (kind=kind_phys),
intent(inout) :: tgb
4514 real (kind=kind_phys),
intent(inout) :: cm
4515 real (kind=kind_phys),
intent(inout) :: ch
4517 character(len=*),
intent(inout) :: errmsg
4518 integer,
intent(inout) :: errflg
4524 real (kind=kind_phys),
intent(out) :: tauxb
4525 real (kind=kind_phys),
intent(out) :: tauyb
4526 real (kind=kind_phys),
intent(out) :: irb
4527 real (kind=kind_phys),
intent(out) :: shb
4528 real (kind=kind_phys),
intent(out) :: evb
4529 real (kind=kind_phys),
intent(out) :: ghb
4530 real (kind=kind_phys),
intent(out) :: t2mb
4532 real (kind=kind_phys),
intent(out) :: q2b
4533 real (kind=kind_phys) :: ehb
4534 real (kind=kind_phys) :: u10b
4535 real (kind=kind_phys) :: v10b
4536 real (kind=kind_phys) :: wspd
4541 real (kind=kind_phys) :: gdx
4542 real (kind=kind_phys) :: snwd
4545 real (kind=kind_phys) :: fm10
4546 real (kind=kind_phys) :: rb1b
4547 real (kind=kind_phys) :: stress1b
4549 real (kind=kind_phys) :: wspdb
4550 real (kind=kind_phys) :: flhcb
4551 real (kind=kind_phys) :: flqcb
4554 real (kind=kind_phys) :: taux
4555 real (kind=kind_phys) :: tauy
4556 real (kind=kind_phys) :: fira
4557 real (kind=kind_phys) :: fsh
4558 real (kind=kind_phys) :: fgev
4559 real (kind=kind_phys) :: ssoil
4560 real (kind=kind_phys) :: fire
4561 real (kind=kind_phys) :: trad
4562 real (kind=kind_phys) :: tah
4564 real (kind=kind_phys) :: cw
4565 real (kind=kind_phys) :: fv
4566 real (kind=kind_phys) :: wstar
4567 real (kind=kind_phys) :: z0mo
4568 real (kind=kind_phys) :: z0h
4569 real (kind=kind_phys) :: rb
4570 real (kind=kind_phys) :: ramb
4571 real (kind=kind_phys) :: rahb
4572 real (kind=kind_phys) :: rawb
4573 real (kind=kind_phys) :: mol
4574 real (kind=kind_phys) :: dtg
4576 real (kind=kind_phys) :: cir
4577 real (kind=kind_phys) :: csh
4578 real (kind=kind_phys) :: cev
4579 real (kind=kind_phys) :: cgh
4581 real(kind=kind_phys) :: kbsigmaf0
4582 real(kind=kind_phys) :: reynb
4586 real (kind=kind_phys) :: rahb2
4587 real (kind=kind_phys) :: rawb2
4588 real (kind=kind_phys),
intent(out) :: ehb2
4589 real (kind=kind_phys) :: ch2b
4590 real (kind=kind_phys) :: cq2b
4591 real (kind=kind_phys) :: thvair
4592 real (kind=kind_phys) :: thgh
4593 real (kind=kind_phys) :: emb
4594 real (kind=kind_phys) :: qfx
4595 real (kind=kind_phys) :: estg2
4596 real (kind=kind_phys) :: e1
4599 real (kind=kind_phys) :: estg
4600 real (kind=kind_phys) :: destg
4601 real (kind=kind_phys) :: esatw
4602 real (kind=kind_phys) :: esati
4603 real (kind=kind_phys) :: dsatw
4604 real (kind=kind_phys) :: dsati
4606 real (kind=kind_phys) :: a
4607 real (kind=kind_phys) :: b
4608 real (kind=kind_phys) :: h
4609 real (kind=kind_phys) :: moz
4610 real (kind=kind_phys) :: mozold
4611 real (kind=kind_phys) :: fm
4612 real (kind=kind_phys) :: fh
4614 real (kind=kind_phys) :: fm2
4615 real (kind=kind_phys) :: fh2
4616 real (kind=kind_phys) :: ch2
4620 real (kind=kind_phys) :: mpe
4628 logical ,
intent(in ) :: thsfc_loc
4629 real (kind=kind_phys),
intent(in ) :: prslkix
4630 real (kind=kind_phys),
intent(in ) :: prsik1x
4631 real (kind=kind_phys),
intent(in ) :: prslk1x
4632 integer ,
intent(in ) :: vegtyp
4633 real (kind=kind_phys),
intent(in ) :: fveg
4634 real (kind=kind_phys),
intent(in ) :: shdfac
4635 real (kind=kind_phys),
intent(in ) :: garea1
4636 real (kind=kind_phys),
intent(inout) :: ustarx
4637 real (kind=kind_phys),
intent( out) :: csigmaf0
4638 real (kind=kind_phys) :: csigmaf1
4640 real (kind=kind_phys) :: temptrs
4642 real (kind=kind_phys) :: t, tdc
4644 real(kind=kind_phys) :: fhi, qss, wrk
4645 real(kind=kind_phys),
parameter :: qmin=1.0e-8
4647 tdc(t) = min( 50., max(-50.,(t-tfrz)) )
4663 cgh = 2.*df(isnow+1)/dzsnso(isnow+1)
4665 reynb = ustarx*z0m/(1.5e-05)
4667 if (reynb .gt. 2.0)
then
4668 kbsigmaf0 = 2.46*reynb**0.25 - log(7.4)
4670 kbsigmaf0 = - log(0.397)
4673 z0h = max(z0m/exp(kbsigmaf0),1.0e-6)
4675 if (opt_sfc == 4)
then
4678 snwd = snowh * 1000.0
4680 if (snowh .gt. 0.1)
then
4688 loop3:
do iter = 1, niterb
4695 call thermalz0(parameters,fveg,z0m,z0m,zlvl,zpd,zpd,ustarx, &
4696 vegtyp,0._kind_phys,ur,csigmaf0,csigmaf1,temptrs,temptrs,temptrs,0, &
4699 if(opt_sfc == 1)
then
4700 call sfcdif1(parameters,iter ,sfctmp ,rhoair ,h ,qair , &
4701 zlvl ,zpd ,z0m ,z0h ,ur , &
4704 moz ,mozsgn ,fm ,fh ,fm2 ,fh2 ,fv,errmsg ,errflg ,&
4706 moz ,mozsgn ,fm ,fh ,fm2 ,fh2 ,fv, &
4710 if (errflg /= 0)
return
4714 if(opt_sfc == 2)
then
4715 call sfcdif2(parameters,iter ,z0m ,tgb ,thair ,ur , &
4716 zlvl ,iloc ,jloc , &
4717 cm ,ch ,moz ,wstar , &
4730 if(opt_sfc == 3)
then
4731 call sfcdif3(parameters,iloc ,jloc ,iter ,sfctmp ,qair ,ur , &
4732 zlvl ,tgb ,thsfc_loc,prslkix,prsik1x ,prslk1x ,z0m , &
4733 z0h, zpd,snowh ,shdfac ,garea1 , &
4734 ustarx ,fm ,fh ,fm2 ,fh2 , &
4739 if(opt_sfc == 4)
then
4741 call sfcdif4(iloc ,jloc ,uu ,vv ,sfctmp , &
4742 sfcprs ,psfc ,pblhx ,gdx ,z0m , &
4744 itime ,snwd ,mnice ,psi_opt , &
4745 tgb ,qair ,zlvl ,iz0tlnd,qsfc , &
4746 h ,qfx ,cm ,ch ,ch2b , &
4747 cq2b ,moz ,fv ,rb1b, fm, fh , &
4748 stress1b,fm10 ,fh2 , wspdb ,flhcb ,flqcb)
4761 ch2b = min(0.01,ch2b)
4762 cq2b = min(0.01,cq2b)
4767 if(opt_sfc == 1 .or. opt_sfc == 2 .or. opt_sfc == 3)
then
4768 ramb = max(1.,1./(cm*ur))
4769 rahb = max(1.,1./(ch*ur))
4770 elseif(opt_sfc == 4)
then
4771 ramb = max(1.,1./(cm*wspdb) )
4772 rahb = max(1.,1./(ch*wspdb) )
4784 call esat(t, esatw, esati, dsatw, dsati)
4793 csh = rhoair*cpair/rahb
4794 cev = rhoair*cpair/gamma/(rsurf+rawb)
4798 irb = cir * tgb**4 - emg*lwdn
4799 shb = csh * (tgb - sfctmp )
4800 evb = cev * (estg*rhsur - eair )
4801 ghb = cgh * (tgb - stc(isnow+1))
4803 b = sag-irb-shb-evb-ghb+pahb
4804 a = 4.*cir*tgb**3 + csh + cev*destg + cgh
4807 irb = irb + 4.*cir*tgb**3*dtg
4809 evb = evb + cev*destg*dtg
4816 h = csh * (tgb - sfctmp)
4819 call esat(t, esatw, esati, dsatw, dsati)
4825 qsfc = ep_2*(estg*rhsur)/(psfc+epsm1*(estg*rhsur))
4827 qfx = (qsfc-qair)*cev*gamma/cpair
4834 if(opt_stc == 1 .or. opt_stc == 3)
then
4835 if (snowh > 0.05 .and. tgb > tfrz)
then
4836 if(opt_stc == 1) tgb = tfrz
4837 if(opt_stc == 3) tgb = (1.-fsno)*tgb + fsno*tfrz
4838 irb = cir * tgb**4 - emg*lwdn
4839 shb = csh * (tgb - sfctmp)
4840 evb = cev * (estg*rhsur - eair )
4841 ghb = sag+pahb - (irb+shb+evb)
4847 tauxb = -rhoair*cm*ur*uu
4848 tauyb = -rhoair*cm*ur*vv
4853 if(opt_sfc == 1 .or. opt_sfc ==2 )
then
4854 ehb2 = fv*vkc/log((2.+z0h)/z0h)
4855 ehb2 = fv*vkc/(log((2.+z0h)/z0h)-fh2)
4857 if (ehb2.lt.1.e-5 )
then
4861 t2mb = tgb - shb/(rhoair*cpair) * 1./ehb2
4862 q2b = qsfc - evb/(lathea*rhoair)*(1./cq2b + rsurf)
4864 if (parameters%urban_flag) q2b = qsfc
4868 if(opt_sfc == 3 )
then
4871 if (ehb2.lt.1.e-5 )
then
4875 t2mb = tgb - shb/(rhoair*cpair) * 1./ehb2
4876 q2b = qsfc - evb/(lathea*rhoair)*(1./cq2b + rsurf)
4878 if (parameters%urban_flag) q2b = qsfc
4881 if(opt_sfc == 4)
then
4883 rahb2 = max(1.,1./(ch2b*wspdb))
4885 cq2b = 1./max(1.,1./(cq2b*wspdb))
4887 if (ehb2.lt.1.e-5 )
then
4891 t2mb = tgb - shb/(rhoair*cpair*ehb2)
4893 q2b = qsfc - evb/(lathea*rhoair)*(1./cq2b + rsurf)
4898 if(opt_diag ==3)
then
4899 if(opt_sfc == 1 .or. opt_sfc == 3)
then
4904 t2mb = tgb*wrk + sfctmp*prslkix*fhi - (grav+grav)/cp
4906 t2mb = tgb*wrk + sfctmp*fhi - (grav+grav)/cp
4910 q2b = qsfc*wrk + max(qmin,qair)*fhi
4913 qss = ep_2 * qss / (psfc + epsm1 * qss)
4914 q2b= qss*wrk + max(qmin,qair)*fhi
4917 qss = ep_2 * qss / (psfc + epsm1 * qss)
4920 errmsg =
'Problem :opt_diag=3 is only applied for opt_sfc=1&3'
4925 if (parameters%urban_flag) q2b = qsfc
4937 subroutine ragrb(parameters,iter ,vai ,rhoair ,hg ,tah , & !in
4938 zpd ,z0mg ,z0hg ,hcan ,uc , & !in
4939 z0h ,fv ,cwp ,vegtyp ,mpe , & !in
4940 tv ,mozg ,fhg ,fhgh ,iloc ,jloc , & !inout
4941 ramg ,rahg ,rawg ,rb )
4950 type (noahmp_parameters),
intent(in) :: parameters
4951 integer,
intent(in) :: iloc
4952 integer,
intent(in) :: jloc
4953 integer,
intent(in) :: iter
4954 integer,
intent(in) :: vegtyp
4955 real (kind=kind_phys),
intent(in) :: vai
4956 real (kind=kind_phys),
intent(in) :: rhoair
4957 real (kind=kind_phys),
intent(in) :: hg
4958 real (kind=kind_phys),
intent(in) :: tv
4959 real (kind=kind_phys),
intent(in) :: tah
4960 real (kind=kind_phys),
intent(in) :: zpd
4961 real (kind=kind_phys),
intent(in) :: z0mg
4962 real (kind=kind_phys),
intent(in) :: hcan
4963 real (kind=kind_phys),
intent(in) :: uc
4964 real (kind=kind_phys),
intent(in) :: z0h
4965 real (kind=kind_phys),
intent(in) :: z0hg
4966 real (kind=kind_phys),
intent(in) :: fv
4967 real (kind=kind_phys),
intent(in) :: cwp
4968 real (kind=kind_phys),
intent(in) :: mpe
4972 real (kind=kind_phys),
intent(inout) :: mozg
4973 real (kind=kind_phys),
intent(inout) :: fhg
4974 real (kind=kind_phys),
intent(inout) :: fhgh
4977 real (kind=kind_phys) :: ramg
4978 real (kind=kind_phys) :: rahg
4979 real (kind=kind_phys) :: rawg
4980 real (kind=kind_phys) :: rb
4983 real (kind=kind_phys) :: kh
4984 real (kind=kind_phys) :: tmp1
4985 real (kind=kind_phys) :: tmp2
4986 real (kind=kind_phys) :: tmprah2
4987 real (kind=kind_phys) :: tmprb
4988 real (kind=kind_phys) :: molg,fhgnew,cwpc
4989 real (kind=kind_phys) :: mozgh, fhgnewh
4998 tmp1 = vkc * (grav/tah) * hg/(rhoair*cpair)
4999 if (abs(tmp1) .le. mpe) tmp1 = mpe
5000 molg = -1. * fv**3 / tmp1
5001 mozg = min( (zpd-z0mg)/molg, 1.)
5002 mozgh = min( (hcan - zpd)/molg, 1.)
5006 fhgnew = (1. - 15.*mozg)**(-0.25)
5007 fhgnewh = 0.74 * (1. - 9.*mozg)**(-0.5)
5009 fhgnew = 1.+ 4.7*mozg
5010 fhgnewh = 0.74 + 4.7*mozgh
5017 fhg = 0.5 * (fhg+fhgnew)
5018 fhgh = 0.5 * (fhgh+fhgnewh)
5021 cwpc = (cwp * vai * hcan * fhg)**0.5
5023 cwpc = max(min(cwpc,5.0),1.0)
5025 tmp1 = exp( -cwpc*z0hg/hcan )
5026 tmp2 = exp( -cwpc*(z0h+zpd)/hcan )
5027 tmprah2 = hcan*exp(cwpc) / cwpc * (tmp1-tmp2)
5031 kh = max( vkc*fv*(hcan-zpd)/(max(fhgh,0.1)), mpe )
5038 tmprb = cwpc*50. / (1. - exp(-cwpc/2.))
5039 rb = tmprb * sqrt(parameters%dleaf/uc)
5040 rb = min(max(rb, 5.0),50.0)
5042 end subroutine ragrb
5048 subroutine sfcdif1(parameters,iter ,sfctmp ,rhoair ,h ,qair , & !in
5049 & zlvl ,zpd ,z0m ,z0h ,ur , & !in
5050 & mpe ,iloc ,jloc , & !in
5052 & moz ,mozsgn ,fm ,fh ,fm2,fh2,fv,errmsg,errflg, & !inout
5054 & moz ,mozsgn ,fm ,fh ,fm2,fh2, fv, & !inout
5064 type (noahmp_parameters),
intent(in) :: parameters
5065 integer,
intent(in) :: iloc
5066 integer,
intent(in) :: jloc
5067 integer,
intent(in) :: iter
5068 real (kind=kind_phys),
intent(in) :: sfctmp
5069 real (kind=kind_phys),
intent(in) :: rhoair
5070 real (kind=kind_phys),
intent(in) :: h
5071 real (kind=kind_phys),
intent(in) :: qair
5072 real (kind=kind_phys),
intent(in) :: zlvl
5073 real (kind=kind_phys),
intent(in) :: zpd
5074 real (kind=kind_phys),
intent(in) :: z0h
5075 real (kind=kind_phys),
intent(in) :: z0m
5076 real (kind=kind_phys),
intent(in) :: ur
5077 real (kind=kind_phys),
intent(in) :: mpe
5080 integer,
intent(inout) :: mozsgn
5081 real (kind=kind_phys),
intent(inout) :: moz
5082 real (kind=kind_phys),
intent(inout) :: fm
5083 real (kind=kind_phys),
intent(inout) :: fh
5084 real (kind=kind_phys),
intent(inout) :: fm2
5085 real (kind=kind_phys),
intent(inout) :: fh2
5086 real (kind=kind_phys),
intent(inout) :: fv
5088 character(len=*),
intent(inout) :: errmsg
5089 integer,
intent(inout) :: errflg
5094 real (kind=kind_phys),
intent(out) :: cm
5095 real (kind=kind_phys),
intent(out) :: ch
5096 real (kind=kind_phys),
intent(out) :: ch2
5099 real (kind=kind_phys) :: mol
5100 real (kind=kind_phys) :: tmpcm
5101 real (kind=kind_phys) :: tmpch
5102 real (kind=kind_phys) :: fmnew
5103 real (kind=kind_phys) :: fhnew
5104 real (kind=kind_phys) :: mozold
5105 real (kind=kind_phys) :: tmp1,tmp2,tmp3,tmp4,tmp5
5106 real (kind=kind_phys) :: tvir
5107 real (kind=kind_phys) :: moz2
5108 real (kind=kind_phys) :: tmpcm2
5109 real (kind=kind_phys) :: tmpch2
5110 real (kind=kind_phys) :: fm2new
5111 real (kind=kind_phys) :: fh2new
5112 real (kind=kind_phys) :: tmp12,tmp22,tmp32
5114 real (kind=kind_phys) :: cmfm, chfh, cm2fm2, ch2fh2
5120 if(zlvl <= zpd)
then
5121 write(*,*)
'critical problem: zlvl <= zpd; model stops'
5124 errmsg =
"stop in noah-mp"
5127 call wrf_error_fatal(
"stop in noah-mp")
5131 tmpcm = log((zlvl-zpd) / z0m)
5132 tmpch = log((zlvl-zpd) / z0h)
5133 tmpcm2 = log((2.0 + z0m) / z0m)
5134 tmpch2 = log((2.0 + z0h) / z0h)
5142 tvir = (1. + 0.61*qair) * sfctmp
5143 tmp1 = vkc * (grav/tvir) * h/(rhoair*cpair)
5144 if (abs(tmp1) .le. mpe) tmp1 = mpe
5145 mol = -1. * fv**3 / tmp1
5146 moz = min( (zlvl-zpd)/mol, 1.)
5147 moz2 = min( (2.0 + z0h)/mol, 1.)
5152 if (mozold*moz .lt. 0.) mozsgn = mozsgn+1
5153 if (mozsgn .ge. 2)
then
5163 if (moz .lt. 0.)
then
5164 tmp1 = (1. - 16.*moz)**0.25
5165 tmp2 = log((1.+tmp1*tmp1)/2.)
5166 tmp3 = log((1.+tmp1)/2.)
5167 fmnew = 2.*tmp3 + tmp2 - 2.*atan(tmp1) + 1.5707963
5171 tmp12 = (1. - 16.*moz2)**0.25
5172 tmp22 = log((1.+tmp12*tmp12)/2.)
5173 tmp32 = log((1.+tmp12)/2.)
5174 fm2new = 2.*tmp32 + tmp22 - 2.*atan(tmp12) + 1.5707963
5192 fm = 0.5 * (fm+fmnew)
5193 fh = 0.5 * (fh+fhnew)
5194 fm2 = 0.5 * (fm2+fm2new)
5195 fh2 = 0.5 * (fh2+fh2new)
5200 fh = min(fh,0.9*tmpch)
5201 fm = min(fm,0.9*tmpcm)
5202 fh2 = min(fh2,0.9*tmpch2)
5203 fm2 = min(fm2,0.9*tmpcm2)
5209 if(abs(cmfm) <= mpe) cmfm = mpe
5210 if(abs(chfh) <= mpe) chfh = mpe
5211 if(abs(cm2fm2) <= mpe) cm2fm2 = mpe
5212 if(abs(ch2fh2) <= mpe) ch2fh2 = mpe
5213 cm = vkc*vkc/(cmfm*cmfm)
5214 ch = vkc*vkc/(cmfm*chfh)
5215 ch2 = vkc*vkc/(cm2fm2*ch2fh2)
5229 subroutine sfcdif2(parameters,iter ,z0 ,thz0 ,thlm ,sfcspd , & !in
5230 zlm ,iloc ,jloc , & !in
5231 akms ,akhs ,rlmo ,wstar2 , & !in
5241 type (noahmp_parameters),
intent(in) :: parameters
5242 integer,
intent(in) :: iloc
5243 integer,
intent(in) :: jloc
5244 integer,
intent(in) :: iter
5245 real (kind=kind_phys),
intent(in) :: zlm, z0, thz0, thlm, sfcspd
5246 real (kind=kind_phys),
intent(inout) :: akms
5247 real (kind=kind_phys),
intent(inout) :: akhs
5248 real (kind=kind_phys),
intent(inout) :: rlmo
5249 real (kind=kind_phys),
intent(inout) :: wstar2
5250 real (kind=kind_phys),
intent(inout) :: ustar
5252 real (kind=kind_phys) zz, pslmu, pslms, pslhu, pslhs
5253 real (kind=kind_phys) xx, pspmu, yy, pspms, psphu, psphs
5254 real (kind=kind_phys) zilfc, zu, zt, rdz, cxch
5255 real (kind=kind_phys) dthv, du2, btgh, zslu, zslt, rlogu, rlogt
5256 real (kind=kind_phys) zetalt, zetalu, zetau, zetat, xlu4, xlt4, xu4, xt4
5258 real (kind=kind_phys) xlu, xlt, xu, xt, psmz, simm, pshz, simh, ustark, rlmn, &
5263 integer,
parameter :: itrmx = 5
5264 real (kind=kind_phys),
parameter :: wwst = 1.2
5265 real (kind=kind_phys),
parameter :: wwst2 = wwst * wwst
5266 real (kind=kind_phys),
parameter :: vkrm = 0.40
5267 real (kind=kind_phys),
parameter :: excm = 0.001
5268 real (kind=kind_phys),
parameter :: beta = 1.0 / 270.0
5269 real (kind=kind_phys),
parameter :: btg = beta * grav
5270 real (kind=kind_phys),
parameter :: elfc = vkrm * btg
5271 real (kind=kind_phys),
parameter :: wold = 0.15
5272 real (kind=kind_phys),
parameter :: wnew = 1.0 - wold
5273 real (kind=kind_phys),
parameter :: pihf = 3.14159265 / 2.
5274 real (kind=kind_phys),
parameter :: epsu2 = 1.e-4
5275 real (kind=kind_phys),
parameter :: epsust = 0.07
5276 real (kind=kind_phys),
parameter :: epsit = 1.e-4
5277 real (kind=kind_phys),
parameter :: epsa = 1.e-8
5278 real (kind=kind_phys),
parameter :: ztmin = -5.0
5279 real (kind=kind_phys),
parameter :: ztmax = 1.0
5280 real (kind=kind_phys),
parameter :: hpbl = 1000.0
5281 real (kind=kind_phys),
parameter :: sqvisc = 258.2
5282 real (kind=kind_phys),
parameter :: ric = 0.183
5283 real (kind=kind_phys),
parameter :: rric = 1.0 / ric
5284 real (kind=kind_phys),
parameter :: fhneu = 0.8
5285 real (kind=kind_phys),
parameter :: rfc = 0.191
5286 real (kind=kind_phys),
parameter :: rfac = ric / ( fhneu * rfc * rfc )
5292 pslmu(zz)= -0.96* log(1.0-4.5* zz)
5293 pslms(zz)= zz * rric -2.076* (1. -1./ (zz +1.))
5294 pslhu(zz)= -0.96* log(1.0-4.5* zz)
5295 pslhs(zz)= zz * rfac -2.076* (1. -1./ (zz +1.))
5297 pspmu(xx)= -2.* log( (xx +1.)*0.5) - log( (xx * xx +1.)*0.5) &
5301 psphu(xx)= -2.* log( (xx * xx +1.)*0.5)
5314 zilfc = - parameters%czil * vkrm * sqvisc
5321 du2 = max(sfcspd * sfcspd,epsu2)
5325 if (btgh * akhs * dthv .ne. 0.0)
then
5326 wstar2 = wwst2* abs(btgh * akhs * dthv)** (2./3.)
5330 ustar = max(sqrt(akms * sqrt(du2+ wstar2)),epsust)
5331 rlmo = elfc * akhs * dthv / ustar **3
5335 zt = max(1.e-6,exp(zilfc * sqrt(ustar * z0))* z0)
5338 rlogu = log(zslu / zu)
5339 rlogt = log(zslt / zt)
5344 zetalt = max(zslt * rlmo,ztmin)
5345 rlmo = zetalt / zslt
5346 zetalu = zslu * rlmo
5350 if (ilech .eq. 0)
then
5351 if (rlmo .lt. 0.)
then
5352 xlu4 = 1. -16.* zetalu
5353 xlt4 = 1. -16.* zetalt
5354 xu4 = 1. -16.* zetau
5355 xt4 = 1. -16.* zetat
5356 xlu = sqrt(sqrt(xlu4))
5357 xlt = sqrt(sqrt(xlt4))
5358 xu = sqrt(sqrt(xu4))
5360 xt = sqrt(sqrt(xt4))
5362 simm = pspmu(xlu) - psmz + rlogu
5364 simh = psphu(xlt) - pshz + rlogt
5366 zetalu = min(zetalu,ztmax)
5367 zetalt = min(zetalt,ztmax)
5368 zetau = min(zetau,ztmax/(zslu/zu))
5369 zetat = min(zetat,ztmax/(zslt/zt))
5371 simm = pspms(zetalu) - psmz + rlogu
5373 simh = psphs(zetalt) - pshz + rlogt
5379 if (rlmo .lt. 0.)
then
5381 simm = pslmu(zetalu) - psmz + rlogu
5383 simh = pslhu(zetalt) - pshz + rlogt
5385 zetalu = min(zetalu,ztmax)
5386 zetalt = min(zetalt,ztmax)
5388 simm = pslms(zetalu) - psmz + rlogu
5390 simh = pslhs(zetalt) - pshz + rlogt
5398 ustar = max(sqrt(akms * sqrt(du2+ wstar2)),epsust)
5401 zt = max(1.e-6,exp(zilfc * sqrt(ustar * z0))* z0)
5404 rlogt = log(zslt / zt)
5405 ustark = ustar * vkrm
5406 if(simm < 1.e-6) simm = 1.e-6
5407 akms = max(ustark / simm,cxch)
5411 if(simh < 1.e-6) simh = 1.e-6
5412 akhs = max(ustark / simh,cxch)
5414 if (btgh * akhs * dthv .ne. 0.0)
then
5415 wstar2 = wwst2* abs(btgh * akhs * dthv)** (2./3.)
5420 rlmn = elfc * akhs * dthv / ustar **3
5424 rlma = rlmo * wold+ rlmn * wnew
5437 subroutine sfcdif3(parameters,iloc ,jloc ,iter ,sfctmp ,qair ,ur , & !in
5438 zlvl ,tgb ,thsfc_loc,prslkix,prsik1x ,prslk1x ,z0m , & !in
5439 z0h,zpd ,snowh ,fveg ,garea1 , & !in
5440 ustarx ,fm ,fh ,fm2 ,fh2 , & !inout
5450 type (noahmp_parameters),
intent(in) :: parameters
5451 integer,
intent(in ) :: iloc
5452 integer,
intent(in ) :: jloc
5453 integer,
intent(in ) :: iter
5454 real (kind=kind_phys),
intent(in ) :: sfctmp
5455 real (kind=kind_phys),
intent(in ) :: qair
5456 real (kind=kind_phys),
intent(in ) :: ur
5457 real (kind=kind_phys),
intent(in ) :: zlvl
5458 real (kind=kind_phys),
intent(in ) :: tgb
5459 logical,
intent(in ) :: thsfc_loc
5460 real (kind=kind_phys),
intent(in ) :: prslkix
5461 real (kind=kind_phys),
intent(in ) :: prsik1x
5462 real (kind=kind_phys),
intent(in ) :: prslk1x
5463 real (kind=kind_phys),
intent(in ) :: z0m
5464 real (kind=kind_phys),
intent(in ) :: z0h
5465 real (kind=kind_phys),
intent(in ) :: zpd
5466 real (kind=kind_phys),
intent(in ) :: snowh
5467 real (kind=kind_phys),
intent(in ) :: fveg
5468 real (kind=kind_phys),
intent(in ) :: garea1
5469 real (kind=kind_phys),
intent(inout) :: ustarx
5470 real (kind=kind_phys),
intent(inout) :: fm
5471 real (kind=kind_phys),
intent(inout) :: fh
5472 real (kind=kind_phys),
intent(inout) :: fm2
5473 real (kind=kind_phys),
intent(inout) :: fh2
5474 real (kind=kind_phys),
intent( out) :: fv
5475 real (kind=kind_phys),
intent( out) :: cm
5476 real (kind=kind_phys),
intent( out) :: ch
5478 real (kind=kind_phys) :: snwd
5479 real (kind=kind_phys) :: zlvlb
5480 real (kind=kind_phys) :: virtfac
5481 real (kind=kind_phys) :: tv1
5482 real (kind=kind_phys) :: thv1
5483 real (kind=kind_phys) :: tvs
5484 real (kind=kind_phys) :: rb1
5485 real (kind=kind_phys) :: stress1
5486 real (kind=kind_phys) :: fm10
5487 real (kind=kind_phys) :: tem1,tem2,zvfun1,gdx
5488 real (kind=kind_phys),
parameter :: z0lo=0.1, z0up=1.0
5498 virtfac = 1.0 + 0.61 * max(qair, 1.0e-8)
5499 tv1 = sfctmp * virtfac
5502 thv1 = sfctmp * prslkix * virtfac
5504 thv1 = sfctmp / prslk1x * virtfac
5507 tem1 = (z0m - z0lo) / (z0up - z0lo)
5508 tem1 = min(max(tem1, 0.0_kind_phys), 1.0_kind_phys)
5509 tem2 = max(fveg, 0.1_kind_phys)
5510 zvfun1 = sqrt(tem1 * tem2)
5519 tvs = tgb/prsik1x * virtfac
5522 call gfs_stability (zlvlb, zvfun1, gdx, tv1, thv1, ur, z0m, z0h, tvs, grav, thsfc_loc, &
5523 rb1, fm,fh,fm10,fh2,cm,ch,stress1,fv)
5529subroutine gfs_stability &
5531 ( z1, zvfun, gdx, tv1, thv1, wind, z0max, ztmax, tvs, grav, &
5534 rb, fm, fh, fm10, fh2, cm, ch, stress, ustar)
5540real(kind=kind_phys),
parameter :: ca=0.4_kind_phys
5542real(kind=kind_phys),
intent(in) :: z1
5543real(kind=kind_phys),
intent(in) :: zvfun
5544real(kind=kind_phys),
intent(in) :: gdx
5545real(kind=kind_phys),
intent(in) :: tv1
5546real(kind=kind_phys),
intent(in) :: thv1
5547real(kind=kind_phys),
intent(in) :: wind
5548real(kind=kind_phys),
intent(in) :: z0max
5549real(kind=kind_phys),
intent(in) :: ztmax
5550real(kind=kind_phys),
intent(in) :: tvs
5551real(kind=kind_phys),
intent(in) :: grav
5552logical,
intent(in) :: thsfc_loc
5554real(kind=kind_phys),
intent(out) :: rb
5555real(kind=kind_phys),
intent(out) :: fm
5556real(kind=kind_phys),
intent(out) :: fh
5557real(kind=kind_phys),
intent(out) :: fm10
5558real(kind=kind_phys),
intent(out) :: fh2
5559real(kind=kind_phys),
intent(out) :: cm
5560real(kind=kind_phys),
intent(out) :: ch
5561real(kind=kind_phys),
intent(out) :: stress
5562real(kind=kind_phys),
intent(out) :: ustar
5565real(kind=kind_phys),
parameter :: a0 = -3.975
5566real(kind=kind_phys),
parameter :: a1 = 12.32
5567real(kind=kind_phys),
parameter :: b1 = -7.755
5568real(kind=kind_phys),
parameter :: b2 = 6.041
5569real(kind=kind_phys),
parameter :: a0p = -7.941
5570real(kind=kind_phys),
parameter :: a1p = 24.75
5571real(kind=kind_phys),
parameter :: b1p = -8.705
5572real(kind=kind_phys),
parameter :: b2p = 7.899
5574real(kind=kind_phys),
parameter :: alpha = 5.0
5575real(kind=kind_phys),
parameter :: alpha4 = 4.0 * alpha
5576real(kind=kind_phys),
parameter :: xkrefsqr = 0.3
5577real(kind=kind_phys),
parameter :: xkmin = 0.05
5578real(kind=kind_phys),
parameter :: xkgdx = 3000.0
5579real(kind=kind_phys),
parameter :: zolmin = -10.0
5580real(kind=kind_phys),
parameter :: zero = 0.0
5581real(kind=kind_phys),
parameter :: one = 1.0
5583real(kind=kind_phys) :: aa
5584real(kind=kind_phys) :: aa0
5585real(kind=kind_phys) :: bb
5586real(kind=kind_phys) :: bb0
5587real(kind=kind_phys) :: dtv
5588real(kind=kind_phys) :: adtv
5589real(kind=kind_phys) :: hl1
5590real(kind=kind_phys) :: hl12
5591real(kind=kind_phys) :: pm
5592real(kind=kind_phys) :: ph
5593real(kind=kind_phys) :: pm10
5594real(kind=kind_phys) :: ph2
5595real(kind=kind_phys) :: z1i
5596real(kind=kind_phys) :: fms
5597real(kind=kind_phys) :: fhs
5598real(kind=kind_phys) :: hl0
5599real(kind=kind_phys) :: hl0inf
5600real(kind=kind_phys) :: hlinf
5601real(kind=kind_phys) :: hl110
5602real(kind=kind_phys) :: hlt
5603real(kind=kind_phys) :: hltinf
5604real(kind=kind_phys) :: olinf
5605real(kind=kind_phys) :: tem1
5606real(kind=kind_phys) :: tem2
5607real(kind=kind_phys) :: zolmax
5609real(kind=kind_phys) xkzo
5619if(gdx >= xkgdx)
then
5628 xkzo = min(max(tem2, xkmin), xkzo)
5631zolmax = xkrefsqr / sqrt(xkzo)
5636 adtv = max(abs(dtv),0.001_kind_phys)
5637 dtv = sign(1.0_kind_phys,dtv) * adtv
5640 rb = max(-5000.0_kind_phys, (grav+grav) * dtv * z1 &
5641 / ((thv1 + tvs) * wind * wind))
5643 rb = max(-5000.0_kind_phys, grav * dtv * z1 &
5644 / (tv1 * wind * wind))
5649 fm = log((z0max+z1) * tem1)
5650 fh = log((ztmax+z1) * tem2)
5651 fm10 = log((z0max+10.0_kind_phys) * tem1)
5652 fh2 = log((ztmax+2.0_kind_phys) * tem2)
5653 hlinf = rb * fm * fm / fh
5654 hlinf = min(max(hlinf,zolmin),zolmax)
5658 if (dtv >= zero)
then
5660 if(hlinf > 0.25_kind_phys)
then
5662 hl0inf = z0max * tem1
5663 hltinf = ztmax * tem1
5664 aa = sqrt(one + alpha4 * hlinf)
5665 aa0 = sqrt(one + alpha4 * hl0inf)
5667 bb0 = sqrt(one + alpha4 * hltinf)
5668 pm = aa0 - aa + log( (aa + one)/(aa0 + one) )
5669 ph = bb0 - bb + log( (bb + one)/(bb0 + one) )
5672 hl1 = fms * fms * rb / fhs
5673 hl1 = min(hl1, zolmax)
5681 aa = sqrt(one + alpha4 * hl1)
5682 aa0 = sqrt(one + alpha4 * hl0)
5684 bb0 = sqrt(one + alpha4 * hlt)
5685 pm = aa0 - aa + log( (one+aa)/(one+aa0) )
5686 ph = bb0 - bb + log( (one+bb)/(one+bb0) )
5687 hl110 = hl1 * 10.0_kind_phys * z1i
5688 aa = sqrt(one + alpha4 * hl110)
5689 pm10 = aa0 - aa + log( (one+aa)/(one+aa0) )
5690 hl12 = (hl1+hl1) * z1i
5692 bb = sqrt(one + alpha4 * hl12)
5693 ph2 = bb0 - bb + log( (one+bb)/(one+bb0) )
5701 tem1 = 50.0_kind_phys * z0max
5702 if(abs(olinf) <= tem1)
then
5704 hlinf = max(hlinf, zolmin)
5709 if (hlinf >= -0.5_kind_phys)
then
5711 pm = (a0 + a1*hl1) * hl1 / (one+ (b1+b2*hl1) *hl1)
5712 ph = (a0p + a1p*hl1) * hl1 / (one+ (b1p+b2p*hl1)*hl1)
5713 hl110 = hl1 * 10.0_kind_phys * z1i
5714 pm10 = (a0 + a1*hl110) * hl110/(one+(b1+b2*hl110)*hl110)
5715 hl12 = (hl1+hl1) * z1i
5716 ph2 = (a0p + a1p*hl12) * hl12/(one+(b1p+b2p*hl12)*hl12)
5719 tem1 = one / sqrt(hl1)
5720 pm = log(hl1) + 2.0_kind_phys * sqrt(tem1) - 0.8776_kind_phys
5721 ph = log(hl1) + 0.5_kind_phys * tem1 + 1.386_kind_phys
5722 hl110 = hl1 * 10.0_kind_phys * z1i
5723 pm10 = log(hl110) + 2.0_kind_phys/sqrt(sqrt(hl110)) - 0.8776_kind_phys
5724 hl12 = (hl1+hl1) * z1i
5725 ph2 = log(hl12) + 0.5_kind_phys / sqrt(hl12) + 1.386_kind_phys
5736 cm = ca * ca / (fm * fm)
5737 ch = ca * ca / (fm * fh)
5738 tem1 = 0.00001_kind_phys/z1
5741 stress = cm * wind * wind
5742 ustar = sqrt(stress)
5746 end subroutine gfs_stability
5755 subroutine thermalz0(parameters, fveg, z0m, z0mg, zlvl, zpd, ezpd, & !in
5756 ustarx, vegtyp, vaie, ur, c_sigma_f0, c_sigma_f1, a1, & !in
5757 cdmn_v, cdmn_g, surface_flag, & !in
5766 type (noahmp_parameters),
intent(in ) :: parameters
5767 integer ,
intent(in ) :: vegtyp
5768 integer ,
intent(in ) :: surface_flag
5769 real (kind=kind_phys),
intent(in ) :: fveg
5770 real (kind=kind_phys),
intent(in ) :: z0m
5771 real (kind=kind_phys),
intent(in ) :: z0mg
5772 real (kind=kind_phys),
intent(in ) :: zlvl
5773 real (kind=kind_phys),
intent(in ) :: zpd
5774 real (kind=kind_phys),
intent(in ) :: ezpd
5775 real (kind=kind_phys),
intent(in ) :: ustarx
5776 real (kind=kind_phys),
intent(in ) :: vaie
5777 real (kind=kind_phys),
intent(in ) :: ur
5778 real (kind=kind_phys),
intent(in ) :: a1
5779 real (kind=kind_phys),
intent(in ) :: cdmn_v
5780 real (kind=kind_phys),
intent(in ) :: cdmn_g
5781 real (kind=kind_phys),
intent(inout) :: c_sigma_f0
5782 real (kind=kind_phys),
intent(inout) :: c_sigma_f1
5783 real (kind=kind_phys),
intent(out ) :: z0m_out
5784 real (kind=kind_phys),
intent(out ) :: z0h_out
5787 real (kind=kind_phys) :: czil
5788 real (kind=kind_phys) :: coeff_a
5789 real (kind=kind_phys) :: coeff_b
5790 real (kind=kind_phys) :: c_sigma_fveg
5791 real (kind=kind_phys) :: g_sigma
5792 real (kind=kind_phys) :: sigma_a
5793 real (kind=kind_phys) :: cdmn
5794 real (kind=kind_phys) :: reyn
5795 real (kind=kind_phys) :: kb_sigma_f0
5796 real (kind=kind_phys) :: kb_sigma_f1
5797 real (kind=kind_phys) :: kb_sigma_fveg
5799 integer,
parameter :: bare_flag = 0, vegetated_flag = 1, composite_flag = 2
5800 integer,
parameter :: z0heqz0m = 1, &
5804 real (kind=kind_phys),
parameter :: blumel_gamma = 0.5, &
5805 blumel_zeta = 1.0, &
5821 surface_flag_select :
select case(surface_flag)
5823 case (composite_flag)
5825 if (opt_trs == z0heqz0m)
then
5827 z0m_out = exp(fveg * log(z0m) + (1.0 - fveg) * log(z0mg))
5830 elseif (opt_trs == chen09)
then
5833 z0m_out = fveg * z0m + (1.0 - fveg) * z0mg
5834 czil = 10.0 ** (- 0.4 * parameters%hvt)
5836 reyn = ustarx*z0m_out/viscosity
5837 if (reyn > 2.0)
then
5838 kb_sigma_f0 = 2.46*reyn**0.25 - log(7.4)
5840 kb_sigma_f0 = - log(0.397)
5843 z0h_out = exp( fveg * log(z0m * exp(-czil*0.4*258.2*sqrt(ustarx*z0m))) + &
5844 (1.0 - fveg) * log(max(z0m/exp(kb_sigma_f0),1.0e-6)) )
5846 elseif (opt_trs == tessel)
then
5848 z0m_out = exp(fveg * log(z0m) + (1.0 - fveg) * log(z0mg))
5849 if (vegtyp <= 5)
then
5850 z0h_out = fveg * log(z0m) + (1.0 - fveg) * log(z0mg * 0.1)
5852 z0h_out = fveg * log(z0m * 0.01) + (1.0 - fveg) * log(z0mg * 0.1)
5855 elseif (opt_trs == blumel99)
then
5857 coeff_a = (c_sigma_f0 - c_sigma_f1)/(1.0 - exp(-1.0*a1))
5858 coeff_b = c_sigma_f0 - coeff_a
5859 c_sigma_fveg = coeff_a * exp(-1.0*a1*fveg) + coeff_b
5866 g_sigma = fveg**blumel_gamma + fveg*(1.0-fveg)*blumel_zeta
5867 cdmn = g_sigma*cdmn_v + (1.0-g_sigma)*cdmn_g
5868 z0m_out = (zlvl - ezpd)*exp(-0.4/sqrt(cdmn))
5869 kb_sigma_fveg = c_sigma_fveg/log((zlvl-ezpd)/z0m_out) - &
5870 log((zlvl-ezpd)/z0m_out)
5871 z0h_out = z0m_out/exp(kb_sigma_fveg)
5879 if (opt_trs == z0heqz0m)
then
5883 elseif (opt_trs == chen09 .or. opt_trs == tessel)
then
5885 if (vegtyp <= 5)
then
5888 z0h_out = z0m_out * 0.01
5891 elseif (opt_trs == blumel99)
then
5893 reyn = ustarx*z0m_out/viscosity
5894 if (reyn > 2.0)
then
5895 kb_sigma_f0 = 2.46*reyn**0.25 - log(7.4)
5897 kb_sigma_f0 = - log(0.397)
5900 z0h_out = max(z0m_out/exp(kb_sigma_f0),1.0e-6)
5901 c_sigma_f0 = log((zlvl-zpd)/z0m_out) * &
5902 (log((zlvl-zpd)/z0m_out) + kb_sigma_f0)
5906 case (vegetated_flag)
5910 if (opt_trs == z0heqz0m)
then
5914 elseif (opt_trs == chen09)
then
5916 czil = 10.0 ** (- 0.4 * parameters%hvt)
5917 z0h_out = z0m_out * exp(-czil*0.4*258.2*sqrt(ustarx*z0m_out))
5919 elseif (opt_trs == tessel)
then
5921 if (vegtyp <= 5)
then
5924 z0h_out = z0m_out*0.01
5927 elseif (opt_trs == blumel99)
then
5929 sigma_a = 1.0 - (0.5/(0.5+vaie)) * exp(-vaie**2/8.0)
5930 kb_sigma_f1 = 16.4 * (sigma_a*vaie**3)**(-0.25) * &
5931 sqrt(parameters%dleaf*ur/log((zlvl-zpd)/z0m_out))
5932 z0h_out = z0m_out/exp(kb_sigma_f1)
5933 c_sigma_f1 = log((zlvl-zpd)/z0m_out)*(log((zlvl-zpd)/z0m_out)+kb_sigma_f1)
5937 end select surface_flag_select
5946 subroutine esat(t, esw, esi, desw, desi)
5954 real (kind=kind_phys),
intent(in) :: t
5958 real (kind=kind_phys),
intent(out) :: esw
5959 real (kind=kind_phys),
intent(out) :: esi
5960 real (kind=kind_phys),
intent(out) :: desw
5961 real (kind=kind_phys),
intent(out) :: desi
5965 real (kind=kind_phys) :: a0,a1,a2,a3,a4,a5,a6
5966 real (kind=kind_phys) :: b0,b1,b2,b3,b4,b5,b6
5967 real (kind=kind_phys) :: c0,c1,c2,c3,c4,c5,c6
5968 real (kind=kind_phys) :: d0,d1,d2,d3,d4,d5,d6
5970 parameter(a0=6.107799961 , a1=4.436518521e-01, &
5971 a2=1.428945805e-02, a3=2.650648471e-04, &
5972 a4=3.031240396e-06, a5=2.034080948e-08, &
5975 parameter(b0=6.109177956 , b1=5.034698970e-01, &
5976 b2=1.886013408e-02, b3=4.176223716e-04, &
5977 b4=5.824720280e-06, b5=4.838803174e-08, &
5980 parameter(c0= 4.438099984e-01, c1=2.857002636e-02, &
5981 c2= 7.938054040e-04, c3=1.215215065e-05, &
5982 c4= 1.036561403e-07, c5=3.532421810e-10, &
5983 c6=-7.090244804e-13)
5985 parameter(d0=5.030305237e-01, d1=3.773255020e-02, &
5986 d2=1.267995369e-03, d3=2.477563108e-05, &
5987 d4=3.005693132e-07, d5=2.158542548e-09, &
5990 esw = 100.*(a0+t*(a1+t*(a2+t*(a3+t*(a4+t*(a5+t*a6))))))
5991 esi = 100.*(b0+t*(b1+t*(b2+t*(b3+t*(b4+t*(b5+t*b6))))))
5992 desw = 100.*(c0+t*(c1+t*(c2+t*(c3+t*(c4+t*(c5+t*c6))))))
5993 desi = 100.*(d0+t*(d1+t*(d2+t*(d3+t*(d4+t*(d5+t*d6))))))
6001 subroutine stomata (parameters,vegtyp ,mpe ,apar ,foln ,iloc , jloc, & !in
6002 tv ,ei ,ea ,sfctmp ,sfcprs , & !in
6003 o2 ,co2 ,igs ,btran ,rb , & !in
6009 type (noahmp_parameters),
intent(in) :: parameters
6010 integer,
intent(in) :: iloc
6011 integer,
intent(in) :: jloc
6012 integer,
intent(in) :: vegtyp
6014 real (kind=kind_phys),
intent(in) :: igs
6015 real (kind=kind_phys),
intent(in) :: mpe
6017 real (kind=kind_phys),
intent(in) :: tv
6018 real (kind=kind_phys),
intent(in) :: ei
6019 real (kind=kind_phys),
intent(in) :: ea
6020 real (kind=kind_phys),
intent(in) :: apar
6021 real (kind=kind_phys),
intent(in) :: o2
6022 real (kind=kind_phys),
intent(in) :: co2
6023 real (kind=kind_phys),
intent(in) :: sfcprs
6024 real (kind=kind_phys),
intent(in) :: sfctmp
6025 real (kind=kind_phys),
intent(in) :: btran
6026 real (kind=kind_phys),
intent(in) :: foln
6027 real (kind=kind_phys),
intent(in) :: rb
6030 real (kind=kind_phys),
intent(out) :: rs
6031 real (kind=kind_phys),
intent(out) :: psn
6034 real (kind=kind_phys) :: rlb
6044 real (kind=kind_phys) :: ab
6045 real (kind=kind_phys) :: bc
6046 real (kind=kind_phys) :: f1
6047 real (kind=kind_phys) :: f2
6048 real (kind=kind_phys) :: tc
6049 real (kind=kind_phys) :: cs
6050 real (kind=kind_phys) :: kc
6051 real (kind=kind_phys) :: ko
6052 real (kind=kind_phys) :: a,b,c,q
6053 real (kind=kind_phys) :: r1,r2
6054 real (kind=kind_phys) :: fnf
6055 real (kind=kind_phys) :: ppf
6056 real (kind=kind_phys) :: wc
6057 real (kind=kind_phys) :: wj
6058 real (kind=kind_phys) :: we
6059 real (kind=kind_phys) :: cp
6060 real (kind=kind_phys) :: ci
6061 real (kind=kind_phys) :: awc
6062 real (kind=kind_phys) :: vcmx
6063 real (kind=kind_phys) :: j
6064 real (kind=kind_phys) :: cea
6065 real (kind=kind_phys) :: cf
6067 f1(ab,bc) = ab**((bc-25.)/10.)
6068 f2(ab) = 1. + exp((-2.2e05+710.*(ab+273.16))/(8.314*(ab+273.16)))
6069 real (kind=kind_phys) :: t
6075 cf = sfcprs/(8.314*sfctmp)*1.e06
6076 rs = 1./parameters%bp * cf
6079 if (apar .le. 0.)
return
6081 fnf = min( foln/max(mpe,parameters%folnmx), 1.0 )
6084 j = ppf*parameters%qe25
6085 kc = parameters%kc25 * f1(parameters%akc,tc)
6086 ko = parameters%ko25 * f1(parameters%ako,tc)
6087 awc = kc * (1.+o2/ko)
6088 cp = 0.5*kc/ko*o2*0.21
6089 vcmx = parameters%vcmx25 / f2(tc) * fnf * btran * f1(parameters%avcmx,tc)
6093 ci = 0.7*co2*parameters%c3psn + 0.4*co2*(1.-parameters%c3psn)
6101 cea = max(0.25*ei*parameters%c3psn+0.40*ei*(1.-parameters%c3psn), min(ea,ei) )
6106 wj = max(ci-cp,0.)*j/(ci+2.*cp)*parameters%c3psn + j*(1.-parameters%c3psn)
6107 wc = max(ci-cp,0.)*vcmx/(ci+awc)*parameters%c3psn + vcmx*(1.-parameters%c3psn)
6108 we = 0.5*vcmx*parameters%c3psn + 4000.*vcmx*ci/sfcprs*(1.-parameters%c3psn)
6109 psn = min(wj,wc,we) * igs
6111 cs = max( co2-1.37*rlb*sfcprs*psn, mpe )
6112 a = parameters%mp*psn*sfcprs*cea / (cs*ei) + parameters%bp
6113 b = ( parameters%mp*psn*sfcprs/cs + parameters%bp ) * rlb - 1.
6116 q = -0.5*( b + sqrt(b*b-4.*a*c) )
6118 q = -0.5*( b - sqrt(b*b-4.*a*c) )
6123 ci = max( cs-psn*sfcprs*1.65*rs, 0. )
6139 subroutine canres (parameters,ep_2,epsm1,par ,sfctmp,rcsoil ,eah ,sfcprs , & !in
6140 rc ,psn ,iloc ,jloc )
6158 type (noahmp_parameters),
intent(in) :: parameters
6159 integer,
intent(in) :: iloc
6160 integer,
intent(in) :: jloc
6161 real (kind=kind_phys),
intent(in) :: ep_2
6162 real (kind=kind_phys),
intent(in) :: epsm1
6163 real (kind=kind_phys),
intent(in) :: par
6164 real (kind=kind_phys),
intent(in) :: sfctmp
6165 real (kind=kind_phys),
intent(in) :: sfcprs
6166 real (kind=kind_phys),
intent(in) :: eah
6167 real (kind=kind_phys),
intent(in) :: rcsoil
6171 real (kind=kind_phys),
intent(out) :: rc
6172 real (kind=kind_phys),
intent(out) :: psn
6176 real (kind=kind_phys) :: rcq
6177 real (kind=kind_phys) :: rcs
6178 real (kind=kind_phys) :: rct
6179 real (kind=kind_phys) :: ff
6180 real (kind=kind_phys) :: q2
6181 real (kind=kind_phys) :: q2sat
6182 real (kind=kind_phys) :: dqsdt2
6195 q2 = ep_2 * eah / (sfcprs + epsm1 * eah)
6196 q2 = q2 / (1.0 - q2)
6198 call calhum(parameters,sfctmp, sfcprs, q2sat, dqsdt2)
6202 ff = 2.0 * par / parameters%rgl
6203 rcs = (ff + parameters%rsmin / parameters%rsmax) / (1.0+ ff)
6204 rcs = max(rcs,0.0001)
6208 rct = 1.0- 0.0016* ( (parameters%topt - sfctmp)**2.0)
6209 rct = max(rct,0.0001)
6213 rcq = 1.0/ (1.0+ parameters%hs * max(0.,q2sat-q2))
6218 rc = parameters%rsmin / (rcs * rct * rcq * rcsoil)
6227 subroutine calhum(parameters,sfctmp, sfcprs, q2sat, dqsdt2)
6231 type (noahmp_parameters),
intent(in) :: parameters
6232 real (kind=kind_phys),
intent(in) :: sfctmp, sfcprs
6233 real (kind=kind_phys),
intent(out) :: q2sat, dqsdt2
6234 real (kind=kind_phys),
parameter :: a2=17.67,a3=273.15,a4=29.65, elwv=2.501e6, &
6235 a23m4=a2*(a3-a4), e0=0.611, rv=461.0, &
6237 real (kind=kind_phys) :: es, sfcprsx
6240 es = e0 * exp( elwv/rv*(1./a3 - 1./sfctmp) )
6242 sfcprsx = sfcprs*1.e-3
6243 q2sat = epsilon * es / (sfcprsx-es)
6245 q2sat = q2sat * 1.e3
6249 dqsdt2=(q2sat/(1+q2sat))*a23m4/(sfctmp-a4)**2
6252 q2sat = q2sat / 1.e3
6263 subroutine tsnosoi (parameters,ice ,nsoil ,nsnow ,isnow ,ist , & !in
6264 tbot ,zsnso ,ssoil ,df ,hcpct , & !in
6265 sag ,dt ,snowh ,dzsnso , & !in
6266 tg ,iloc ,jloc , & !in
6268 stc ,errmsg ,errflg)
6281 type (noahmp_parameters),
intent(in) :: parameters
6282 integer,
intent(in) :: iloc
6283 integer,
intent(in) :: jloc
6284 integer,
intent(in) :: ice
6285 integer,
intent(in) :: nsoil
6286 integer,
intent(in) :: nsnow
6287 integer,
intent(in) :: isnow
6288 integer,
intent(in) :: ist
6290 real (kind=kind_phys),
intent(in) :: dt
6291 real (kind=kind_phys),
intent(in) :: tbot
6292 real (kind=kind_phys),
intent(in) :: ssoil
6293 real (kind=kind_phys),
intent(in) :: sag
6294 real (kind=kind_phys),
intent(in) :: snowh
6295 real (kind=kind_phys),
intent(in) :: tg
6296 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: zsnso
6297 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: dzsnso
6298 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: df
6299 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: hcpct
6303 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: stc
6305 character(len=*) ,
intent(inout) :: errmsg
6306 integer ,
intent(inout) :: errflg
6312 real (kind=kind_phys) :: zbotsno
6313 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: ai, bi, ci, rhsts
6314 real (kind=kind_phys) :: eflxb
6315 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: phi
6317 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: tbeg
6318 real (kind=kind_phys) :: err_est
6319 real (kind=kind_phys) :: ssoil2
6320 real (kind=kind_phys) :: eflxb2
6321 character(len=256) :: message
6325 phi(isnow+1:nsoil) = 0.
6329 zbotsno = parameters%zbot - snowh
6333 do iz = isnow+1, nsoil
6339 call hrt (parameters,nsnow ,nsoil ,isnow ,zsnso , &
6340 stc ,tbot ,zbotsno ,dt , &
6341 df ,hcpct ,ssoil ,phi , &
6342 ai ,bi ,ci ,rhsts , &
6345 call hstep (parameters,nsnow ,nsoil ,isnow ,dt , &
6346 ai ,bi ,ci ,rhsts , &
6352 if(opt_tbot == 1)
then
6354 else if(opt_tbot == 2)
then
6355 eflxb2 = df(nsoil)*(tbot-stc(nsoil)) / &
6356 (0.5*(zsnso(nsoil-1)+zsnso(nsoil)) - zbotsno)
6366 do iz = isnow+1, nsoil
6367 err_est = err_est + (stc(iz)-tbeg(iz)) * dzsnso(iz) * hcpct(iz) / dt
6370 if (opt_stc == 1 .or. opt_stc == 3)
then
6371 err_est = err_est - (ssoil +eflxb)
6373 ssoil2 = df(isnow+1)*(tg-stc(isnow+1))/(0.5*dzsnso(isnow+1))
6374 err_est = err_est - (ssoil2+eflxb2)
6377 if (abs(err_est) > 1.)
then
6378 write(message,*)
'tsnosoi is losing(-)/gaining(+) false energy',err_est,
' w/m2'
6380 errmsg = trim(message)
6382 call wrf_message(trim(message))
6384 write(message,
'(i6,1x,i6,1x,i3,f18.13,5f20.12)') &
6385 iloc, jloc, ist,err_est,ssoil,snowh,tg,stc(isnow+1),eflxb
6387 errmsg = trim(errmsg)//new_line(
'A')//trim(message)
6389 call wrf_message(trim(message))
6402 subroutine hrt (parameters,nsnow ,nsoil ,isnow ,zsnso , &
6403 stc ,tbot ,zbot ,dt , &
6404 df ,hcpct ,ssoil ,phi , &
6405 ai ,bi ,ci ,rhsts , &
6417 type (noahmp_parameters),
intent(in) :: parameters
6418 integer,
intent(in) :: nsoil
6419 integer,
intent(in) :: nsnow
6420 integer,
intent(in) :: isnow
6421 real (kind=kind_phys),
intent(in) :: tbot
6422 real (kind=kind_phys),
intent(in) :: zbot
6424 real (kind=kind_phys),
intent(in) :: dt
6425 real (kind=kind_phys),
intent(in) :: ssoil
6426 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: zsnso
6427 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: stc
6428 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: df
6429 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: hcpct
6430 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: phi
6434 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(out) :: rhsts
6435 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(out) :: ai
6436 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(out) :: bi
6437 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(out) :: ci
6438 real (kind=kind_phys),
intent(out) :: botflx
6443 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: ddz
6444 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: dz
6445 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: denom
6446 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: dtsdz
6447 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: eflux
6448 real (kind=kind_phys) :: temp1
6451 do k = isnow+1, nsoil
6452 if (k == isnow+1)
then
6453 denom(k) = - zsnso(k) * hcpct(k)
6454 temp1 = - zsnso(k+1)
6455 ddz(k) = 2.0 / temp1
6456 dtsdz(k) = 2.0 * (stc(k) - stc(k+1)) / temp1
6457 eflux(k) = df(k) * dtsdz(k) - ssoil - phi(k)
6458 else if (k < nsoil)
then
6459 denom(k) = (zsnso(k-1) - zsnso(k)) * hcpct(k)
6460 temp1 = zsnso(k-1) - zsnso(k+1)
6461 ddz(k) = 2.0 / temp1
6462 dtsdz(k) = 2.0 * (stc(k) - stc(k+1)) / temp1
6463 eflux(k) = (df(k)*dtsdz(k) - df(k-1)*dtsdz(k-1)) - phi(k)
6464 else if (k == nsoil)
then
6465 denom(k) = (zsnso(k-1) - zsnso(k)) * hcpct(k)
6466 temp1 = zsnso(k-1) - zsnso(k)
6467 if(opt_tbot == 1)
then
6470 if(opt_tbot == 2)
then
6471 dtsdz(k) = (stc(k) - tbot) / ( 0.5*(zsnso(k-1)+zsnso(k)) - zbot)
6472 botflx = -df(k) * dtsdz(k)
6474 eflux(k) = (-botflx - df(k-1)*dtsdz(k-1) ) - phi(k)
6478 do k = isnow+1, nsoil
6479 if (k == isnow+1)
then
6481 ci(k) = - df(k) * ddz(k) / denom(k)
6482 if (opt_stc == 1 .or. opt_stc == 3 )
then
6485 if (opt_stc == 2)
then
6486 bi(k) = - ci(k) + df(k)/(0.5*zsnso(k)*zsnso(k)*hcpct(k))
6488 else if (k < nsoil)
then
6489 ai(k) = - df(k-1) * ddz(k-1) / denom(k)
6490 ci(k) = - df(k ) * ddz(k ) / denom(k)
6491 bi(k) = - (ai(k) + ci(k))
6492 else if (k == nsoil)
then
6493 ai(k) = - df(k-1) * ddz(k-1) / denom(k)
6495 bi(k) = - (ai(k) + ci(k))
6497 rhsts(k) = eflux(k)/ (-denom(k))
6506 subroutine hstep (parameters,nsnow ,nsoil ,isnow ,dt , &
6507 ai ,bi ,ci ,rhsts , &
6516 type (noahmp_parameters),
intent(in) :: parameters
6517 integer,
intent(in) :: nsoil
6518 integer,
intent(in) :: nsnow
6519 integer,
intent(in) :: isnow
6520 real (kind=kind_phys),
intent(in) :: dt
6523 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: rhsts
6524 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: ai
6525 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: bi
6526 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: ci
6527 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: stc
6531 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: rhstsin
6532 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: ciin
6535 do k = isnow+1,nsoil
6536 rhsts(k) = rhsts(k) * dt
6538 bi(k) = 1. + bi(k) * dt
6544 do k = isnow+1,nsoil
6545 rhstsin(k) = rhsts(k)
6551 call rosr12 (ci,ai,bi,ciin,rhstsin,rhsts,isnow+1,nsoil,nsnow)
6555 do k = isnow+1,nsoil
6556 stc(k) = stc(k) + ci(k)
6559 end subroutine hstep
6565 subroutine rosr12 (p,a,b,c,d,delta,ntop,nsoil,nsnow)
6586 integer,
intent(in) :: ntop
6587 integer,
intent(in) :: nsoil,nsnow
6590 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in):: a, b, d
6591 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout):: c,p,delta
6597 p(ntop) = - c(ntop) / b(ntop)
6601 delta(ntop) = d(ntop) / b(ntop)
6606 p(k) = - c(k) * ( 1.0 / (b(k) + a(k) * p(k -1)) )
6607 delta(k) = (d(k) - a(k)* delta(k -1))* (1.0/ (b(k) + a(k)&
6613 p(nsoil) = delta(nsoil)
6618 kk = nsoil - k + (ntop-1) + 1
6619 p(kk) = p(kk) * p(kk +1) + delta(kk)
6628 subroutine phasechange (parameters,nsnow ,nsoil ,isnow ,dt ,fact , & !in
6629 dzsnso ,hcpct ,ist ,iloc ,jloc , & !in
6630 stc ,snice ,snliq ,sneqv ,snowh , & !inout
6632 smc ,sh2o ,errmsg ,errflg , & !inout
6634 smc ,sh2o , & !inout
6636 qmelt ,imelt ,ponding )
6644 type (noahmp_parameters),
intent(in) :: parameters
6645 integer,
intent(in) :: iloc
6646 integer,
intent(in) :: jloc
6647 integer,
intent(in) :: nsnow
6648 integer,
intent(in) :: nsoil
6649 integer,
intent(in) :: isnow
6650 integer,
intent(in) :: ist
6651 real (kind=kind_phys),
intent(in) :: dt
6652 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: fact
6653 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: dzsnso
6654 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: hcpct
6657 integer,
dimension(-nsnow+1:nsoil),
intent(out) :: imelt
6658 real (kind=kind_phys),
intent(out) :: qmelt
6659 real (kind=kind_phys),
intent(out) :: ponding
6663 real (kind=kind_phys),
intent(inout) :: sneqv
6664 real (kind=kind_phys),
intent(inout) :: snowh
6665 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: stc
6666 real (kind=kind_phys),
dimension( 1:nsoil),
intent(inout) :: sh2o
6667 real (kind=kind_phys),
dimension( 1:nsoil),
intent(inout) :: smc
6668 real (kind=kind_phys),
dimension(-nsnow+1:0) ,
intent(inout) :: snice
6669 real (kind=kind_phys),
dimension(-nsnow+1:0) ,
intent(inout) :: snliq
6671 character(len=*) ,
intent(inout) :: errmsg
6672 integer ,
intent(inout) :: errflg
6678 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: hm
6679 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: xm
6680 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: wmass0
6681 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: wice0
6682 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: wliq0
6683 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: mice
6684 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: mliq
6685 real (kind=kind_phys),
dimension(-nsnow+1:nsoil) :: supercool
6686 real (kind=kind_phys) :: heatr
6687 real (kind=kind_phys) :: temp1
6688 real (kind=kind_phys) :: propor
6689 real (kind=kind_phys) :: smp
6690 real (kind=kind_phys) :: xmf
6699 do j = -nsnow+1, nsoil
6709 mliq(j) = sh2o(j) * dzsnso(j) * 1000.
6710 mice(j) = (smc(j) - sh2o(j)) * dzsnso(j) * 1000.
6713 do j = isnow+1,nsoil
6719 wmass0(j) = mice(j) + mliq(j)
6724 if (opt_frz == 1)
then
6725 if(stc(j) < tfrz)
then
6726 smp = hfus*(tfrz-stc(j))/(grav*stc(j))
6727 supercool(j) = parameters%smcmax(j)*(smp/parameters%psisat(j))**(-1./parameters%bexp(j))
6728 supercool(j) = supercool(j)*dzsnso(j)*1000.
6731 if (opt_frz == 2)
then
6733 call frh2o (parameters,j,supercool(j),stc(j),smc(j),sh2o(j),errmsg,errflg)
6734 if (errflg /=0)
return
6736 call frh2o (parameters,j,supercool(j),stc(j),smc(j),sh2o(j))
6738 supercool(j) = supercool(j)*dzsnso(j)*1000.
6743 do j = isnow+1,nsoil
6744 if (mice(j) > 0. .and. stc(j) >= tfrz)
then
6747 if (mliq(j) > supercool(j) .and. stc(j) < tfrz)
then
6752 if (isnow == 0 .and. sneqv > 0. .and. j == 1)
then
6753 if (stc(j) >= tfrz)
then
6761 do j = isnow+1,nsoil
6762 if (imelt(j) > 0)
then
6763 hm(j) = (stc(j)-tfrz)/fact(j)
6767 if (imelt(j) == 1 .and. hm(j) < 0.)
then
6771 if (imelt(j) == 2 .and. hm(j) > 0.)
then
6775 xm(j) = hm(j)*dt/hfus
6780 if (isnow == 0 .and. sneqv > 0. .and. xm(1) > 0.)
then
6782 sneqv = max(0.,temp1-xm(1))
6783 propor = sneqv/temp1
6784 snowh = max(0.,propor * snowh)
6785 snowh = min(max(snowh,sneqv/500.0),sneqv/50.0)
6786 heatr = hm(1) - hfus*(temp1-sneqv)/dt
6787 if (heatr > 0.)
then
6788 xm(1) = heatr*dt/hfus
6794 qmelt = max(0.,(temp1-sneqv))/dt
6796 ponding = temp1-sneqv
6801 do j = isnow+1,nsoil
6802 if (imelt(j) > 0 .and. abs(hm(j)) > 0.)
then
6805 if (xm(j) > 0.)
then
6806 mice(j) = max(0., wice0(j)-xm(j))
6807 heatr = hm(j) - hfus*(wice0(j)-mice(j))/dt
6808 else if (xm(j) < 0.)
then
6810 mice(j) = min(wmass0(j), wice0(j)-xm(j))
6812 if (wmass0(j) < supercool(j))
then
6815 mice(j) = min(wmass0(j) - supercool(j),wice0(j)-xm(j))
6816 mice(j) = max(mice(j),0.0)
6819 heatr = hm(j) - hfus*(wice0(j)-mice(j))/dt
6822 mliq(j) = max(0.,wmass0(j)-mice(j))
6824 if (abs(heatr) > 0.)
then
6825 stc(j) = stc(j) + fact(j)*heatr
6827 if (mliq(j)*mice(j)>0.) stc(j) = tfrz
6828 if (mice(j) == 0.)
then
6830 hm(j+1) = hm(j+1) + heatr
6831 xm(j+1) = hm(j+1)*dt/hfus
6836 xmf = xmf + hfus * (wice0(j)-mice(j))/dt
6839 qmelt = qmelt + max(0.,(wice0(j)-mice(j)))/dt
6850 sh2o(j) = mliq(j) / (1000. * dzsnso(j))
6851 smc(j) = (mliq(j) + mice(j)) / (1000. * dzsnso(j))
6863 subroutine frh2o (parameters,isoil,free,tkelv,smc,sh2o,&
6898 type (noahmp_parameters),
intent(in) :: parameters
6899 integer,
intent(in) :: isoil
6900 real (kind=kind_phys),
intent(in) :: sh2o,smc,tkelv
6901 real (kind=kind_phys),
intent(out) :: free
6903 character(len=*),
intent(inout) :: errmsg
6904 integer,
intent(inout) :: errflg
6906 real (kind=kind_phys) :: bx,denom,df,dswl,fk,swl,swlk
6907 integer :: nlog,kcount
6909 real (kind=kind_phys),
parameter :: ck = 8.0, blim = 5.5,
error = 0.005, &
6911 character(len=80) :: message
6918 bx = parameters%bexp(isoil)
6923 if (parameters%bexp(isoil) > blim) bx = blim
6930 if (tkelv > (tfrz- 1.e-3))
then
6944 if (swl > (smc -0.02)) swl = smc -0.02
6948 if (swl < 0.) swl = 0.
6950 if (.not.( (nlog < 10) .and. (kcount == 0)))
goto 1002
6952 df = log( ( parameters%psisat(isoil) * grav / hfus ) * ( ( 1. + ck * swl )**2.) * &
6953 ( parameters%smcmax(isoil) / (smc - swl) )** bx) - log( - ( &
6954 tkelv - tfrz)/ tkelv)
6955 denom = 2. * ck / ( 1. + ck * swl ) + bx / ( smc - swl )
6956 swlk = swl - df / denom
6960 if (swlk > (smc -0.02)) swlk = smc - 0.02
6961 if (swlk < 0.) swlk = 0.
6966 dswl = abs(swlk - swl)
6971 if ( dswl <=
error )
then
6991 if (kcount == 0)
then
6992 write(message,
'("flerchinger used in new version. iterations=", i6)') nlog
6994 errmsg = trim(message)
6996 call wrf_message(trim(message))
6998 fk = ( ( (hfus / (grav * ( - parameters%psisat(isoil))))* &
6999 ( (tkelv - tfrz)/ tkelv))** ( -1/ bx))* parameters%smcmax(isoil)
7000 if (fk < 0.02) fk = 0.02
7008 end subroutine frh2o
7018 subroutine water (parameters,vegtyp ,nsnow ,nsoil ,imelt ,dt ,uu , & !in
7019 vv ,fcev ,fctr ,qprecc ,qprecl ,elai , & !in
7020 esai ,sfctmp ,qvap ,qdew ,zsoil ,btrani , & !in
7021 ficeold,ponding,tg ,ist ,fveg ,iloc ,jloc ,smceq , & !in
7022 bdfall ,fp ,rain ,snow, & !in mb/an: v3.7
7023 qsnow ,qrain ,snowhin,latheav,latheag,frozen_canopy,frozen_ground, & !in mb
7024 isnow ,canliq ,canice ,tv ,snowh ,sneqv , & !inout
7025 snice ,snliq ,stc ,zsnso ,sh2o ,smc , & !inout
7026 sice ,zwt ,wa ,wt ,dzsnso ,wslake , & !inout
7027 smcwtd ,deeprech,rech , & !inout
7028 cmc ,ecan ,etran ,fwet ,runsrf ,runsub , & !out
7029 qin ,qdis ,ponding1 ,ponding2, &
7038 type (noahmp_parameters),
intent(in) :: parameters
7039 integer,
intent(in) :: iloc
7040 integer,
intent(in) :: jloc
7041 integer,
intent(in) :: vegtyp
7042 integer,
intent(in) :: nsnow
7043 integer ,
intent(in) :: ist
7044 integer,
intent(in) :: nsoil
7045 integer,
dimension(-nsnow+1:0) ,
intent(in) :: imelt
7046 real (kind=kind_phys),
intent(in) :: dt
7047 real (kind=kind_phys),
intent(in) :: uu
7048 real (kind=kind_phys),
intent(in) :: vv
7049 real (kind=kind_phys),
intent(in) :: fcev
7050 real (kind=kind_phys),
intent(in) :: fctr
7051 real (kind=kind_phys),
intent(in) :: qprecc
7052 real (kind=kind_phys),
intent(in) :: qprecl
7053 real (kind=kind_phys),
intent(in) :: elai
7054 real (kind=kind_phys),
intent(in) :: esai
7055 real (kind=kind_phys),
intent(in) :: sfctmp
7056 real (kind=kind_phys),
intent(in) :: qvap
7057 real (kind=kind_phys),
intent(in) :: qdew
7058 real (kind=kind_phys),
dimension( 1:nsoil),
intent(in) :: zsoil
7059 real (kind=kind_phys),
dimension( 1:nsoil),
intent(in) :: btrani
7060 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(in) :: ficeold
7062 real (kind=kind_phys) ,
intent(in) :: tg
7063 real (kind=kind_phys) ,
intent(in) :: fveg
7064 real (kind=kind_phys) ,
intent(in) :: bdfall
7065 real (kind=kind_phys) ,
intent(in) :: fp
7066 real (kind=kind_phys) ,
intent(in) :: rain
7067 real (kind=kind_phys) ,
intent(in) :: snow
7068 real (kind=kind_phys),
dimension( 1:nsoil),
intent(in) :: smceq
7069 real (kind=kind_phys) ,
intent(in) :: qsnow
7070 real (kind=kind_phys) ,
intent(in) :: qrain
7071 real (kind=kind_phys) ,
intent(in) :: snowhin
7074 integer,
intent(inout) :: isnow
7075 real (kind=kind_phys),
intent(inout) :: canliq
7076 real (kind=kind_phys),
intent(inout) :: canice
7077 real (kind=kind_phys),
intent(inout) :: tv
7078 real (kind=kind_phys),
intent(inout) :: snowh
7079 real (kind=kind_phys),
intent(inout) :: sneqv
7080 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(inout) :: snice
7081 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(inout) :: snliq
7082 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: stc
7083 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: zsnso
7084 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: dzsnso
7085 real (kind=kind_phys),
dimension( 1:nsoil),
intent(inout) :: sh2o
7086 real (kind=kind_phys),
dimension( 1:nsoil),
intent(inout) :: sice
7087 real (kind=kind_phys),
dimension( 1:nsoil),
intent(inout) :: smc
7088 real (kind=kind_phys),
intent(inout) :: zwt
7089 real (kind=kind_phys),
intent(inout) :: wa
7090 real (kind=kind_phys),
intent(inout) :: wt
7092 real (kind=kind_phys),
intent(inout) :: wslake
7093 real (kind=kind_phys) ,
intent(inout) :: ponding
7094 real (kind=kind_phys),
intent(inout) :: smcwtd
7095 real (kind=kind_phys),
intent(inout) :: deeprech
7096 real (kind=kind_phys),
intent(inout) :: rech
7099 real (kind=kind_phys),
intent(out) :: cmc
7100 real (kind=kind_phys),
intent(out) :: ecan
7101 real (kind=kind_phys),
intent(out) :: etran
7102 real (kind=kind_phys),
intent(out) :: fwet
7103 real (kind=kind_phys),
intent(out) :: runsrf
7104 real (kind=kind_phys),
intent(out) :: runsub
7105 real (kind=kind_phys),
intent(out) :: qin
7106 real (kind=kind_phys),
intent(out) :: qdis
7107 real (kind=kind_phys),
intent(out) :: ponding1
7108 real (kind=kind_phys),
intent(out) :: ponding2
7109 real (kind=kind_phys),
intent(out) :: esnow
7110 real (kind=kind_phys),
intent(out) :: qsnbot
7111 real (kind=kind_phys) ,
intent(in) :: latheav
7112 real (kind=kind_phys) ,
intent(in) :: latheag
7113 logical ,
intent(in) :: frozen_ground
7114 logical ,
intent(in) :: frozen_canopy
7119 real (kind=kind_phys) :: qinsur
7120 real (kind=kind_phys) :: qseva
7121 real (kind=kind_phys) :: qsdew
7122 real (kind=kind_phys) :: qsnfro
7123 real (kind=kind_phys) :: qsnsub
7124 real (kind=kind_phys),
dimension( 1:nsoil) :: etrani
7125 real (kind=kind_phys),
dimension( 1:nsoil) :: wcnd
7126 real (kind=kind_phys) :: qdrain
7127 real (kind=kind_phys) :: snoflow
7128 real (kind=kind_phys) :: fcrmax
7130 real (kind=kind_phys),
parameter :: wslmax = 5000.
7136 etrani(1:nsoil) = 0.
7143 call canwater (parameters,vegtyp ,dt , &
7144 fcev ,fctr ,elai , &
7145 esai ,tg ,fveg ,iloc , jloc, &
7146 bdfall ,frozen_canopy , &
7147 canliq ,canice ,tv , &
7148 cmc ,ecan ,etran , &
7154 if (sneqv > 0.)
then
7155 qsnsub = min(qvap, sneqv/dt)
7161 if (sneqv > 0.)
then
7164 qsdew = qdew - qsnfro
7166 call snowwater (parameters,nsnow ,nsoil ,imelt ,dt ,zsoil , &
7167 & sfctmp ,snowhin,qsnow ,qsnfro ,qsnsub , &
7168 & qrain ,ficeold,iloc ,jloc , &
7169 & isnow ,snowh ,sneqv ,snice ,snliq , &
7170 & sh2o ,sice ,stc ,zsnso ,dzsnso , &
7171 & qsnbot ,snoflow,ponding1 ,ponding2)
7173 if(frozen_ground)
then
7174 sice(1) = sice(1) + (qsdew-qseva)*dt/(dzsnso(1)*1000.)
7177 if(sice(1) < 0.)
then
7178 sh2o(1) = sh2o(1) + sice(1)
7186 qinsur = (ponding+ponding1+ponding2)/dt * 0.001
7190 qinsur = qinsur+(qsnbot + qsdew + qrain) * 0.001
7192 qinsur = qinsur+(qsnbot + qsdew) * 0.001
7195 qseva = qseva * 0.001
7197 do iz = 1, parameters%nroot
7198 etrani(iz) = etran * btrani(iz) * 0.001
7206 if(wslake >= wslmax) runsrf = qinsur*1000.
7207 wslake = wslake + (qinsur-qseva)*1000.*dt -runsrf*dt
7209 call soilwater (parameters,nsoil ,nsnow ,dt ,zsoil ,dzsnso , &
7210 qinsur ,qseva ,etrani ,sice ,iloc , jloc , &
7211 sh2o ,smc ,zwt ,vegtyp , &
7212 smcwtd, deeprech , &
7213 runsrf ,qdrain ,runsub ,wcnd ,fcrmax )
7215 if(opt_run == 1)
then
7216 call groundwater (parameters,nsnow ,nsoil ,dt ,sice ,zsoil , &
7217 stc ,wcnd ,fcrmax ,iloc ,jloc , &
7218 sh2o ,zwt ,wa ,wt , &
7223 if(opt_run == 3 .or. opt_run == 4)
then
7224 runsub = runsub + qdrain
7228 smc(iz) = sh2o(iz) + sice(iz)
7231 if(opt_run == 5)
then
7233 dzsnso ,smceq ,iloc , jloc , &
7234 smc ,zwt ,smcwtd ,rech, qdrain )
7236 sh2o(nsoil) = smc(nsoil) - sice(nsoil)
7237 runsub = runsub + qdrain
7243 runsub = runsub + snoflow
7245 end subroutine water
7252 fcev ,fctr ,elai , & !in
7253 esai ,tg ,fveg ,iloc , jloc , & !in
7254 bdfall ,frozen_canopy , & !in
7255 canliq ,canice ,tv , & !inout
7256 cmc ,ecan ,etran , & !out
7265 type (noahmp_parameters),
intent(in) :: parameters
7266 integer,
intent(in) :: iloc
7267 integer,
intent(in) :: jloc
7268 integer,
intent(in) :: vegtyp
7269 real (kind=kind_phys),
intent(in) :: dt
7270 real (kind=kind_phys),
intent(in) :: fcev
7271 real (kind=kind_phys),
intent(in) :: fctr
7272 real (kind=kind_phys),
intent(in) :: elai
7273 real (kind=kind_phys),
intent(in) :: esai
7274 real (kind=kind_phys),
intent(in) :: tg
7275 real (kind=kind_phys),
intent(in) :: fveg
7276 logical ,
intent(in) :: frozen_canopy
7277 real (kind=kind_phys),
intent(in) :: bdfall
7280 real (kind=kind_phys),
intent(inout) :: canliq
7281 real (kind=kind_phys),
intent(inout) :: canice
7282 real (kind=kind_phys),
intent(inout) :: tv
7285 real (kind=kind_phys),
intent(out) :: cmc
7286 real (kind=kind_phys),
intent(out) :: ecan
7287 real (kind=kind_phys),
intent(out) :: etran
7288 real (kind=kind_phys),
intent(out) :: fwet
7292 real (kind=kind_phys) :: maxsno
7293 real (kind=kind_phys) :: maxliq
7294 real (kind=kind_phys) :: qevac
7295 real (kind=kind_phys) :: qdewc
7296 real (kind=kind_phys) :: qfroc
7297 real (kind=kind_phys) :: qsubc
7298 real (kind=kind_phys) :: qmeltc
7299 real (kind=kind_phys) :: qfrzc
7300 real (kind=kind_phys) :: canmas
7309 maxliq = parameters%ch2op * (elai+ esai)
7313 if (.not.frozen_canopy)
then
7314 etran = max( fctr/hvap, 0. )
7315 qevac = max( fcev/hvap, 0. )
7316 qdewc = abs( min( fcev/hvap, 0. ) )
7320 etran = max( fctr/hsub, 0. )
7323 qsubc = max( fcev/hsub, 0. )
7324 qfroc = abs( min( fcev/hsub, 0. ) )
7330 qevac = min(canliq/dt,qevac)
7331 canliq=max(0.,canliq+(qdewc-qevac)*dt)
7332 if(canliq <= 1.e-06) canliq = 0.0
7337 maxsno = 6.6*(0.27+46./bdfall) * (elai+ esai)
7339 qsubc = min(canice/dt,qsubc)
7340 canice= max(0.,canice + (qfroc-qsubc)*dt)
7341 if(canice.le.1.e-6) canice = 0.
7345 if(canice.gt.0.)
then
7346 fwet = max(0.,canice) / max(maxsno,1.e-06)
7348 fwet = max(0.,canliq) / max(maxliq,1.e-06)
7350 fwet = min(fwet, 1.) ** 0.667
7357 if(canice.gt.1.e-6.and.tv.gt.tfrz)
then
7358 qmeltc = min(canice/dt,(tv-tfrz)*cice*canice/denice/(dt*hfus))
7359 canice = max(0.,canice - qmeltc*dt)
7360 canliq = max(0.,canliq + qmeltc*dt)
7361 tv = fwet*tfrz + (1.-fwet)*tv
7364 if(canliq.gt.1.e-6.and.tv.lt.tfrz)
then
7365 qfrzc = min(canliq/dt,(tfrz-tv)*cwat*canliq/denh2o/(dt*hfus))
7366 canliq = max(0.,canliq - qfrzc*dt)
7367 canice = max(0.,canice + qfrzc*dt)
7368 tv = fwet*tfrz + (1.-fwet)*tv
7373 cmc = canliq + canice
7377 ecan = qevac + qsubc - qdewc - qfroc
7385 subroutine snowwater (parameters,nsnow ,nsoil ,imelt ,dt ,zsoil , & !in
7386 sfctmp ,snowhin,qsnow ,qsnfro ,qsnsub , & !in
7387 qrain ,ficeold,iloc ,jloc , & !in
7388 isnow ,snowh ,sneqv ,snice ,snliq , & !inout
7389 sh2o ,sice ,stc ,zsnso ,dzsnso , & !inout
7390 qsnbot ,snoflow,ponding1 ,ponding2)
7395 type (noahmp_parameters),
intent(in) :: parameters
7396 integer,
intent(in) :: iloc
7397 integer,
intent(in) :: jloc
7398 integer,
intent(in) :: nsnow
7399 integer,
intent(in) :: nsoil
7400 integer,
dimension(-nsnow+1:0) ,
intent(in) :: imelt
7401 real (kind=kind_phys),
intent(in) :: dt
7402 real (kind=kind_phys),
dimension( 1:nsoil),
intent(in) :: zsoil
7403 real (kind=kind_phys),
intent(in) :: sfctmp
7404 real (kind=kind_phys),
intent(in) :: snowhin
7405 real (kind=kind_phys),
intent(in) :: qsnow
7406 real (kind=kind_phys),
intent(in) :: qsnfro
7407 real (kind=kind_phys),
intent(in) :: qsnsub
7408 real (kind=kind_phys),
intent(in) :: qrain
7409 real (kind=kind_phys),
dimension(-nsnow+1:0) ,
intent(in) :: ficeold
7412 integer,
intent(inout) :: isnow
7413 real (kind=kind_phys),
intent(inout) :: snowh
7414 real (kind=kind_phys),
intent(inout) :: sneqv
7415 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(inout) :: snice
7416 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(inout) :: snliq
7417 real (kind=kind_phys),
dimension( 1:nsoil),
intent(inout) :: sh2o
7418 real (kind=kind_phys),
dimension( 1:nsoil),
intent(inout) :: sice
7419 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: stc
7420 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: zsnso
7421 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: dzsnso
7424 real (kind=kind_phys),
intent(out) :: qsnbot
7425 real (kind=kind_phys),
intent(out) :: snoflow
7426 real (kind=kind_phys),
intent(out) :: ponding1
7427 real (kind=kind_phys),
intent(out) :: ponding2
7431 real (kind=kind_phys) :: bdsnow
7437 call snowfall (parameters,nsoil ,nsnow ,dt ,qsnow ,snowhin, &
7438 sfctmp ,iloc ,jloc , &
7439 isnow ,snowh ,dzsnso ,stc ,snice , &
7445 call compact (parameters,nsnow ,nsoil ,dt ,stc ,snice , &
7446 snliq ,zsoil ,imelt ,ficeold,iloc , jloc ,&
7447 isnow ,dzsnso ,zsnso )
7450 call combine (parameters,nsnow ,nsoil ,iloc ,jloc , &
7451 isnow ,sh2o ,stc ,snice ,snliq , &
7452 dzsnso ,sice ,snowh ,sneqv , &
7456 call divide (parameters,nsnow ,nsoil , &
7457 isnow ,stc ,snice ,snliq ,dzsnso )
7459 call snowh2o (parameters,nsnow ,nsoil ,dt ,qsnfro ,qsnsub , &
7460 qrain ,iloc ,jloc , &
7461 isnow ,dzsnso ,snowh ,sneqv ,snice , &
7462 snliq ,sh2o ,sice ,stc , &
7463 qsnbot ,ponding1 ,ponding2)
7467 do iz = -nsnow+1, isnow
7477 if(sneqv > 5000.)
then
7478 bdsnow = snice(0) / dzsnso(0)
7479 snoflow = (sneqv - 5000.)
7480 snice(0) = snice(0) - snoflow
7481 dzsnso(0) = dzsnso(0) - snoflow/bdsnow
7482 snoflow = snoflow / dt
7491 sneqv = sneqv + snice(iz) + snliq(iz)
7492 snowh = snowh + dzsnso(iz)
7499 dzsnso(iz) = -dzsnso(iz)
7502 dzsnso(1) = zsoil(1)
7504 dzsnso(iz) = (zsoil(iz) - zsoil(iz-1))
7507 zsnso(isnow+1) = dzsnso(isnow+1)
7508 do iz = isnow+2 ,nsoil
7509 zsnso(iz) = zsnso(iz-1) + dzsnso(iz)
7512 do iz = isnow+1 ,nsoil
7513 dzsnso(iz) = -dzsnso(iz)
7523 subroutine snowfall (parameters,nsoil ,nsnow ,dt ,qsnow ,snowhin , & !in
7524 sfctmp ,iloc ,jloc , & !in
7525 isnow ,snowh ,dzsnso ,stc ,snice , & !inout
7535 type (noahmp_parameters),
intent(in) :: parameters
7536 integer,
intent(in) :: iloc
7537 integer,
intent(in) :: jloc
7538 integer,
intent(in) :: nsoil
7539 integer,
intent(in) :: nsnow
7540 real (kind=kind_phys),
intent(in) :: dt
7541 real (kind=kind_phys),
intent(in) :: qsnow
7542 real (kind=kind_phys),
intent(in) :: snowhin
7543 real (kind=kind_phys),
intent(in) :: sfctmp
7547 integer,
intent(inout) :: isnow
7548 real (kind=kind_phys),
intent(inout) :: snowh
7549 real (kind=kind_phys),
intent(inout) :: sneqv
7550 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: dzsnso
7551 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: stc
7552 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(inout) :: snice
7553 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(inout) :: snliq
7563 if(isnow == 0 .and. qsnow > 0.)
then
7564 snowh = snowh + snowhin * dt
7565 sneqv = sneqv + qsnow * dt
7570 if(isnow == 0 .and. qsnow>0. .and. snowh >= 0.025)
then
7576 stc(0) = min(273.16, sfctmp)
7583 if(isnow < 0 .and. newnode == 0 .and. qsnow > 0.)
then
7584 snice(isnow+1) = snice(isnow+1) + qsnow * dt
7585 dzsnso(isnow+1) = dzsnso(isnow+1) + snowhin * dt
7595 subroutine combine (parameters,nsnow ,nsoil ,iloc ,jloc , & !in
7596 isnow ,sh2o ,stc ,snice ,snliq , & !inout
7597 dzsnso ,sice ,snowh ,sneqv , & !inout
7604 type (noahmp_parameters),
intent(in) :: parameters
7605 integer,
intent(in) :: iloc
7606 integer,
intent(in) :: jloc
7607 integer,
intent(in) :: nsnow
7608 integer,
intent(in) :: nsoil
7612 integer,
intent(inout) :: isnow
7613 real (kind=kind_phys),
dimension( 1:nsoil),
intent(inout) :: sh2o
7614 real (kind=kind_phys),
dimension( 1:nsoil),
intent(inout) :: sice
7615 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: stc
7616 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(inout) :: snice
7617 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(inout) :: snliq
7618 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: dzsnso
7619 real (kind=kind_phys),
intent(inout) :: sneqv
7620 real (kind=kind_phys),
intent(inout) :: snowh
7621 real (kind=kind_phys),
intent(out) :: ponding1
7622 real (kind=kind_phys),
intent(out) :: ponding2
7627 integer :: isnow_old
7630 real (kind=kind_phys) :: zwice
7631 real (kind=kind_phys) :: zwliq
7633 real (kind=kind_phys) :: dzmin(3)
7635 data dzmin /0.025, 0.025, 0.1/
7640 do j = isnow_old+1,0
7641 if (snice(j) <= .1)
then
7643 snliq(j+1) = snliq(j+1) + snliq(j)
7644 snice(j+1) = snice(j+1) + snice(j)
7645 dzsnso(j+1) = dzsnso(j+1) + dzsnso(j)
7647 if (isnow_old < -1)
then
7648 snliq(j-1) = snliq(j-1) + snliq(j)
7649 snice(j-1) = snice(j-1) + snice(j)
7650 dzsnso(j-1) = dzsnso(j-1) + dzsnso(j)
7652 if(snice(j) >= 0.)
then
7657 ponding1 = snliq(j) + snice(j)
7658 if(ponding1 < 0.)
then
7659 sice(1) = max(0.0,sice(1)+ponding1/(dzsnso(1)*1000.))
7674 if (j > isnow+1 .and. isnow < -1)
then
7675 do i = j, isnow+2, -1
7677 snliq(i) = snliq(i-1)
7678 snice(i) = snice(i-1)
7679 dzsnso(i)= dzsnso(i-1)
7688 if(sice(1) < 0.)
then
7689 sh2o(1) = sh2o(1) + sice(1)
7693 if(isnow ==0)
return
7701 sneqv = sneqv + snice(j) + snliq(j)
7702 snowh = snowh + dzsnso(j)
7703 zwice = zwice + snice(j)
7704 zwliq = zwliq + snliq(j)
7710 if (snowh < 0.025 .and. isnow < 0 )
then
7715 if(sneqv <= 0.) snowh = 0.
7727 if (isnow < -1)
then
7732 do i = isnow_old+1,0
7733 if (dzsnso(i) < dzmin(mssi))
then
7735 if (i == isnow+1)
then
7737 else if (i == 0)
then
7741 if ((dzsnso(i-1)+dzsnso(i)) < (dzsnso(i+1)+dzsnso(i))) neibor = i-1
7745 if (neibor > i)
then
7753 call combo (parameters,dzsnso(j), snliq(j), snice(j), &
7754 stc(j), dzsnso(l), snliq(l), snice(l), stc(l) )
7757 if (j-1 > isnow+1)
then
7758 do k = j-1, isnow+2, -1
7760 snice(k) = snice(k-1)
7761 snliq(k) = snliq(k-1)
7762 dzsnso(k) = dzsnso(k-1)
7768 if (isnow >= -1)
exit
7785 subroutine divide (parameters,nsnow ,nsoil , & !in
7786 isnow ,stc ,snice ,snliq ,dzsnso )
7792 type (noahmp_parameters),
intent(in) :: parameters
7793 integer,
intent(in) :: nsnow
7794 integer,
intent(in) :: nsoil
7798 integer ,
intent(inout) :: isnow
7799 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: stc
7800 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(inout) :: snice
7801 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(inout) :: snliq
7802 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: dzsnso
7808 real (kind=kind_phys) :: drr
7809 real (kind=kind_phys),
dimension( 1:nsnow) :: dz
7810 real (kind=kind_phys),
dimension( 1:nsnow) :: swice
7811 real (kind=kind_phys),
dimension( 1:nsnow) :: swliq
7812 real (kind=kind_phys),
dimension( 1:nsnow) :: tsno
7813 real (kind=kind_phys) :: zwice
7814 real (kind=kind_phys) :: zwliq
7815 real (kind=kind_phys) :: propor
7816 real (kind=kind_phys) :: dtdz
7820 if (j <= abs(isnow))
then
7821 dz(j) = dzsnso(j+isnow)
7822 swice(j) = snice(j+isnow)
7823 swliq(j) = snliq(j+isnow)
7824 tsno(j) = stc(j+isnow)
7832 if (dz(1) > 0.05)
then
7835 swice(1) = swice(1)/2.
7836 swliq(1) = swliq(1)/2.
7845 if (dz(1) > 0.05)
then
7848 zwice = propor*swice(1)
7849 zwliq = propor*swliq(1)
7851 swice(1) = propor*swice(1)
7852 swliq(1) = propor*swliq(1)
7855 call combo (parameters,dz(2), swliq(2), swice(2), tsno(2), drr, &
7856 zwliq, zwice, tsno(1))
7859 if (msno <= 2 .and. dz(2) > 0.20)
then
7862 dtdz = (tsno(1) - tsno(2))/((dz(1)+dz(2))/2.)
7864 swice(2) = swice(2)/2.
7865 swliq(2) = swliq(2)/2.
7869 tsno(3) = tsno(2) - dtdz*dz(2)/2.
7870 if (tsno(3) >= tfrz)
then
7873 tsno(2) = tsno(2) + dtdz*dz(2)/2.
7881 if (dz(2) > 0.2)
then
7884 zwice = propor*swice(2)
7885 zwliq = propor*swliq(2)
7887 swice(2) = propor*swice(2)
7888 swliq(2) = propor*swliq(2)
7890 call combo (parameters,dz(3), swliq(3), swice(3), tsno(3), drr, &
7891 zwliq, zwice, tsno(2))
7898 dzsnso(j) = dz(j-isnow)
7899 snice(j) = swice(j-isnow)
7900 snliq(j) = swliq(j-isnow)
7901 stc(j) = tsno(j-isnow)
7915 subroutine combo(parameters,dz, wliq, wice, t, dz2, wliq2, wice2, t2)
7923 type (noahmp_parameters),
intent(in) :: parameters
7924 real (kind=kind_phys),
intent(in) :: dz2
7925 real (kind=kind_phys),
intent(in) :: wliq2
7926 real (kind=kind_phys),
intent(in) :: wice2
7927 real (kind=kind_phys),
intent(in) :: t2
7928 real (kind=kind_phys),
intent(inout) :: dz
7929 real (kind=kind_phys),
intent(inout) :: wliq
7930 real (kind=kind_phys),
intent(inout) :: wice
7931 real (kind=kind_phys),
intent(inout) :: t
7935 real (kind=kind_phys) :: dzc
7936 real (kind=kind_phys) :: wliqc
7937 real (kind=kind_phys) :: wicec
7938 real (kind=kind_phys) :: tc
7939 real (kind=kind_phys) :: h
7940 real (kind=kind_phys) :: h2
7941 real (kind=kind_phys) :: hc
7946 wicec = (wice+wice2)
7947 wliqc = (wliq+wliq2)
7948 h = (cice*wice+cwat*wliq) * (t-tfrz)+hfus*wliq
7949 h2= (cice*wice2+cwat*wliq2) * (t2-tfrz)+hfus*wliq2
7953 tc = tfrz + hc/(cice*wicec + cwat*wliqc)
7954 else if (hc.le.hfus*wliqc)
then
7957 tc = tfrz + (hc - hfus*wliqc) / (cice*wicec + cwat*wliqc)
7965 end subroutine combo
7971 subroutine compact (parameters,nsnow ,nsoil ,dt ,stc ,snice , & !in
7972 snliq ,zsoil ,imelt ,ficeold,iloc , jloc , & !in
7973 isnow ,dzsnso ,zsnso )
7978 type (noahmp_parameters),
intent(in) :: parameters
7979 integer,
intent(in) :: iloc
7980 integer,
intent(in) :: jloc
7981 integer,
intent(in) :: nsoil
7982 integer,
intent(in) :: nsnow
7983 integer,
dimension(-nsnow+1:0) ,
intent(in) :: imelt
7984 real (kind=kind_phys),
intent(in) :: dt
7985 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: stc
7986 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(in) :: snice
7987 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(in) :: snliq
7988 real (kind=kind_phys),
dimension( 1:nsoil),
intent(in) :: zsoil
7989 real (kind=kind_phys),
dimension(-nsnow+1: 0),
intent(in) :: ficeold
7992 integer,
intent(inout) :: isnow
7993 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: dzsnso
7994 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: zsnso
7997 real (kind=kind_phys),
parameter :: c2 = 21.e-3
7998 real (kind=kind_phys),
parameter :: c3 = 2.5e-6
7999 real (kind=kind_phys),
parameter :: c4 = 0.04
8000 real (kind=kind_phys),
parameter :: c5 = 2.0
8001 real (kind=kind_phys),
parameter :: dm = 100.0
8002 real (kind=kind_phys),
parameter :: eta0 = 1.8e+6
8004 real (kind=kind_phys) :: burden
8005 real (kind=kind_phys) :: ddz1
8006 real (kind=kind_phys) :: ddz2
8007 real (kind=kind_phys) :: ddz3
8008 real (kind=kind_phys) :: dexpf
8009 real (kind=kind_phys) :: td
8010 real (kind=kind_phys) :: pdzdtc
8011 real (kind=kind_phys) :: void
8012 real (kind=kind_phys) :: wx
8013 real (kind=kind_phys) :: bi
8014 real (kind=kind_phys),
dimension(-nsnow+1:0) :: fice
8023 wx = snice(j) + snliq(j)
8024 fice(j) = snice(j) / wx
8025 void = 1. - (snice(j)/denice + snliq(j)/denh2o) / dzsnso(j)
8028 if (void > 0.001 .and. snice(j) > 0.1)
then
8029 bi = snice(j) / dzsnso(j)
8030 td = max(0.,tfrz-stc(j))
8037 if (bi > dm) ddz1 = ddz1*exp(-46.0e-3*(bi-dm))
8041 if (snliq(j) > 0.01*dzsnso(j)) ddz1=ddz1*c5
8045 ddz2 = -(burden+0.5*wx)*exp(-0.08*td-c2*bi)/eta0
8049 if (imelt(j) == 1)
then
8050 ddz3 = max(0.,(ficeold(j) - fice(j))/max(1.e-6,ficeold(j)))
8058 pdzdtc = (ddz1 + ddz2 + ddz3)*dt
8059 pdzdtc = max(-0.5,pdzdtc)
8063 dzsnso(j) = dzsnso(j)*(1.+pdzdtc)
8064 dzsnso(j) = min(max(dzsnso(j),(snliq(j)+snice(j))/500.0),(snliq(j)+snice(j))/50.0)
8069 burden = burden + wx
8080 subroutine snowh2o (parameters,nsnow ,nsoil ,dt ,qsnfro ,qsnsub , & !in
8081 qrain ,iloc ,jloc , & !in
8082 isnow ,dzsnso ,snowh ,sneqv ,snice , & !inout
8083 snliq ,sh2o ,sice ,stc , & !inout
8084 qsnbot ,ponding1 ,ponding2)
8093 type (noahmp_parameters),
intent(in) :: parameters
8094 integer,
intent(in) :: iloc
8095 integer,
intent(in) :: jloc
8096 integer,
intent(in) :: nsnow
8097 integer,
intent(in) :: nsoil
8098 real (kind=kind_phys),
intent(in) :: dt
8099 real (kind=kind_phys),
intent(in) :: qsnfro
8100 real (kind=kind_phys),
intent(in) :: qsnsub
8101 real (kind=kind_phys),
intent(in) :: qrain
8105 real (kind=kind_phys),
intent(out) :: qsnbot
8109 integer,
intent(inout) :: isnow
8110 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: dzsnso
8111 real (kind=kind_phys),
intent(inout) :: snowh
8112 real (kind=kind_phys),
intent(inout) :: sneqv
8113 real (kind=kind_phys),
dimension(-nsnow+1:0),
intent(inout) :: snice
8114 real (kind=kind_phys),
dimension(-nsnow+1:0),
intent(inout) :: snliq
8115 real (kind=kind_phys),
dimension( 1:nsoil),
intent(inout) :: sh2o
8116 real (kind=kind_phys),
dimension( 1:nsoil),
intent(inout) :: sice
8117 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(inout) :: stc
8122 real (kind=kind_phys) :: qin
8123 real (kind=kind_phys) :: qout
8124 real (kind=kind_phys) :: wgdif
8125 real (kind=kind_phys),
dimension(-nsnow+1:0) :: vol_liq
8126 real (kind=kind_phys),
dimension(-nsnow+1:0) :: vol_ice
8127 real (kind=kind_phys),
dimension(-nsnow+1:0) :: epore
8128 real (kind=kind_phys) :: propor, temp
8129 real (kind=kind_phys) :: ponding1, ponding2
8130 real (kind=kind_phys),
parameter :: max_liq_mass_fraction = 0.4
8135 if(sneqv == 0.)
then
8136 sice(1) = sice(1) + (qsnfro-qsnsub)*dt/(dzsnso(1)*1000.)
8137 if(sice(1) < 0.)
then
8138 sh2o(1) = sh2o(1) + sice(1)
8148 if(isnow == 0 .and. sneqv > 0.)
then
8150 sneqv = sneqv - qsnsub*dt + qsnfro*dt
8152 snowh = max(0.,propor * snowh)
8153 snowh = min(max(snowh,sneqv/500.0),sneqv/50.0)
8156 sice(1) = sice(1) + sneqv/(dzsnso(1)*1000.)
8160 if(sice(1) < 0.)
then
8161 sh2o(1) = sh2o(1) + sice(1)
8166 if(snowh <= 1.e-6 .or. sneqv <= 1.e-3)
then
8173 if ( isnow < 0 )
then
8175 wgdif = snice(isnow+1) - qsnsub*dt + qsnfro*dt
8176 snice(isnow+1) = wgdif
8177 if (wgdif < 1.e-6 .and. isnow <0)
then
8178 call combine (parameters,nsnow ,nsoil ,iloc, jloc , &
8179 isnow ,sh2o ,stc ,snice ,snliq , &
8180 dzsnso ,sice ,snowh ,sneqv , &
8181 ponding1, ponding2 )
8184 if ( isnow < 0 )
then
8185 snliq(isnow+1) = snliq(isnow+1) + qrain * dt
8186 snliq(isnow+1) = max(0., snliq(isnow+1))
8194 vol_ice(j) = min(1., snice(j)/(dzsnso(j)*denice))
8195 epore(j) = 1. - vol_ice(j)
8202 snliq(j) = snliq(j) + qin
8203 vol_liq(j) = snliq(j)/(dzsnso(j)*denh2o)
8204 qout = max(0.,(vol_liq(j)-parameters%ssi*epore(j))*dzsnso(j))
8206 qout = max((vol_liq(j)- epore(j))*dzsnso(j) , parameters%snow_ret_fac*dt*qout)
8209 snliq(j) = snliq(j) - qout
8210 if((snliq(j)/(snice(j)+snliq(j))) > max_liq_mass_fraction)
then
8211 qout = qout + (snliq(j) - max_liq_mass_fraction/(1.0 - max_liq_mass_fraction)*snice(j))
8212 snliq(j) = max_liq_mass_fraction/(1.0 - max_liq_mass_fraction)*snice(j)
8218 dzsnso(j) = min(max(dzsnso(j),(snliq(j)+snice(j))/500.0),(snliq(j)+snice(j))/50.0)
8231 subroutine soilwater (parameters,nsoil ,nsnow ,dt ,zsoil ,dzsnso , & !in
8232 qinsur ,qseva ,etrani ,sice ,iloc , jloc, & !in
8233 sh2o ,smc ,zwt ,vegtyp ,& !inout
8234 smcwtd, deeprech ,& !inout
8235 runsrf ,qdrain ,runsub ,wcnd ,fcrmax )
8244 type (noahmp_parameters),
intent(in) :: parameters
8245 integer,
intent(in) :: iloc
8246 integer,
intent(in) :: jloc
8247 integer,
intent(in) :: nsoil
8248 integer,
intent(in) :: nsnow
8249 real (kind=kind_phys),
intent(in) :: dt
8250 real (kind=kind_phys),
intent(in) :: qinsur
8251 real (kind=kind_phys),
intent(in) :: qseva
8252 real (kind=kind_phys),
dimension(1:nsoil),
intent(in) :: zsoil
8253 real (kind=kind_phys),
dimension(1:nsoil),
intent(in) :: etrani
8254 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: dzsnso
8255 real (kind=kind_phys),
dimension(1:nsoil),
intent(in) :: sice
8257 integer,
intent(in) :: vegtyp
8260 real (kind=kind_phys),
dimension(1:nsoil),
intent(inout) :: sh2o
8261 real (kind=kind_phys),
dimension(1:nsoil),
intent(inout) :: smc
8262 real (kind=kind_phys),
intent(inout) :: zwt
8263 real (kind=kind_phys),
intent(inout) :: smcwtd
8264 real (kind=kind_phys) ,
intent(inout) :: deeprech
8267 real (kind=kind_phys),
intent(out) :: qdrain
8268 real (kind=kind_phys),
intent(out) :: runsrf
8269 real (kind=kind_phys),
intent(out) :: runsub
8270 real (kind=kind_phys),
intent(out) :: fcrmax
8271 real (kind=kind_phys),
dimension(1:nsoil),
intent(out) :: wcnd
8276 real (kind=kind_phys) :: dtfine
8277 real (kind=kind_phys),
dimension(1:nsoil) :: rhstt
8278 real (kind=kind_phys),
dimension(1:nsoil) :: ai
8279 real (kind=kind_phys),
dimension(1:nsoil) :: bi
8280 real (kind=kind_phys),
dimension(1:nsoil) :: ci
8282 real (kind=kind_phys) :: fff
8283 real (kind=kind_phys) :: rsbmx
8284 real (kind=kind_phys) :: pddum
8285 real (kind=kind_phys) :: fice
8286 real (kind=kind_phys) :: wplus
8287 real (kind=kind_phys) :: rsat
8288 real (kind=kind_phys) :: sicemax
8289 real (kind=kind_phys) :: sh2omin
8290 real (kind=kind_phys) :: wtsub
8291 real (kind=kind_phys) :: mh2o
8292 real (kind=kind_phys) :: fsat
8293 real (kind=kind_phys),
dimension(1:nsoil) :: mliq
8294 real (kind=kind_phys) :: xs
8295 real (kind=kind_phys) :: watmin
8296 real (kind=kind_phys) :: qdrain_save
8297 real (kind=kind_phys) :: runsrf_save
8298 real (kind=kind_phys) :: epore
8299 real (kind=kind_phys),
dimension(1:nsoil) :: fcr
8301 real (kind=kind_phys) :: smctot
8302 real (kind=kind_phys) :: dztot
8303 real (kind=kind_phys),
parameter :: a = 4.0
8312 epore = max( 1.e-4 , ( parameters%smcmax(k) - sice(k) ) )
8313 rsat = rsat + max(0.,sh2o(k)-epore)*dzsnso(k)
8314 sh2o(k) = min(epore,sh2o(k))
8320 fice = min(1.0,sice(k)/parameters%smcmax(k))
8321 fcr(k) = max(0.0,exp(-a*(1.-fice))- exp(-a)) / &
8329 sh2omin = parameters%smcmax(1)
8331 if (sice(k) > sicemax) sicemax = sice(k)
8332 if (fcr(k) > fcrmax) fcrmax = fcr(k)
8333 if (sh2o(k) < sh2omin) sh2omin = sh2o(k)
8338 if(opt_run == 2)
then
8341 call zwteq (parameters,nsoil ,nsnow ,zsoil ,dzsnso ,sh2o ,zwt)
8342 runsub = (1.0-fcrmax) * rsbmx * exp(-parameters%timean) * exp(-fff*zwt)
8348 if ( parameters%urban_flag ) fcr(1)= 0.95
8350 if(opt_run == 1)
then
8352 fff = parameters%bexp(1) / 3.0
8354 fsat = parameters%fsatmx*exp(-0.5*fff*zwt)
8355 if(qinsur > 0.)
then
8356 runsrf = qinsur * ( (1.0-fcr(1))*fsat + fcr(1) )
8357 pddum = qinsur - runsrf
8361 if(opt_run == 5)
then
8363 fsat = parameters%fsatmx*exp(-0.5*fff*max(-2.0-zwt,0.))
8364 if(qinsur > 0.)
then
8365 runsrf = qinsur * ( (1.0-fcr(1))*fsat + fcr(1) )
8366 pddum = qinsur - runsrf
8370 if(opt_run == 2)
then
8372 fsat = parameters%fsatmx*exp(-0.5*fff*zwt)
8373 if(qinsur > 0.)
then
8374 runsrf = qinsur * ( (1.0-fcr(1))*fsat + fcr(1) )
8375 pddum = qinsur - runsrf
8379 if(opt_run == 3)
then
8380 call infil (parameters,nsoil ,dt ,zsoil ,sh2o ,sice , &
8385 if(opt_run == 4)
then
8389 dztot = dztot + dzsnso(k)
8390 smctot = smctot + smc(k)/parameters%smcmax(k)*dzsnso(k)
8391 if(dztot >= 2.0)
exit
8393 smctot = smctot/dztot
8394 fsat = max(0.01,smctot) ** 4.
8396 if(qinsur > 0.)
then
8397 runsrf = qinsur * ((1.0-fcr(1))*fsat+fcr(1))
8398 pddum = qinsur - runsrf
8408 if (pddum*dt>dzsnso(1)*parameters%smcmax(1) )
then
8420 if(qinsur > 0. .and. opt_run == 3)
then
8421 call infil (parameters,nsoil ,dtfine ,zsoil ,sh2o ,sice , &
8426 call srt (parameters,nsoil ,zsoil ,dtfine ,pddum ,etrani , &
8427 qseva ,sh2o ,smc ,zwt ,fcr , &
8428 sicemax,fcrmax ,iloc ,jloc ,smcwtd , &
8429 rhstt ,ai ,bi ,ci ,qdrain , &
8432 call sstep (parameters,nsoil ,nsnow ,dtfine ,zsoil ,dzsnso , &
8433 sice ,iloc ,jloc ,zwt , &
8434 sh2o ,smc ,ai ,bi ,ci , &
8435 rhstt ,smcwtd ,qdrain ,deeprech, &
8438 qdrain_save = qdrain_save + qdrain
8439 runsrf_save = runsrf_save + runsrf
8442 qdrain = qdrain_save/niter
8443 runsrf = runsrf_save/niter
8445 runsrf = runsrf * 1000. + rsat * 1000./dt
8446 qdrain = qdrain * 1000.
8453 if(opt_run == 2)
then
8456 wtsub = wtsub + wcnd(k)*dzsnso(k)
8460 mh2o = runsub*dt*(wcnd(k)*dzsnso(k))/wtsub
8461 sh2o(k) = sh2o(k) - mh2o/(dzsnso(k)*1000.)
8468 if(opt_run /= 1)
then
8470 mliq(iz) = sh2o(iz)*dzsnso(iz)*1000.
8475 if (mliq(iz) .lt. 0.)
then
8476 xs = watmin-mliq(iz)
8480 mliq(iz ) = mliq(iz ) + xs
8481 mliq(iz+1) = mliq(iz+1) - xs
8485 if (mliq(iz) .lt. watmin)
then
8486 xs = watmin-mliq(iz)
8490 mliq(iz) = mliq(iz) + xs
8491 runsub = runsub - xs/dt
8492 if(opt_run == 5)deeprech = deeprech - xs*1.e-3
8495 sh2o(iz) = mliq(iz) / (dzsnso(iz)*1000.)
8505 subroutine zwteq (parameters,nsoil ,nsnow ,zsoil ,dzsnso ,sh2o ,zwt)
8513 type (noahmp_parameters),
intent(in) :: parameters
8514 integer,
intent(in) :: nsoil
8515 integer,
intent(in) :: nsnow
8516 real (kind=kind_phys),
dimension(1:nsoil),
intent(in) :: zsoil
8517 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: dzsnso
8518 real (kind=kind_phys),
dimension(1:nsoil),
intent(in) :: sh2o
8522 real (kind=kind_phys),
intent(out) :: zwt
8527 integer,
parameter :: nfine = 100
8528 real (kind=kind_phys) :: wd1
8529 real (kind=kind_phys) :: wd2
8530 real (kind=kind_phys) :: dzfine
8531 real (kind=kind_phys) :: temp
8532 real (kind=kind_phys),
dimension(1:nfine) :: zfine
8537 wd1 = wd1 + (parameters%smcmax(1)-sh2o(k)) * dzsnso(k)
8540 dzfine = 3.0 * (-zsoil(nsoil)) / nfine
8542 zfine(k) = float(k) * dzfine
8545 zwt = -3.*zsoil(nsoil) - 0.001
8549 temp = 1. + (zwt-zfine(k))/parameters%psisat(1)
8550 wd2 = wd2 + parameters%smcmax(1)*(1.-temp**(-1./parameters%bexp(1)))*dzfine
8551 if(abs(wd2-wd1).le.0.01)
then
8557 end subroutine zwteq
8563 subroutine infil (parameters,nsoil ,dt ,zsoil ,sh2o ,sice , & !in
8564 sicemax,qinsur , & !in
8572 type (noahmp_parameters),
intent(in) :: parameters
8573 integer,
intent(in) :: nsoil
8574 real (kind=kind_phys),
intent(in) :: dt
8575 real (kind=kind_phys),
dimension(1:nsoil),
intent(in) :: zsoil
8576 real (kind=kind_phys),
dimension(1:nsoil),
intent(in) :: sh2o
8577 real (kind=kind_phys),
dimension(1:nsoil),
intent(in) :: sice
8578 real (kind=kind_phys),
intent(in) :: qinsur
8579 real (kind=kind_phys),
intent(in) :: sicemax
8582 real (kind=kind_phys),
intent(out) :: runsrf
8583 real (kind=kind_phys),
intent(out) :: pddum
8586 integer :: ialp1, j, jj, k
8587 real (kind=kind_phys) :: val
8588 real (kind=kind_phys) :: ddt
8589 real (kind=kind_phys) :: px
8590 real (kind=kind_phys) :: dt1, dd, dice
8591 real (kind=kind_phys) :: fcr
8592 real (kind=kind_phys) :: sum
8593 real (kind=kind_phys) :: acrt
8594 real (kind=kind_phys) :: wdf
8595 real (kind=kind_phys) :: wcnd
8596 real (kind=kind_phys) :: smcav
8597 real (kind=kind_phys) :: infmax
8598 real (kind=kind_phys),
dimension(1:nsoil) :: dmax
8599 integer,
parameter :: cvfrz = 3
8602 if (qinsur > 0.0)
then
8604 smcav = parameters%smcmax(1) - parameters%smcwlt(1)
8608 dmax(1)= -zsoil(1) * smcav
8609 dice = -zsoil(1) * sice(1)
8610 dmax(1)= dmax(1)* (1.0-(sh2o(1) + sice(1) - parameters%smcwlt(1))/smcav)
8615 dice = dice + (zsoil(k-1) - zsoil(k) ) * sice(k)
8616 dmax(k) = (zsoil(k-1) - zsoil(k)) * smcav
8617 dmax(k) = dmax(k) * (1.0-(sh2o(k) + sice(k) - parameters%smcwlt(k))/smcav)
8621 val = (1. - exp( - parameters%kdt * dt1))
8623 px = max(0.,qinsur * dt)
8624 infmax = (px * (ddt / (px + ddt)))/ dt
8629 if (dice > 1.e-2)
then
8630 acrt = cvfrz * parameters%frzx / dice
8638 sum = sum + (acrt ** (cvfrz - j)) / float(k)
8640 fcr = 1. - exp(-acrt) * sum
8645 infmax = infmax * fcr
8650 call wdfcnd2 (parameters,wdf,wcnd,sh2o(1),sicemax,1)
8651 infmax = max(infmax,wcnd)
8652 infmax = min(infmax,px/dt)
8654 runsrf= max(0., qinsur - infmax)
8655 pddum = qinsur - runsrf
8659 end subroutine infil
8667 subroutine srt (parameters,nsoil ,zsoil ,dt ,pddum ,etrani , & !in
8668 qseva ,sh2o ,smc ,zwt ,fcr , & !in
8669 sicemax,fcrmax ,iloc ,jloc ,smcwtd , & !in
8670 rhstt ,ai ,bi ,ci ,qdrain , & !out
8681 type (noahmp_parameters),
intent(in) :: parameters
8682 integer,
intent(in) :: iloc
8683 integer,
intent(in) :: jloc
8684 integer,
intent(in) :: nsoil
8685 real (kind=kind_phys),
dimension(1:nsoil),
intent(in) :: zsoil
8686 real (kind=kind_phys),
intent(in) :: dt
8687 real (kind=kind_phys),
intent(in) :: pddum
8688 real (kind=kind_phys),
intent(in) :: qseva
8689 real (kind=kind_phys),
dimension(1:nsoil),
intent(in) :: etrani
8690 real (kind=kind_phys),
dimension(1:nsoil),
intent(in) :: sh2o
8691 real (kind=kind_phys),
dimension(1:nsoil),
intent(in) :: smc
8692 real (kind=kind_phys),
intent(in) :: zwt
8693 real (kind=kind_phys),
dimension(1:nsoil),
intent(in) :: fcr
8694 real (kind=kind_phys),
intent(in) :: fcrmax
8695 real (kind=kind_phys),
intent(in) :: sicemax
8696 real (kind=kind_phys),
intent(in) :: smcwtd
8700 real (kind=kind_phys),
dimension(1:nsoil),
intent(out) :: rhstt
8701 real (kind=kind_phys),
dimension(1:nsoil),
intent(out) :: ai
8702 real (kind=kind_phys),
dimension(1:nsoil),
intent(out) :: bi
8703 real (kind=kind_phys),
dimension(1:nsoil),
intent(out) :: ci
8704 real (kind=kind_phys),
dimension(1:nsoil),
intent(out) :: wcnd
8705 real (kind=kind_phys),
intent(out) :: qdrain
8709 real (kind=kind_phys),
dimension(1:nsoil) :: ddz
8710 real (kind=kind_phys),
dimension(1:nsoil) :: denom
8711 real (kind=kind_phys),
dimension(1:nsoil) :: dsmdz
8712 real (kind=kind_phys),
dimension(1:nsoil) :: wflux
8713 real (kind=kind_phys),
dimension(1:nsoil) :: wdf
8714 real (kind=kind_phys),
dimension(1:nsoil) :: smx
8715 real (kind=kind_phys) :: temp1
8716 real (kind=kind_phys) :: smxwtd
8717 real (kind=kind_phys) :: smxbot
8722 if(opt_inf == 1)
then
8724 call wdfcnd1 (parameters,wdf(k),wcnd(k),smc(k),fcr(k),k)
8727 if(opt_run == 5)smxwtd=smcwtd
8730 if(opt_inf == 2)
then
8732 call wdfcnd2 (parameters,wdf(k),wcnd(k),sh2o(k),sicemax,k)
8735 if(opt_run == 5)smxwtd=smcwtd*sh2o(nsoil)/smc(nsoil)
8740 denom(k) = - zsoil(k)
8741 temp1 = - zsoil(k+1)
8742 ddz(k) = 2.0 / temp1
8743 dsmdz(k) = 2.0 * (smx(k) - smx(k+1)) / temp1
8744 wflux(k) = wdf(k) * dsmdz(k) + wcnd(k) - pddum + etrani(k) + qseva
8745 else if (k < nsoil)
then
8746 denom(k) = (zsoil(k-1) - zsoil(k))
8747 temp1 = (zsoil(k-1) - zsoil(k+1))
8748 ddz(k) = 2.0 / temp1
8749 dsmdz(k) = 2.0 * (smx(k) - smx(k+1)) / temp1
8750 wflux(k) = wdf(k ) * dsmdz(k ) + wcnd(k ) &
8751 - wdf(k-1) * dsmdz(k-1) - wcnd(k-1) + etrani(k)
8753 denom(k) = (zsoil(k-1) - zsoil(k))
8754 if(opt_run == 1 .or. opt_run == 2)
then
8757 if(opt_run == 3)
then
8758 qdrain = parameters%slope*wcnd(k)
8760 if(opt_run == 4)
then
8761 qdrain = (1.0-fcrmax)*wcnd(k)
8763 if(opt_run == 5)
then
8764 temp1 = 2.0 * denom(k)
8765 if(zwt < zsoil(nsoil)-denom(nsoil))
then
8767 smxbot = smx(k) - (smx(k)-smxwtd) * denom(k) * 2./ (denom(k) + zsoil(k) - zwt)
8771 dsmdz(k) = 2.0 * (smx(k) - smxbot) / temp1
8772 qdrain = wdf(k ) * dsmdz(k ) + wcnd(k )
8774 wflux(k) = -(wdf(k-1)*dsmdz(k-1))-wcnd(k-1)+etrani(k) + qdrain
8781 bi(k) = wdf(k ) * ddz(k ) / denom(k)
8783 else if (k < nsoil)
then
8784 ai(k) = - wdf(k-1) * ddz(k-1) / denom(k)
8785 ci(k) = - wdf(k ) * ddz(k ) / denom(k)
8786 bi(k) = - ( ai(k) + ci(k) )
8788 ai(k) = - wdf(k-1) * ddz(k-1) / denom(k)
8790 bi(k) = - ( ai(k) + ci(k) )
8792 rhstt(k) = wflux(k) / (-denom(k))
8802 subroutine sstep (parameters,nsoil ,nsnow ,dt ,zsoil ,dzsnso , & !in
8803 sice ,iloc ,jloc ,zwt , & !in
8804 sh2o ,smc ,ai ,bi ,ci , & !inout
8805 rhstt ,smcwtd ,qdrain ,deeprech, & !inout
8815 type (noahmp_parameters),
intent(in) :: parameters
8816 integer,
intent(in) :: iloc
8817 integer,
intent(in) :: jloc
8818 integer,
intent(in) :: nsoil
8819 integer,
intent(in) :: nsnow
8820 real (kind=kind_phys),
intent(in) :: dt
8821 real (kind=kind_phys),
intent(in) :: zwt
8822 real (kind=kind_phys),
dimension( 1:nsoil),
intent(in) :: zsoil
8823 real (kind=kind_phys),
dimension( 1:nsoil),
intent(in) :: sice
8824 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: dzsnso
8827 real (kind=kind_phys),
dimension(1:nsoil),
intent(inout) :: sh2o
8828 real (kind=kind_phys),
dimension(1:nsoil),
intent(inout) :: smc
8829 real (kind=kind_phys),
dimension(1:nsoil),
intent(inout) :: ai
8830 real (kind=kind_phys),
dimension(1:nsoil),
intent(inout) :: bi
8831 real (kind=kind_phys),
dimension(1:nsoil),
intent(inout) :: ci
8832 real (kind=kind_phys),
dimension(1:nsoil),
intent(inout) :: rhstt
8833 real (kind=kind_phys) ,
intent(inout) :: smcwtd
8834 real (kind=kind_phys) ,
intent(inout) :: qdrain
8835 real (kind=kind_phys) ,
intent(inout) :: deeprech
8838 real (kind=kind_phys),
intent(out) :: wplus
8842 real (kind=kind_phys),
dimension(1:nsoil) :: rhsttin
8843 real (kind=kind_phys),
dimension(1:nsoil) :: ciin
8844 real (kind=kind_phys) :: stot
8845 real (kind=kind_phys) :: epore
8846 real (kind=kind_phys) :: wminus
8851 rhstt(k) = rhstt(k) * dt
8853 bi(k) = 1. + bi(k) * dt
8860 rhsttin(k) = rhstt(k)
8866 call rosr12 (ci,ai,bi,ciin,rhsttin,rhstt,1,nsoil,0)
8869 sh2o(k) = sh2o(k) + ci(k)
8876 if(opt_run == 5)
then
8880 if(zwt < zsoil(nsoil)-dzsnso(nsoil))
then
8882 deeprech = deeprech + dt * qdrain
8884 smcwtd = smcwtd + dt * qdrain / dzsnso(nsoil)
8885 wplus = max((smcwtd-parameters%smcmax(nsoil)), 0.0) * dzsnso(nsoil)
8886 wminus = max((1.e-4-smcwtd), 0.0) * dzsnso(nsoil)
8888 smcwtd = max( min(smcwtd,parameters%smcmax(nsoil)) , 1.e-4)
8889 sh2o(nsoil) = sh2o(nsoil) + wplus/dzsnso(nsoil)
8892 qdrain = qdrain - wplus/dt
8893 deeprech = deeprech - wminus
8899 epore = max( 1.e-4 , ( parameters%smcmax(k) - sice(k) ) )
8900 wplus = max((sh2o(k)-epore), 0.0) * dzsnso(k)
8901 sh2o(k) = min(epore,sh2o(k))
8902 sh2o(k-1) = sh2o(k-1) + wplus/dzsnso(k-1)
8905 epore = max( 1.e-4 , ( parameters%smcmax(1) - sice(1) ) )
8906 wplus = max((sh2o(1)-epore), 0.0) * dzsnso(1)
8907 sh2o(1) = min(epore,sh2o(1))
8909 if(wplus > 0.0)
then
8910 sh2o(2) = sh2o(2) + wplus/dzsnso(2)
8912 epore = max( 1.e-4 , ( parameters%smcmax(k) - sice(k) ) )
8913 wplus = max((sh2o(k)-epore), 0.0) * dzsnso(k)
8914 sh2o(k) = min(epore,sh2o(k))
8915 sh2o(k+1) = sh2o(k+1) + wplus/dzsnso(k+1)
8918 epore = max( 1.e-4 , ( parameters%smcmax(nsoil) - sice(nsoil) ) )
8919 wplus = max((sh2o(nsoil)-epore), 0.0) * dzsnso(nsoil)
8920 sh2o(nsoil) = min(epore,sh2o(nsoil))
8925 end subroutine sstep
8931 subroutine wdfcnd1 (parameters,wdf,wcnd,smc,fcr,isoil)
8938 type (noahmp_parameters),
intent(in) :: parameters
8939 real (kind=kind_phys),
intent(in) :: smc
8940 real (kind=kind_phys),
intent(in) :: fcr
8941 integer,
intent(in) :: isoil
8944 real (kind=kind_phys),
intent(out) :: wcnd
8945 real (kind=kind_phys),
intent(out) :: wdf
8948 real (kind=kind_phys) :: expon
8949 real (kind=kind_phys) :: factr
8950 real (kind=kind_phys) :: vkwgt
8955 factr = max(0.01, smc/parameters%smcmax(isoil))
8956 expon = parameters%bexp(isoil) + 2.0
8957 wdf = parameters%dwsat(isoil) * factr ** expon
8958 wdf = wdf * (1.0 - fcr)
8962 expon = 2.0*parameters%bexp(isoil) + 3.0
8963 wcnd = parameters%dksat(isoil) * factr ** expon
8964 wcnd = wcnd * (1.0 - fcr)
8972 subroutine wdfcnd2 (parameters,wdf,wcnd,smc,sice,isoil)
8979 type (noahmp_parameters),
intent(in) :: parameters
8980 real (kind=kind_phys),
intent(in) :: smc
8981 real (kind=kind_phys),
intent(in) :: sice
8982 integer,
intent(in) :: isoil
8985 real (kind=kind_phys),
intent(out) :: wcnd
8986 real (kind=kind_phys),
intent(out) :: wdf
8989 real (kind=kind_phys) :: expon
8990 real (kind=kind_phys) :: factr1,factr2
8991 real (kind=kind_phys) :: vkwgt
8996 factr1 = 0.05/parameters%smcmax(isoil)
8997 factr2 = max(0.01, smc/parameters%smcmax(isoil))
8998 factr1 = min(factr1,factr2)
8999 expon = parameters%bexp(isoil) + 2.0
9000 wdf = parameters%dwsat(isoil) * factr2 ** expon
9002 if (sice > 0.0)
then
9003 vkwgt = 1./ (1. + (500.* sice)**3.)
9004 wdf = vkwgt * wdf + (1.-vkwgt)*parameters%dwsat(isoil)*(factr1)**expon
9009 expon = 2.0*parameters%bexp(isoil) + 3.0
9010 wcnd = parameters%dksat(isoil) * factr2 ** expon
9018 subroutine groundwater(parameters,nsnow ,nsoil ,dt ,sice ,zsoil , & !in
9019 stc ,wcnd ,fcrmax ,iloc ,jloc , & !in
9020 sh2o ,zwt ,wa ,wt , & !inout
9026 type (noahmp_parameters),
intent(in) :: parameters
9027 integer,
intent(in) :: iloc
9028 integer,
intent(in) :: jloc
9029 integer,
intent(in) :: nsnow
9030 integer,
intent(in) :: nsoil
9031 real (kind=kind_phys),
intent(in) :: dt
9032 real (kind=kind_phys),
intent(in) :: fcrmax
9033 real (kind=kind_phys),
dimension( 1:nsoil),
intent(in) :: sice
9034 real (kind=kind_phys),
dimension( 1:nsoil),
intent(in) :: zsoil
9035 real (kind=kind_phys),
dimension( 1:nsoil),
intent(in) :: wcnd
9036 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: stc
9039 real (kind=kind_phys),
dimension( 1:nsoil),
intent(inout) :: sh2o
9040 real (kind=kind_phys),
intent(inout) :: zwt
9041 real (kind=kind_phys),
intent(inout) :: wa
9042 real (kind=kind_phys),
intent(inout) :: wt
9045 real (kind=kind_phys),
intent(out) :: qin
9046 real (kind=kind_phys),
intent(out) :: qdis
9049 real (kind=kind_phys) :: fff
9050 real (kind=kind_phys) :: rsbmx
9053 real (kind=kind_phys),
dimension( 1:nsoil) :: dzmm
9054 real (kind=kind_phys),
dimension( 1:nsoil) :: znode
9055 real (kind=kind_phys),
dimension( 1:nsoil) :: mliq
9056 real (kind=kind_phys),
dimension( 1:nsoil) :: epore
9057 real (kind=kind_phys),
dimension( 1:nsoil) :: hk
9058 real (kind=kind_phys),
dimension( 1:nsoil) :: smc
9059 real (kind=kind_phys) :: s_node
9060 real (kind=kind_phys) :: dzsum
9061 real (kind=kind_phys) :: smpfz
9062 real (kind=kind_phys) :: ka
9063 real (kind=kind_phys) :: wh_zwt
9064 real (kind=kind_phys) :: wh
9065 real (kind=kind_phys) :: ws
9066 real (kind=kind_phys) :: wtsub
9067 real (kind=kind_phys) :: watmin
9068 real (kind=kind_phys) :: xs
9069 real (kind=kind_phys),
parameter :: rous = 0.2
9072 real (kind=kind_phys),
parameter :: cmic = 0.80
9080 dzmm(1) = -zsoil(1)*1.e3
9082 dzmm(iz) = 1.e3 * (zsoil(iz - 1) - zsoil(iz))
9087 znode(1) = -zsoil(1) / 2.
9089 znode(iz) = -zsoil(iz-1) + 0.5 * (zsoil(iz-1) - zsoil(iz))
9095 smc(iz) = sh2o(iz) + sice(iz)
9096 mliq(iz) = sh2o(iz) * dzmm(iz)
9097 epore(iz) = max(0.01,parameters%smcmax(iz) - sice(iz))
9098 hk(iz) = 1.e3*wcnd(iz)
9106 if(zwt .le. -zsoil(iz) )
then
9116 fff = parameters%bexp(iwt) / 3.0
9117 rsbmx = hk(iwt) * 1.0e3 * exp(3.0)
9120 qdis = (1.0-fcrmax)*rsbmx*exp(-parameters%timean)*exp(-fff*zwt)
9124 s_node = min(1.0,smc(iwt)/parameters%smcmax(iwt) )
9125 s_node = max(s_node,real(0.01,kind=8))
9126 smpfz = -parameters%psisat(iwt)*1000.*s_node**(-parameters%bexp(iwt))
9127 smpfz = max(-120000.0,cmic*smpfz)
9133 ka = 2.0*(hk(iwt)*parameters%dksat(iwt)*1.0e3) / (hk(iwt)+parameters%dksat(iwt)*1.0e3)
9135 wh_zwt = - zwt * 1.e3
9136 wh = smpfz - znode(iwt)*1.e3
9137 qin = - ka * (wh_zwt-wh) /((zwt-znode(iwt))*1.e3)
9138 qin = max(-10.0/dt,min(10./dt,qin))
9142 wt = wt + (qin - qdis) * dt
9144 if(iwt.eq.nsoil)
then
9145 wa = wa + (qin - qdis) * dt
9147 zwt = (-zsoil(nsoil) + 25.) - wa/1000./rous
9148 mliq(nsoil) = mliq(nsoil) - qin * dt
9150 mliq(nsoil) = mliq(nsoil) + max(0.,(wa - 5000.))
9154 if (iwt.eq.nsoil-1)
then
9155 zwt = -zsoil(nsoil) &
9156 - (wt-rous*1000*25.) / (epore(nsoil))/1000.
9160 ws = ws + epore(iz) * dzmm(iz)
9162 zwt = -zsoil(iwt+1) &
9163 - (wt-rous*1000.*25.-ws) /(epore(iwt+1))/1000.
9168 wtsub = wtsub + hk(iz)*dzmm(iz)
9172 mliq(iz) = mliq(iz) - qdis*dt*hk(iz)*dzmm(iz)/wtsub
9184 if (mliq(iz) .lt. 0.)
then
9185 xs = watmin-mliq(iz)
9189 mliq(iz ) = mliq(iz ) + xs
9190 mliq(iz+1) = mliq(iz+1) - xs
9194 if (mliq(iz) .lt. watmin)
then
9195 xs = watmin-mliq(iz)
9199 mliq(iz) = mliq(iz) + xs
9204 sh2o(iz) = mliq(iz) / dzmm(iz)
9215 dzsnso ,smceq ,iloc ,jloc , & !in
9216 smc ,wtd ,smcwtd ,rech, qdrain )
9224 type (noahmp_parameters),
intent(in) :: parameters
9225 integer,
intent(in) :: nsnow
9226 integer,
intent(in) :: nsoil
9227 integer,
intent(in) :: iloc,jloc
9228 real (kind=kind_phys),
intent(in) :: dt
9229 real (kind=kind_phys),
dimension( 1:nsoil),
intent(in) :: zsoil
9230 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: dzsnso
9231 real (kind=kind_phys),
dimension( 1:nsoil),
intent(in) :: smceq
9234 real (kind=kind_phys),
dimension( 1:nsoil),
intent(inout) :: smc
9235 real (kind=kind_phys),
intent(inout) :: wtd
9236 real (kind=kind_phys),
intent(inout) :: smcwtd
9237 real (kind=kind_phys),
intent(out) :: rech
9238 real (kind=kind_phys),
intent(inout) :: qdrain
9244 real (kind=kind_phys) :: wtdold
9245 real (kind=kind_phys) :: dzup
9246 real (kind=kind_phys) :: smceqdeep
9247 real (kind=kind_phys),
dimension( 0:nsoil) :: zsoil0
9251zsoil0(1:nsoil) = zsoil(1:nsoil)
9256 if(wtd + 1.e-6 < zsoil0(iz))
exit
9262 if(kwtd.le.nsoil)
then
9264 if(smc(kwtd).gt.smceq(kwtd))
then
9266 if(smc(kwtd).eq.parameters%smcmax(kwtd))
then
9268 rech=-(wtdold-wtd) * (parameters%smcmax(kwtd)-smceq(kwtd))
9272 if(smc(kwtd).gt.smceq(kwtd))
then
9274 wtd = min( ( smc(kwtd)*dzsnso(kwtd) &
9275 - smceq(kwtd)*zsoil0(iwtd) + parameters%smcmax(kwtd)*zsoil0(kwtd) ) / &
9276 ( parameters%smcmax(kwtd)-smceq(kwtd) ), zsoil0(iwtd))
9277 rech=rech-(wtdold-wtd) * (parameters%smcmax(kwtd)-smceq(kwtd))
9281 wtd = min( ( smc(kwtd)*dzsnso(kwtd) &
9282 - smceq(kwtd)*zsoil0(iwtd) + parameters%smcmax(kwtd)*zsoil0(kwtd) ) / &
9283 ( parameters%smcmax(kwtd)-smceq(kwtd) ), zsoil0(iwtd))
9284 rech=-(wtdold-wtd) * (parameters%smcmax(kwtd)-smceq(kwtd))
9289 rech=-(wtdold-wtd) * (parameters%smcmax(kwtd)-smceq(kwtd))
9293 if(kwtd.le.nsoil)
then
9295 if(smc(kwtd).gt.smceq(kwtd))
then
9296 wtd = min( ( smc(kwtd)*dzsnso(kwtd) &
9297 - smceq(kwtd)*zsoil0(iwtd) + parameters%smcmax(kwtd)*zsoil0(kwtd) ) / &
9298 ( parameters%smcmax(kwtd)-smceq(kwtd) ) , zsoil0(iwtd) )
9302 rech = rech - (wtdold-wtd) * &
9303 (parameters%smcmax(kwtd)-smceq(kwtd))
9312 smceqdeep = parameters%smcmax(nsoil) * ( -parameters%psisat(nsoil) / ( -parameters%psisat(nsoil) - dzsnso(nsoil) ) ) ** (1./parameters%bexp(nsoil))
9313 wtd = min( ( smcwtd*dzsnso(nsoil) &
9314 - smceqdeep*zsoil0(nsoil) + parameters%smcmax(nsoil)*(zsoil0(nsoil)-dzsnso(nsoil)) ) / &
9315 ( parameters%smcmax(nsoil)-smceqdeep ) , zsoil0(nsoil) )
9316 rech = rech - (wtdold-wtd) * &
9317 (parameters%smcmax(nsoil)-smceqdeep)
9321 elseif(wtd.ge.zsoil0(nsoil)-dzsnso(nsoil))
then
9324 smceqdeep = parameters%smcmax(nsoil) * ( -parameters%psisat(nsoil) / ( -parameters%psisat(nsoil) - dzsnso(nsoil) ) ) ** (1./parameters%bexp(nsoil))
9325 if(smcwtd.gt.smceqdeep)
then
9326 wtd = min( ( smcwtd*dzsnso(nsoil) &
9327 - smceqdeep*zsoil0(nsoil) + parameters%smcmax(nsoil)*(zsoil0(nsoil)-dzsnso(nsoil)) ) / &
9328 ( parameters%smcmax(nsoil)-smceqdeep ) , zsoil0(nsoil) )
9329 rech = -(wtdold-wtd) * (parameters%smcmax(nsoil)-smceqdeep)
9331 rech = -(wtdold-(zsoil0(nsoil)-dzsnso(nsoil))) * (parameters%smcmax(nsoil)-smceqdeep)
9332 wtdold=zsoil0(nsoil)-dzsnso(nsoil)
9334 dzup=(smceqdeep-smcwtd)*dzsnso(nsoil)/(parameters%smcmax(nsoil)-smceqdeep)
9336 rech = rech - (parameters%smcmax(nsoil)-smceqdeep)*dzup
9343if(iwtd.lt.nsoil .and. iwtd.gt.0)
then
9344 smcwtd=parameters%smcmax(iwtd)
9345elseif(iwtd.lt.nsoil .and. iwtd.le.0)
then
9346 smcwtd=parameters%smcmax(1)
9359 subroutine carbon (parameters,nsnow ,nsoil ,vegtyp ,dt ,zsoil , & !in
9360 dzsnso ,stc ,smc ,tv ,tg ,psn , & !in
9361 foln ,btran ,apar ,fveg ,igs , & !in
9362 troot ,ist ,lat ,iloc ,jloc , & !in
9363 lfmass ,rtmass ,stmass ,wood ,stblcp ,fastcp , & !inout
9364 gpp ,npp ,nee ,autors ,heters ,totsc , & !out
9371 type (noahmp_parameters),
intent(in) :: parameters
9372 integer ,
intent(in) :: iloc
9373 integer ,
intent(in) :: jloc
9374 integer ,
intent(in) :: vegtyp
9375 integer ,
intent(in) :: nsnow
9376 integer ,
intent(in) :: nsoil
9377 real (kind=kind_phys) ,
intent(in) :: lat
9378 real (kind=kind_phys) ,
intent(in) :: dt
9379 real (kind=kind_phys),
dimension( 1:nsoil),
intent(in) :: zsoil
9380 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: dzsnso
9381 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: stc
9382 real (kind=kind_phys),
dimension( 1:nsoil),
intent(in) :: smc
9383 real (kind=kind_phys) ,
intent(in) :: tv
9384 real (kind=kind_phys) ,
intent(in) :: tg
9385 real (kind=kind_phys) ,
intent(in) :: foln
9386 real (kind=kind_phys) ,
intent(in) :: btran
9387 real (kind=kind_phys) ,
intent(in) :: psn
9388 real (kind=kind_phys) ,
intent(in) :: apar
9389 real (kind=kind_phys) ,
intent(in) :: igs
9390 real (kind=kind_phys) ,
intent(in) :: fveg
9391 real (kind=kind_phys) ,
intent(in) :: troot
9392 integer ,
intent(in) :: ist
9396 real (kind=kind_phys) ,
intent(inout) :: lfmass
9397 real (kind=kind_phys) ,
intent(inout) :: rtmass
9398 real (kind=kind_phys) ,
intent(inout) :: stmass
9399 real (kind=kind_phys) ,
intent(inout) :: wood
9400 real (kind=kind_phys) ,
intent(inout) :: stblcp
9401 real (kind=kind_phys) ,
intent(inout) :: fastcp
9405 real (kind=kind_phys) ,
intent(out) :: gpp
9406 real (kind=kind_phys) ,
intent(out) :: npp
9407 real (kind=kind_phys) ,
intent(out) :: nee
9408 real (kind=kind_phys) ,
intent(out) :: autors
9409 real (kind=kind_phys) ,
intent(out) :: heters
9410 real (kind=kind_phys) ,
intent(out) :: totsc
9411 real (kind=kind_phys) ,
intent(out) :: totlb
9412 real (kind=kind_phys) ,
intent(out) :: xlai
9413 real (kind=kind_phys) ,
intent(out) :: xsai
9419 real (kind=kind_phys) :: wroot
9420 real (kind=kind_phys) :: wstres
9421 real (kind=kind_phys) :: lapm
9424 if ( ( vegtyp == parameters%iswater ) .or. ( vegtyp == parameters%isbarren ) .or. &
9425 ( vegtyp == parameters%isice ) .or. (parameters%urban_flag) )
then
9445 lapm = parameters%sla / 1000.
9452 do j=1,parameters%nroot
9453 wroot = wroot + smc(j)/parameters%smcmax(j) * dzsnso(j) / (-zsoil(parameters%nroot))
9456 call co2flux (parameters,nsnow ,nsoil ,vegtyp ,igs ,dt , &
9457 dzsnso ,stc ,psn ,troot ,tv , &
9458 wroot ,wstres ,foln ,lapm , &
9459 lat ,iloc ,jloc ,fveg , &
9460 xlai ,xsai ,lfmass ,rtmass ,stmass , &
9461 fastcp ,stblcp ,wood , &
9462 gpp ,npp ,nee ,autors ,heters , &
9475 subroutine co2flux (parameters,nsnow ,nsoil ,vegtyp ,igs ,dt , & !in
9476 dzsnso ,stc ,psn ,troot ,tv , & !in
9477 wroot ,wstres ,foln ,lapm , & !in
9478 lat ,iloc ,jloc ,fveg , & !in
9479 xlai ,xsai ,lfmass ,rtmass ,stmass , & !inout
9480 fastcp ,stblcp ,wood , & !inout
9481 gpp ,npp ,nee ,autors ,heters , & !out
9491 type (noahmp_parameters),
intent(in) :: parameters
9492 integer ,
intent(in) :: iloc
9493 integer ,
intent(in) :: jloc
9494 integer ,
intent(in) :: vegtyp
9495 integer ,
intent(in) :: nsnow
9496 integer ,
intent(in) :: nsoil
9497 real (kind=kind_phys) ,
intent(in) :: dt
9498 real (kind=kind_phys) ,
intent(in) :: lat
9499 real (kind=kind_phys) ,
intent(in) :: igs
9500 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: dzsnso
9501 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: stc
9502 real (kind=kind_phys) ,
intent(in) :: psn
9503 real (kind=kind_phys) ,
intent(in) :: troot
9504 real (kind=kind_phys) ,
intent(in) :: tv
9505 real (kind=kind_phys) ,
intent(in) :: wroot
9506 real (kind=kind_phys) ,
intent(in) :: wstres
9507 real (kind=kind_phys) ,
intent(in) :: foln
9508 real (kind=kind_phys) ,
intent(in) :: lapm
9509 real (kind=kind_phys) ,
intent(in) :: fveg
9513 real (kind=kind_phys) ,
intent(inout) :: xlai
9514 real (kind=kind_phys) ,
intent(inout) :: xsai
9515 real (kind=kind_phys) ,
intent(inout) :: lfmass
9516 real (kind=kind_phys) ,
intent(inout) :: rtmass
9517 real (kind=kind_phys) ,
intent(inout) :: stmass
9518 real (kind=kind_phys) ,
intent(inout) :: fastcp
9519 real (kind=kind_phys) ,
intent(inout) :: stblcp
9520 real (kind=kind_phys) ,
intent(inout) :: wood
9524 real (kind=kind_phys) ,
intent(out) :: gpp
9525 real (kind=kind_phys) ,
intent(out) :: npp
9526 real (kind=kind_phys) ,
intent(out) :: nee
9527 real (kind=kind_phys) ,
intent(out) :: autors
9528 real (kind=kind_phys) ,
intent(out) :: heters
9529 real (kind=kind_phys) ,
intent(out) :: totsc
9530 real (kind=kind_phys) ,
intent(out) :: totlb
9534 real (kind=kind_phys) :: cflux
9535 real (kind=kind_phys) :: lfmsmn
9536 real (kind=kind_phys) :: rswood
9537 real (kind=kind_phys) :: rsleaf
9538 real (kind=kind_phys) :: rsroot
9539 real (kind=kind_phys) :: nppl
9540 real (kind=kind_phys) :: nppr
9541 real (kind=kind_phys) :: nppw
9542 real (kind=kind_phys) :: npps
9543 real (kind=kind_phys) :: dielf
9545 real (kind=kind_phys) :: addnpplf
9546 real (kind=kind_phys) :: addnppst
9547 real (kind=kind_phys) :: carbfx
9548 real (kind=kind_phys) :: grleaf
9549 real (kind=kind_phys) :: grroot
9550 real (kind=kind_phys) :: grwood
9551 real (kind=kind_phys) :: grstem
9552 real (kind=kind_phys) :: leafpt
9553 real (kind=kind_phys) :: lfdel
9554 real (kind=kind_phys) :: lftovr
9555 real (kind=kind_phys) :: sttovr
9556 real (kind=kind_phys) :: wdtovr
9557 real (kind=kind_phys) :: rssoil
9558 real (kind=kind_phys) :: rttovr
9559 real (kind=kind_phys) :: stablc
9560 real (kind=kind_phys) :: woodf
9561 real (kind=kind_phys) :: nonlef
9562 real (kind=kind_phys) :: rootpt
9563 real (kind=kind_phys) :: woodpt
9564 real (kind=kind_phys) :: stempt
9565 real (kind=kind_phys) :: resp
9566 real (kind=kind_phys) :: rsstem
9568 real (kind=kind_phys) :: fsw
9569 real (kind=kind_phys) :: fst
9570 real (kind=kind_phys) :: fnf
9571 real (kind=kind_phys) :: tf
9572 real (kind=kind_phys) :: rf
9573 real (kind=kind_phys) :: stdel
9574 real (kind=kind_phys) :: stmsmn
9575 real (kind=kind_phys) :: sapm
9576 real (kind=kind_phys) :: diest
9578 real (kind=kind_phys) :: bf
9579 real (kind=kind_phys) :: rswoodc
9580 real (kind=kind_phys) :: stovrc
9581 real (kind=kind_phys) :: rsdryc
9582 real (kind=kind_phys) :: rtovrc
9583 real (kind=kind_phys) :: wstrc
9584 real (kind=kind_phys) :: laimin
9585 real (kind=kind_phys) :: xsamin
9586 real (kind=kind_phys) :: sc
9587 real (kind=kind_phys) :: sd
9588 real (kind=kind_phys) :: vegfrac
9592 real (kind=kind_phys) :: r,x
9593 r(x) = exp(0.08*(x-298.16))
9606 lfmsmn = laimin/lapm
9607 stmsmn = xsamin/sapm
9612 if(igs .eq. 0.)
then
9618 fnf = min( foln/max(1.e-06,parameters%folnmx), 1.0 )
9619 tf = parameters%arm**( (tv-298.16)/10. )
9620 resp = parameters%rmf25 * tf * fnf * xlai * rf * (1.-wstres)
9621 rsleaf = min((lfmass-lfmsmn)/dt,resp*12.e-6)
9623 rsroot = parameters%rmr25*(rtmass*1e-3)*tf *rf* 12.e-6
9624 rsstem = parameters%rms25*((stmass-stmsmn)*1e-3)*tf *rf* 12.e-6
9625 rswood = rswoodc * r(tv) * wood*parameters%wdpool
9630 carbfx = psn * 12.e-6
9634 leafpt = exp(0.01*(1.-exp(0.75*xlai))*xlai)
9635 if(vegtyp == parameters%eblforest) leafpt = exp(0.01*(1.-exp(0.50*xlai))*xlai)
9637 nonlef = 1.0 - leafpt
9638 stempt = xlai/10.0*leafpt
9639 leafpt = leafpt - stempt
9643 if(wood > 1.e-6)
then
9644 woodf = (1.-exp(-bf*(parameters%wrrat*rtmass/wood))/bf)*parameters%wdpool
9646 woodf = parameters%wdpool
9649 rootpt = nonlef*(1.-woodf)
9650 woodpt = nonlef*woodf
9654 lftovr = parameters%ltovrc*5.e-7*lfmass
9655 sttovr = parameters%ltovrc*5.e-7*stmass
9656 rttovr = rtovrc*rtmass
9657 wdtovr = 9.5e-10*wood
9662 sc = exp(-0.3*max(0.,tv-parameters%tdlef)) * (lfmass/120.)
9663 sd = exp((wstres-1.)*wstrc)
9664 dielf = lfmass*1.e-6*(parameters%dilefw * sd + parameters%dilefc*sc)
9665 diest = stmass*1.e-6*(parameters%dilefw * sd + parameters%dilefc*sc)
9669 grleaf = max(0.0,parameters%fragr*(leafpt*carbfx - rsleaf))
9670 grstem = max(0.0,parameters%fragr*(stempt*carbfx - rsstem))
9671 grroot = max(0.0,parameters%fragr*(rootpt*carbfx - rsroot))
9672 grwood = max(0.0,parameters%fragr*(woodpt*carbfx - rswood))
9676 addnpplf = max(0.,leafpt*carbfx - grleaf-rsleaf)
9677 addnppst = max(0.,stempt*carbfx - grstem-rsstem)
9680 if(tv.lt.parameters%tmin) addnpplf =0.
9681 if(tv.lt.parameters%tmin) addnppst =0.
9686 lfdel = (lfmass - lfmsmn)/dt
9687 stdel = (stmass - stmsmn)/dt
9688 dielf = min(dielf,lfdel+addnpplf-lftovr)
9689 diest = min(diest,stdel+addnppst-sttovr)
9693 nppl = max(addnpplf,-lfdel)
9694 npps = max(addnppst,-stdel)
9695 nppr = rootpt*carbfx - rsroot - grroot
9696 nppw = woodpt*carbfx - rswood - grwood
9700 lfmass = lfmass + (nppl-lftovr-dielf)*dt
9701 stmass = stmass + (npps-sttovr-diest)*dt
9702 rtmass = rtmass + (nppr-rttovr) *dt
9704 if(rtmass.lt.0.0)
then
9708 wood = (wood+(nppw-wdtovr)*dt)*parameters%wdpool
9712 fastcp = fastcp + (rttovr+lftovr+sttovr+wdtovr+dielf+diest)*dt
9714 fst = 2.0**( (stc(1)-283.16)/10. )
9715 fsw = wroot / (0.20+wroot) * 0.23 / (0.23+wroot)
9716 rssoil = fsw * fst * parameters%mrp* max(0.,fastcp*1.e-3)*12.e-6
9719 fastcp = fastcp - (rssoil + stablc)*dt
9720 stblcp = stblcp + stablc*dt
9724 cflux = - carbfx + rsleaf + rsroot + rswood + rsstem &
9725 + 0.9*rssoil + grleaf + grroot + grwood + grstem
9730 npp = nppl + nppw + nppr +npps
9731 autors = rsroot + rswood + rsleaf + rsstem + &
9732 grleaf + grroot + grwood + grstem
9734 nee = (autors + heters - gpp)*44./12.
9735 totsc = fastcp + stblcp
9736 totlb = lfmass + rtmass +stmass + wood
9740 xlai = max(lfmass*lapm,laimin)
9741 xsai = max(stmass*sapm,xsamin)
9749 subroutine carbon_crop (parameters,nsnow ,nsoil ,vegtyp ,dt ,zsoil ,julian , & !in
9750 dzsnso ,stc ,smc ,tv ,psn ,foln ,btran , & !in
9752 lfmass ,rtmass ,stmass ,wood ,stblcp ,fastcp ,grain , & !inout
9753 xlai ,xsai ,gdd , & !inout
9754 gpp ,npp ,nee ,autors ,heters ,totsc ,totlb, pgs )
9764 type (noahmp_parameters),
intent(in) :: parameters
9765 integer ,
intent(in) :: nsnow
9766 integer ,
intent(in) :: nsoil
9767 integer ,
intent(in) :: vegtyp
9768 real (kind=kind_phys) ,
intent(in) :: dt
9769 real (kind=kind_phys),
dimension( 1:nsoil),
intent(in) :: zsoil
9770 real (kind=kind_phys) ,
intent(in) :: julian
9771 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: dzsnso
9772 real (kind=kind_phys),
dimension(-nsnow+1:nsoil),
intent(in) :: stc
9773 real (kind=kind_phys),
dimension( 1:nsoil),
intent(in) :: smc
9774 real (kind=kind_phys) ,
intent(in) :: tv
9775 real (kind=kind_phys) ,
intent(in) :: psn
9776 real (kind=kind_phys) ,
intent(in) :: foln
9777 real (kind=kind_phys) ,
intent(in) :: btran
9778 real (kind=kind_phys) ,
intent(in) :: soldn
9779 real (kind=kind_phys) ,
intent(in) :: t2m
9783 real (kind=kind_phys) ,
intent(inout) :: lfmass
9784 real (kind=kind_phys) ,
intent(inout) :: rtmass
9785 real (kind=kind_phys) ,
intent(inout) :: stmass
9786 real (kind=kind_phys) ,
intent(inout) :: wood
9787 real (kind=kind_phys) ,
intent(inout) :: stblcp
9788 real (kind=kind_phys) ,
intent(inout) :: fastcp
9789 real (kind=kind_phys) ,
intent(inout) :: grain
9790 real (kind=kind_phys) ,
intent(inout) :: xlai
9791 real (kind=kind_phys) ,
intent(inout) :: xsai
9792 real (kind=kind_phys) ,
intent(inout) :: gdd
9795 real (kind=kind_phys) ,
intent(out) :: gpp
9796 real (kind=kind_phys) ,
intent(out) :: npp
9797 real (kind=kind_phys) ,
intent(out) :: nee
9798 real (kind=kind_phys) ,
intent(out) :: autors
9799 real (kind=kind_phys) ,
intent(out) :: heters
9800 real (kind=kind_phys) ,
intent(out) :: totsc
9801 real (kind=kind_phys) ,
intent(out) :: totlb
9806 real (kind=kind_phys) :: wroot
9807 real (kind=kind_phys) :: wstres
9810 integer,
intent(out) :: pgs
9812 real (kind=kind_phys) :: psncrop
9815 if ( ( vegtyp == parameters%iswater ) .or. ( vegtyp == parameters%isbarren ) .or. &
9816 ( vegtyp == parameters%isice ) .or. (parameters%urban_flag) )
then
9842 do j=1,parameters%nroot
9843 wroot = wroot + smc(j)/parameters%smcmax(j) * dzsnso(j) / (-zsoil(parameters%nroot))
9856 dt ,stc(1) ,psn ,tv ,wroot ,wstres ,foln , &
9858 xlai ,xsai ,lfmass ,rtmass ,stmass , &
9859 fastcp ,stblcp ,wood ,grain ,gdd , &
9860 gpp ,npp ,nee ,autors ,heters , &
9870 dt ,stc ,psn ,tv ,wroot ,wstres ,foln , & !in
9871 ipa ,iha ,pgs , & !in xing
9872 xlai ,xsai ,lfmass ,rtmass ,stmass , & !inout
9873 fastcp ,stblcp ,wood ,grain ,gdd, & !inout
9874 gpp ,npp ,nee ,autors ,heters , & !out
9886 type (noahmp_parameters),
intent(in) :: parameters
9887 real (kind=kind_phys) ,
intent(in) :: dt
9888 real (kind=kind_phys) ,
intent(in) :: stc
9889 real (kind=kind_phys) ,
intent(in) :: psn
9890 real (kind=kind_phys) ,
intent(in) :: tv
9891 real (kind=kind_phys) ,
intent(in) :: wroot
9892 real (kind=kind_phys) ,
intent(in) :: wstres
9893 real (kind=kind_phys) ,
intent(in) :: foln
9894 integer ,
intent(in) :: ipa
9895 integer ,
intent(in) :: iha
9896 integer ,
intent(in) :: pgs
9900 real (kind=kind_phys) ,
intent(inout) :: xlai
9901 real (kind=kind_phys) ,
intent(inout) :: xsai
9902 real (kind=kind_phys) ,
intent(inout) :: lfmass
9903 real (kind=kind_phys) ,
intent(inout) :: rtmass
9904 real (kind=kind_phys) ,
intent(inout) :: stmass
9905 real (kind=kind_phys) ,
intent(inout) :: fastcp
9906 real (kind=kind_phys) ,
intent(inout) :: stblcp
9907 real (kind=kind_phys) ,
intent(inout) :: wood
9908 real (kind=kind_phys) ,
intent(inout) :: grain
9909 real (kind=kind_phys) ,
intent(inout) :: gdd
9913 real (kind=kind_phys) ,
intent(out) :: gpp
9914 real (kind=kind_phys) ,
intent(out) :: npp
9915 real (kind=kind_phys) ,
intent(out) :: nee
9916 real (kind=kind_phys) ,
intent(out) :: autors
9917 real (kind=kind_phys) ,
intent(out) :: heters
9918 real (kind=kind_phys) ,
intent(out) :: totsc
9919 real (kind=kind_phys) ,
intent(out) :: totlb
9923 real (kind=kind_phys) :: cflux
9924 real (kind=kind_phys) :: lfmsmn
9925 real (kind=kind_phys) :: rswood
9926 real (kind=kind_phys) :: rsleaf
9927 real (kind=kind_phys) :: rsroot
9928 real (kind=kind_phys) :: rsgrain
9929 real (kind=kind_phys) :: nppl
9930 real (kind=kind_phys) :: nppr
9931 real (kind=kind_phys) :: nppw
9932 real (kind=kind_phys) :: npps
9933 real (kind=kind_phys) :: nppg
9934 real (kind=kind_phys) :: dielf
9936 real (kind=kind_phys) :: addnpplf
9937 real (kind=kind_phys) :: addnppst
9938 real (kind=kind_phys) :: carbfx
9939 real (kind=kind_phys) :: cbhydrafx
9940 real (kind=kind_phys) :: grleaf
9941 real (kind=kind_phys) :: grroot
9942 real (kind=kind_phys) :: grwood
9943 real (kind=kind_phys) :: grstem
9944 real (kind=kind_phys) :: grgrain
9945 real (kind=kind_phys) :: leafpt
9946 real (kind=kind_phys) :: lfdel
9947 real (kind=kind_phys) :: lftovr
9948 real (kind=kind_phys) :: sttovr
9949 real (kind=kind_phys) :: wdtovr
9950 real (kind=kind_phys) :: grtovr
9951 real (kind=kind_phys) :: rssoil
9952 real (kind=kind_phys) :: rttovr
9953 real (kind=kind_phys) :: stablc
9954 real (kind=kind_phys) :: woodf
9955 real (kind=kind_phys) :: nonlef
9956 real (kind=kind_phys) :: resp
9957 real (kind=kind_phys) :: rsstem
9959 real (kind=kind_phys) :: fsw
9960 real (kind=kind_phys) :: fst
9961 real (kind=kind_phys) :: fnf
9962 real (kind=kind_phys) :: tf
9963 real (kind=kind_phys) :: stdel
9964 real (kind=kind_phys) :: stmsmn
9965 real (kind=kind_phys) :: sapm
9966 real (kind=kind_phys) :: diest
9967 real (kind=kind_phys) :: stconvert
9968 real (kind=kind_phys) :: rtconvert
9970 real (kind=kind_phys) :: bf
9971 real (kind=kind_phys) :: rswoodc
9972 real (kind=kind_phys) :: stovrc
9973 real (kind=kind_phys) :: rsdryc
9974 real (kind=kind_phys) :: rtovrc
9975 real (kind=kind_phys) :: wstrc
9976 real (kind=kind_phys) :: laimin
9977 real (kind=kind_phys) :: xsamin
9978 real (kind=kind_phys) :: sc
9979 real (kind=kind_phys) :: sd
9980 real (kind=kind_phys) :: vegfrac
9981 real (kind=kind_phys) :: temp
9985 real (kind=kind_phys) :: r,x
9986 r(x) = exp(0.08*(x-298.16))
9998 lfmsmn = laimin/0.035
9999 stmsmn = xsamin/sapm
10005 carbfx = psn*12.e-6
10006 cbhydrafx = psn*30.e-6
10009 fnf = min( foln/max(1.e-06,parameters%foln_mx), 1.0 )
10010 tf = parameters%q10mr**( (tv-298.16)/10. )
10011 resp = parameters%lfmr25 * tf * fnf * xlai * (1.-wstres)
10012 rsleaf = min((lfmass-lfmsmn)/dt,resp*30.e-6)
10013 rsroot = parameters%rtmr25*(rtmass*1e-3)*tf * 30.e-6
10014 rsstem = parameters%stmr25*(stmass*1e-3)*tf * 30.e-6
10015 rsgrain = parameters%grainmr25*(grain*1e-3)*tf * 30.e-6
10019 grleaf = max(0.0,parameters%fra_gr*(parameters%lfpt(pgs)*cbhydrafx - rsleaf))
10020 grstem = max(0.0,parameters%fra_gr*(parameters%stpt(pgs)*cbhydrafx - rsstem))
10021 grroot = max(0.0,parameters%fra_gr*(parameters%rtpt(pgs)*cbhydrafx - rsroot))
10022 grgrain = max(0.0,parameters%fra_gr*(parameters%grainpt(pgs)*cbhydrafx - rsgrain))
10027 lftovr = parameters%lf_ovrc(pgs)*1.e-6*lfmass
10028 rttovr = parameters%rt_ovrc(pgs)*1.e-6*rtmass
10029 sttovr = parameters%st_ovrc(pgs)*1.e-6*stmass
10030 sc = exp(-0.3*max(0.,tv-parameters%lefreez)) * (lfmass/120.)
10031 sd = exp((wstres-1.)*wstrc)
10032 dielf = lfmass*1.e-6*(parameters%dile_fw(pgs) * sd + parameters%dile_fc(pgs)*sc)
10037 addnpplf = max(0.,parameters%lfpt(pgs)*cbhydrafx - grleaf-rsleaf)
10038 addnpplf = parameters%lfpt(pgs)*cbhydrafx - grleaf-rsleaf
10039 addnppst = max(0.,parameters%stpt(pgs)*cbhydrafx - grstem-rsstem)
10040 addnppst = parameters%stpt(pgs)*cbhydrafx - grstem-rsstem
10045 lfdel = (lfmass - lfmsmn)/dt
10046 stdel = (stmass - stmsmn)/dt
10047 lftovr = min(lftovr,lfdel+addnpplf)
10048 sttovr = min(sttovr,stdel+addnppst)
10049 dielf = min(dielf,lfdel+addnpplf-lftovr)
10053 nppl = max(addnpplf,-lfdel)
10055 npps = max(addnppst,-stdel)
10057 nppr = parameters%rtpt(pgs)*cbhydrafx - rsroot - grroot
10058 nppg = parameters%grainpt(pgs)*cbhydrafx - rsgrain - grgrain
10062 lfmass = lfmass + (nppl-lftovr-dielf)*dt
10063 stmass = stmass + (npps-sttovr)*dt
10064 rtmass = rtmass + (nppr-rttovr)*dt
10065 grain = grain + nppg*dt
10067 gpp = cbhydrafx* 0.4
10072 stconvert = stmass*(0.00005*dt/3600.0)
10073 stmass = stmass - stconvert
10074 rtconvert = rtmass*(0.0005*dt/3600.0)
10075 rtmass = rtmass - rtconvert
10076 grain = grain + stconvert + rtconvert
10079 if(rtmass.lt.0.0)
then
10084 if(grain.lt.0.0)
then
10093 fastcp = fastcp + (rttovr+lftovr+sttovr+dielf)*dt
10095 fst = 2.0**( (stc-283.16)/10. )
10096 fsw = wroot / (0.20+wroot) * 0.23 / (0.23+wroot)
10097 rssoil = fsw * fst * parameters%mrp* max(0.,fastcp*1.e-3)*12.e-6
10099 stablc = 0.1*rssoil
10100 fastcp = fastcp - (rssoil + stablc)*dt
10101 stblcp = stblcp + stablc*dt
10105 cflux = - carbfx + rsleaf + rsroot + rsstem &
10106 + rssoil + grleaf + grroot
10111 npp = (nppl + npps+ nppr +nppg)*0.4
10114 autors = rsroot + rsgrain + rsleaf + &
10115 grleaf + grroot + grgrain
10118 nee = (autors + heters - gpp)*44./30.
10119 totsc = fastcp + stblcp
10121 totlb = lfmass + rtmass + grain
10125 xlai = max(lfmass*parameters%bio2lai,laimin)
10126 xsai = max(stmass*sapm,xsamin)
10137 if(pgs == 8 .and. (grain > 0. .or. lfmass > 0 .or. stmass > 0 .or. rtmass > 0))
then
10152 t2m , dt, julian, & !in
10159 type (noahmp_parameters),
intent(in) :: parameters
10160 real (kind=kind_phys) ,
intent(in) :: t2m
10161 real (kind=kind_phys) ,
intent(in) :: dt
10162 real (kind=kind_phys) ,
intent(in) :: julian
10166 real (kind=kind_phys) ,
intent(inout) :: gdd
10170 integer ,
intent(out) :: ipa
10171 integer ,
intent(out) :: iha
10172 integer ,
intent(out) :: pgs
10176 real (kind=kind_phys) :: gddday
10177 real (kind=kind_phys) :: dayofs2
10178 real (kind=kind_phys) :: tdiff
10179 real (kind=kind_phys) :: tc
10190 if(julian < parameters%pltday) ipa = 0
10193 if(julian >= parameters%hsday) iha = 0
10197 if(tc < parameters%gddtbase)
then
10199 elseif(tc >= parameters%gddtcut)
then
10200 tdiff = parameters%gddtcut - parameters%gddtbase
10202 tdiff = tc - parameters%gddtbase
10205 gdd = (gdd + tdiff * dt / 86400.0) * ipa * iha
10228 if(gddday > 0.0) pgs = 2
10230 if(gddday >= parameters%gdds1) pgs = 3
10232 if(gddday >= parameters%gdds2) pgs = 4
10234 if(gddday >= parameters%gdds3) pgs = 5
10236 if(gddday >= parameters%gdds4) pgs = 6
10238 if(gddday >= parameters%gdds5) pgs = 7
10240 if(julian >= parameters%hsday) pgs = 8
10242 if(julian < parameters%pltday) pgs = 1
10250 soldn, xlai,t2m, & !in
10256 type (noahmp_parameters),
intent(in) :: parameters
10257 real (kind=kind_phys) ,
intent(in) :: soldn
10258 real (kind=kind_phys) ,
intent(in) :: xlai
10259 real (kind=kind_phys) ,
intent(in) :: t2m
10260 real (kind=kind_phys) ,
intent(out) :: psncrop
10264 real (kind=kind_phys) :: par
10265 real (kind=kind_phys) :: amax
10266 real (kind=kind_phys) :: l1
10267 real (kind=kind_phys) :: l2
10268 real (kind=kind_phys) :: l3
10269 real (kind=kind_phys) :: i1
10270 real (kind=kind_phys) :: i2
10271 real (kind=kind_phys) :: i3
10272 real (kind=kind_phys) :: a1
10273 real (kind=kind_phys) :: a2
10274 real (kind=kind_phys) :: a3
10275 real (kind=kind_phys) :: a
10276 real (kind=kind_phys) :: tc
10280 par = parameters%i2par * soldn * 0.0036
10282 if(tc < parameters%tassim0)
then
10284 elseif(tc >= parameters%tassim0 .and. tc < parameters%tassim1)
then
10285 amax = (tc - parameters%tassim0) * parameters%aref / (parameters%tassim1 - parameters%tassim0)
10286 elseif(tc >= parameters%tassim1 .and. tc < parameters%tassim2)
then
10287 amax = parameters%aref
10289 amax= parameters%aref - 0.2 * (t2m - parameters%tassim2)
10292 amax = max(amax,0.01)
10294 if(xlai <= 0.05)
then
10304 i1 = parameters%k * par * exp(-parameters%k * l1)
10305 i2 = parameters%k * par * exp(-parameters%k * l2)
10306 i3 = parameters%k * par * exp(-parameters%k * l3)
10312 a1 = amax * (1 - exp(-parameters%epsi * i1 / amax))
10313 a2 = amax * (1 - exp(-parameters%epsi * i2 / amax)) * 1.6
10314 a3 = amax * (1 - exp(-parameters%epsi * i3 / amax))
10316 if (xlai <= 0.05)
then
10317 a = (a1+a2+a3) / 3.6 * 0.05
10318 elseif (xlai > 0.05 .and. xlai <= 4.0)
then
10319 a = (a1+a2+a3) / 3.6 * xlai
10321 a = (a1+a2+a3) / 3.6 * 4
10324 a = a * parameters%psnrf
10326 psncrop = 6.313 * a
10430 subroutine noahmp_options(idveg , iopt_crs , iopt_btr , iopt_run , iopt_sfc , iopt_frz , &
10431 iopt_inf, iopt_rad , iopt_alb , iopt_snf , iopt_tbot, iopt_stc , &
10432 iopt_rsf, iopt_soil, iopt_pedo, iopt_crop, iopt_trs , iopt_diag, &
10437 integer,
intent(in) :: idveg
10438 integer,
intent(in) :: iopt_crs
10439 integer,
intent(in) :: iopt_btr
10440 integer,
intent(in) :: iopt_run
10441 integer,
intent(in) :: iopt_sfc
10442 integer,
intent(in) :: iopt_frz
10443 integer,
intent(in) :: iopt_inf
10444 integer,
intent(in) :: iopt_rad
10445 integer,
intent(in) :: iopt_alb
10446 integer,
intent(in) :: iopt_snf
10447 integer,
intent(in) :: iopt_tbot
10449 integer,
intent(in) :: iopt_stc
10451 integer,
intent(in) :: iopt_rsf
10452 integer,
intent(in) :: iopt_soil
10453 integer,
intent(in) :: iopt_pedo
10454 integer,
intent(in) :: iopt_crop
10455 integer,
intent(in) :: iopt_trs
10456 integer,
intent(in) :: iopt_diag
10457 integer,
intent(in) :: iopt_z0m
10472 opt_tbot = iopt_tbot
10475 opt_soil = iopt_soil
10476 opt_pedo = iopt_pedo
10477 opt_crop = iopt_crop
10479 opt_diag = iopt_diag
10487 p1d ,psfcpa,pblhx ,dx ,znt , &
10489 itime ,snwh ,isice ,psi_opt, &
10490 tsk ,qx ,zlvl ,iz0tlnd,qsfc , &
10491 hfx ,qfx ,cm ,chs ,chs2 , &
10493 rmolx ,ust , rbx, fmx, fhx,stressx,&
10494 fm10x, fh2x, wspdx,flhcx,flqcx)
10504 integer,
intent(in ) :: iloc
10505 integer,
intent(in ) :: jloc
10506 integer,
intent(in) :: itime
10508 integer,
intent(in) :: psi_opt
10510 integer,
intent(in) :: isice
10512 real(kind=kind_phys),
intent(in ) :: pblhx
10513 real(kind=kind_phys),
intent(in ) :: tsk
10514 real(kind=kind_phys),
intent(in ) :: psfcpa
10515 real(kind=kind_phys),
intent(in ) :: p1d
10516 real(kind=kind_phys),
intent(in ) :: t1d
10517 real(kind=kind_phys),
intent(in ) :: qx
10518 real(kind=kind_phys),
intent(in ) :: zlvl
10519 real(kind=kind_phys),
intent(in ) :: hfx
10520 real(kind=kind_phys),
intent(in ) :: qfx
10521 real(kind=kind_phys),
intent(in ) :: dx
10522 real(kind=kind_phys),
intent(in ) :: ux
10523 real(kind=kind_phys),
intent(in ) :: vx
10524 real(kind=kind_phys),
intent(in ) :: znt
10525 real(kind=kind_phys),
intent(in ) :: snwh
10526 real(kind=kind_phys),
intent(in ) :: ep_1
10527 real(kind=kind_phys),
intent(in ) :: ep_2
10528 real(kind=kind_phys),
intent(in ) :: cp
10532 integer,
optional,
intent(in ) :: iz0tlnd
10534 real(kind=kind_phys),
intent(inout) :: qsfc
10535 real(kind=kind_phys),
intent(inout) :: ust
10536 real(kind=kind_phys),
intent(inout) :: chs
10537 real(kind=kind_phys),
intent(inout) :: chs2
10538 real(kind=kind_phys),
intent(inout) :: cqs2
10539 real(kind=kind_phys),
intent(inout) :: cm
10541 real(kind=kind_phys),
intent(inout) :: rmolx
10542 real(kind=kind_phys),
intent(inout) :: rbx
10543 real(kind=kind_phys),
intent(inout) :: fmx
10544 real(kind=kind_phys),
intent(inout) :: fhx
10545 real(kind=kind_phys),
intent(inout) :: stressx
10546 real(kind=kind_phys),
intent(inout) :: fm10x
10547 real(kind=kind_phys),
intent(inout) :: fh2x
10549 real(kind=kind_phys),
intent(inout) :: wspdx
10550 real(kind=kind_phys),
intent(inout) :: flhcx
10551 real(kind=kind_phys),
intent(inout) :: flqcx
10553 real(kind=kind_phys) :: zolx
10554 real(kind=kind_phys) :: molx
10567 real(kind=kind_phys) :: za
10568 real(kind=kind_phys) :: thvx
10569 real(kind=kind_phys) :: zqkl
10570 real(kind=kind_phys) :: zqklp1
10571 real(kind=kind_phys) :: thx
10572 real(kind=kind_phys) :: psih
10573 real(kind=kind_phys) :: psih2
10574 real(kind=kind_phys) :: psih10
10575 real(kind=kind_phys) :: psim
10576 real(kind=kind_phys) :: psim2
10577 real(kind=kind_phys) :: psim10
10579 real(kind=kind_phys) :: gz1oz0
10580 real(kind=kind_phys) :: gz2oz0
10581 real(kind=kind_phys) :: gz10oz0
10583 real(kind=kind_phys) :: rhox
10584 real(kind=kind_phys) :: govrth
10585 real(kind=kind_phys) :: tgdsa
10586 real(kind=kind_phys) :: tvir
10587 real(kind=kind_phys) :: thgb
10588 real(kind=kind_phys) :: psfcx
10589 real(kind=kind_phys) :: cpm
10590 real(kind=kind_phys) :: qgh
10592 integer :: n,i,k,kk,l,nzol,nk,nzol2,nzol10
10594 real(kind=kind_phys) :: zolzt, zolz0, zolza
10595 real(kind=kind_phys) :: gz1ozt,gz2ozt,gz10ozt
10598 real(kind=kind_phys) :: pl,thcon,tvcon,e1
10599 real(kind=kind_phys) :: zl,tskv,dthvdz,dthvm,vconv,rzol,rzol2,rzol10,zol2,zol10
10600 real(kind=kind_phys) :: dtg,psix,dtthx,psix10,psit,psit2,psiq,psiq2,psiq10
10601 real(kind=kind_phys) :: fluxc,vsgd,z0q,visc,restar,czil,restar2
10603 real(kind=kind_phys) :: dqg
10604 real(kind=kind_phys) :: tabs
10605 real(kind=kind_phys) :: qsfcmr
10606 real(kind=kind_phys) :: t1dc
10607 real(kind=kind_phys) :: zt
10608 real(kind=kind_phys) :: zq
10609 real(kind=kind_phys) :: zratio
10610 real(kind=kind_phys) :: qstar
10611 real(kind=kind_phys) :: ep2
10612 real(kind=kind_phys) :: ep_3
10619 if (itime == 1)
then
10620 if (isice == 0)
then
10621 tabs = 0.5*(tsk + t1d)
10622 if (tabs .lt. 273.15)
then
10624 e1=svp1*exp(4648*(1./273.15 - 1./tabs) - &
10625 & 11.64*log(273.15/tabs) + 0.02265*(273.15 - tabs))
10628 e1=svp1*exp(svp2*(tabs-svpt0)/(tabs-svp3))
10631 qsfc =ep2*e1/(psfcx-ep_3*e1)
10632 qsfcmr =qsfc/(1.-qsfc)
10635 if (isice == 1)
then
10636 if (tsk .lt. 273.15)
then
10638 e1=svp1*exp(4648*(1./273.15 - 1./tsk) - &
10639 & 11.64*log(273.15/tsk) + 0.02265*(273.15 - tsk))
10642 e1=svp1*exp(svp2*(tsk-svpt0)/(tsk-svp3))
10645 qsfc=ep2*e1/(psfcx-ep_3*e1)
10646 qsfcmr=ep2*e1/(psfcx-e1)
10652 if (isice == 0)
then
10653 tabs = 0.5*(tsk + t1d)
10654 if (tabs .lt. 273.15)
then
10656 e1=svp1*exp(4648*(1./273.15 - 1./tabs) - &
10657 & 11.64*log(273.15/tabs) + 0.02265*(273.15 - tabs))
10660 e1=svp1*exp(svp2*(tabs-svpt0)/(tabs-svp3))
10663 qsfc =ep2*e1/(psfcx-ep_3*e1)
10664 qsfcmr=qsfc/(1.-qsfc)
10668 if (isice == 1)
then
10669 if (tsk .lt. 273.15)
then
10671 e1=svp1*exp(4648*(1./273.15 - 1./tsk) - &
10672 & 11.64*log(273.15/tsk) + 0.02265*(273.15 - tsk))
10675 e1=svp1*exp(svp2*(tsk-svpt0)/(tsk-svp3))
10678 qsfc=ep2*e1/(psfcx-ep_3*e1)
10679 qsfcmr=qsfc/(1.-qsfc)
10686 thgb = tsk*(p1000mb/psfcpa)**(rair/cpair)
10691 thx = t1d*(p1000mb*0.001/pl)**(rair/cpair)
10692 t1dc = t1d - 273.15
10694 thvx = thx*(1.+ep_1*qx)
10695 tvir = t1d*(1.+ep_1*qx)
10697 rhox=psfcx*1000./(rair*tvir)
10719 if (t1d .lt. 273.15)
then
10721 e1=svp1*exp(4648.*(1./273.15 - 1./t1d) - &
10722 & 11.64*log(273.15/t1d) + 0.02265*(273.15 - t1d))
10725 e1=svp1*exp(svp2*(t1d-svpt0)/(t1d-svp3))
10734 cpm=cp*(1.+0.84*qx/(1.0-qx) )
10736 wspdx=sqrt(ux*ux+vx*vx)
10738 tskv=thgb*(1.+ep_1*qsfc)
10741 fluxc = max(hfx/rhox/cp + ep_1*tskv*qfx/rhox,0.)
10744 vconv = vconvc*(grav/tgdsa*min(1.5*pblhx,4000.0)*fluxc)**.33
10747 vsgd = min(0.32 * (max(dx/5000.-1.,0.))**.33,0.5)
10748 wspdx=sqrt(wspdx*wspdx+vconv*vconv+vsgd*vsgd)
10749 wspdx=max(wspdx,0.1)
10750 rbx=govrth*za*dthvdz/(wspdx*wspdx)
10752 if (itime == 1)
then
10765 visc=1.326e-5*(1. + 6.542e-3*t1dc + 8.301e-6*t1dc*t1dc &
10766 - 4.84e-9*t1dc*t1dc*t1dc)
10771 restar=max(ust*znt/visc,0.1)
10776 if (snwh > 50. .or. isice == 1)
then
10779 if (
present(iz0tlnd) )
then
10780 if ( iz0tlnd .le. 1 )
then
10782 ust,vkc,1.0_kind_phys,iz0tlnd,0,0.0_kind_phys)
10783 elseif ( iz0tlnd .eq. 2 )
then
10786 elseif ( iz0tlnd .eq. 3 )
then
10797 ust,vkc,1.0_kind_phys,0,0,0.0_kind_phys)
10807 gz1oz0= log((za+znt)/znt)
10808 gz1ozt= log((za+znt)/zt)
10809 gz2oz0= log((2.0+znt)/znt)
10810 gz2ozt= log((2.0+znt)/zt)
10811 gz10oz0=log((10.+znt)/znt)
10821 if (rbx .gt. 0.0)
then
10834 zolx=zolrib(rbx,za,znt,zt,gz1oz0,gz1ozt,zolx,psi_opt)
10839 zolz0 = zolx*znt/za
10840 zolza = zolx*(za+znt)/za
10841 zol10 = zolx*(10.+znt)/za
10842 zol2 = zolx*(2.+znt)/za
10851 psim=psim_stable(zolza,psi_opt)-psim_stable(zolz0,psi_opt)
10852 psih=psih_stable(zolza,psi_opt)-psih_stable(zolzt,psi_opt)
10853 psim10=psim_stable(zol10,psi_opt)-psim_stable(zolz0,psi_opt)
10855 psih2=psih_stable(zol2,psi_opt)-psih_stable(zolzt,psi_opt)
10861 elseif(rbx .eq. 0.)
then
10875 elseif(rbx .lt. 0.)
then
10886 zolx=max(zolx,-20.0)
10894 zolx=zolrib(rbx,za,znt,zt,gz1oz0,gz1ozt,zolx,psi_opt)
10895 zolx=max(zolx,-20.0)
10899 zolz0 = zolx*znt/za
10900 zolza = zolx*(za+znt)/za
10901 zol10 = zolx*(10.+znt)/za
10902 zol2 = zolx*(2.+znt)/za
10910 psim=psim_unstable(zolza,psi_opt)-psim_unstable(zolz0,psi_opt)
10911 psih=psih_unstable(zolza,psi_opt)-psih_unstable(zolzt,psi_opt)
10912 psim10=psim_unstable(zol10,psi_opt)-psim_unstable(zolz0,psi_opt)
10914 psih2=psih_unstable(zol2,psi_opt)-psih_unstable(zolzt,psi_opt)
10920 psih=min(psih,0.9*gz1ozt)
10921 psim=min(psim,0.9*gz1oz0)
10922 psih2=min(psih2,0.9*gz2ozt)
10923 psim10=min(psim10,0.9*gz10oz0)
10932 psix =max(gz1oz0-psim, 1.0)
10933 psix10=max(gz10oz0-psim10, 1.0)
10934 psit =max(gz1ozt-psih , 1.0)
10935 psit2 =max(gz2ozt-psih2, 1.0)
10936 psiq =max(log((za+zq)/zq)-psih ,1.0)
10937 psiq2 =max(log((2.0+zq)/zq)-psih2 ,1.0)
10948 ust=0.5*ust+0.5*vkc*wspdx/psix
10967 molx=vkc*dtg/psit/prt
10974 dqg=(qx-qsfc)*1000.
10975 qstar=vkc*dqg/psiq/prt
10977 cm = (vkc/psix)*(vkc/psix)*wspdx
10989 flhcx = rhox*cpm*ust*vkc/psit
10990 flqcx = rhox*1.0*ust*vkc/psiq
11008 & landsea,iz0tlnd2,spp_pbl,rstoch)
11011 real (kind=kind_phys),
intent(in) :: z_0,restar,ustar,vkc,landsea
11012 integer,
optional,
intent(in):: iz0tlnd2
11013 real (kind=kind_phys),
intent(out) :: zt,zq
11014 real (kind=kind_phys) :: czil
11017 integer,
intent(in) :: spp_pbl
11018 real (kind=kind_phys),
intent(in) :: rstoch
11021 if (landsea-1.5 .gt. 0)
then
11025 if (restar .lt. 0.1)
then
11026 zt = z_0*exp(vkc*2.0)
11027 zt = min( zt, 6.0e-5)
11028 zt = max( zt, 2.0e-9)
11029 zq = z_0*exp(vkc*3.0)
11030 zq = min( zq, 6.0e-5)
11031 zq = max( zq, 2.0e-9)
11033 zt = z_0*exp(-vkc*(4.0*sqrt(restar)-3.2))
11034 zt = min( zt, 6.0e-5)
11035 zt = max( zt, 2.0e-9)
11036 zq = z_0*exp(-vkc*(4.0*sqrt(restar)-4.2))
11037 zq = min( zt, 6.0e-5)
11038 zq = max( zt, 2.0e-9)
11044 if ( iz0tlnd2 .eq. 1 )
then
11045 czil = 10.0 ** ( -0.40 * ( z_0 / 0.07 ) )
11050 zt = z_0*exp(-vkc*czil*sqrt(restar))
11051 zt = min( zt, 0.75*z_0)
11053 zq = z_0*exp(-vkc*czil*sqrt(restar))
11054 zq = min( zq, 0.75*z_0)
11059 if (spp_pbl==1)
then
11060 zt = zt + zt * 0.5 * rstoch
11061 zt = max(zt, 0.0001)
11077 real (kind=kind_phys),
intent(in) :: ren, z_0,landsea
11078 real (kind=kind_phys),
intent(out) :: zt,zq
11079 real (kind=kind_phys) :: rq
11080 real (kind=kind_phys),
parameter :: e=2.71828183
11082 if (landsea-1.5 .gt. 0)
then
11084 zt = z_0*exp(2.0 - (2.48*(ren**0.25)))
11085 zq = z_0*exp(2.0 - (2.28*(ren**0.25)))
11087 zq = min( zq, 5.5e-5)
11088 zq = max( zq, 2.0e-9)
11089 zt = min( zt, 5.5e-5)
11090 zt = max( zt, 2.0e-9)
11127 real (kind=kind_phys),
intent(in) :: z_0, ren, ustar, tstar, qst, visc
11128 real (kind=kind_phys) :: ht, &
11133 real (kind=kind_phys),
intent(out) :: zt,zq
11134 real (kind=kind_phys),
parameter :: renc=300., &
11139 z_02 = min(z_0,0.5)
11140 z_02 = max(z_02,0.04)
11141 renc2= b + m*log(z_02)
11142 ht = renc2*visc/max(ustar,0.01)
11143 tstar2 = min(tstar, 0.0)
11144 qstar2 = min(qst,0.0)
11146 zt = ht * exp(-beta*(ustar**0.5)*(abs(tstar2)**1.0))
11147 zq = ht * exp(-beta*(ustar**0.5)*(abs(qstar2)**1.0))
11150 zt = min(zt, z_0/2.0)
11151 zq = min(zq, z_0/2.0)
11165 real (kind=kind_phys),
intent(in) :: z_0, bvisc, ustar
11166 real (kind=kind_phys),
intent(out) :: zt, zq
11167 real (kind=kind_phys):: ren2, zntsno
11169 real (kind=kind_phys),
parameter :: bt0_s=1.25, bt0_t=0.149, bt0_r=0.317, &
11170 bt1_s=0.0, bt1_t=-0.55, bt1_r=-0.565, &
11171 bt2_s=0.0, bt2_t=0.0, bt2_r=-0.183
11173 real (kind=kind_phys),
parameter :: bq0_s=1.61, bq0_t=0.351, bq0_r=0.396, &
11174 bq1_s=0.0, bq1_t=-0.628, bq1_r=-0.512, &
11175 bq2_s=0.0, bq2_t=0.0, bq2_r=-0.180
11178 zntsno = 0.135*bvisc/ustar + &
11179 (0.035*(ustar*ustar)/9.8) * &
11180 (5.*exp(-1.*(((ustar - 0.18)/0.1)*((ustar - 0.18)/0.1))) + 1.)
11181 ren2 = ustar*zntsno/bvisc
11185 if (ren2 .gt. 1000.) ren2 = 1000.
11187 if (ren2 .le. 0.135)
then
11189 zt = zntsno*exp(bt0_s + bt1_s*log(ren2) + bt2_s*log(ren2)**2)
11190 zq = zntsno*exp(bq0_s + bq1_s*log(ren2) + bq2_s*log(ren2)**2)
11192 else if (ren2 .gt. 0.135 .and. ren2 .lt. 2.5)
then
11194 zt = zntsno*exp(bt0_t + bt1_t*log(ren2) + bt2_t*log(ren2)**2)
11195 zq = zntsno*exp(bq0_t + bq1_t*log(ren2) + bq2_t*log(ren2)**2)
11199 zt = zntsno*exp(bt0_r + bt1_r*log(ren2) + bt2_r*log(ren2)**2)
11200 zq = zntsno*exp(bq0_r + bq1_r*log(ren2) + bq2_r*log(ren2)**2)
11215 real (kind=kind_phys),
intent(out) :: zl
11216 real (kind=kind_phys),
intent(in) :: rib, zaz0, z0zt
11217 real (kind=kind_phys) :: alfa, beta, zaz02, z0zt2
11218 real (kind=kind_phys),
parameter :: au11=0.045, bu11=0.003, bu12=0.0059, &
11219 &bu21=-0.0828, bu22=0.8845, bu31=0.1739, &
11220 &bu32=-0.9213, bu33=-0.1057
11221 real (kind=kind_phys),
parameter :: aw11=0.5738, aw12=-0.4399, aw21=-4.901,&
11222 &aw22=52.50, bw11=-0.0539, bw12=1.540, &
11223 &bw21=-0.669, bw22=-3.282
11224 real (kind=kind_phys),
parameter :: as11=0.7529, as21=14.94, bs11=0.1569,&
11225 &bs21=-0.3091, bs22=-1.303
11229 if (zaz0 .lt. 100.0) zaz02=100.
11230 if (zaz0 .gt. 100000.0) zaz02=100000.
11234 if (z0zt .lt. 0.5) z0zt2=0.5
11235 if (z0zt .gt. 100.0) z0zt2=100.
11240 if (rib .le. 0.0)
then
11241 zl = au11*alfa*rib**2 + ( &
11242 & (bu11*beta + bu12)*alfa**2 + &
11243 & (bu21*beta + bu22)*alfa + &
11244 & (bu31*beta**2 + bu32*beta + bu33))*rib
11248 elseif (rib .gt. 0.0 .and. rib .le. 0.2)
then
11249 zl = ((aw11*beta + aw12)*alfa + &
11250 & (aw21*beta + aw22))*rib**2 + &
11251 & ((bw11*beta + bw12)*alfa + &
11252 & (bw21*beta + bw22))*rib
11257 zl = (as11*alfa + as21)*rib + bs11*alfa + &
11271 real*8 function zolri(ri,za,z0,zt,zol1,psi_opt)
11280 real (kind=kind_phys),
intent(in) :: ri,za,z0,zt,zol1
11281 integer,
intent(in) :: psi_opt
11282 real (kind=kind_phys) :: x1,x2,fx1,fx2
11284 integer,
parameter :: nmax = 20
11285 real(kind=kind_phys) zolri_iteration
11298 fx1=zolri2(x1,ri,za,z0,zt,psi_opt)
11299 fx2=zolri2(x2,ri,za,z0,zt,psi_opt)
11301 do while (abs(x1 - x2) > 0.01 .and. n < nmax)
11302 if(abs(fx2).lt.abs(fx1))
then
11303 x1=x1-fx1/(fx2-fx1)*(x2-x1)
11304 fx1=zolri2(x1,ri,za,z0,zt,psi_opt)
11307 x2=x2-fx2/(fx2-fx1)*(x2-x1)
11308 fx2=zolri2(x2,ri,za,z0,zt,psi_opt)
11316 if (n==nmax .and. abs(x1 - x2) >= 0.01)
then
11318 zolri_iteration=
zolri
11320 zolri = zolri_iteration
11330 real*8 function zolri2(zol2,ri2,za,z0,zt,psi_opt)
11342 integer,
intent(in) :: psi_opt
11343 real (kind=kind_phys),
intent(in) :: ri2,za,z0,zt
11344 real (kind=kind_phys),
intent(inout) :: zol2
11345 real (kind=kind_phys) :: zol20,zol3,psim1,psih1,psix2,psit2,zolt
11349 if(zol2*ri2 .lt. 0.)zol2=0.
11358 psit2=max(log((za+z0)/zt)-(psih_unstable(zol3,psi_opt)-psih_unstable(zolt,psi_opt)), 1.0)
11359 psix2=max(log((za+z0)/z0)-(psim_unstable(zol3,psi_opt)-psim_unstable(zol20,psi_opt)),1.0)
11363 psit2=max(log((za+z0)/zt)-(psih_stable(zol3,psi_opt)-psih_stable(zolt,psi_opt)), 1.0)
11364 psix2=max(log((za+z0)/z0)-(psim_stable(zol3,psi_opt)-psim_stable(zol20,psi_opt)),1.0)
11367 zolri2=zol2*psit2/psix2**2 - ri2
11374 real*8 function zolrib(ri,za,z0,zt,logz0,logzt,zol1,psi_opt)
11379 real (kind=kind_phys),
intent(in) :: ri,za,z0,zt,logz0,logzt
11380 integer,
intent(in) :: psi_opt
11381 real (kind=kind_phys),
intent(inout) :: zol1
11382 real (kind=kind_phys) :: zol20,zol3,zolt,zolold
11384 integer,
parameter :: nmax = 20
11385 real (kind=kind_phys),
dimension(nmax):: zlhux
11386 real (kind=kind_phys) :: psit2,psix2,zolrib_iteration
11392 if (zol1*ri .lt. 0.)
then
11397 if (ri .lt. 0.)
then
11406 do while (abs(zolold - zolrib) > 0.01 .and. n < nmax)
11420 psit2=max(logzt-(psih_unstable(zol3,psi_opt)-psih_unstable(zolt,psi_opt)), 1.0)
11421 psix2=max(logz0-(psim_unstable(zol3,psi_opt)-psim_unstable(zol20,psi_opt)), 1.0)
11425 psit2=max(logzt-(psih_stable(zol3,psi_opt)-psih_stable(zolt,psi_opt)), 1.0)
11426 psix2=max(logz0-(psim_stable(zol3,psi_opt)-psim_stable(zol20,psi_opt)), 1.0)
11429 zolrib=ri*psix2**2/psit2
11434 if (n==nmax .and. abs(zolold - zolrib) > 0.01 )
then
11437 zolrib_iteration = zolrib
11439 zolrib = zolrib_iteration
11461 integer :: n,psi_opt
11462 real (kind=kind_phys) :: zolf
11463 character(len=*),
intent(out) :: errmsg
11464 integer,
intent(out) :: errflg
11466 if (psi_opt == 0)
then
11469 zolf = float(n)*0.01
11474 zolf = -float(n)*0.01
11481 zolf = float(n)*0.01
11482 psim_stab(n)=psim_stable_full_gfs(zolf)
11483 psih_stab(n)=psih_stable_full_gfs(zolf)
11486 zolf = -float(n)*0.01
11487 psim_unstab(n)=psim_unstable_full_gfs(zolf)
11488 psih_unstab(n)=psih_unstable_full_gfs(zolf)
11493 if (psim_stab(1) < 0. .and. psih_stab(1) < 0. .and. &
11494 psim_unstab(1) > 0. .and. psih_unstab(1) > 0.)
then
11495 errmsg =
'in mynn sfc, psi tables have been initialized'
11498 errmsg =
'error in mynn sfc: problem initializing psi tables'
11508 real (kind=kind_phys) :: zolf
11518 real (kind=kind_phys) :: zolf
11528 real (kind=kind_phys) :: zolf,x,ym,psimc,psimk
11530 x=(1.-16.*zolf)**.25
11532 psimk=2.*log(0.5*(1+x))+log(0.5*(1+x*x))-2.*atan(x)+2.*atan1
11534 ym=(1.-10.*zolf)**onethird
11536 psimc=1.5*log((ym**2 + ym+1.)*onethird)-sqrt3*atan((2.*ym+1)/sqrt3)+4.*atan1/sqrt3
11545 real (kind=kind_phys) :: zolf,y,yh,psihc,psihk
11547 y=(1.-16.*zolf)**.5
11549 psihk=2.*log((1+y)*0.5)
11551 yh=(1.-34.*zolf)**onethird
11553 psihc=1.5*log((yh**2.+yh+1.)*onethird)-sqrt3*atan((2.*yh+1)/sqrt3)+4.*atan1/sqrt3
11563 real*8 function psim_stable_full_gfs(zolf)
11564 real (kind=kind_phys) :: zolf
11565 real (kind=kind_phys),
parameter :: alpha4 = 20.
11566 real (kind=kind_phys) :: aa
11568 aa = sqrt(1. + alpha4 * zolf)
11569 psim_stable_full_gfs = -1.*aa + log(aa + 1.)
11574 real*8 function psih_stable_full_gfs(zolf)
11575 real (kind=kind_phys) :: zolf
11576 real (kind=kind_phys),
parameter :: alpha4 = 20.
11577 real (kind=kind_phys) :: bb
11579 bb = sqrt(1. + alpha4 * zolf)
11580 psih_stable_full_gfs = -1.*bb + log(bb + 1.)
11585 real*8 function psim_unstable_full_gfs(zolf)
11586 real (kind=kind_phys) :: zolf
11587 real (kind=kind_phys) :: hl1,tem1
11588 real (kind=kind_phys),
parameter :: a0=-3.975, a1=12.32, &
11589 b1=-7.755, b2=6.041
11591 if (zolf .ge. -0.5)
then
11593 psim_unstable_full_gfs = (a0 + a1*hl1) * hl1 / (1.+ (b1+b2*hl1) *hl1)
11596 tem1 = 1.0 / sqrt(hl1)
11597 psim_unstable_full_gfs = log(hl1) + 2. * sqrt(tem1) - .8776
11603 real*8 function psih_unstable_full_gfs(zolf)
11604 real (kind=kind_phys) :: zolf
11605 real (kind=kind_phys) :: hl1,tem1
11606 real (kind=kind_phys),
parameter :: a0p=-7.941, a1p=24.75, &
11607 b1p=-8.705, b2p=7.899
11609 if (zolf .ge. -0.5)
then
11611 psih_unstable_full_gfs = (a0p + a1p*hl1) * hl1 / (1.+ (b1p+b2p*hl1)*hl1)
11614 tem1 = 1.0 / sqrt(hl1)
11615 psih_unstable_full_gfs = log(hl1) + .5 * tem1 + 1.386
11624 real*8 function psim_stable(zolf,psi_opt)
11625 integer :: nzol,psi_opt
11626 real (kind=kind_phys) :: rzol,zolf
11628 nzol = int(zolf*100.)
11629 rzol = zolf*100. - nzol
11630 if(nzol+1 .lt. 1000)
then
11631 psim_stable = psim_stab(nzol) + rzol*(psim_stab(nzol+1)-psim_stab(nzol))
11633 if (psi_opt == 0)
then
11636 psim_stable = psim_stable_full_gfs(zolf)
11643 real*8 function psih_stable(zolf,psi_opt)
11644 integer :: nzol,psi_opt
11645 real (kind=kind_phys) :: rzol,zolf
11647 nzol = int(zolf*100.)
11648 rzol = zolf*100. - nzol
11649 if(nzol+1 .lt. 1000)
then
11650 psih_stable = psih_stab(nzol) + rzol*(psih_stab(nzol+1)-psih_stab(nzol))
11652 if (psi_opt == 0)
then
11655 psih_stable = psih_stable_full_gfs(zolf)
11662 real*8 function psim_unstable(zolf,psi_opt)
11663 integer :: nzol,psi_opt
11664 real (kind=kind_phys) :: rzol,zolf
11666 nzol = int(-zolf*100.)
11667 rzol = -zolf*100. - nzol
11668 if(nzol+1 .lt. 1000)
then
11669 psim_unstable = psim_unstab(nzol) + rzol*(psim_unstab(nzol+1)-psim_unstab(nzol))
11671 if (psi_opt == 0)
then
11674 psim_unstable = psim_unstable_full_gfs(zolf)
11681 real*8 function psih_unstable(zolf,psi_opt)
11682 integer :: nzol,psi_opt
11683 real (kind=kind_phys) :: rzol,zolf
11685 nzol = int(-zolf*100.)
11686 rzol = -zolf*100. - nzol
11687 if(nzol+1 .lt. 1000)
then
11688 psih_unstable = psih_unstab(nzol) + rzol*(psih_unstab(nzol+1)-psih_unstab(nzol))
11690 if (psi_opt == 0)
then
11693 psih_unstable = psih_unstable_full_gfs(zolf)
11700end module module_sf_noahmplsm
subroutine csnow
This subroutine calculates snow termal conductivity.
subroutine sstep(nsoil, sh2oin, rhsct, dt, smcmax, cmcmax, zsoil, sice, cmc, rhstt, ai, bi, ci, sh2oout, runoff3, smc)
This subroutine calculates/updates soil moisture content values and canopy moisture content values.
subroutine rosr12(nsoil, a, b, d, c, p, delta)
This subroutine inverts (solve) the tri-diagonal matrix problem.
subroutine frh2o(tkelv, smc, sh2o, smcmax, bexp, psis, liqwat)
This subroutine calculates amount of supercooled liquid soil water content if temperature is below 27...
subroutine tdfcnd(smc, qz, smcmax, sh2o, df)
This subroutine calculates thermal diffusivity and conductivity of the soil for a given point and tim...
subroutine snowz0
This subroutine calculates total roughness length over snow.
subroutine canres
This subroutine calculates canopy resistance which depends on incoming solar radiation,...
subroutine hrt(nsoil, stc, smc, smcmax, zsoil, yy, zz1, tbot, zbot, psisat, dt, bexp, df1, quartz, csoil, vegtyp, shdfac, lheatstrg, sh2o, rhsts, ai, bi, ci)
This subroutine calculates the right hand side of the time tendency term of the soil thermal diffusio...
subroutine hstep(nsoil, stcin, dt, rhsts, ai, bi, ci, stcout)
This subroutine calculates/updates the soil temperature field.
subroutine srt(nsoil, edir, et, sh2o, sh2oa, pcpdrp, zsoil, dwsat, dksat, smcmax, bexp, dt, smcwlt, slope, kdt, frzx, sice, rhstt, runoff1, runoff2, ai, bi, ci)
This subroutine calculates the right hand side of the time tendency term of the soil water diffusion ...
subroutine shallowwatertable(parameters, nsnow, nsoil, zsoil, dt, dzsnso, smceq, iloc, jloc, smc, wtd, smcwtd, rech, qdrain)
diagnoses water table depth and computes recharge when the water table is within the resolved soil la...
subroutine surrad(parameters, mpe, fsun, fsha, elai, vai, laisun, laisha, solad, solai, fabd, fabi, ftdd, ftid, ftii, albgrd, albgri, albd, albi, iloc, jloc, parsun, parsha, sav, sag, fsa, fsr, frevi, frevd, fregd, fregi, fsrv, fsrg)
surface raditiation
subroutine combine(parameters, nsnow, nsoil, iloc, jloc, isnow, sh2o, stc, snice, snliq, dzsnso, sice, snowh, sneqv, ponding1, ponding2)
subroutine canwater(parameters, vegtyp, dt, fcev, fctr, elai, esai, tg, fveg, iloc, jloc, bdfall, frozen_canopy, canliq, canice, tv, cmc, ecan, etran, fwet)
canopy hydrology
subroutine carbon_crop(parameters, nsnow, nsoil, vegtyp, dt, zsoil, julian, dzsnso, stc, smc, tv, psn, foln, btran, soldn, t2m, lfmass, rtmass, stmass, wood, stblcp, fastcp, grain, xlai, xsai, gdd, gpp, npp, nee, autors, heters, totsc, totlb, pgs)
initial crop version created by xing liu initial crop version added by barlage v3....
subroutine phasechange(parameters, nsnow,nsoil,isnow,dt,fact, dzsnso,hcpct,ist,iloc,jloc, stc,snice,snliq,sneqv,snowh, ifdef ccpp
melting/freezing of snow water and soil water
subroutine snowalb_bats(parameters, nband, fsno, cosz, fage, albsnd, albsni)
bats snow surface albedo
subroutine energy(parameters, ice,vegtyp,ist,nsnow,nsoil, isnow,dt,rhoair,sfcprs,qair, sfctmp,thair,lwdn,uu,vv,zref, co2air,o2air,solad,solai,cosz,igs, eair,tbot,zsnso,zsoil, elai,esai,fwet,foln, fveg,shdfac, pahv,pahg,pahb, qsnow,dzsnso,lat,canliq,canice,iloc, jloc, thsfc_loc, prslkix, prsik1x, prslk1x, garea1, pblhx, iz0tlnd, itime, psi_opt, ep_1, ep_2, epsm1, cp, z0wrf,z0hwrf, imelt,snicev,snliqv,epore,t2m,fsno, sav,sag,qmelt,fsa,fsr,taux, tauy,fira,fsh,fcev,fgev,fctr, trad,psn,apar,ssoil,btrani,btran, ponding, ts,latheav, latheag, frozen_canopy, frozen_ground, tv,tg,stc,snowh,eah,tah, sneqvo,sneqv,sh2o,smc,snice,snliq, albold,cm,ch,dx,dz8w,q2, ustarx, ifdef ccpp
We use different approaches to deal with subgrid features of radiation transfer and turbulent transfe...
subroutine snowfall(parameters, nsoil, nsnow, dt, qsnow, snowhin, sfctmp, iloc, jloc, isnow, snowh, dzsnso, stc, snice, snliq, sneqv)
snow depth and density to account for the new snowfall. new values of snow depth & density returned.
subroutine growing_gdd(parameters, t2m, dt, julian, gdd, ipa, iha, pgs)
subroutine divide(parameters, nsnow, nsoil, isnow, stc, snice, snliq, dzsnso)
subroutine noahmp_options(idveg, iopt_crs, iopt_btr, iopt_run, iopt_sfc, iopt_frz, iopt_inf, iopt_rad, iopt_alb, iopt_snf, iopt_tbot, iopt_stc, iopt_rsf, iopt_soil, iopt_pedo, iopt_crop, iopt_trs, iopt_diag, iopt_z0m)
subroutine water(parameters, vegtyp, nsnow, nsoil, imelt, dt, uu, vv, fcev, fctr, qprecc, qprecl, elai, esai, sfctmp, qvap, qdew, zsoil, btrani, ficeold, ponding, tg, ist, fveg, iloc, jloc, smceq, bdfall, fp, rain, snow, qsnow, qrain, snowhin, latheav, latheag, frozen_canopy, frozen_ground, isnow, canliq, canice, tv, snowh, sneqv, snice, snliq, stc, zsnso, sh2o, smc, sice, zwt, wa, wt, dzsnso, wslake, smcwtd, deeprech, rech, cmc, ecan, etran, fwet, runsrf, runsub, qin, qdis, ponding1, ponding2, qsnbot, esnow)
compute water budgets (water storages, et components, and runoff)
subroutine snowalb_class(parameters, nband, qsnow, dt, alb, albold, albsnd, albsni, iloc, jloc)
class snow surface albedo
subroutine psi_init(psi_opt, errmsg, errflg)
subroutine infil(parameters, nsoil, dt, zsoil, sh2o, sice, sicemax, qinsur, pddum, runsrf)
compute inflitration rate at soil surface and surface runoff
subroutine carbon(parameters, nsnow, nsoil, vegtyp, dt, zsoil, dzsnso, stc, smc, tv, tg, psn, foln, btran, apar, fveg, igs, troot, ist, lat, iloc, jloc, lfmass, rtmass, stmass, wood, stblcp, fastcp, gpp, npp, nee, autors, heters, totsc, totlb, xlai, xsai)
subroutine combo(parameters, dz, wliq, wice, t, dz2, wliq2, wice2, t2)
subroutine groundalb(parameters, nsoil, nband, ice, ist, fsno, smc, albsnd, albsni, cosz, tg, iloc, jloc, albgrd, albgri)
ground surface albedo
subroutine sfcdif4(iloc, jloc, ux, vx, t1d, p1d, psfcpa, pblhx, dx, znt, ep_1, ep_2, cp, itime, snwh, isice, psi_opt, tsk, qx, zlvl, iz0tlnd, qsfc, hfx, qfx, cm, chs, chs2, cqs2, rmolx, ust, rbx, fmx, fhx, stressx, fm10x, fh2x, wspdx, flhcx, flqcx)
subroutine sfcdif1(parameters, iter,sfctmp,rhoair,h,qair, zlvl,zpd,z0m,z0h,ur, mpe,iloc,jloc, ifdef ccpp
compute surface drag coefficient cm for momentum and ch for heat.
subroutine sfcdif3(parameters, iloc, jloc, iter, sfctmp, qair, ur, zlvl, tgb, thsfc_loc, prslkix, prsik1x, prslk1x, z0m, z0h, zpd, snowh, fveg, garea1, ustarx, fm, fh, fm2, fh2, fv, cm, ch)
compute surface drag coefficient cm for momentum and ch for heat.
subroutine phenology(parameters, vegtyp, croptype, snowh, tv, lat, yearlen, julian, lai, sai, troot, elai, esai, igs, pgs)
vegetation phenology considering vegetation canopy being buried by snow and evolution in time.
subroutine groundwater(parameters, nsnow, nsoil, dt, sice, zsoil, stc, wcnd, fcrmax, iloc, jloc, sh2o, zwt, wa, wt, qin, qdis)
subroutine snow_age(parameters, dt, tg, sneqvo, sneqv, tauss, fage)
subroutine tsnosoi(parameters, ice,nsoil,nsnow,isnow,ist, tbot,zsnso,ssoil,df,hcpct, sag,dt,snowh,dzsnso, tg,iloc,jloc, ifdef ccpp
compute snow (up to 3l) and soil (4l) temperature. note that snow temperatures during melting season ...
subroutine snowwater(parameters, nsnow, nsoil, imelt, dt, zsoil, sfctmp, snowhin, qsnow, qsnfro, qsnsub, qrain, ficeold, iloc, jloc, isnow, snowh, sneqv, snice, snliq, sh2o, sice, stc, zsnso, dzsnso, qsnbot, snoflow, ponding1, ponding2)
subroutine garratt_1992(zt, zq, z_0, ren, landsea)
data. the formula for land uses a constant ratio (z_0/7.4) taken from garratt (1992).
subroutine sfcdif2(parameters, iter, z0, thz0, thlm, sfcspd, zlm, iloc, jloc, akms, akhs, rlmo, wstar2, ustar)
calculate surface layer exchange coefficients via iteractive process (Chen et al. 1997,...
subroutine albedo(parameters, vegtyp, ist, ice, nsoil, dt, cosz, fage, elai, esai, tg, tv, snowh, fsno, fwet, smc, sneqvo, sneqv, qsnow, fveg, iloc, jloc, albold, tauss, albgrd, albgri, albd, albi, fabd, fabi, ftdd, ftid, ftii, fsun, frevi, frevd, fregd, fregi, bgap, wgap, albsnd, albsni)
surface albedos. also fluxes (per unit incoming direct and diffuse radiation) reflected,...
subroutine calhum(parameters, sfctmp, sfcprs, q2sat, dqsdt2)
subroutine zilitinkevich_1995(z_0, zt, zq, restar, ustar, vkc, landsea, iz0tlnd2, spp_pbl, rstoch)
subroutine twostream(parameters, ib, ic, vegtyp, cosz, vai, fwet, t, albgrd, albgri, rho, tau, fveg, ist, iloc, jloc, fab, fre, ftd, fti, gdir, frev, freg, bgap, wgap)
use two-stream approximation of Dickinson (1983) adv geophysics 25: 305-353 and sellers (1985) int j ...
subroutine atm(parameters, ep_2, epsm1, sfcprs, sfctmp, q2, prcpconv, prcpnonc, prcpshcv, prcpsnow, prcpgrpl, prcphail, soldn, cosz, thair, qair, eair, rhoair, qprecc, qprecl, solad, solai, swdown, bdfall, rain, snow, fp, fpice, prcp)
re-precess atmospheric forcing.
subroutine radiation(parameters, vegtyp, ist, ice, nsoil, sneqvo, sneqv, dt, cosz, snowh, tg, tv, fsno, qsnow, fwet, elai, esai, smc, solad, solai, fveg, iloc, jloc, albold, tauss, fsun, laisun, laisha, parsun, parsha, sav, sag, fsr, fsa, fsrv, fsrg, albd, albi, albsnd, albsni, bgap, wgap)
Calculate solar radiation: absorbed & reflected by the ground and canopy.
subroutine co2flux(parameters, nsnow, nsoil, vegtyp, igs, dt, dzsnso, stc, psn, troot, tv, wroot, wstres, foln, lapm, lat, iloc, jloc, fveg, xlai, xsai, lfmass, rtmass, stmass, fastcp, stblcp, wood, gpp, npp, nee, autors, heters, totsc, totlb)
the original code is from Dickinson et al.(1998), modified by guo-yue niu, 2004
subroutine thermoprop(parameters, nsoil, nsnow, isnow, ist, dzsnso, dt, snowh, snice, snliq, shdfac, smc, sh2o, tg, stc, ur, lat, z0m, zlvl, vegtyp, df, hcpct, snicev, snliqv, epore, fact)
subroutine noahmp_sflx(parameters, iloc, jloc, lat, yearlen, julian, cosz, dt, dx, dz8w, nsoil, zsoil, nsnow, shdfac, shdmax, vegtyp, ice, ist, croptype, smceq, sfctmp, sfcprs, psfc, uu, vv, q2, garea1, qc, soldn, lwdn, thsfc_loc, prslkix, prsik1x, prslk1x, pblhx, iz0tlnd, itime,psi_opt, prcpconv, prcpnonc, prcpshcv, prcpsnow, prcpgrpl, prcphail, tbot, co2air, o2air, foln, ficeold, zlvl, ep_1, ep_2, epsm1, cp, albold, sneqvo, stc, sh2o, smc, tah, eah, fwet, canliq, canice, tv, tg, qsfc, qsnow, qrain, isnow, zsnso, snowh, sneqv, snice, snliq, zwt, wa, wt, wslake, lfmass, rtmass, stmass, wood, stblcp, fastcp, lai, sai, cm, ch, tauss, grain, gdd, pgs, smcwtd,deeprech, rech, ustarx, z0wrf, z0hwrf, ts, fsa, fsr, fira, fsh, ssoil, fcev, fgev, fctr, ecan, etran, edir, trad, tgb, tgv, t2mv, t2mb, q2v, q2b, runsrf, runsub, apar, psn, sav, sag, fsno, nee, gpp, npp, fveg, albedo, qsnbot, ponding, ponding1, ponding2, rssun, rssha, albd, albi, albsnd, albsni, bgap, wgap, chv, chb, emissi, shg, shc, shb, evg, evb, ghv, ghb, irg, irc, irb, tr, evc, chleaf, chuc, chv2, chb2, fpice, pahv, pahg, pahb, pah, esnow, canhs, laisun, laisha, rb, qsfcveg, qsfcbare ifdef ccpp
subroutine compact(parameters, nsnow, nsoil, dt, stc, snice, snliq, zsoil, imelt, ficeold, iloc, jloc, isnow, dzsnso, zsnso)
subroutine wdfcnd2(parameters, wdf, wcnd, smc, sice, isoil)
calculate soil water diffusivity and soil hydraulic conductivity.
subroutine ragrb(parameters, iter, vai, rhoair, hg, tah, zpd, z0mg, z0hg, hcan, uc, z0h, fv, cwp, vegtyp, mpe, tv, mozg, fhg, fhgh, iloc, jloc, ramg, rahg, rawg, rb)
compute under-canopy aerodynamic resistance rag and leaf boundary layer resistance rb.
subroutine error(parameters, swdown,fsa,fsr,fira,fsh,fcev, fgev,fctr,ssoil,beg_wb,canliq,canice, sneqv,wa,smc,dzsnso,prcp,ecan, etran,edir,runsrf,runsub,dt,nsoil, nsnow,ist,errwat, iloc,jloc,fveg, sav,sag,fsrv,fsrg,zwt,pah, ifdef ccpp
check surface energy balance and water balance.
subroutine psn_crop(parameters, soldn, xlai, t2m, psncrop)
subroutine snowh2o(parameters, nsnow, nsoil, dt, qsnfro, qsnsub, qrain, iloc, jloc, isnow, dzsnso, snowh, sneqv, snice, snliq, sh2o, sice, stc, qsnbot, ponding1, ponding2)
renew the mass of ice lens (snice) and liquid (snliq) of the surface snow layer resulting from sublim...
subroutine precip_heat(parameters, iloc, jloc, vegtyp, dt, uu, vv, elai, esai, fveg, ist, bdfall, rain, snow, fp, canliq, canice, tv, sfctmp, tg, qintr, qdripr, qthror, qints, qdrips, qthros, pahv, pahg, pahb, qrain, qsnow, snowhin, fwet, cmc)
Michael Barlage: Oct 2013 - Split canwater to calculate precip movement for tracking of advected heat...
subroutine zwteq(parameters, nsoil, nsnow, zsoil, dzsnso, sh2o, zwt)
calculate equilibrium water table depth (niu et al., 2005)
subroutine soilwater(parameters, nsoil, nsnow, dt, zsoil, dzsnso, qinsur, qseva, etrani, sice, iloc, jloc, sh2o, smc, zwt, vegtyp, smcwtd, deeprech, runsrf, qdrain, runsub, wcnd, fcrmax)
calculate surface runoff and soil moisture.
subroutine co2flux_crop(parameters, dt, stc, psn, tv, wroot, wstres, foln, ipa, iha, pgs, xlai, xsai, lfmass, rtmass, stmass, fastcp, stblcp, wood, grain, gdd, gpp, npp, nee, autors, heters, totsc, totlb)
the original code from re dickinson et al.(1998) and guo-yue niu (2004), modified by xing liu,...
subroutine vege_flux(parameters, nsnow,nsoil,isnow,vegtyp,veg, dt,sav,sag,lwdn,ur, uu,vv,sfctmp,thair,qair, eair,rhoair,snowh,vai,gammav,gammag, fwet,laisun,laisha,cwp,dzsnso, zlvl,zpd,z0m,fveg,shdfac, z0mg,emv,emg,canliq,fsno, canice,stc,df,rssun,rssha, rsurf,latheav,latheag,parsun,parsha,igs, foln,co2air,o2air,btran,sfcprs, rhsur,iloc,jloc,q2,pahv,pahg, thsfc_loc, prslkix, prsik1x, prslk1x, garea1, pblhx,iz0tlnd,itime,psi_opt,ep_1, ep_2, epsm1, cp, eah,tah,tv,tg,cm, ustarx, ifdef ccpp
use newton-raphson iteration to solve for vegetation (tv) and ground (tg) temperatures that balance t...
subroutine thermalz0(parameters, fveg, z0m, z0mg, zlvl, zpd, ezpd, ustarx, vegtyp, vaie, ur, c_sigma_f0, c_sigma_f1, a1, cdmn_v, cdmn_g, surface_flag, z0m_out, z0h_out)
subroutine bare_flux(parameters, nsnow,nsoil,isnow,dt,sag, lwdn,ur,uu,vv,sfctmp, thair,qair,eair,rhoair,snowh, dzsnso,zlvl,zpd,z0m,fsno, emg,stc,df,rsurf,lathea, gamma,rhsur,iloc,jloc,q2,pahb, thsfc_loc, prslkix, prsik1x, prslk1x, vegtyp, fveg, shdfac, garea1, pblhx, iz0tlnd, itime,psi_opt, ep_1, ep_2, epsm1, cp,ifdef ccpp
use newton-raphson iteration to solve ground (tg) temperature that balances the surface energy budget...
subroutine stomata(parameters, vegtyp, mpe, apar, foln, iloc, jloc, tv, ei, ea, sfctmp, sfcprs, o2, co2, igs, btran, rb, rs, psn)
subroutine esat(t, esw, esi, desw, desi)
use polynomials to calculate saturation vapor pressure and derivative with respect to temperature: ov...
real *8 function zolri(ri, za, z0, zt, zol1, psi_opt)
subroutine wdfcnd1(parameters, wdf, wcnd, smc, fcr, isoil)
calculate soil water diffusivity and soil hydraulic conductivity.
subroutine yang_2008(z_0, zt, zq, ustar, tstar, qst, ren, visc)
this is a modified version of yang et al (2002 qjrms, 2008 jamc) and chen et al (2010,...
real *8 function psih_stable_full(zolf)
real *8 function psim_unstable_full(zolf)
subroutine li_etal_2010(zl, rib, zaz0, z0zt)
this subroutine returns a more robust z/l that best matches the z/l from hogstrom (1996) for unstable...
real *8 function psim_stable_full(zolf)
subroutine andreas_2002(z_0, bvisc, ustar, zt, zq)
this is taken from andreas (2002; j. of hydromet) and andreas et al. (2005; blm).
real *8 function psih_unstable_full(zolf)