Skip to content

Commit ac29818

Browse files
authored
Merge pull request #170 from NCAR/release-v5.0-LIS
Add driver files for coupling with NASA LIS
2 parents ce86364 + 0cd3385 commit ac29818

21 files changed

+5790
-1
lines changed

drivers/hrldas/ConfigVarInTransferMod.F90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ subroutine ConfigVarInTransfer(noahmp, NoahmpIO)
7474
noahmp%config%domain%GridIndexJ = NoahmpIO%J
7575
noahmp%config%domain%MainTimeStep = NoahmpIO%DTBL
7676
noahmp%config%domain%SoilTimeStep = NoahmpIO%DTBL * NoahmpIO%soil_update_steps
77-
noahmp%config%domain%GridSize = NoahmpIO%DX
77+
noahmp%config%domain%GridSize = sqrt(NoahmpIO%DX * NoahmpIO%DY)
7878
noahmp%config%domain%LandUseDataName = NoahmpIO%LLANDUSE
7979
noahmp%config%domain%VegType = NoahmpIO%IVGTYP(I,J)
8080
noahmp%config%domain%CropType = NoahmpIO%CROPCAT(I,J)
Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
module BiochemVarInTransferMod
2+
3+
!!! Transfer input 2-D NoahmpIO Biochemistry variables to 1-D column variable
4+
!!! 1-D variables should be first defined in /src/BiochemVarType.F90
5+
!!! 2-D variables should be first defined in NoahmpIOVarType.F90
6+
7+
! ------------------------ Code history -----------------------------------
8+
! Original code: Guo-Yue Niu and Noah-MP team (Niu et al. 2011)
9+
! Refactered code: C. He, P. Valayamkunnath, & refactor team (He et al. 2023)
10+
! -------------------------------------------------------------------------
11+
12+
use Machine
13+
use NoahmpIOVarType
14+
use NoahmpVarType
15+
use LisNoahmpParamType
16+
17+
implicit none
18+
19+
contains
20+
21+
!=== initialize with input data or table values
22+
23+
subroutine BiochemVarInTransfer(noahmp, NoahmpIO, LISparam)
24+
25+
implicit none
26+
27+
type(noahmp_type), intent(inout) :: noahmp
28+
type(NoahmpIO_type), intent(inout) :: NoahmpIO
29+
type(LisNoahmpParam_type), intent(in) :: LISparam
30+
31+
! -------------------------------------------------------------------------
32+
associate( &
33+
I => noahmp%config%domain%GridIndexI ,&
34+
J => noahmp%config%domain%GridIndexJ ,&
35+
VegType => noahmp%config%domain%VegType ,&
36+
CropType => noahmp%config%domain%CropType ,&
37+
OptCropModel => noahmp%config%nmlist%OptCropModel &
38+
)
39+
! -------------------------------------------------------------------------
40+
41+
! biochem state variables
42+
noahmp%biochem%state%PlantGrowStage = NoahmpIO%PGSXY (I,J)
43+
noahmp%biochem%state%LeafMass = NoahmpIO%LFMASSXY(I,J)
44+
noahmp%biochem%state%RootMass = NoahmpIO%RTMASSXY(I,J)
45+
noahmp%biochem%state%StemMass = NoahmpIO%STMASSXY(I,J)
46+
noahmp%biochem%state%WoodMass = NoahmpIO%WOODXY (I,J)
47+
noahmp%biochem%state%CarbonMassDeepSoil = NoahmpIO%STBLCPXY(I,J)
48+
noahmp%biochem%state%CarbonMassShallowSoil = NoahmpIO%FASTCPXY(I,J)
49+
noahmp%biochem%state%GrainMass = NoahmpIO%GRAINXY (I,J)
50+
noahmp%biochem%state%GrowDegreeDay = NoahmpIO%GDDXY (I,J)
51+
noahmp%biochem%state%NitrogenConcFoliage = 1.0 ! for now, set to nitrogen saturation
52+
53+
! biochem parameter variables
54+
noahmp%biochem%param%NitrogenConcFoliageMax = LISparam%FOLNMX
55+
noahmp%biochem%param%QuantumEfficiency25C = LISparam%QE25
56+
noahmp%biochem%param%CarboxylRateMax25C = LISparam%VCMX25
57+
noahmp%biochem%param%CarboxylRateMaxQ10 = LISparam%AVCMX
58+
noahmp%biochem%param%PhotosynPathC3 = LISparam%C3PSN
59+
noahmp%biochem%param%SlopeConductToPhotosyn = LISparam%MP
60+
noahmp%biochem%param%RespMaintQ10 = LISparam%ARM
61+
noahmp%biochem%param%RespMaintLeaf25C = LISparam%RMF25
62+
noahmp%biochem%param%RespMaintStem25C = LISparam%RMS25
63+
noahmp%biochem%param%RespMaintRoot25C = LISparam%RMR25
64+
noahmp%biochem%param%WoodToRootRatio = LISparam%WRRAT
65+
noahmp%biochem%param%WoodPoolIndex = LISparam%WDPOOL
66+
noahmp%biochem%param%TurnoverCoeffLeafVeg = LISparam%LTOVRC
67+
noahmp%biochem%param%TemperaureLeafFreeze = LISparam%TDLEF
68+
noahmp%biochem%param%LeafDeathWaterCoeffVeg = LISparam%DILEFW
69+
noahmp%biochem%param%LeafDeathTempCoeffVeg = LISparam%DILEFC
70+
noahmp%biochem%param%GrowthRespFrac = LISparam%FRAGR
71+
noahmp%biochem%param%MicroRespCoeff = LISparam%MRP
72+
noahmp%biochem%param%TemperatureMinPhotosyn = LISparam%TMIN
73+
noahmp%biochem%param%LeafAreaPerMass1side = LISparam%SLA
74+
noahmp%biochem%param%StemAreaIndexMin = LISparam%XSAMIN
75+
noahmp%biochem%param%WoodAllocFac = LISparam%BF
76+
noahmp%biochem%param%WaterStressCoeff = LISparam%WSTRC
77+
noahmp%biochem%param%LeafAreaIndexMin = LISparam%LAIMIN
78+
noahmp%biochem%param%TurnoverCoeffRootVeg = LISparam%RTOVRC
79+
noahmp%biochem%param%WoodRespCoeff = LISparam%RSWOODC
80+
! crop model specific parameters
81+
if ( (OptCropModel > 0) .and. (CropType > 0) ) then
82+
noahmp%biochem%param%DatePlanting = LISparam%PLTDAY
83+
noahmp%biochem%param%DateHarvest = LISparam%HSDAY
84+
noahmp%biochem%param%NitrogenConcFoliageMax = LISparam%FOLNMX
85+
noahmp%biochem%param%QuantumEfficiency25C = LISparam%QE25
86+
noahmp%biochem%param%CarboxylRateMax25C = LISparam%VCMX25
87+
noahmp%biochem%param%CarboxylRateMaxQ10 = LISparam%AVCMX
88+
noahmp%biochem%param%PhotosynPathC3 = LISparam%C3PSN
89+
noahmp%biochem%param%SlopeConductToPhotosyn = LISparam%MP
90+
noahmp%biochem%param%RespMaintQ10 = LISparam%Q10MR
91+
noahmp%biochem%param%RespMaintLeaf25C = LISparam%LFMR25
92+
noahmp%biochem%param%RespMaintStem25C = LISparam%STMR25
93+
noahmp%biochem%param%RespMaintRoot25C = LISparam%RTMR25
94+
noahmp%biochem%param%GrowthRespFrac = LISparam%FRA_GR
95+
noahmp%biochem%param%TemperaureLeafFreeze = LISparam%LEFREEZ
96+
noahmp%biochem%param%LeafAreaPerBiomass = LISparam%BIO2LAI
97+
noahmp%biochem%param%TempBaseGrowDegDay = LISparam%GDDTBASE
98+
noahmp%biochem%param%TempMaxGrowDegDay = LISparam%GDDTCUT
99+
noahmp%biochem%param%GrowDegDayEmerg = LISparam%GDDS1
100+
noahmp%biochem%param%GrowDegDayInitVeg = LISparam%GDDS2
101+
noahmp%biochem%param%GrowDegDayPostVeg = LISparam%GDDS3
102+
noahmp%biochem%param%GrowDegDayInitReprod = LISparam%GDDS4
103+
noahmp%biochem%param%GrowDegDayMature = LISparam%GDDS5
104+
noahmp%biochem%param%PhotosynRadFrac = LISparam%I2PAR
105+
noahmp%biochem%param%TempMinCarbonAssim = LISparam%TASSIM0
106+
noahmp%biochem%param%TempMaxCarbonAssim = LISparam%TASSIM1
107+
noahmp%biochem%param%TempMaxCarbonAssimMax = LISparam%TASSIM2
108+
noahmp%biochem%param%CarbonAssimRefMax = LISparam%AREF
109+
noahmp%biochem%param%LightExtCoeff = LISparam%K
110+
noahmp%biochem%param%LightUseEfficiency = LISparam%EPSI
111+
noahmp%biochem%param%CarbonAssimReducFac = LISparam%PSNRF
112+
noahmp%biochem%param%RespMaintGrain25C = LISparam%GRAINMR25
113+
noahmp%biochem%param%LeafDeathTempCoeffCrop = LISparam%DILE_FC
114+
noahmp%biochem%param%LeafDeathWaterCoeffCrop = LISparam%DILE_FW
115+
noahmp%biochem%param%CarbohydrLeafToGrain = LISparam%LFCT
116+
noahmp%biochem%param%CarbohydrStemToGrain = LISparam%STCT
117+
noahmp%biochem%param%CarbohydrRootToGrain = LISparam%RTCT
118+
noahmp%biochem%param%CarbohydrFracToLeaf = LISparam%LFPT
119+
noahmp%biochem%param%CarbohydrFracToStem = LISparam%STPT
120+
noahmp%biochem%param%CarbohydrFracToRoot = LISparam%RTPT
121+
noahmp%biochem%param%CarbohydrFracToGrain = LISparam%GRAINPT
122+
noahmp%biochem%param%TurnoverCoeffLeafCrop = LISparam%LF_OVRC
123+
noahmp%biochem%param%TurnoverCoeffStemCrop = LISparam%ST_OVRC
124+
noahmp%biochem%param%TurnoverCoeffRootCrop = LISparam%RT_OVRC
125+
126+
if ( OptCropModel == 1 ) then
127+
noahmp%biochem%param%DatePlanting = NoahmpIO%PLANTING(I,J)
128+
noahmp%biochem%param%DateHarvest = NoahmpIO%HARVEST(I,J)
129+
noahmp%biochem%param%GrowDegDayEmerg = NoahmpIO%SEASON_GDD(I,J) / 1770.0 * &
130+
noahmp%biochem%param%GrowDegDayEmerg
131+
noahmp%biochem%param%GrowDegDayInitVeg = NoahmpIO%SEASON_GDD(I,J) / 1770.0 * &
132+
noahmp%biochem%param%GrowDegDayInitVeg
133+
noahmp%biochem%param%GrowDegDayPostVeg = NoahmpIO%SEASON_GDD(I,J) / 1770.0 * &
134+
noahmp%biochem%param%GrowDegDayPostVeg
135+
noahmp%biochem%param%GrowDegDayInitReprod = NoahmpIO%SEASON_GDD(I,J) / 1770.0 * &
136+
noahmp%biochem%param%GrowDegDayInitReprod
137+
noahmp%biochem%param%GrowDegDayMature = NoahmpIO%SEASON_GDD(I,J) / 1770.0 * &
138+
noahmp%biochem%param%GrowDegDayMature
139+
endif
140+
endif ! activate crop parameters
141+
142+
if ( noahmp%config%nmlist%OptIrrigation == 2 ) then
143+
noahmp%biochem%param%DatePlanting = NoahmpIO%PLANTING(I,J)
144+
noahmp%biochem%param%DateHarvest = NoahmpIO%HARVEST (I,J)
145+
endif
146+
147+
end associate
148+
149+
end subroutine BiochemVarInTransfer
150+
151+
end module BiochemVarInTransferMod
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
module BiochemVarOutTransferMod
2+
3+
!!! Transfer column (1-D) biochemistry variables to 2D NoahmpIO for output
4+
5+
! ------------------------ Code history -----------------------------------
6+
! Original code: Guo-Yue Niu and Noah-MP team (Niu et al. 2011)
7+
! Refactered code: C. He, P. Valayamkunnath, & refactor team (He et al. 2023)
8+
! -------------------------------------------------------------------------
9+
10+
use Machine
11+
use NoahmpIOVarType
12+
use NoahmpVarType
13+
14+
implicit none
15+
16+
contains
17+
18+
!=== Transfer model states to output =====
19+
20+
subroutine BiochemVarOutTransfer(noahmp, NoahmpIO)
21+
22+
implicit none
23+
24+
type(noahmp_type), intent(inout) :: noahmp
25+
type(NoahmpIO_type), intent(inout) :: NoahmpIO
26+
27+
! ---------------------------------------------------------------------
28+
associate( &
29+
I => noahmp%config%domain%GridIndexI ,&
30+
J => noahmp%config%domain%GridIndexJ &
31+
)
32+
! ---------------------------------------------------------------------
33+
34+
! biochem state variables
35+
NoahmpIO%LFMASSXY(I,J) = noahmp%biochem%state%LeafMass
36+
NoahmpIO%RTMASSXY(I,J) = noahmp%biochem%state%RootMass
37+
NoahmpIO%STMASSXY(I,J) = noahmp%biochem%state%StemMass
38+
NoahmpIO%WOODXY (I,J) = noahmp%biochem%state%WoodMass
39+
NoahmpIO%STBLCPXY(I,J) = noahmp%biochem%state%CarbonMassDeepSoil
40+
NoahmpIO%FASTCPXY(I,J) = noahmp%biochem%state%CarbonMassShallowSoil
41+
NoahmpIO%GDDXY (I,J) = noahmp%biochem%state%GrowDegreeDay
42+
NoahmpIO%PGSXY (I,J) = noahmp%biochem%state%PlantGrowStage
43+
NoahmpIO%GRAINXY (I,J) = noahmp%biochem%state%GrainMass
44+
45+
! biochem flux variables
46+
NoahmpIO%NEEXY (I,J) = noahmp%biochem%flux%NetEcoExchange
47+
NoahmpIO%GPPXY (I,J) = noahmp%biochem%flux%GrossPriProduction
48+
NoahmpIO%NPPXY (I,J) = noahmp%biochem%flux%NetPriProductionTot
49+
NoahmpIO%PSNXY (I,J) = noahmp%biochem%flux%PhotosynTotal
50+
51+
end associate
52+
53+
end subroutine BiochemVarOutTransfer
54+
55+
end module BiochemVarOutTransferMod

0 commit comments

Comments
 (0)