forked from NCAR/ccpp-physics
-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathmodule_sf_noahmplsm.F90
11697 lines (9829 loc) · 548 KB
/
module_sf_noahmplsm.F90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#define CCPP
!> \file module_sf_noahmplsm.F90
!! This file contains the NoahMP land surface model.
!>\ingroup NoahMP_LSM
module module_sf_noahmplsm
#ifndef CCPP
use module_wrf_utl
#endif
use machine , only : kind_phys
implicit none
public :: noahmp_options
public :: noahmp_sflx
public :: sfcdif4
public :: psi_init
private :: atm
private :: phenology
private :: precip_heat
private :: energy
private :: thermoprop
private :: csnow
private :: tdfcnd
private :: radiation
private :: albedo
private :: snow_age
private :: snowalb_bats
private :: snowalb_class
private :: groundalb
private :: twostream
private :: surrad
private :: vege_flux
private :: sfcdif1
private :: sfcdif2
private :: stomata
private :: canres
private :: esat
private :: ragrb
private :: bare_flux
private :: tsnosoi
private :: hrt
private :: hstep
private :: rosr12
private :: phasechange
private :: frh2o
private :: water
private :: canwater
private :: snowwater
private :: snowfall
private :: combine
private :: divide
private :: combo
private :: compact
private :: snowh2o
private :: soilwater
private :: zwteq
private :: infil
private :: srt
private :: wdfcnd1
private :: wdfcnd2
private :: sstep
private :: groundwater
private :: shallowwatertable
private :: carbon
private :: co2flux
! private :: bvocflux
! private :: ch4flux
private :: error
! =====================================options for different schemes================================
! **recommended
integer :: dveg !< options for dynamic vegetation:
! 1 -> off (use table lai; use fveg = shdfac from input)
! 2 -> on (together with opt_crs = 1)
! 3 -> off (use table lai; calculate fveg)
! **4 -> off (use table lai; use maximum vegetation fraction)
! **5 -> on (use maximum vegetation fraction)
! 6 -> on (use FVEG = SHDFAC from input)
! 7 -> off (use input LAI; use FVEG = SHDFAC from input)
! 8 -> off (use input LAI; calculate FVEG)
! 9 -> off (use input LAI; use maximum vegetation fraction)
! 10 -> crop model on (use maximum vegetation fraction)
integer :: opt_crs !< options for canopy stomatal resistance
! **1 -> ball-berry
! 2 -> jarvis
integer :: opt_btr !< options for soil moisture factor for stomatal resistance
! **1 -> noah (soil moisture)
! 2 -> clm (matric potential)
! 3 -> ssib (matric potential)
integer :: opt_run !< options for runoff and groundwater
! **1 -> topmodel with groundwater (niu et al. 2007 jgr) ;
! 2 -> topmodel with an equilibrium water table (niu et al. 2005 jgr) ;
! 3 -> original surface and subsurface runoff (free drainage)
! 4 -> bats surface and subsurface runoff (free drainage)
! 5 -> miguez-macho&fan groundwater scheme (miguez-macho et al. 2007 jgr; fan et al. 2007 jgr)
! (needs further testing for public use)
integer :: opt_sfc !< options for surface layer drag coeff (ch & cm)
! **1 -> m-o
! **2 -> original noah (chen97)
! **3 -> myj consistent; 4->ysu consistent. mb: removed in v3.7 for further testing
integer :: opt_frz !< options for supercooled liquid water (or ice fraction)
! **1 -> no iteration (niu and yang, 2006 jhm)
! 2 -> koren's iteration
integer :: opt_inf !< options for frozen soil permeability
! **1 -> linear effects, more permeable (niu and yang, 2006, jhm)
! 2 -> nonlinear effects, less permeable (old)
integer :: opt_rad !< options for radiation transfer
! 1 -> modified two-stream (gap = f(solar angle, 3d structure ...)<1-fveg)
! 2 -> two-stream applied to grid-cell (gap = 0)
! **3 -> two-stream applied to vegetated fraction (gap=1-fveg)
integer :: opt_alb !< options for ground snow surface albedo
! 1 -> bats
! **2 -> class
integer :: opt_snf !< options for partitioning precipitation into rainfall & snowfall
! **1 -> jordan (1991)
! 2 -> bats: when sfctmp<tfrz+2.2
! 3 -> sfctmp < tfrz
! 4 -> use wrf microphysics output
integer :: opt_tbot !< options for lower boundary condition of soil temperature
! 1 -> zero heat flux from bottom (zbot and tbot not used)
! **2 -> tbot at zbot (8m) read from a file (original noah)
integer :: opt_stc !< options for snow/soil temperature time scheme (only layer 1)
! **1 -> semi-implicit; flux top boundary condition
! 2 -> full implicit (original noah); temperature top boundary condition
! 3 -> same as 1, but fsno for ts calculation (generally improves snow; v3.7)
integer :: opt_rsf !< options for surface resistent to evaporation/sublimation
! **1 -> sakaguchi and zeng, 2009
! 2 -> sellers (1992)
! 3 -> adjusted sellers to decrease rsurf for wet soil
! 4 -> option 1 for non-snow; rsurf = rsurf_snow for snow (set in mptable); ad v3.8
integer :: opt_soil !< options for defining soil properties
! **1 -> use input dominant soil texture
! 2 -> use input soil texture that varies with depth
! 3 -> use soil composition (sand, clay, orgm) and pedotransfer functions (opt_pedo)
! 4 -> use input soil properties (bexp_3d, smcmax_3d, etc.)
integer :: opt_pedo !< options for pedotransfer functions (used when opt_soil = 3)
! **1 -> saxton and rawls (2006)
integer :: opt_crop !< options for crop model
! **0 -> no crop model, will run default dynamic vegetation
! 1 -> liu, et al. 2016
integer :: opt_trs !< options for thermal roughness scheme
! **1 -> z0h=z0m
! 2 -> czil = f(canopy height) from Chen09
! 3 -> ec style from TESSEL
! 4 -> kb inverse from Blumel99
integer :: opt_diag !< options for surface 2m/q diagnostic approach
! 1 -> external GFS sfc_diag
! **2 -> original NoahMP 2-title
! 3 -> NoahMP 2-title + internal GFS sfc_diag
integer :: opt_z0m !< options for momentum roughness length
! **1 -> use z0m from MPTABLE
! 2 -> z0m = f(canopy height, LAI/SAI)
!------------------------------------------------------------------------------------------!
! physical constants: !
!------------------------------------------------------------------------------------------!
real (kind=kind_phys), parameter :: grav = 9.80616 !< acceleration due to gravity (m/s2)
real (kind=kind_phys), parameter :: sb = 5.67e-08 !< stefan-boltzmann constant (w/m2/k4)
real (kind=kind_phys), parameter :: vkc = 0.40 !< von karman constant
real (kind=kind_phys), parameter :: tfrz = 273.16 !< freezing/melting point (k)
real (kind=kind_phys), parameter :: hsub = 2.8440e06 !< latent heat of sublimation (j/kg)
real (kind=kind_phys), parameter :: hvap = 2.5104e06 !< latent heat of vaporization (j/kg)
real (kind=kind_phys), parameter :: hfus = 0.3336e06 !< latent heat of fusion (j/kg)
real (kind=kind_phys), parameter :: cwat = 4.188e06 !< specific heat capacity of water (j/m3/k)
real (kind=kind_phys), parameter :: cice = 2.094e06 !< specific heat capacity of ice (j/m3/k)
real (kind=kind_phys), parameter :: cpair = 1004.64 !< heat capacity dry air at const pres (j/kg/k)
real (kind=kind_phys), parameter :: tkwat = 0.6 !< thermal conductivity of water (w/m/k)
real (kind=kind_phys), parameter :: tkice = 2.2 !< thermal conductivity of ice (w/m/k)
real (kind=kind_phys), parameter :: tkair = 0.023 !< thermal conductivity of air (w/m/k) (not used mb: 20140718)
real (kind=kind_phys), parameter :: rair = 287.04 !< gas constant for dry air (j/kg/k)
real (kind=kind_phys), parameter :: rw = 461.269 !< gas constant for water vapor (j/kg/k)
real (kind=kind_phys), parameter :: denh2o = 1000. !< density of water (kg/m3)
real (kind=kind_phys), parameter :: denice = 917. !< density of ice (kg/m3)
integer, private, parameter :: mband = 2
integer, private, parameter :: nsoil = 4
integer, private, parameter :: nstage = 8
type noahmp_parameters ! define a noahmp parameters type
!------------------------------------------------------------------------------------------!
! from the veg section of mptable.tbl
!------------------------------------------------------------------------------------------!
logical :: urban_flag
integer :: iswater
integer :: isbarren
integer :: isice
integer :: iscrop
integer :: eblforest
real (kind=kind_phys) :: ch2op !< maximum intercepted h2o per unit lai+sai (mm)
real (kind=kind_phys) :: dleaf !< characteristic leaf dimension (m)
real (kind=kind_phys) :: z0mvt !< momentum roughness length (m)
real (kind=kind_phys) :: hvt !< top of canopy (m)
real (kind=kind_phys) :: hvb !< bottom of canopy (m)
real (kind=kind_phys) :: z0mhvt !< ratio of z0m to hvt
real (kind=kind_phys) :: den !< tree density (no. of trunks per m2)
real (kind=kind_phys) :: rc !< tree crown radius (m)
real (kind=kind_phys) :: mfsno !< snowmelt m parameter ()
real (kind=kind_phys) :: scffac !< snow cover factor (m)
real (kind=kind_phys) :: cbiom !< canopy biomass heat capacity parameter (m)
real (kind=kind_phys) :: saim(12) !< monthly stem area index, one-sided
real (kind=kind_phys) :: laim(12) !< monthly leaf area index, one-sided
real (kind=kind_phys) :: sla !< single-side leaf area per kg [m2/kg]
real (kind=kind_phys) :: prcpiceden !< precipitation ice density [kg/m^3]
real (kind=kind_phys) :: dilefc !< coeficient for leaf stress death [1/s]
real (kind=kind_phys) :: dilefw !< coeficient for leaf stress death [1/s]
real (kind=kind_phys) :: fragr !< fraction of growth respiration !original was 0.3
real (kind=kind_phys) :: ltovrc !< leaf turnover [1/s]
real (kind=kind_phys) :: c3psn !< photosynthetic pathway: 0. = c4, 1. = c3
real (kind=kind_phys) :: kc25 !< co2 michaelis-menten constant at 25c (pa)
real (kind=kind_phys) :: akc !< q10 for kc25
real (kind=kind_phys) :: ko25 !< o2 michaelis-menten constant at 25c (pa)
real (kind=kind_phys) :: ako !< q10 for ko25
real (kind=kind_phys) :: vcmx25 !< maximum rate of carboxylation at 25c (umol co2/m**2/s)
real (kind=kind_phys) :: avcmx !< q10 for vcmx25
real (kind=kind_phys) :: bp !< minimum leaf conductance (umol/m**2/s)
real (kind=kind_phys) :: mp !< slope of conductance-to-photosynthesis relationship
real (kind=kind_phys) :: qe25 !< quantum efficiency at 25c (umol co2 / umol photon)
real (kind=kind_phys) :: aqe !< q10 for qe25
real (kind=kind_phys) :: rmf25 !< leaf maintenance respiration at 25c (umol co2/m**2/s)
real (kind=kind_phys) :: rms25 !< stem maintenance respiration at 25c (umol co2/kg bio/s)
real (kind=kind_phys) :: rmr25 !< root maintenance respiration at 25c (umol co2/kg bio/s)
real (kind=kind_phys) :: arm !< q10 for maintenance respiration
real (kind=kind_phys) :: folnmx !< foliage nitrogen concentration when f(n)=1 (%)
real (kind=kind_phys) :: tmin !< minimum temperature for photosynthesis (k)
real (kind=kind_phys) :: xl !< leaf/stem orientation index
real (kind=kind_phys) :: rhol(mband) !< leaf reflectance: 1=vis, 2=nir
real (kind=kind_phys) :: rhos(mband) !< stem reflectance: 1=vis, 2=nir
real (kind=kind_phys) :: taul(mband) !< leaf transmittance: 1=vis, 2=nir
real (kind=kind_phys) :: taus(mband) !< stem transmittance: 1=vis, 2=nir
real (kind=kind_phys) :: mrp !< microbial respiration parameter (umol co2 /kg c/ s)
real (kind=kind_phys) :: cwpvt !< empirical canopy wind parameter
real (kind=kind_phys) :: wrrat !< wood to non-wood ratio
real (kind=kind_phys) :: wdpool !< wood pool (switch 1 or 0) depending on woody or not [-]
real (kind=kind_phys) :: tdlef !< characteristic t for leaf freezing [k]
integer :: nroot !< number of soil layers with root present
real (kind=kind_phys) :: rgl !< parameter used in radiation stress function
real (kind=kind_phys) :: rsmin !< minimum stomatal resistance [s m-1]
real (kind=kind_phys) :: hs !< parameter used in vapor pressure deficit function
real (kind=kind_phys) :: topt !< optimum transpiration air temperature [k]
real (kind=kind_phys) :: rsmax !< maximal stomatal resistance [s m-1]
real (kind=kind_phys) :: slarea
real (kind=kind_phys) :: eps(5)
!------------------------------------------------------------------------------------------!
! from the rad section of mptable.tbl
!------------------------------------------------------------------------------------------!
real (kind=kind_phys) :: albsat(mband) !< saturated soil albedos: 1=vis, 2=nir
real (kind=kind_phys) :: albdry(mband) !< dry soil albedos: 1=vis, 2=nir
real (kind=kind_phys) :: albice(mband) !< albedo land ice: 1=vis, 2=nir
real (kind=kind_phys) :: alblak(mband) !< albedo frozen lakes: 1=vis, 2=nir
real (kind=kind_phys) :: omegas(mband) !< two-stream parameter omega for snow
real (kind=kind_phys) :: betads !< two-stream parameter betad for snow
real (kind=kind_phys) :: betais !< two-stream parameter betad for snow
real (kind=kind_phys) :: eg(2) !< emissivity
!------------------------------------------------------------------------------------------!
! from the globals section of mptable.tbl
!------------------------------------------------------------------------------------------!
real (kind=kind_phys) :: co2 !< co2 partial pressure
real (kind=kind_phys) :: o2 !< o2 partial pressure
real (kind=kind_phys) :: timean !< gridcell mean topgraphic index (global mean)
real (kind=kind_phys) :: fsatmx !< maximum surface saturated fraction (global mean)
real (kind=kind_phys) :: z0sno !< snow surface roughness length (m) (0.002)
real (kind=kind_phys) :: ssi !< liquid water holding capacity for snowpack (m3/m3)
real (kind=kind_phys) :: snow_ret_fac !< snowpack water release timescale factor (1/s)
real (kind=kind_phys) :: swemx !< new snow mass to fully cover old snow (mm)
real (kind=kind_phys) :: snow_emis !< snow emissivity
real (kind=kind_phys) :: tau0 !< tau0 from yang97 eqn. 10a
real (kind=kind_phys) :: grain_growth !< growth from vapor diffusion yang97 eqn. 10b
real (kind=kind_phys) :: extra_growth !< extra growth near freezing yang97 eqn. 10c
real (kind=kind_phys) :: dirt_soot !< dirt and soot term yang97 eqn. 10d
real (kind=kind_phys) :: bats_cosz !< zenith angle snow albedo adjustment; b in yang97 eqn. 15
real (kind=kind_phys) :: bats_vis_new !< new snow visible albedo
real (kind=kind_phys) :: bats_nir_new !< new snow nir albedo
real (kind=kind_phys) :: bats_vis_age !< age factor for diffuse visible snow albedo yang97 eqn. 17
real (kind=kind_phys) :: bats_nir_age !< age factor for diffuse nir snow albedo yang97 eqn. 18
real (kind=kind_phys) :: bats_vis_dir !< cosz factor for direct visible snow albedo yang97 eqn. 15
real (kind=kind_phys) :: bats_nir_dir !< cosz factor for direct nir snow albedo yang97 eqn. 16
real (kind=kind_phys) :: rsurf_snow !< surface resistance for snow(s/m)
real (kind=kind_phys) :: rsurf_exp !< exponent in the shape parameter for soil resistance option 1
!------------------------------------------------------------------------------------------!
! from the crop section of mptable.tbl
!------------------------------------------------------------------------------------------!
integer :: pltday !< planting date
integer :: hsday !< harvest date
real (kind=kind_phys) :: plantpop !< plant density [per ha] - used?
real (kind=kind_phys) :: irri !< irrigation strategy 0= non-irrigation 1=irrigation (no water-stress)
real (kind=kind_phys) :: gddtbase !< base temperature for gdd accumulation [c]
real (kind=kind_phys) :: gddtcut !< upper temperature for gdd accumulation [c]
real (kind=kind_phys) :: gdds1 !< gdd from seeding to emergence
real (kind=kind_phys) :: gdds2 !< gdd from seeding to initial vegetative
real (kind=kind_phys) :: gdds3 !< gdd from seeding to post vegetative
real (kind=kind_phys) :: gdds4 !< gdd from seeding to intial reproductive
real (kind=kind_phys) :: gdds5 !< gdd from seeding to pysical maturity
integer :: c3c4 !< photosynthetic pathway: 1 = c3 2 = c4
real (kind=kind_phys) :: aref !< reference maximum co2 assimulation rate
real (kind=kind_phys) :: psnrf !< co2 assimulation reduction factor(0-1) (caused by non-modeling part,e.g.pest,weeds)
real (kind=kind_phys) :: i2par !< fraction of incoming solar radiation to photosynthetically active radiation
real (kind=kind_phys) :: tassim0 !< minimum temperature for co2 assimulation [c]
real (kind=kind_phys) :: tassim1 !< co2 assimulation linearly increasing until temperature reaches t1 [c]
real (kind=kind_phys) :: tassim2 !< co2 assmilation rate remain at aref until temperature reaches t2 [c]
real (kind=kind_phys) :: k !< light extinction coefficient
real (kind=kind_phys) :: epsi !< initial light use efficiency
real (kind=kind_phys) :: q10mr !< q10 for maintainance respiration
real (kind=kind_phys) :: foln_mx !< foliage nitrogen concentration when f(n)=1 (%)
real (kind=kind_phys) :: lefreez !< characteristic t for leaf freezing [k]
real (kind=kind_phys) :: dile_fc(nstage) !< coeficient for temperature leaf stress death [1/s]
real (kind=kind_phys) :: dile_fw(nstage) !< coeficient for water leaf stress death [1/s]
real (kind=kind_phys) :: fra_gr !< fraction of growth respiration
real (kind=kind_phys) :: lf_ovrc(nstage) !< fraction of leaf turnover [1/s]
real (kind=kind_phys) :: st_ovrc(nstage) !< fraction of stem turnover [1/s]
real (kind=kind_phys) :: rt_ovrc(nstage) !< fraction of root tunrover [1/s]
real (kind=kind_phys) :: lfmr25 !< leaf maintenance respiration at 25c [umol co2/m**2 /s]
real (kind=kind_phys) :: stmr25 !< stem maintenance respiration at 25c [umol co2/kg bio/s]
real (kind=kind_phys) :: rtmr25 !< root maintenance respiration at 25c [umol co2/kg bio/s]
real (kind=kind_phys) :: grainmr25 !< grain maintenance respiration at 25c [umol co2/kg bio/s]
real (kind=kind_phys) :: lfpt(nstage) !< fraction of carbohydrate flux to leaf
real (kind=kind_phys) :: stpt(nstage) !< fraction of carbohydrate flux to stem
real (kind=kind_phys) :: rtpt(nstage) !< fraction of carbohydrate flux to root
real (kind=kind_phys) :: grainpt(nstage) !< fraction of carbohydrate flux to grain
real (kind=kind_phys) :: bio2lai !< leaf are per living leaf biomass [m^2/kg]
!------------------------------------------------------------------------------------------!
! from the soilparm.tbl tables, as functions of soil category.
!------------------------------------------------------------------------------------------!
real (kind=kind_phys) :: bexp(nsoil) !< b parameter
real (kind=kind_phys) :: smcdry(nsoil) !< dry soil moisture threshold where direct evap from top
!layer ends (volumetric) (not used mb: 20140718)
real (kind=kind_phys) :: smcwlt(nsoil) !< wilting point soil moisture (volumetric)
real (kind=kind_phys) :: smcref(nsoil) !< reference soil moisture (field capacity) (volumetric)
real (kind=kind_phys) :: smcmax (nsoil) !< porosity, saturated value of soil moisture (volumetric)
real (kind=kind_phys) :: psisat(nsoil) !< saturated soil matric potential
real (kind=kind_phys) :: dksat(nsoil) !< saturated soil hydraulic conductivity
real (kind=kind_phys) :: dwsat(nsoil) !< saturated soil hydraulic diffusivity
real (kind=kind_phys) :: quartz(nsoil) !< soil quartz content
real (kind=kind_phys) :: f1 !< soil thermal diffusivity/conductivity coef (not used mb: 20140718)
!------------------------------------------------------------------------------------------!
! from the genparm.tbl file
!------------------------------------------------------------------------------------------!
real (kind=kind_phys) :: slope !< slope index (0 - 1)
real (kind=kind_phys) :: csoil !< vol. soil heat capacity [j/m3/k]
real (kind=kind_phys) :: zbot !< depth (m) of lower boundary soil temperature
real (kind=kind_phys) :: czil !< calculate roughness length of heat
real (kind=kind_phys) :: refdk
real (kind=kind_phys) :: refkdt
real (kind=kind_phys) :: kdt !< used in compute maximum infiltration rate (in infil)
real (kind=kind_phys) :: frzx !< used in compute maximum infiltration rate (in infil)
end type noahmp_parameters
!
! for sfcdif4
!
real(kind=kind_phys), parameter :: prt=1. !prandtl number
real(kind=kind_phys), parameter :: p1000mb = 100000.
real(kind=kind_phys), parameter :: svp1 = 0.6112
real(kind=kind_phys), parameter :: svp2 = 17.67
real(kind=kind_phys), parameter :: svp3 = 29.65
real(kind=kind_phys), parameter :: svpt0 = 273.15
real(kind=kind_phys), parameter :: onethird = 1./3.
real(kind=kind_phys), parameter :: sqrt3 = 1.7320508075688773
real(kind=kind_phys), parameter :: atan1 = 0.785398163397 !in radians
real(kind=kind_phys), parameter :: vconvc=1.25
real(kind=kind_phys), parameter :: snowz0 = 0.011
real(kind=kind_phys), parameter :: wmin = 0.1
real(kind=kind_phys), dimension(0:1000 ),save :: psim_stab,psim_unstab, &
psih_stab,psih_unstab
contains
!
!== begin noahmp_sflx ==============================================================================
!>\ingroup NoahMP_LSM
!!
subroutine noahmp_sflx (parameters, &
iloc , jloc , lat , yearlen , julian , cosz , & ! in : time/space-related
dt , dx , dz8w , nsoil , zsoil , nsnow , & ! in : model configuration
shdfac , shdmax , vegtyp , ice , ist , croptype, & ! in : vegetation/soil characteristics
smceq , & ! in : vegetation/soil characteristics
sfctmp , sfcprs , psfc , uu , vv , q2, garea1 , & ! in : forcing
qc , soldn , lwdn,thsfc_loc, prslkix,prsik1x,prslk1x,& ! in : forcing
pblhx , iz0tlnd , itime ,psi_opt ,&
prcpconv, prcpnonc, prcpshcv, prcpsnow, prcpgrpl, prcphail, & ! in : forcing
tbot , co2air , o2air , foln , ficeold , zlvl , & ! in : forcing
ep_1 , ep_2 , epsm1 , cp , & ! in : constants
albold , sneqvo , & ! in/out :
stc , sh2o , smc , tah , eah , fwet , & ! in/out :
canliq , canice , tv , tg , qsfc, qsnow, qrain, & ! in/out :
isnow , zsnso , snowh , sneqv , snice , snliq , & ! in/out :
zwt , wa , wt , wslake , lfmass , rtmass , & ! in/out :
stmass , wood , stblcp , fastcp , lai , sai , & ! in/out :
cm , ch , tauss , & ! in/out :
grain , gdd , pgs , & ! in/out
smcwtd ,deeprech , rech , ustarx , & ! in/out :
z0wrf , z0hwrf , ts , & ! out :
fsa , fsr , fira , fsh , ssoil , fcev , & ! out :
fgev , fctr , ecan , etran , edir , trad , & ! out :
tgb , tgv , t2mv , t2mb , q2v , q2b , & ! out :
runsrf , runsub , apar , psn , sav , sag , & ! out :
fsno , nee , gpp , npp , fveg , albedo , & ! out :
qsnbot , ponding , ponding1, ponding2, rssun , rssha , & ! out :
albd , albi , albsnd , albsni , & ! out :
bgap , wgap , chv , chb , emissi , & ! out :
shg , shc , shb , evg , evb , ghv , & ! out :
ghb , irg , irc , irb , tr , evc , & ! out :
chleaf , chuc , chv2 , chb2 , fpice , pahv , &
pahg , pahb , pah , esnow , canhs , laisun , &
laisha , rb , qsfcveg , qsfcbare &
#ifdef CCPP
,errmsg, errflg)
#else
)
#endif
! --------------------------------------------------------------------------------------------------
! initial code: guo-yue niu, oct. 2007
! --------------------------------------------------------------------------------------------------
implicit none
! --------------------------------------------------------------------------------------------------
! input
type (noahmp_parameters), intent(in) :: parameters
integer , intent(in) :: ice !< ice (ice = 1)
integer , intent(in) :: ist !< surface type 1->soil; 2->lake
integer , intent(in) :: vegtyp !< vegetation type
INTEGER , INTENT(IN) :: CROPTYPE !< crop type
integer , intent(in) :: nsnow !< maximum no. of snow layers
integer , intent(in) :: nsoil !< no. of soil layers
integer , intent(in) :: iloc !< grid index
integer , intent(in) :: jloc !< grid index
real (kind=kind_phys) , intent(in) :: ep_1 !<
real (kind=kind_phys) , intent(in) :: ep_2 !<
real (kind=kind_phys) , intent(in) :: epsm1 !<
real (kind=kind_phys) , intent(in) :: cp !<
real (kind=kind_phys) , intent(in) :: dt !< time step [sec]
real (kind=kind_phys), dimension( 1:nsoil), intent(in) :: zsoil !< layer-bottom depth from soil surf (m)
real (kind=kind_phys) , intent(in) :: q2 !< mixing ratio (kg/kg) lowest model layer
real (kind=kind_phys) , intent(in) :: sfctmp !< surface air temperature [k]
real (kind=kind_phys) , intent(in) :: uu !< wind speed in eastward dir (m/s)
real (kind=kind_phys) , intent(in) :: vv !< wind speed in northward dir (m/s)
real (kind=kind_phys) , intent(in) :: soldn !< downward shortwave radiation (w/m2)
real (kind=kind_phys) , intent(in) :: lwdn !< downward longwave radiation (w/m2)
real (kind=kind_phys) , intent(in) :: sfcprs !< pressure (pa)
logical , intent(in) :: thsfc_loc !<
real (kind=kind_phys) , intent(in) :: prslkix !< in exner function
real (kind=kind_phys) , intent(in) :: prsik1x !< in exner function
real (kind=kind_phys) , intent(in) :: prslk1x !< in exner function
real (kind=kind_phys) , intent(in) :: garea1 !< in exner function
real (kind=kind_phys) , intent(in) :: pblhx !< pbl height
integer , intent(in) :: iz0tlnd !< z0t option
integer , intent(in) :: itime !<
integer , intent(in) :: psi_opt !<
real (kind=kind_phys) , intent(inout) :: zlvl !< reference height (m)
real (kind=kind_phys) , intent(in) :: cosz !< cosine solar zenith angle [0-1]
real (kind=kind_phys) , intent(in) :: tbot !< bottom condition for soil temp. [k]
real (kind=kind_phys) , intent(in) :: foln !< foliage nitrogen (%) [1-saturated]
real (kind=kind_phys) , intent(in) :: shdfac !< green vegetation fraction [0.0-1.0]
integer , intent(in) :: yearlen!< number of days in the particular year.
real (kind=kind_phys) , intent(in) :: julian !< julian day of year (floating point)
real (kind=kind_phys) , intent(in) :: lat !< latitude (radians)
real (kind=kind_phys), dimension(-nsnow+1: 0), intent(in) :: ficeold!< ice fraction at last timestep
real (kind=kind_phys), dimension( 1:nsoil), intent(in) :: smceq !< equilibrium soil water content [m3/m3]
real (kind=kind_phys) , intent(in) :: prcpconv !< convective precipitation entering [mm/s] ! mb/an : v3.7
real (kind=kind_phys) , intent(in) :: prcpnonc !< non-convective precipitation entering [mm/s] ! mb/an : v3.7
real (kind=kind_phys) , intent(in) :: prcpshcv !< shallow convective precip entering [mm/s] ! mb/an : v3.7
real (kind=kind_phys) , intent(in) :: prcpsnow !< snow entering land model [mm/s] ! mb/an : v3.7
real (kind=kind_phys) , intent(in) :: prcpgrpl !< graupel entering land model [mm/s] ! mb/an : v3.7
real (kind=kind_phys) , intent(in) :: prcphail !< hail entering land model [mm/s] ! mb/an : v3.7
!jref:start; in
real (kind=kind_phys) , intent(in) :: qc !< cloud water mixing ratio
real (kind=kind_phys) , intent(inout) :: qsfc !< mixing ratio at lowest model layer
real (kind=kind_phys) , intent(in) :: psfc !< pressure at lowest model layer
real (kind=kind_phys) , intent(in) :: dz8w !< thickness of lowest layer
real (kind=kind_phys) , intent(in) :: dx
real (kind=kind_phys) , intent(in) :: shdmax !< yearly max vegetation fraction
!jref:end
! input/output : need arbitary intial values
real (kind=kind_phys) , intent(inout) :: qsnow !< snowfall [mm/s]
REAL (kind=kind_phys) , INTENT(INOUT) :: QRAIN !< rainfall [mm/s]
real (kind=kind_phys) , intent(inout) :: fwet !< wetted or snowed fraction of canopy (-)
real (kind=kind_phys) , intent(inout) :: sneqvo !< snow mass at last time step (mm)
real (kind=kind_phys) , intent(inout) :: eah !< canopy air vapor pressure (pa)
real (kind=kind_phys) , intent(inout) :: tah !< canopy air tmeperature (k)
real (kind=kind_phys) , intent(inout) :: albold !< snow albedo at last time step (class type)
real (kind=kind_phys) , intent(inout) :: cm !< momentum drag coefficient
real (kind=kind_phys) , intent(inout) :: ch !< sensible heat exchange coefficient
real (kind=kind_phys) , intent(inout) :: tauss !< non-dimensional snow age
real (kind=kind_phys) , intent(inout) :: ustarx !< friction velocity
! prognostic variables
integer , intent(inout) :: isnow !< actual no. of snow layers [-]
real (kind=kind_phys) , intent(inout) :: canliq !< intercepted liquid water (mm)
real (kind=kind_phys) , intent(inout) :: canice !< intercepted ice mass (mm)
real (kind=kind_phys) , intent(inout) :: sneqv !< snow water eqv. [mm]
real (kind=kind_phys), dimension( 1:nsoil), intent(inout) :: smc !< soil moisture (ice + liq.) [m3/m3]
real (kind=kind_phys), dimension(-nsnow+1:nsoil), intent(inout) :: zsnso !< layer-bottom depth from snow surf [m]
real (kind=kind_phys) , intent(inout) :: snowh !< snow height [m]
real (kind=kind_phys), dimension(-nsnow+1: 0), intent(inout) :: snice !< snow layer ice [mm]
real (kind=kind_phys), dimension(-nsnow+1: 0), intent(inout) :: snliq !< snow layer liquid water [mm]
real (kind=kind_phys) , intent(inout) :: tv !< vegetation temperature (k)
real (kind=kind_phys) , intent(inout) :: tg !< ground temperature (k)
real (kind=kind_phys), dimension(-nsnow+1:nsoil), intent(inout) :: stc !< snow/soil temperature [k]
real (kind=kind_phys), dimension( 1:nsoil), intent(inout) :: sh2o !< liquid soil moisture [m3/m3]
real (kind=kind_phys) , intent(inout) :: zwt !< depth to water table [m]
real (kind=kind_phys) , intent(inout) :: wa !< water storage in aquifer [mm]
real (kind=kind_phys) , intent(inout) :: wt !< water in aquifer&saturated soil [mm]
real (kind=kind_phys) , intent(inout) :: wslake !< lake water storage (can be neg.) (mm)
real (kind=kind_phys), intent(inout) :: smcwtd !< soil water content between bottom of the soil and water table [m3/m3]
real (kind=kind_phys), intent(inout) :: deeprech !< recharge to or from the water table when deep [m]
real (kind=kind_phys), intent(inout) :: rech !< recharge to or from the water table when shallow [m] (diagnostic)
! output
real (kind=kind_phys) , intent(out) :: z0wrf !< combined z0 sent to coupled model
real (kind=kind_phys) , intent(out) :: z0hwrf !< combined z0h sent to coupled model
real (kind=kind_phys) , intent(out) :: fsa !< total absorbed solar radiation (w/m2)
real (kind=kind_phys) , intent(out) :: fsr !< total reflected solar radiation (w/m2)
real (kind=kind_phys) , intent(out) :: fira !< total net lw rad (w/m2) [+ to atm]
real (kind=kind_phys) , intent(out) :: fsh !< total sensible heat (w/m2) [+ to atm]
real (kind=kind_phys) , intent(out) :: fcev !< canopy evap heat (w/m2) [+ to atm]
real (kind=kind_phys) , intent(out) :: fgev !< ground evap heat (w/m2) [+ to atm]
real (kind=kind_phys) , intent(out) :: fctr !< transpiration heat (w/m2) [+ to atm]
real (kind=kind_phys) , intent(out) :: ssoil !< ground heat flux (w/m2) [+ to soil]
real (kind=kind_phys) , intent(out) :: trad !< surface radiative temperature (k)
real (kind=kind_phys) , intent(out) :: ts !< surface combined aero temperature (k)
real (kind=kind_phys) , intent(out) :: ecan !< evaporation of intercepted water (mm/s)
real (kind=kind_phys) , intent(out) :: etran !< transpiration rate (mm/s)
real (kind=kind_phys) , intent(out) :: edir !< soil surface evaporation rate (mm/s]
real (kind=kind_phys) , intent(out) :: runsrf !< surface runoff [mm/s]
real (kind=kind_phys) , intent(out) :: runsub !< baseflow (saturation excess) [mm/s]
real (kind=kind_phys) , intent(out) :: psn !< total photosynthesis (umol co2/m2/s) [+]
real (kind=kind_phys) , intent(out) :: apar !< photosyn active energy by canopy (w/m2)
real (kind=kind_phys) , intent(out) :: sav !< solar rad absorbed by veg. (w/m2)
real (kind=kind_phys) , intent(out) :: sag !< solar rad absorbed by ground (w/m2)
real (kind=kind_phys) , intent(out) :: fsno !< snow cover fraction on the ground (-)
real (kind=kind_phys) , intent(out) :: fveg !< green vegetation fraction [0.0-1.0]
real (kind=kind_phys) , intent(out) :: albedo !< surface albedo [-]
real (kind=kind_phys) :: errwat !< water error [kg m{-2}]
real (kind=kind_phys) , intent(out) :: qsnbot !< snowmelt out bottom of pack [mm/s]
real (kind=kind_phys) , intent(out) :: ponding!< surface ponding [mm]
real (kind=kind_phys) , intent(out) :: ponding1!< surface ponding [mm]
real (kind=kind_phys) , intent(out) :: ponding2!< surface ponding [mm]
real (kind=kind_phys) , intent(out) :: esnow
real (kind=kind_phys) , intent(out) :: rb !< leaf boundary layer resistance (s/m)
real (kind=kind_phys) , intent(out) :: laisun !< sunlit leaf area index (m2/m2)
real (kind=kind_phys) , intent(out) :: laisha !< shaded leaf area index (m2/m2)
real (kind=kind_phys) , intent(out) :: qsfcveg !< effective spec humid over vegetation
real (kind=kind_phys) , intent(out) :: qsfcbare !< effective spec humid over bare soil
!jref:start; output
real (kind=kind_phys) , intent(out) :: t2mv !< 2-m air temperature over vegetated part [k]
real (kind=kind_phys) , intent(out) :: t2mb !< 2-m air temperature over bare ground part [k]
real (kind=kind_phys), intent(out) :: rssun !< sunlit leaf stomatal resistance (s/m)
real (kind=kind_phys), intent(out) :: rssha !< shaded leaf stomatal resistance (s/m)
real (kind=kind_phys), intent(out) :: bgap
real (kind=kind_phys), intent(out) :: wgap
real (kind=kind_phys), dimension(1:2) , intent(out) :: albd !< albedo (direct)
real (kind=kind_phys), dimension(1:2) , intent(out) :: albi !< albedo (diffuse)
real (kind=kind_phys), dimension(1:2) , intent(out) :: albsnd !< snow albedo (direct)
real (kind=kind_phys), dimension(1:2) , intent(out) :: albsni !< snow albedo (diffuse)
real (kind=kind_phys), intent(out) :: tgv
real (kind=kind_phys), intent(out) :: tgb
real (kind=kind_phys) :: q1
real (kind=kind_phys), intent(out) :: emissi
!jref:end
#ifdef CCPP
character(len=*), intent(inout) :: errmsg
integer, intent(inout) :: errflg
#endif
! local
integer :: iz !< do-loop index
integer, dimension(-nsnow+1:nsoil) :: imelt !< phase change index [1-melt; 2-freeze]
real (kind=kind_phys) :: cmc !< intercepted water (canice+canliq) (mm)
real (kind=kind_phys) :: taux !< wind stress: e-w (n/m2)
real (kind=kind_phys) :: tauy !< wind stress: n-s (n/m2)
real (kind=kind_phys) :: rhoair !< density air (kg/m3)
! real (kind=kind_phys), dimension( 1: 5) :: vocflx !< voc fluxes [ug c m-2 h-1]
real (kind=kind_phys), dimension(-nsnow+1:nsoil) :: dzsnso !< snow/soil layer thickness [m]
real (kind=kind_phys) :: thair !< potential temperature (k)
real (kind=kind_phys) :: qair !< specific humidity (kg/kg) (q2/(1+q2))
real (kind=kind_phys) :: eair !< vapor pressure air (pa)
real (kind=kind_phys), dimension( 1: 2) :: solad !< incoming direct solar rad (w/m2)
real (kind=kind_phys), dimension( 1: 2) :: solai !< incoming diffuse solar rad (w/m2)
real (kind=kind_phys) :: qprecc !< convective precipitation (mm/s)
real (kind=kind_phys) :: qprecl !< large-scale precipitation (mm/s)
real (kind=kind_phys) :: igs !< growing season index (0=off, 1=on)
real (kind=kind_phys) :: elai !< leaf area index, after burying by snow
real (kind=kind_phys) :: esai !< stem area index, after burying by snow
real (kind=kind_phys) :: bevap !< soil water evaporation factor (0 - 1)
real (kind=kind_phys), dimension( 1:nsoil) :: btrani !< soil water transpiration factor (0 - 1)
real (kind=kind_phys) :: btran !< soil water transpiration factor (0 - 1)
real (kind=kind_phys) :: qin !< groundwater recharge [mm/s]
real (kind=kind_phys) :: qdis !< groundwater discharge [mm/s]
real (kind=kind_phys), dimension( 1:nsoil) :: sice !< soil ice content (m3/m3)
real (kind=kind_phys), dimension(-nsnow+1: 0) :: snicev !< partial volume ice of snow [m3/m3]
real (kind=kind_phys), dimension(-nsnow+1: 0) :: snliqv !< partial volume liq of snow [m3/m3]
real (kind=kind_phys), dimension(-nsnow+1: 0) :: epore !< effective porosity [m3/m3]
real (kind=kind_phys) :: totsc !< total soil carbon (g/m2)
real (kind=kind_phys) :: totlb !< total living carbon (g/m2)
real (kind=kind_phys) :: t2m !< 2-meter air temperature (k)
real (kind=kind_phys) :: qdew !< ground surface dew rate [mm/s]
real (kind=kind_phys) :: qvap !< ground surface evap. rate [mm/s]
real (kind=kind_phys) :: lathea !< latent heat [j/kg]
real (kind=kind_phys) :: swdown !< downward solar [w/m2]
real (kind=kind_phys) :: qmelt !< snowmelt [mm/s]
real (kind=kind_phys) :: beg_wb !< water storage at begin of a step [mm]
real (kind=kind_phys),intent(out) :: irc !< canopy net lw rad. [w/m2] [+ to atm]
real (kind=kind_phys),intent(out) :: irg !< ground net lw rad. [w/m2] [+ to atm]
real (kind=kind_phys),intent(out) :: shc !< canopy sen. heat [w/m2] [+ to atm]
real (kind=kind_phys),intent(out) :: shg !< ground sen. heat [w/m2] [+ to atm]
real (kind=kind_phys),intent(out) :: evg !< ground evap. heat [w/m2] [+ to atm]
real (kind=kind_phys),intent(out) :: ghv !< ground heat flux [w/m2] [+ to soil]
real (kind=kind_phys),intent(out) :: irb !< net longwave rad. [w/m2] [+ to atm]
real (kind=kind_phys),intent(out) :: shb !< sensible heat [w/m2] [+ to atm]
real (kind=kind_phys),intent(out) :: evb !< evaporation heat [w/m2] [+ to atm]
real (kind=kind_phys),intent(out) :: ghb !< ground heat flux [w/m2] [+ to soil]
real (kind=kind_phys),intent(out) :: evc !< canopy evap. heat [w/m2] [+ to atm]
real (kind=kind_phys),intent(out) :: tr !< transpiration heat [w/m2] [+ to atm]
real (kind=kind_phys), intent(out) :: fpice !< snow fraction in precipitation
real (kind=kind_phys), intent(out) :: pahv !< precipitation advected heat - vegetation net (w/m2)
real (kind=kind_phys), intent(out) :: pahg !< precipitation advected heat - under canopy net (w/m2)
real (kind=kind_phys), intent(out) :: pahb !< precipitation advected heat - bare ground net (w/m2)
real (kind=kind_phys), intent(out) :: pah !< precipitation advected heat - total (w/m2)
!jref:start
real (kind=kind_phys) :: fsrv
real (kind=kind_phys) :: fsrg
real (kind=kind_phys),intent(out) :: q2v
real (kind=kind_phys),intent(out) :: q2b
real (kind=kind_phys) :: q2e
real (kind=kind_phys) :: qfx
real (kind=kind_phys),intent(out) :: chv !< sensible heat exchange coefficient over vegetated fraction
real (kind=kind_phys),intent(out) :: chb !< sensible heat exchange coefficient over bare-ground
real (kind=kind_phys),intent(out) :: chleaf !< leaf exchange coefficient
real (kind=kind_phys),intent(out) :: chuc !< under canopy exchange coefficient
real (kind=kind_phys),intent(out) :: chv2 !< sensible heat exchange coefficient over vegetated fraction
real (kind=kind_phys),intent(out) :: chb2 !< sensible heat exchange coefficient over bare-ground
!jref:end
! carbon
! inputs
real (kind=kind_phys) , intent(in) :: co2air !< atmospheric co2 concentration (pa)
real (kind=kind_phys) , intent(in) :: o2air !< atmospheric o2 concentration (pa)
! inputs and outputs : prognostic variables
real (kind=kind_phys) , intent(inout) :: lfmass !< leaf mass [g/m2]
real (kind=kind_phys) , intent(inout) :: rtmass !< mass of fine roots [g/m2]
real (kind=kind_phys) , intent(inout) :: stmass !< stem mass [g/m2]
real (kind=kind_phys) , intent(inout) :: wood !< mass of wood (incl. woody roots) [g/m2]
real (kind=kind_phys) , intent(inout) :: stblcp !< stable carbon in deep soil [g/m2]
real (kind=kind_phys) , intent(inout) :: fastcp !< short-lived carbon, shallow soil [g/m2]
real (kind=kind_phys) , intent(inout) :: lai !< leaf area index [-]
real (kind=kind_phys) , intent(inout) :: sai !< stem area index [-]
real (kind=kind_phys) , intent(inout) :: grain !< grain mass [g/m2]
real (kind=kind_phys) , intent(inout) :: gdd !< growing degree days
integer , intent(inout) :: pgs !< plant growing stage [-]
! outputs
real (kind=kind_phys) , intent(out) :: nee !< net ecosys exchange (g/m2/s co2)
real (kind=kind_phys) , intent(out) :: gpp !< net instantaneous assimilation [g/m2/s c]
real (kind=kind_phys) , intent(out) :: npp !< net primary productivity [g/m2/s c]
real (kind=kind_phys) :: autors !< net ecosystem respiration (g/m2/s c)
real (kind=kind_phys) :: heters !< organic respiration (g/m2/s c)
real (kind=kind_phys) :: troot !< root-zone averaged temperature (k)
real (kind=kind_phys) :: bdfall !< bulk density of new snow (kg/m3) ! mb/an: v3.7
real (kind=kind_phys) :: rain !< rain rate (mm/s) ! mb/an: v3.7
real (kind=kind_phys) :: snow !< liquid equivalent snow rate (mm/s) ! mb/an: v3.7
real (kind=kind_phys) :: fp ! mb/an: v3.7
real (kind=kind_phys) :: prcp ! mb/an: v3.7
!more local variables for precip heat mb
real (kind=kind_phys) :: qintr !< interception rate for rain (mm/s)
real (kind=kind_phys) :: qdripr !< drip rate for rain (mm/s)
real (kind=kind_phys) :: qthror !< throughfall for rain (mm/s)
real (kind=kind_phys) :: qints !< interception (loading) rate for snowfall (mm/s)
real (kind=kind_phys) :: qdrips !< drip (unloading) rate for intercepted snow (mm/s)
real (kind=kind_phys) :: qthros !< throughfall of snowfall (mm/s)
real (kind=kind_phys) :: snowhin !< snow depth increasing rate (m/s)
real (kind=kind_phys) :: latheav !< latent heat vap./sublimation (j/kg)
real (kind=kind_phys) :: latheag !< latent heat vap./sublimation (j/kg)
logical :: frozen_ground !< used to define latent heat pathway
logical :: frozen_canopy !< used to define latent heat pathway
logical :: dveg_active !< flag to run dynamic vegetation
logical :: crop_active !< flag to run crop model
! add canopy heat storage (C.He added based on GY Niu's communication)
real (kind=kind_phys) , intent(out) :: canhs ! canopy heat storage change w/m2
! intent (out) variables need to be assigned a value. these normally get assigned values
! only if dveg == 2.
nee = 0.0
npp = 0.0
gpp = 0.0
pahv = 0.
pahg = 0.
pahb = 0.
pah = 0.
canhs = 0.
! --------------------------------------------------------------------------------------------------
! re-process atmospheric forcing
call 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 )
! snow/soil layer thickness (m)
do iz = isnow+1, nsoil
if(iz == isnow+1) then
dzsnso(iz) = - zsnso(iz)
else
dzsnso(iz) = zsnso(iz-1) - zsnso(iz)
end if
end do
! root-zone temperature
troot = 0.
do iz=1,parameters%nroot
troot = troot + stc(iz)*dzsnso(iz)/(-zsoil(parameters%nroot))
enddo
! total water storage for water balance check
if(ist == 1) then
beg_wb = canliq + canice + sneqv + wa
do iz = 1,nsoil
beg_wb = beg_wb + smc(iz) * dzsnso(iz) * 1000.
end do
end if
! vegetation phenology
call phenology (parameters,vegtyp ,croptype, snowh , tv , lat , yearlen , julian , & !in
lai , sai , troot , elai , esai ,igs, pgs)
!input gvf should be consistent with lai
if(dveg == 1 .or. dveg == 6 .or. dveg == 7) then
fveg = shdfac
if(fveg <= 0.05) fveg = 0.05
else if (dveg == 2 .or. dveg == 3 .or. dveg == 8) then
fveg = 1.-exp(-0.52*(lai+sai))
if(fveg <= 0.05) fveg = 0.05
else if (dveg == 4 .or. dveg == 5 .or. dveg == 9) then
fveg = shdmax
if(fveg <= 0.05) fveg = 0.05
else
write(*,*) "-------- fatal called in sflx -----------"
#ifdef CCPP
errflg = 1
errmsg = "namelist parameter dveg unknown"
return
#else
call wrf_error_fatal("namelist parameter dveg unknown")
#endif
endif
if(opt_crop > 0 .and. croptype > 0) then
fveg = shdmax
if(fveg <= 0.05) fveg = 0.05
endif
if(parameters%urban_flag .or. vegtyp == parameters%isbarren) fveg = 0.0
if(elai+esai == 0.0) fveg = 0.0
call precip_heat(parameters,iloc ,jloc ,vegtyp ,dt ,uu ,vv , & !in
elai ,esai ,fveg ,ist , & !in
bdfall ,rain ,snow ,fp , & !in
canliq ,canice ,tv ,sfctmp ,tg , & !in
qintr ,qdripr ,qthror ,qints ,qdrips ,qthros , & !out
pahv ,pahg ,pahb ,qrain ,qsnow ,snowhin, & !out
fwet ,cmc ) !out
! compute energy budget (momentum & energy fluxes and phase changes)
call energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in
isnow ,dt ,rhoair ,sfcprs ,qair , & !in
sfctmp ,thair ,lwdn ,uu ,vv ,zlvl , & !in
co2air ,o2air ,solad ,solai ,cosz ,igs , & !in
eair ,tbot ,zsnso ,zsoil , & !in
elai ,esai ,fwet ,foln , & !in
fveg ,shdfac, pahv ,pahg ,pahb , & !in
qsnow ,dzsnso ,lat ,canliq ,canice ,iloc, jloc , & !in
thsfc_loc, prslkix,prsik1x,prslk1x,garea1, & !in
pblhx ,iz0tlnd, itime ,psi_opt, ep_1, ep_2, epsm1,cp, &
z0wrf ,z0hwrf , & !out
imelt ,snicev ,snliqv ,epore ,t2m ,fsno , & !out
sav ,sag ,qmelt ,fsa ,fsr ,taux , & !out
tauy ,fira ,fsh ,fcev ,fgev ,fctr , & !out
trad ,psn ,apar ,ssoil ,btrani ,btran , & !out
ponding,ts ,latheav , latheag , frozen_canopy,frozen_ground, & !out
tv ,tg ,stc ,snowh ,eah ,tah , & !inout
sneqvo ,sneqv ,sh2o ,smc ,snice ,snliq , & !inout
albold ,cm ,ch ,dx ,dz8w ,q2 , & !inout
ustarx , & !inout
#ifdef CCPP
tauss ,laisun ,laisha ,rb , errmsg ,errflg , & !inout
#else
tauss ,laisun ,laisha ,rb , & !inout
#endif
!jref:start
qc ,qsfc ,psfc , & !in
t2mv ,t2mb ,fsrv , &
fsrg ,rssun ,rssha ,albd ,albi ,albsnd,albsni, bgap ,wgap, tgv,tgb,&
q1 ,q2v ,q2b ,q2e ,chv ,chb , & !out
emissi ,pah ,canhs, &
shg,shc,shb,evg,evb,ghv,ghb,irg,irc,irb,tr,evc,chleaf,chuc,chv2,chb2 ) !out
qsfcveg = eah*ep_2/(sfcprs + epsm1*eah)
qsfcbare = qsfc
qsfc = q1
!jref:end
#ifdef CCPP
if (errflg /= 0) return
#endif
sice(:) = max(0.0, smc(:) - sh2o(:))
sneqvo = sneqv
qvap = max( fgev/latheag, 0.) ! positive part of fgev; barlage change to ground v3.6
qdew = abs( min(fgev/latheag, 0.)) ! negative part of fgev
edir = qvap - qdew
! compute water budgets (water storages, et components, and runoff)
call water (parameters,vegtyp ,nsnow ,nsoil ,imelt ,dt ,uu , & !in
vv ,fcev ,fctr ,qprecc ,qprecl ,elai , & !in
esai ,sfctmp ,qvap ,qdew ,zsoil ,btrani , & !in
ficeold,ponding,tg ,ist ,fveg ,iloc,jloc , smceq , & !in
bdfall ,fp ,rain ,snow , & !in mb/an: v3.7
qsnow ,qrain ,snowhin,latheav,latheag,frozen_canopy,frozen_ground, & !in mb
isnow ,canliq ,canice ,tv ,snowh ,sneqv , & !inout
snice ,snliq ,stc ,zsnso ,sh2o ,smc , & !inout
sice ,zwt ,wa ,wt ,dzsnso ,wslake , & !inout
smcwtd ,deeprech,rech , & !inout
cmc ,ecan ,etran ,fwet ,runsrf ,runsub , & !out
qin ,qdis ,ponding1 ,ponding2,&
qsnbot ,esnow ) !out
! write(*,'(a20,10f15.5)') 'sflx:runoff=',runsrf*dt,runsub*dt,edir*dt
! compute carbon budgets (carbon storages and co2 & bvoc fluxes)
crop_active = .false.
dveg_active = .false.
if (dveg == 2 .or. dveg == 5 .or. dveg == 6) dveg_active = .true.
if (opt_crop > 0 .and. croptype > 0) then
crop_active = .true.
dveg_active = .false.
endif
IF (dveg_active) THEN
call carbon (parameters,nsnow ,nsoil ,vegtyp ,dt ,zsoil , & !in
dzsnso ,stc ,smc ,tv ,tg ,psn , & !in
foln ,btran ,apar ,fveg ,igs , & !in
troot ,ist ,lat ,iloc ,jloc , & !in
lfmass ,rtmass ,stmass ,wood ,stblcp ,fastcp , & !inout
gpp ,npp ,nee ,autors ,heters ,totsc , & !out
totlb ,lai ,sai ) !out
end if
if (opt_crop == 1 .and. crop_active) then
call carbon_crop (parameters,nsnow ,nsoil ,vegtyp ,dt ,zsoil ,julian , & !in
dzsnso ,stc ,smc ,tv ,psn ,foln ,btran , & !in
soldn ,t2m , & !in
lfmass ,rtmass ,stmass ,wood ,stblcp ,fastcp ,grain , & !inout
lai ,sai ,gdd , & !inout
gpp ,npp ,nee ,autors ,heters ,totsc ,totlb, pgs ) !out
end if
! water and energy balance check
call error (parameters,swdown ,fsa ,fsr ,fira ,fsh ,fcev , & !in
fgev ,fctr ,ssoil ,beg_wb ,canliq ,canice , & !in
sneqv ,wa ,smc ,dzsnso ,prcp ,ecan , & !in
etran ,edir ,runsrf ,runsub ,dt ,nsoil , & !in
nsnow ,ist ,errwat ,iloc , jloc ,fveg , &
sav ,sag ,fsrv ,fsrg ,zwt ,pah , &
#ifdef CCPP
pahv ,pahg ,pahb ,canhs,errmsg, errflg) !in ( except errwat [out] and errmsg, errflg [inout] )
#else
pahv ,pahg ,pahb, canhs ) !in ( except errwat, which is out )
#endif
#ifdef CCPP
if (errflg /= 0) return
#endif
! urban - jref
qfx = etran + ecan + edir
if ( parameters%urban_flag ) then
qsfc = qfx/(rhoair*ch) + qair
q2b = qsfc
end if
if(snowh <= 1.e-6 .or. sneqv <= 1.e-3) then
snowh = 0.0
sneqv = 0.0
end if
if(swdown.ne.0.) then
albedo = fsr / swdown
else
albedo = -999.9
end if
end subroutine noahmp_sflx
!== begin atm ======================================================================================
!>\ingroup NoahMP_LSM
!! re-precess atmospheric forcing.
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-process atmospheric forcing
! ----------------------------------------------------------------------
implicit none
! --------------------------------------------------------------------------------------------------
! inputs
type (noahmp_parameters), intent(in) :: parameters
real (kind=kind_phys) , intent(in) :: ep_2 !<
real (kind=kind_phys) , intent(in) :: epsm1 !<
real (kind=kind_phys) , intent(in) :: sfcprs !< pressure (pa)
real (kind=kind_phys) , intent(in) :: sfctmp !< surface air temperature [k]
real (kind=kind_phys) , intent(in) :: q2 !< mixing ratio (kg/kg)
real (kind=kind_phys) , intent(in) :: prcpconv !< convective precipitation entering [mm/s] ! mb/an : v3.7
real (kind=kind_phys) , intent(in) :: prcpnonc !< non-convective precipitation entering [mm/s] ! mb/an : v3.7
real (kind=kind_phys) , intent(in) :: prcpshcv !< shallow convective precip entering [mm/s] ! mb/an : v3.7
real (kind=kind_phys) , intent(in) :: prcpsnow !< snow entering land model [mm/s] ! mb/an : v3.7
real (kind=kind_phys) , intent(in) :: prcpgrpl !< graupel entering land model [mm/s] ! mb/an : v3.7
real (kind=kind_phys) , intent(in) :: prcphail !< hail entering land model [mm/s] ! mb/an : v3.7
real (kind=kind_phys) , intent(in) :: soldn !< downward shortwave radiation (w/m2)
real (kind=kind_phys) , intent(in) :: cosz !< cosine solar zenith angle [0-1]
! outputs
real (kind=kind_phys) , intent(out) :: thair !< potential temperature (k)
real (kind=kind_phys) , intent(out) :: qair !< specific humidity (kg/kg) (q2/(1+q2))
real (kind=kind_phys) , intent(out) :: eair !< vapor pressure air (pa)
real (kind=kind_phys) , intent(out) :: rhoair !< density air (kg/m3)
real (kind=kind_phys) , intent(out) :: qprecc !< convective precipitation (mm/s)
real (kind=kind_phys) , intent(out) :: qprecl !< large-scale precipitation (mm/s)
real (kind=kind_phys), dimension( 1: 2), intent(out) :: solad !< incoming direct solar radiation (w/m2)
real (kind=kind_phys), dimension( 1: 2), intent(out) :: solai !< incoming diffuse solar radiation (w/m2)
real (kind=kind_phys) , intent(out) :: swdown !< downward solar filtered by sun angle [w/m2]