diff --git a/drivers/hrldas/ConfigVarInTransferMod.F90 b/drivers/hrldas/ConfigVarInTransferMod.F90 index f71caa17..35998c0f 100644 --- a/drivers/hrldas/ConfigVarInTransferMod.F90 +++ b/drivers/hrldas/ConfigVarInTransferMod.F90 @@ -74,7 +74,7 @@ subroutine ConfigVarInTransfer(noahmp, NoahmpIO) noahmp%config%domain%GridIndexJ = NoahmpIO%J noahmp%config%domain%MainTimeStep = NoahmpIO%DTBL noahmp%config%domain%SoilTimeStep = NoahmpIO%DTBL * NoahmpIO%soil_update_steps - noahmp%config%domain%GridSize = NoahmpIO%DX + noahmp%config%domain%GridSize = sqrt(NoahmpIO%DX * NoahmpIO%DY) noahmp%config%domain%LandUseDataName = NoahmpIO%LLANDUSE noahmp%config%domain%VegType = NoahmpIO%IVGTYP(I,J) noahmp%config%domain%CropType = NoahmpIO%CROPCAT(I,J) diff --git a/drivers/lis/BiochemVarInTransferMod.F90 b/drivers/lis/BiochemVarInTransferMod.F90 new file mode 100644 index 00000000..cff6860d --- /dev/null +++ b/drivers/lis/BiochemVarInTransferMod.F90 @@ -0,0 +1,151 @@ +module BiochemVarInTransferMod + +!!! Transfer input 2-D NoahmpIO Biochemistry variables to 1-D column variable +!!! 1-D variables should be first defined in /src/BiochemVarType.F90 +!!! 2-D variables should be first defined in NoahmpIOVarType.F90 + +! ------------------------ Code history ----------------------------------- +! Original code: Guo-Yue Niu and Noah-MP team (Niu et al. 2011) +! Refactered code: C. He, P. Valayamkunnath, & refactor team (He et al. 2023) +! ------------------------------------------------------------------------- + + use Machine + use NoahmpIOVarType + use NoahmpVarType + use LisNoahmpParamType + + implicit none + +contains + +!=== initialize with input data or table values + + subroutine BiochemVarInTransfer(noahmp, NoahmpIO, LISparam) + + implicit none + + type(noahmp_type), intent(inout) :: noahmp + type(NoahmpIO_type), intent(inout) :: NoahmpIO + type(LisNoahmpParam_type), intent(in) :: LISparam + +! ------------------------------------------------------------------------- + associate( & + I => noahmp%config%domain%GridIndexI ,& + J => noahmp%config%domain%GridIndexJ ,& + VegType => noahmp%config%domain%VegType ,& + CropType => noahmp%config%domain%CropType ,& + OptCropModel => noahmp%config%nmlist%OptCropModel & + ) +! ------------------------------------------------------------------------- + + ! biochem state variables + noahmp%biochem%state%PlantGrowStage = NoahmpIO%PGSXY (I,J) + noahmp%biochem%state%LeafMass = NoahmpIO%LFMASSXY(I,J) + noahmp%biochem%state%RootMass = NoahmpIO%RTMASSXY(I,J) + noahmp%biochem%state%StemMass = NoahmpIO%STMASSXY(I,J) + noahmp%biochem%state%WoodMass = NoahmpIO%WOODXY (I,J) + noahmp%biochem%state%CarbonMassDeepSoil = NoahmpIO%STBLCPXY(I,J) + noahmp%biochem%state%CarbonMassShallowSoil = NoahmpIO%FASTCPXY(I,J) + noahmp%biochem%state%GrainMass = NoahmpIO%GRAINXY (I,J) + noahmp%biochem%state%GrowDegreeDay = NoahmpIO%GDDXY (I,J) + noahmp%biochem%state%NitrogenConcFoliage = 1.0 ! for now, set to nitrogen saturation + + ! biochem parameter variables + noahmp%biochem%param%NitrogenConcFoliageMax = LISparam%FOLNMX + noahmp%biochem%param%QuantumEfficiency25C = LISparam%QE25 + noahmp%biochem%param%CarboxylRateMax25C = LISparam%VCMX25 + noahmp%biochem%param%CarboxylRateMaxQ10 = LISparam%AVCMX + noahmp%biochem%param%PhotosynPathC3 = LISparam%C3PSN + noahmp%biochem%param%SlopeConductToPhotosyn = LISparam%MP + noahmp%biochem%param%RespMaintQ10 = LISparam%ARM + noahmp%biochem%param%RespMaintLeaf25C = LISparam%RMF25 + noahmp%biochem%param%RespMaintStem25C = LISparam%RMS25 + noahmp%biochem%param%RespMaintRoot25C = LISparam%RMR25 + noahmp%biochem%param%WoodToRootRatio = LISparam%WRRAT + noahmp%biochem%param%WoodPoolIndex = LISparam%WDPOOL + noahmp%biochem%param%TurnoverCoeffLeafVeg = LISparam%LTOVRC + noahmp%biochem%param%TemperaureLeafFreeze = LISparam%TDLEF + noahmp%biochem%param%LeafDeathWaterCoeffVeg = LISparam%DILEFW + noahmp%biochem%param%LeafDeathTempCoeffVeg = LISparam%DILEFC + noahmp%biochem%param%GrowthRespFrac = LISparam%FRAGR + noahmp%biochem%param%MicroRespCoeff = LISparam%MRP + noahmp%biochem%param%TemperatureMinPhotosyn = LISparam%TMIN + noahmp%biochem%param%LeafAreaPerMass1side = LISparam%SLA + noahmp%biochem%param%StemAreaIndexMin = LISparam%XSAMIN + noahmp%biochem%param%WoodAllocFac = LISparam%BF + noahmp%biochem%param%WaterStressCoeff = LISparam%WSTRC + noahmp%biochem%param%LeafAreaIndexMin = LISparam%LAIMIN + noahmp%biochem%param%TurnoverCoeffRootVeg = LISparam%RTOVRC + noahmp%biochem%param%WoodRespCoeff = LISparam%RSWOODC + ! crop model specific parameters + if ( (OptCropModel > 0) .and. (CropType > 0) ) then + noahmp%biochem%param%DatePlanting = LISparam%PLTDAY + noahmp%biochem%param%DateHarvest = LISparam%HSDAY + noahmp%biochem%param%NitrogenConcFoliageMax = LISparam%FOLNMX + noahmp%biochem%param%QuantumEfficiency25C = LISparam%QE25 + noahmp%biochem%param%CarboxylRateMax25C = LISparam%VCMX25 + noahmp%biochem%param%CarboxylRateMaxQ10 = LISparam%AVCMX + noahmp%biochem%param%PhotosynPathC3 = LISparam%C3PSN + noahmp%biochem%param%SlopeConductToPhotosyn = LISparam%MP + noahmp%biochem%param%RespMaintQ10 = LISparam%Q10MR + noahmp%biochem%param%RespMaintLeaf25C = LISparam%LFMR25 + noahmp%biochem%param%RespMaintStem25C = LISparam%STMR25 + noahmp%biochem%param%RespMaintRoot25C = LISparam%RTMR25 + noahmp%biochem%param%GrowthRespFrac = LISparam%FRA_GR + noahmp%biochem%param%TemperaureLeafFreeze = LISparam%LEFREEZ + noahmp%biochem%param%LeafAreaPerBiomass = LISparam%BIO2LAI + noahmp%biochem%param%TempBaseGrowDegDay = LISparam%GDDTBASE + noahmp%biochem%param%TempMaxGrowDegDay = LISparam%GDDTCUT + noahmp%biochem%param%GrowDegDayEmerg = LISparam%GDDS1 + noahmp%biochem%param%GrowDegDayInitVeg = LISparam%GDDS2 + noahmp%biochem%param%GrowDegDayPostVeg = LISparam%GDDS3 + noahmp%biochem%param%GrowDegDayInitReprod = LISparam%GDDS4 + noahmp%biochem%param%GrowDegDayMature = LISparam%GDDS5 + noahmp%biochem%param%PhotosynRadFrac = LISparam%I2PAR + noahmp%biochem%param%TempMinCarbonAssim = LISparam%TASSIM0 + noahmp%biochem%param%TempMaxCarbonAssim = LISparam%TASSIM1 + noahmp%biochem%param%TempMaxCarbonAssimMax = LISparam%TASSIM2 + noahmp%biochem%param%CarbonAssimRefMax = LISparam%AREF + noahmp%biochem%param%LightExtCoeff = LISparam%K + noahmp%biochem%param%LightUseEfficiency = LISparam%EPSI + noahmp%biochem%param%CarbonAssimReducFac = LISparam%PSNRF + noahmp%biochem%param%RespMaintGrain25C = LISparam%GRAINMR25 + noahmp%biochem%param%LeafDeathTempCoeffCrop = LISparam%DILE_FC + noahmp%biochem%param%LeafDeathWaterCoeffCrop = LISparam%DILE_FW + noahmp%biochem%param%CarbohydrLeafToGrain = LISparam%LFCT + noahmp%biochem%param%CarbohydrStemToGrain = LISparam%STCT + noahmp%biochem%param%CarbohydrRootToGrain = LISparam%RTCT + noahmp%biochem%param%CarbohydrFracToLeaf = LISparam%LFPT + noahmp%biochem%param%CarbohydrFracToStem = LISparam%STPT + noahmp%biochem%param%CarbohydrFracToRoot = LISparam%RTPT + noahmp%biochem%param%CarbohydrFracToGrain = LISparam%GRAINPT + noahmp%biochem%param%TurnoverCoeffLeafCrop = LISparam%LF_OVRC + noahmp%biochem%param%TurnoverCoeffStemCrop = LISparam%ST_OVRC + noahmp%biochem%param%TurnoverCoeffRootCrop = LISparam%RT_OVRC + + if ( OptCropModel == 1 ) then + noahmp%biochem%param%DatePlanting = NoahmpIO%PLANTING(I,J) + noahmp%biochem%param%DateHarvest = NoahmpIO%HARVEST(I,J) + noahmp%biochem%param%GrowDegDayEmerg = NoahmpIO%SEASON_GDD(I,J) / 1770.0 * & + noahmp%biochem%param%GrowDegDayEmerg + noahmp%biochem%param%GrowDegDayInitVeg = NoahmpIO%SEASON_GDD(I,J) / 1770.0 * & + noahmp%biochem%param%GrowDegDayInitVeg + noahmp%biochem%param%GrowDegDayPostVeg = NoahmpIO%SEASON_GDD(I,J) / 1770.0 * & + noahmp%biochem%param%GrowDegDayPostVeg + noahmp%biochem%param%GrowDegDayInitReprod = NoahmpIO%SEASON_GDD(I,J) / 1770.0 * & + noahmp%biochem%param%GrowDegDayInitReprod + noahmp%biochem%param%GrowDegDayMature = NoahmpIO%SEASON_GDD(I,J) / 1770.0 * & + noahmp%biochem%param%GrowDegDayMature + endif + endif ! activate crop parameters + + if ( noahmp%config%nmlist%OptIrrigation == 2 ) then + noahmp%biochem%param%DatePlanting = NoahmpIO%PLANTING(I,J) + noahmp%biochem%param%DateHarvest = NoahmpIO%HARVEST (I,J) + endif + + end associate + + end subroutine BiochemVarInTransfer + +end module BiochemVarInTransferMod diff --git a/drivers/lis/BiochemVarOutTransferMod.F90 b/drivers/lis/BiochemVarOutTransferMod.F90 new file mode 100644 index 00000000..0a4395db --- /dev/null +++ b/drivers/lis/BiochemVarOutTransferMod.F90 @@ -0,0 +1,55 @@ +module BiochemVarOutTransferMod + +!!! Transfer column (1-D) biochemistry variables to 2D NoahmpIO for output + +! ------------------------ Code history ----------------------------------- +! Original code: Guo-Yue Niu and Noah-MP team (Niu et al. 2011) +! Refactered code: C. He, P. Valayamkunnath, & refactor team (He et al. 2023) +! ------------------------------------------------------------------------- + + use Machine + use NoahmpIOVarType + use NoahmpVarType + + implicit none + +contains + +!=== Transfer model states to output ===== + + subroutine BiochemVarOutTransfer(noahmp, NoahmpIO) + + implicit none + + type(noahmp_type), intent(inout) :: noahmp + type(NoahmpIO_type), intent(inout) :: NoahmpIO + +! --------------------------------------------------------------------- + associate( & + I => noahmp%config%domain%GridIndexI ,& + J => noahmp%config%domain%GridIndexJ & + ) +! --------------------------------------------------------------------- + + ! biochem state variables + NoahmpIO%LFMASSXY(I,J) = noahmp%biochem%state%LeafMass + NoahmpIO%RTMASSXY(I,J) = noahmp%biochem%state%RootMass + NoahmpIO%STMASSXY(I,J) = noahmp%biochem%state%StemMass + NoahmpIO%WOODXY (I,J) = noahmp%biochem%state%WoodMass + NoahmpIO%STBLCPXY(I,J) = noahmp%biochem%state%CarbonMassDeepSoil + NoahmpIO%FASTCPXY(I,J) = noahmp%biochem%state%CarbonMassShallowSoil + NoahmpIO%GDDXY (I,J) = noahmp%biochem%state%GrowDegreeDay + NoahmpIO%PGSXY (I,J) = noahmp%biochem%state%PlantGrowStage + NoahmpIO%GRAINXY (I,J) = noahmp%biochem%state%GrainMass + + ! biochem flux variables + NoahmpIO%NEEXY (I,J) = noahmp%biochem%flux%NetEcoExchange + NoahmpIO%GPPXY (I,J) = noahmp%biochem%flux%GrossPriProduction + NoahmpIO%NPPXY (I,J) = noahmp%biochem%flux%NetPriProductionTot + NoahmpIO%PSNXY (I,J) = noahmp%biochem%flux%PhotosynTotal + + end associate + + end subroutine BiochemVarOutTransfer + +end module BiochemVarOutTransferMod diff --git a/drivers/lis/ConfigVarInTransferMod.F90 b/drivers/lis/ConfigVarInTransferMod.F90 new file mode 100644 index 00000000..35998c0f --- /dev/null +++ b/drivers/lis/ConfigVarInTransferMod.F90 @@ -0,0 +1,172 @@ +module ConfigVarInTransferMod + +!!! Transfer input 2-D NoahmpIO Configuration variables to 1-D column variable +!!! 1-D variables should be first defined in /src/ConfigVarType.F90 +!!! 2-D variables should be first defined in NoahmpIOVarType.F90 + +! ------------------------ Code history ----------------------------------- +! Original code: Guo-Yue Niu and Noah-MP team (Niu et al. 2011) +! Refactered code: C. He, P. Valayamkunnath, & refactor team (He et al. 2023) +! ------------------------------------------------------------------------- + + use Machine + use NoahmpIOVarType + use NoahmpVarType + + implicit none + +contains + +!=== initialize with input/restart data or table values + + subroutine ConfigVarInTransfer(noahmp, NoahmpIO) + + implicit none + + type(NoahmpIO_type) , intent(inout) :: NoahmpIO + type(noahmp_type), intent(inout) :: noahmp + +! --------------------------------------------------------------------- + associate( & + I => NoahmpIO%I ,& + J => NoahmpIO%J ,& + NumSnowLayerMax => NoahmpIO%NSNOW ,& + NumSoilLayer => NoahmpIO%NSOIL & + ) +! --------------------------------------------------------------------- + + ! config namelist variable + noahmp%config%nmlist%OptDynamicVeg = NoahmpIO%IOPT_DVEG + noahmp%config%nmlist%OptRainSnowPartition = NoahmpIO%IOPT_SNF + noahmp%config%nmlist%OptSoilWaterTranspiration = NoahmpIO%IOPT_BTR + noahmp%config%nmlist%OptGroundResistanceEvap = NoahmpIO%IOPT_RSF + noahmp%config%nmlist%OptSurfaceDrag = NoahmpIO%IOPT_SFC + noahmp%config%nmlist%OptStomataResistance = NoahmpIO%IOPT_CRS + noahmp%config%nmlist%OptSnowAlbedo = NoahmpIO%IOPT_ALB + noahmp%config%nmlist%OptCanopyRadiationTransfer = NoahmpIO%IOPT_RAD + noahmp%config%nmlist%OptSnowSoilTempTime = NoahmpIO%IOPT_STC + noahmp%config%nmlist%OptSnowThermConduct = NoahmpIO%IOPT_TKSNO + noahmp%config%nmlist%OptSoilTemperatureBottom = NoahmpIO%IOPT_TBOT + noahmp%config%nmlist%OptSoilSupercoolWater = NoahmpIO%IOPT_FRZ + noahmp%config%nmlist%OptSoilPermeabilityFrozen = NoahmpIO%IOPT_INF + noahmp%config%nmlist%OptDynVicInfiltration = NoahmpIO%IOPT_INFDV + noahmp%config%nmlist%OptTileDrainage = NoahmpIO%IOPT_TDRN + noahmp%config%nmlist%OptIrrigation = NoahmpIO%IOPT_IRR + noahmp%config%nmlist%OptIrrigationMethod = NoahmpIO%IOPT_IRRM + noahmp%config%nmlist%OptCropModel = NoahmpIO%IOPT_CROP + noahmp%config%nmlist%OptSoilProperty = NoahmpIO%IOPT_SOIL + noahmp%config%nmlist%OptPedotransfer = NoahmpIO%IOPT_PEDO + noahmp%config%nmlist%OptRunoffSurface = NoahmpIO%IOPT_RUNSRF + noahmp%config%nmlist%OptRunoffSubsurface = NoahmpIO%IOPT_RUNSUB + noahmp%config%nmlist%OptGlacierTreatment = NoahmpIO%IOPT_GLA + + ! config domain variable + noahmp%config%domain%SurfaceType = 1 + noahmp%config%domain%NumSwRadBand = 2 + noahmp%config%domain%SoilColor = 4 + noahmp%config%domain%NumCropGrowStage = 8 + noahmp%config%domain%FlagSoilProcess = NoahmpIO%calculate_soil + noahmp%config%domain%NumSoilTimeStep = NoahmpIO%soil_update_steps + noahmp%config%domain%NumSnowLayerMax = NoahmpIO%NSNOW + noahmp%config%domain%NumSnowLayerNeg = NoahmpIO%ISNOWXY(I,J) + noahmp%config%domain%NumSoilLayer = NoahmpIO%NSOIL + noahmp%config%domain%GridIndexI = NoahmpIO%I + noahmp%config%domain%GridIndexJ = NoahmpIO%J + noahmp%config%domain%MainTimeStep = NoahmpIO%DTBL + noahmp%config%domain%SoilTimeStep = NoahmpIO%DTBL * NoahmpIO%soil_update_steps + noahmp%config%domain%GridSize = sqrt(NoahmpIO%DX * NoahmpIO%DY) + noahmp%config%domain%LandUseDataName = NoahmpIO%LLANDUSE + noahmp%config%domain%VegType = NoahmpIO%IVGTYP(I,J) + noahmp%config%domain%CropType = NoahmpIO%CROPCAT(I,J) + noahmp%config%domain%IndicatorIceSfc = NoahmpIO%ICE + noahmp%config%domain%DayJulianInYear = NoahmpIO%JULIAN + noahmp%config%domain%NumDayInYear = NoahmpIO%YEARLEN + noahmp%config%domain%Latitude = NoahmpIO%XLAT(I,J) + noahmp%config%domain%RefHeightAboveSfc = NoahmpIO%DZ8W(I,1,J)*0.5 + noahmp%config%domain%ThicknessAtmosBotLayer = NoahmpIO%DZ8W(I,1,J) + noahmp%config%domain%CosSolarZenithAngle = NoahmpIO%COSZEN(I,J) + noahmp%config%domain%IndexWaterPoint = NoahmpIO%ISWATER_TABLE + noahmp%config%domain%IndexBarrenPoint = NoahmpIO%ISBARREN_TABLE + noahmp%config%domain%IndexIcePoint = NoahmpIO%ISICE_TABLE + noahmp%config%domain%IndexCropPoint = NoahmpIO%ISCROP_TABLE + noahmp%config%domain%IndexEBLForest = NoahmpIO%EBLFOREST_TABLE + noahmp%config%domain%RunoffSlopeType = NoahmpIO%SLOPETYP + noahmp%config%domain%DepthSoilTempBottom = NoahmpIO%ZBOT_TABLE + + ! the following initialization cannot be done in ConfigVarInitMod + ! because the NumSoilLayer and NumSnowLayerMax are initialized with input values in this module + if ( .not. allocated(noahmp%config%domain%DepthSoilLayer) ) & + allocate( noahmp%config%domain%DepthSoilLayer(1:NumSoilLayer) ) + if ( .not. allocated(noahmp%config%domain%ThicknessSoilLayer) ) & + allocate( noahmp%config%domain%ThicknessSoilLayer(1:NumSoilLayer) ) + if ( .not. allocated(noahmp%config%domain%SoilType) ) & + allocate( noahmp%config%domain%SoilType(1:NumSoilLayer) ) + if ( .not. allocated(noahmp%config%domain%ThicknessSnowSoilLayer) ) & + allocate( noahmp%config%domain%ThicknessSnowSoilLayer(-NumSnowLayerMax+1:NumSoilLayer) ) + if ( .not. allocated(noahmp%config%domain%DepthSnowSoilLayer) ) & + allocate( noahmp%config%domain%DepthSnowSoilLayer(-NumSnowLayerMax+1:NumSoilLayer) ) + + noahmp%config%domain%SoilType (:) = undefined_int + noahmp%config%domain%DepthSoilLayer (:) = undefined_real + noahmp%config%domain%ThicknessSoilLayer (:) = undefined_real + noahmp%config%domain%ThicknessSnowSoilLayer(:) = undefined_real + noahmp%config%domain%DepthSnowSoilLayer (:) = undefined_real + + if ( noahmp%config%nmlist%OptSoilProperty == 1 ) then + noahmp%config%domain%SoilType(1:NumSoilLayer) = NoahmpIO%ISLTYP(I,J) ! soil type same in all layers + elseif ( noahmp%config%nmlist%OptSoilProperty == 2 ) then + noahmp%config%domain%SoilType(1) = nint(NoahmpIO%SOILCL1(I,J)) ! soil type in layer1 + noahmp%config%domain%SoilType(2) = nint(NoahmpIO%SOILCL2(I,J)) ! soil type in layer2 + noahmp%config%domain%SoilType(3) = nint(NoahmpIO%SOILCL3(I,J)) ! soil type in layer3 + noahmp%config%domain%SoilType(4) = nint(NoahmpIO%SOILCL4(I,J)) ! soil type in layer4 + elseif ( noahmp%config%nmlist%OptSoilProperty == 3 ) then + noahmp%config%domain%SoilType(1:NumSoilLayer) = NoahmpIO%ISLTYP(I,J) ! to initialize with default + endif + + noahmp%config%domain%DepthSoilLayer(1:NumSoilLayer) = NoahmpIO%ZSOIL(1:NumSoilLayer) + noahmp%config%domain%DepthSnowSoilLayer(-NumSnowLayerMax+1:NumSoilLayer) = & + NoahmpIO%ZSNSOXY(I,-NumSnowLayerMax+1:NumSoilLayer,J) + + ! treatment for urban point + if ( (NoahmpIO%IVGTYP(I,J) == NoahmpIO%ISURBAN_TABLE) .or. (NoahmpIO%IVGTYP(I,J) > NoahmpIO%URBTYPE_beg) ) then + if ( NoahmpIO%SF_URBAN_PHYSICS == 0 ) then + noahmp%config%domain%VegType = NoahmpIO%ISURBAN_TABLE ! treat as bulk urban point + noahmp%config%domain%FlagUrban = .true. + else + noahmp%config%domain%VegType = NoahmpIO%NATURAL_TABLE ! set rural vegetation type based on table natural + ! urban is handled by explicit urban scheme outside Noah-MP + NoahmpIO%GVFMAX(I,J) = 0.96 * 100.0 ! unit: % + endif + endif + + ! treatment for crop point + noahmp%config%domain%CropType = 0 + if ( (NoahmpIO%IOPT_CROP > 0) .and. (NoahmpIO%IVGTYP(I,J) == NoahmpIO%ISCROP_TABLE) ) & + noahmp%config%domain%CropType = NoahmpIO%DEFAULT_CROP_TABLE + + if ( (NoahmpIO%IOPT_CROP > 0) .and. (NoahmpIO%CROPCAT(I,J) > 0) ) then + noahmp%config%domain%CropType = NoahmpIO%CROPCAT(I,J) + noahmp%config%domain%VegType = NoahmpIO%ISCROP_TABLE + NoahmpIO%VEGFRA(I,J) = 0.95 * 100.0 ! unit: % + NoahmpIO%GVFMAX(I,J) = 0.95 * 100.0 ! unit: % + endif + + ! correct inconsistent soil type + if ( any(noahmp%config%domain%SoilType == 14) .and. (NoahmpIO%XICE(I,J) == 0.0) ) then + write(*,*) "SOIL TYPE FOUND TO BE WATER AT A LAND-POINT" + write(*,*) "RESET SOIL type to SANDY CLAY LOAM at grid = ", I, J + noahmp%config%domain%SoilType = 7 + endif + + ! set warning message for inconsistent surface and subsurface runoff option + ! for now, only the same options for surface and subsurface runoff have been tested + if ( noahmp%config%nmlist%OptRunoffSurface /= noahmp%config%nmlist%OptRunoffSubsurface ) then + write(*,*) "Warning: Surface and subsurface runoff options are inconsistent! They may be incompatible!" + write(*,*) "Warning: Currently only the same options for surface and subsurface runoff are tested." + endif + + end associate + + end subroutine ConfigVarInTransfer + +end module ConfigVarInTransferMod diff --git a/drivers/lis/ConfigVarOutTransferMod.F90 b/drivers/lis/ConfigVarOutTransferMod.F90 new file mode 100644 index 00000000..402397d3 --- /dev/null +++ b/drivers/lis/ConfigVarOutTransferMod.F90 @@ -0,0 +1,46 @@ +module ConfigVarOutTransferMod + +!!! To transfer 1D Noah-MP column Config variables to 2D NoahmpIO for output + +! ------------------------ Code history ----------------------------------- +! Original code: Guo-Yue Niu and Noah-MP team (Niu et al. 2011) +! Refactered code: C. He, P. Valayamkunnath, & refactor team (He et al. 2023) +! ------------------------------------------------------------------------- + + use Machine + use NoahmpIOVarType + use NoahmpVarType + + implicit none + +contains + +!=== Transfer model states to output===== + + subroutine ConfigVarOutTransfer(noahmp, NoahmpIO) + + implicit none + + type(NoahmpIO_type) , intent(inout) :: NoahmpIO + type(noahmp_type), intent(inout) :: noahmp + +! ---------------------------------------------------------------------- + associate( & + I => noahmp%config%domain%GridIndexI ,& + J => noahmp%config%domain%GridIndexJ ,& + NumSnowLayerMax => noahmp%config%domain%NumSnowLayerMax ,& + NumSoilLayer => noahmp%config%domain%NumSoilLayer & + ) +! ---------------------------------------------------------------------- + + ! config domain variables + NoahmpIO%ISNOWXY(I,J) = noahmp%config%domain%NumSnowLayerNeg + NoahmpIO%ZSNSOXY(I,-NumSnowLayerMax+1:NumSoilLayer,J) = & + noahmp%config%domain%DepthSnowSoilLayer(-NumSnowLayerMax+1:NumSoilLayer) + NoahmpIO%FORCZLSM(I,J) = noahmp%config%domain%RefHeightAboveSfc + + end associate + + end subroutine ConfigVarOutTransfer + +end module ConfigVarOutTransferMod diff --git a/drivers/lis/EnergyVarInTransferMod.F90 b/drivers/lis/EnergyVarInTransferMod.F90 new file mode 100644 index 00000000..1525f5bf --- /dev/null +++ b/drivers/lis/EnergyVarInTransferMod.F90 @@ -0,0 +1,157 @@ +module EnergyVarInTransferMod + +!!! Transfer input 2-D NoahmpIO Energy variables to 1-D column variable +!!! 1-D variables should be first defined in /src/EnergyVarType.F90 +!!! 2-D variables should be first defined in NoahmpIOVarType.F90 + +! ------------------------ Code history ----------------------------------- +! Original code: Guo-Yue Niu and Noah-MP team (Niu et al. 2011) +! Refactered code: C. He, P. Valayamkunnath, & refactor team (He et al. 2023) +! ------------------------------------------------------------------------- + + use Machine + use NoahmpIOVarType + use NoahmpVarType + use LisNoahmpParamType + + implicit none + +contains + +!=== initialize with input data or table values + + subroutine EnergyVarInTransfer(noahmp, NoahmpIO, LISparam) + + implicit none + + type(NoahmpIO_type), intent(inout) :: NoahmpIO + type(noahmp_type), intent(inout) :: noahmp + type(LisNoahmpParam_type), intent(in) :: LISparam ! lis/noahmp parameter + + ! local loop index + integer :: SoilLayerIndex + +! ------------------------------------------------------------------------- + associate( & + I => noahmp%config%domain%GridIndexI ,& + J => noahmp%config%domain%GridIndexJ ,& + VegType => noahmp%config%domain%VegType ,& + SoilType => noahmp%config%domain%SoilType ,& + CropType => noahmp%config%domain%CropType ,& + SoilColor => noahmp%config%domain%SoilColor ,& + FlagUrban => noahmp%config%domain%FlagUrban ,& + NumSnowLayerMax => noahmp%config%domain%NumSnowLayerMax ,& + NumSoilLayer => noahmp%config%domain%NumSoilLayer ,& + NumSwRadBand => noahmp%config%domain%NumSwRadBand & + ) +! ------------------------------------------------------------------------- + + ! energy state variables + noahmp%energy%state%LeafAreaIndex = NoahmpIO%LAI (I,J) + noahmp%energy%state%StemAreaIndex = NoahmpIO%XSAIXY (I,J) + noahmp%energy%state%SpecHumiditySfcMean = NoahmpIO%QSFC (I,J) + noahmp%energy%state%TemperatureGrd = NoahmpIO%TGXY (I,J) + noahmp%energy%state%TemperatureCanopy = NoahmpIO%TVXY (I,J) + noahmp%energy%state%SnowAgeNondim = NoahmpIO%TAUSSXY (I,J) + noahmp%energy%state%AlbedoSnowPrev = NoahmpIO%ALBOLDXY(I,J) + noahmp%energy%state%PressureVaporCanAir = NoahmpIO%EAHXY (I,J) + noahmp%energy%state%TemperatureCanopyAir = NoahmpIO%TAHXY (I,J) + noahmp%energy%state%ExchCoeffShSfc = NoahmpIO%CHXY (I,J) + noahmp%energy%state%ExchCoeffMomSfc = NoahmpIO%CMXY (I,J) + noahmp%energy%state%TemperatureSoilSnow(-NumSnowLayerMax+1:0) = NoahmpIO%TSNOXY (I,-NumSnowLayerMax+1:0,J) + noahmp%energy%state%TemperatureSoilSnow(1:NumSoilLayer) = NoahmpIO%TSLB (I,1:NumSoilLayer,J) + noahmp%energy%state%PressureAtmosCO2 = LISparam%CO2 * noahmp%forcing%PressureAirRefHeight + noahmp%energy%state%PressureAtmosO2 = LISparam%O2 * noahmp%forcing%PressureAirRefHeight + ! vegetation treatment for USGS land types (playa, lava, sand to bare) + if ( (VegType == 25) .or. (VegType == 26) .or. (VegType == 27) ) then + noahmp%energy%state%VegFrac = 0.0 + noahmp%energy%state%LeafAreaIndex = 0.0 + endif + + ! energy flux variables + noahmp%energy%flux%HeatGroundTotAcc = NoahmpIO%ACC_SSOILXY(I,J) + + ! energy parameter variables + noahmp%energy%param%SoilHeatCapacity = LISparam%CSOIL + noahmp%energy%param%SnowAgeFacBats = LISparam%TAU0 + noahmp%energy%param%SnowGrowVapFacBats = LISparam%GRAIN_GROWTH + noahmp%energy%param%SnowSootFacBats = LISparam%DIRT_SOOT + noahmp%energy%param%SnowGrowFrzFacBats = LISparam%EXTRA_GROWTH + noahmp%energy%param%SolarZenithAdjBats = LISparam%BATS_COSZ + noahmp%energy%param%FreshSnoAlbVisBats = LISparam%BATS_VIS_NEW + noahmp%energy%param%FreshSnoAlbNirBats = LISparam%BATS_NIR_NEW + noahmp%energy%param%SnoAgeFacDifVisBats = LISparam%BATS_VIS_AGE + noahmp%energy%param%SnoAgeFacDifNirBats = LISparam%BATS_NIR_AGE + noahmp%energy%param%SzaFacDirVisBats = LISparam%BATS_VIS_DIR + noahmp%energy%param%SzaFacDirNirBats = LISparam%BATS_NIR_DIR + noahmp%energy%param%SnowAlbRefClass = LISparam%CLASS_ALB_REF + noahmp%energy%param%SnowAgeFacClass = LISparam%CLASS_SNO_AGE + noahmp%energy%param%SnowAlbFreshClass = LISparam%CLASS_ALB_NEW + noahmp%energy%param%UpscatterCoeffSnowDir = LISparam%BETADS + noahmp%energy%param%UpscatterCoeffSnowDif = LISparam%BETAIS + noahmp%energy%param%ZilitinkevichCoeff = LISparam%CZIL + noahmp%energy%param%EmissivitySnow = LISparam%SNOW_EMIS + noahmp%energy%param%EmissivitySoilLake = LISparam%EG + noahmp%energy%param%AlbedoLandIce = LISparam%ALBICE + noahmp%energy%param%RoughLenMomSnow = LISparam%Z0SNO + noahmp%energy%param%RoughLenMomSoil = LISparam%Z0SOIL + noahmp%energy%param%RoughLenMomLake = LISparam%Z0LAKE + noahmp%energy%param%EmissivityIceSfc = LISparam%EICE + noahmp%energy%param%ResistanceSoilExp = LISparam%RSURF_EXP + noahmp%energy%param%ResistanceSnowSfc = LISparam%RSURF_SNOW + noahmp%energy%param%VegFracAnnMax = NoahmpIO%GVFMAX(I,J) / 100.0 + noahmp%energy%param%VegFracGreen = NoahmpIO%VEGFRA(I,J) / 100.0 + noahmp%energy%param%TreeCrownRadius = LISparam%RC + noahmp%energy%param%HeightCanopyTop = LISparam%HVT + noahmp%energy%param%HeightCanopyBot = LISparam%HVB + noahmp%energy%param%RoughLenMomVeg = LISparam%Z0MVT + noahmp%energy%param%CanopyWindExtFac = LISparam%CWPVT + noahmp%energy%param%TreeDensity = LISparam%DEN + noahmp%energy%param%CanopyOrientIndex = LISparam%XL + noahmp%energy%param%ConductanceLeafMin = LISparam%BP + noahmp%energy%param%Co2MmConst25C = LISparam%KC25 + noahmp%energy%param%O2MmConst25C = LISparam%KO25 + noahmp%energy%param%Co2MmConstQ10 = LISparam%AKC + noahmp%energy%param%O2MmConstQ10 = LISparam%AKO + noahmp%energy%param%RadiationStressFac = LISparam%RGL + noahmp%energy%param%ResistanceStomataMin = LISparam%RSMIN + noahmp%energy%param%ResistanceStomataMax = LISparam%RSMAX + noahmp%energy%param%AirTempOptimTransp = LISparam%TOPT + noahmp%energy%param%VaporPresDeficitFac = LISparam%HS + noahmp%energy%param%LeafDimLength = LISparam%DLEAF + noahmp%energy%param%HeatCapacCanFac = LISparam%CBIOM + noahmp%energy%param%LeafAreaIndexMon = LISparam%LAIM + noahmp%energy%param%StemAreaIndexMon = LISparam%SAIM + noahmp%energy%param%ReflectanceLeaf = LISparam%RHOL + noahmp%energy%param%ReflectanceStem = LISparam%RHOS + noahmp%energy%param%TransmittanceLeaf = LISparam%TAUL + noahmp%energy%param%TransmittanceStem = LISparam%TAUS + noahmp%energy%param%AlbedoSoilSat = LISparam%ALBSAT + noahmp%energy%param%AlbedoSoilDry = LISparam%ALBDRY + noahmp%energy%param%AlbedoLakeFrz = LISparam%ALBLAK + noahmp%energy%param%ScatterCoeffSnow = LISparam%OMEGAS + + do SoilLayerIndex = 1, size(SoilType) + noahmp%energy%param%SoilQuartzFrac(SoilLayerIndex) = LISparam%QUARTZ(SoilLayerIndex) + enddo + + ! spatial varying soil input + if ( noahmp%config%nmlist%OptSoilProperty == 4 ) then + noahmp%energy%param%SoilQuartzFrac(1:NumSoilLayer) = NoahmpIO%QUARTZ_3D(I,1:NumSoilLayer,J) + endif + + if ( FlagUrban .eqv. .true. ) noahmp%energy%param%SoilHeatCapacity = 3.0e6 + + if ( CropType > 0 ) then + noahmp%energy%param%ConductanceLeafMin = LISparam%BP + noahmp%energy%param%Co2MmConst25C = LISparam%KC25 + noahmp%energy%param%O2MmConst25C = LISparam%KO25 + noahmp%energy%param%Co2MmConstQ10 = LISparam%AKC + noahmp%energy%param%O2MmConstQ10 = LISparam%AKO + endif + + end associate + + end subroutine EnergyVarInTransfer + +end module EnergyVarInTransferMod diff --git a/drivers/lis/EnergyVarOutTransferMod.F90 b/drivers/lis/EnergyVarOutTransferMod.F90 new file mode 100644 index 00000000..f51af1cf --- /dev/null +++ b/drivers/lis/EnergyVarOutTransferMod.F90 @@ -0,0 +1,192 @@ +module EnergyVarOutTransferMod + +!!! Transfer column (1-D) Noah-MP Energy variables to 2D NoahmpIO for output + +! ------------------------ Code history ----------------------------------- +! Original code: Guo-Yue Niu and Noah-MP team (Niu et al. 2011) +! Refactered code: C. He, P. Valayamkunnath, & refactor team (He et al. 2023) +! ------------------------------------------------------------------------- + + use Machine + use NoahmpIOVarType + use NoahmpVarType + + implicit none + +contains + +!=== Transfer model states to output ===== + + subroutine EnergyVarOutTransfer(noahmp, NoahmpIO) + + implicit none + + type(NoahmpIO_type), intent(inout) :: NoahmpIO + type(noahmp_type), intent(inout) :: noahmp + + ! local variables + integer :: LoopInd ! snow/soil layer loop index + real(kind=kind_noahmp) :: LeafAreaIndSunlit ! sunlit leaf area index [m2/m2] + real(kind=kind_noahmp) :: LeafAreaIndShade ! shaded leaf area index [m2/m2] + real(kind=kind_noahmp) :: ResistanceLeafBoundary ! leaf boundary layer resistance [s/m] + real(kind=kind_noahmp) :: ThicknessSnowSoilLayer ! temporary snow/soil layer thickness [m] + +!----------------------------------------------------------------------- + associate( & + I => noahmp%config%domain%GridIndexI ,& + J => noahmp%config%domain%GridIndexJ ,& + NumSoilLayer => noahmp%config%domain%NumSoilLayer ,& + NumSnowLayerMax => noahmp%config%domain%NumSnowLayerMax ,& + NumSnowLayerNeg => noahmp%config%domain%NumSnowLayerNeg ,& + IndicatorIceSfc => noahmp%config%domain%IndicatorIceSfc & + ) +!----------------------------------------------------------------------- + + ! special treatment for glacier point output + if ( IndicatorIceSfc == -1 ) then ! land ice point + noahmp%energy%state%VegFrac = 0.0 + noahmp%energy%state%RoughLenMomSfcToAtm = 0.002 + noahmp%energy%flux%RadSwAbsVeg = 0.0 + noahmp%energy%flux%RadLwNetCanopy = 0.0 + noahmp%energy%flux%RadLwNetVegGrd = 0.0 + noahmp%energy%flux%HeatSensibleCanopy = 0.0 + noahmp%energy%flux%HeatSensibleVegGrd = 0.0 + noahmp%energy%flux%HeatLatentVegGrd = 0.0 + noahmp%energy%flux%HeatGroundVegGrd = 0.0 + noahmp%energy%flux%HeatCanStorageChg = 0.0 + noahmp%energy%flux%HeatLatentCanTransp = 0.0 + noahmp%energy%flux%HeatLatentCanEvap = 0.0 + noahmp%energy%flux%HeatPrecipAdvCanopy = 0.0 + noahmp%energy%flux%HeatPrecipAdvVegGrd = 0.0 + noahmp%energy%flux%HeatLatentCanopy = 0.0 + noahmp%energy%flux%HeatLatentTransp = 0.0 + noahmp%energy%flux%RadLwNetBareGrd = noahmp%energy%flux%RadLwNetSfc + noahmp%energy%flux%HeatSensibleBareGrd = noahmp%energy%flux%HeatSensibleSfc + noahmp%energy%flux%HeatLatentBareGrd = noahmp%energy%flux%HeatLatentGrd + noahmp%energy%flux%HeatGroundBareGrd = noahmp%energy%flux%HeatGroundTot + noahmp%energy%state%TemperatureGrdBare = noahmp%energy%state%TemperatureGrd + noahmp%energy%state%ExchCoeffShBare = noahmp%energy%state%ExchCoeffShSfc + NoahmpIO%LH(I,J) = noahmp%energy%flux%HeatLatentGrd + endif + + if ( IndicatorIceSfc == 0 ) then ! land soil point + NoahmpIO%LH(I,J) = noahmp%energy%flux%HeatLatentGrd + noahmp%energy%flux%HeatLatentCanopy + & + noahmp%energy%flux%HeatLatentTransp + noahmp%energy%flux%HeatLatentIrriEvap + endif + + ! energy flux variables + NoahmpIO%HFX (I,J) = noahmp%energy%flux%HeatSensibleSfc + NoahmpIO%GRDFLX (I,J) = noahmp%energy%flux%HeatGroundTot + NoahmpIO%FSAXY (I,J) = noahmp%energy%flux%RadSwAbsSfc + NoahmpIO%FIRAXY (I,J) = noahmp%energy%flux%RadLwNetSfc + NoahmpIO%APARXY (I,J) = noahmp%energy%flux%RadPhotoActAbsCan + NoahmpIO%SAVXY (I,J) = noahmp%energy%flux%RadSwAbsVeg + NoahmpIO%SAGXY (I,J) = noahmp%energy%flux%RadSwAbsGrd + NoahmpIO%IRCXY (I,J) = noahmp%energy%flux%RadLwNetCanopy + NoahmpIO%IRGXY (I,J) = noahmp%energy%flux%RadLwNetVegGrd + NoahmpIO%SHCXY (I,J) = noahmp%energy%flux%HeatSensibleCanopy + NoahmpIO%SHGXY (I,J) = noahmp%energy%flux%HeatSensibleVegGrd + NoahmpIO%EVGXY (I,J) = noahmp%energy%flux%HeatLatentVegGrd + NoahmpIO%GHVXY (I,J) = noahmp%energy%flux%HeatGroundVegGrd + NoahmpIO%IRBXY (I,J) = noahmp%energy%flux%RadLwNetBareGrd + NoahmpIO%SHBXY (I,J) = noahmp%energy%flux%HeatSensibleBareGrd + NoahmpIO%EVBXY (I,J) = noahmp%energy%flux%HeatLatentBareGrd + NoahmpIO%GHBXY (I,J) = noahmp%energy%flux%HeatGroundBareGrd + NoahmpIO%TRXY (I,J) = noahmp%energy%flux%HeatLatentCanTransp + NoahmpIO%EVCXY (I,J) = noahmp%energy%flux%HeatLatentCanEvap + NoahmpIO%CANHSXY (I,J) = noahmp%energy%flux%HeatCanStorageChg + NoahmpIO%PAHXY (I,J) = noahmp%energy%flux%HeatPrecipAdvSfc + NoahmpIO%PAHGXY (I,J) = noahmp%energy%flux%HeatPrecipAdvVegGrd + NoahmpIO%PAHVXY (I,J) = noahmp%energy%flux%HeatPrecipAdvCanopy + NoahmpIO%PAHBXY (I,J) = noahmp%energy%flux%HeatPrecipAdvBareGrd + NoahmpIO%ACC_SSOILXY(I,J) = noahmp%energy%flux%HeatGroundTotAcc + NoahmpIO%EFLXBXY (I,J) = noahmp%energy%flux%HeatFromSoilBot + + ! energy state variables + NoahmpIO%TSK (I,J) = noahmp%energy%state%TemperatureRadSfc + NoahmpIO%EMISS (I,J) = noahmp%energy%state%EmissivitySfc + NoahmpIO%QSFC (I,J) = noahmp%energy%state%SpecHumiditySfcMean + NoahmpIO%TVXY (I,J) = noahmp%energy%state%TemperatureCanopy + NoahmpIO%TGXY (I,J) = noahmp%energy%state%TemperatureGrd + NoahmpIO%EAHXY (I,J) = noahmp%energy%state%PressureVaporCanAir + NoahmpIO%TAHXY (I,J) = noahmp%energy%state%TemperatureCanopyAir + NoahmpIO%CMXY (I,J) = noahmp%energy%state%ExchCoeffMomSfc + NoahmpIO%CHXY (I,J) = noahmp%energy%state%ExchCoeffShSfc + NoahmpIO%ALBOLDXY(I,J) = noahmp%energy%state%AlbedoSnowPrev + NoahmpIO%LAI (I,J) = noahmp%energy%state%LeafAreaIndex + NoahmpIO%XSAIXY (I,J) = noahmp%energy%state%StemAreaIndex + NoahmpIO%TAUSSXY (I,J) = noahmp%energy%state%SnowAgeNondim + NoahmpIO%Z0 (I,J) = noahmp%energy%state%RoughLenMomSfcToAtm + NoahmpIO%ZNT (I,J) = noahmp%energy%state%RoughLenMomSfcToAtm + NoahmpIO%T2MVXY (I,J) = noahmp%energy%state%TemperatureAir2mVeg + NoahmpIO%T2MBXY (I,J) = noahmp%energy%state%TemperatureAir2mBare + NoahmpIO%TRADXY (I,J) = noahmp%energy%state%TemperatureRadSfc + NoahmpIO%FVEGXY (I,J) = noahmp%energy%state%VegFrac + NoahmpIO%RSSUNXY (I,J) = noahmp%energy%state%ResistanceStomataSunlit + NoahmpIO%RSSHAXY (I,J) = noahmp%energy%state%ResistanceStomataShade + NoahmpIO%BGAPXY (I,J) = noahmp%energy%state%GapBtwCanopy + NoahmpIO%WGAPXY (I,J) = noahmp%energy%state%GapInCanopy + NoahmpIO%TGVXY (I,J) = noahmp%energy%state%TemperatureGrdVeg + NoahmpIO%TGBXY (I,J) = noahmp%energy%state%TemperatureGrdBare + NoahmpIO%CHVXY (I,J) = noahmp%energy%state%ExchCoeffShAbvCan + NoahmpIO%CHBXY (I,J) = noahmp%energy%state%ExchCoeffShBare + NoahmpIO%CHLEAFXY(I,J) = noahmp%energy%state%ExchCoeffShLeaf + NoahmpIO%CHUCXY (I,J) = noahmp%energy%state%ExchCoeffShUndCan + NoahmpIO%CHV2XY (I,J) = noahmp%energy%state%ExchCoeffSh2mVeg + NoahmpIO%CHB2XY (I,J) = noahmp%energy%state%ExchCoeffSh2mBare + NoahmpIO%Q2MVXY (I,J) = noahmp%energy%state%SpecHumidity2mVeg /(1.0-noahmp%energy%state%SpecHumidity2mVeg) ! spec humidity to mixing ratio + NoahmpIO%Q2MBXY (I,J) = noahmp%energy%state%SpecHumidity2mBare/(1.0-noahmp%energy%state%SpecHumidity2mBare) + NoahmpIO%ALBEDO (I,J) = noahmp%energy%state%AlbedoSfc + NoahmpIO%IRRSPLH (I,J) = NoahmpIO%IRRSPLH(I,J) + & + (noahmp%energy%flux%HeatLatentIrriEvap * noahmp%config%domain%MainTimeStep) + NoahmpIO%TSLB (I,1:NumSoilLayer,J) = noahmp%energy%state%TemperatureSoilSnow(1:NumSoilLayer) + NoahmpIO%TSNOXY (I,-NumSnowLayerMax+1:0,J) = noahmp%energy%state%TemperatureSoilSnow(-NumSnowLayerMax+1:0) + + ! New Calculation of total Canopy/Stomatal Conductance Based on Bonan et al. (2011), Inverse of Canopy Resistance (below) + LeafAreaIndSunlit = max(noahmp%energy%state%LeafAreaIndSunlit, 0.0) + LeafAreaIndShade = max(noahmp%energy%state%LeafAreaIndShade, 0.0) + ResistanceLeafBoundary = max(noahmp%energy%state%ResistanceLeafBoundary, 0.0) + if ( (noahmp%energy%state%ResistanceStomataSunlit <= 0.0) .or. (noahmp%energy%state%ResistanceStomataShade <= 0.0) .or. & + (LeafAreaIndSunlit == 0.0) .or. (LeafAreaIndShade == 0.0) .or. & + (noahmp%energy%state%ResistanceStomataSunlit == undefined_real) .or. & + (noahmp%energy%state%ResistanceStomataShade == undefined_real) ) then + NoahmpIO%RS (I,J) = 0.0 + else + NoahmpIO%RS (I,J) = ((1.0 / (noahmp%energy%state%ResistanceStomataSunlit + ResistanceLeafBoundary) * & + noahmp%energy%state%LeafAreaIndSunlit) + & + ((1.0 / (noahmp%energy%state%ResistanceStomataShade + ResistanceLeafBoundary)) * & + noahmp%energy%state%LeafAreaIndShade)) + NoahmpIO%RS (I,J) = 1.0 / NoahmpIO%RS (I,J) ! Resistance + endif + + ! calculation of snow and soil energy storage + NoahmpIO%SNOWENERGY(I,J) = 0.0 + NoahmpIO%SOILENERGY(I,J) = 0.0 + do LoopInd = NumSnowLayerNeg+1, NumSoilLayer + if ( LoopInd == NumSnowLayerNeg+1 ) then + ThicknessSnowSoilLayer = -noahmp%config%domain%DepthSnowSoilLayer(LoopInd) + else + ThicknessSnowSoilLayer = noahmp%config%domain%DepthSnowSoilLayer(LoopInd-1) - & + noahmp%config%domain%DepthSnowSoilLayer(LoopInd) + endif + if ( LoopInd >= 1 ) then + NoahmpIO%SOILENERGY(I,J) = NoahmpIO%SOILENERGY(I,J) + ThicknessSnowSoilLayer * & + noahmp%energy%state%HeatCapacSoilSnow(LoopInd) * & + (noahmp%energy%state%TemperatureSoilSnow(LoopInd) - 273.16) * 0.001 + else + NoahmpIO%SNOWENERGY(I,J) = NoahmpIO%SNOWENERGY(I,J) + ThicknessSnowSoilLayer * & + noahmp%energy%state%HeatCapacSoilSnow(LoopInd) * & + (noahmp%energy%state%TemperatureSoilSnow(LoopInd) - 273.16) * 0.001 + endif + enddo + + ! PET related, requires modifying NoahMP core source code (TODO) + NoahmpIO%FGEV_PET = undefined_real + NoahmpIO%FCEV_PET = undefined_real + NoahmpIO%FCTR_PET = undefined_real + + end associate + + end subroutine EnergyVarOutTransfer + +end module EnergyVarOutTransferMod diff --git a/drivers/lis/ForcingVarInTransferMod.F90 b/drivers/lis/ForcingVarInTransferMod.F90 new file mode 100644 index 00000000..5cef99c5 --- /dev/null +++ b/drivers/lis/ForcingVarInTransferMod.F90 @@ -0,0 +1,69 @@ +module ForcingVarInTransferMod + +!!! Transfer input 2-D NoahmpIO Forcing variables to 1-D column variable +!!! 1-D variables should be first defined in /src/ForcingVarType.F90 +!!! 2-D variables should be first defined in NoahmpIOVarType.F90 + +! ------------------------ Code history ----------------------------------- +! Original code: Guo-Yue Niu and Noah-MP team (Niu et al. 2011) +! Refactered code: C. He, P. Valayamkunnath, & refactor team (He et al. 2023) +! ------------------------------------------------------------------------- + + use Machine + use NoahmpIOVarType + use NoahmpVarType + + implicit none + +contains + +!=== initialize with input data or table values + + subroutine ForcingVarInTransfer(noahmp, NoahmpIO) + + implicit none + + type(NoahmpIO_type), intent(inout) :: NoahmpIO + type(noahmp_type), intent(inout) :: noahmp + + ! local variables + real(kind=kind_noahmp) :: PrecipOtherRefHeight ! other precipitation, e.g. fog [mm/s] at reference height + real(kind=kind_noahmp) :: PrecipTotalRefHeight ! total precipitation [mm/s] at reference height + +! --------------------------------------------------------------- + associate( & + I => noahmp%config%domain%GridIndexI ,& + J => noahmp%config%domain%GridIndexJ & + ) +! --------------------------------------------------------------- + + noahmp%forcing%TemperatureAirRefHeight = NoahmpIO%T_PHY(I,1,J) + noahmp%forcing%WindEastwardRefHeight = NoahmpIO%U_PHY(I,1,J) + noahmp%forcing%WindNorthwardRefHeight = NoahmpIO%V_PHY(I,1,J) + noahmp%forcing%SpecHumidityRefHeight = NoahmpIO%QV_CURR(I,1,J)/(1.0+NoahmpIO%QV_CURR(I,1,J)) ! convert from mixing ratio to specific humidity + noahmp%forcing%PressureAirRefHeight = (NoahmpIO%P8W(I,1,J) + NoahmpIO%P8W(I,2,J)) * 0.5 ! air pressure at middle point of lowest atmos model layer + noahmp%forcing%PressureAirSurface = NoahmpIO%P8W (I,1,J) + noahmp%forcing%RadLwDownRefHeight = NoahmpIO%GLW (I,J) + noahmp%forcing%RadSwDownRefHeight = NoahmpIO%SWDOWN (I,J) + noahmp%forcing%TemperatureSoilBottom = NoahmpIO%TMN (I,J) + + ! treat different precipitation types + PrecipTotalRefHeight = NoahmpIO%RAINBL (I,J) / NoahmpIO%DTBL ! convert precip unit from mm/timestep to mm/s + noahmp%forcing%PrecipConvRefHeight = NoahmpIO%MP_RAINC (I,J) / NoahmpIO%DTBL + noahmp%forcing%PrecipNonConvRefHeight = NoahmpIO%MP_RAINNC(I,J) / NoahmpIO%DTBL + noahmp%forcing%PrecipShConvRefHeight = NoahmpIO%MP_SHCV (I,J) / NoahmpIO%DTBL + noahmp%forcing%PrecipSnowRefHeight = NoahmpIO%MP_SNOW (I,J) / NoahmpIO%DTBL + noahmp%forcing%PrecipGraupelRefHeight = NoahmpIO%MP_GRAUP (I,J) / NoahmpIO%DTBL + noahmp%forcing%PrecipHailRefHeight = NoahmpIO%MP_HAIL (I,J) / NoahmpIO%DTBL + ! treat other precipitation (e.g. fog) contained in total precipitation + PrecipOtherRefHeight = PrecipTotalRefHeight - noahmp%forcing%PrecipConvRefHeight - & + noahmp%forcing%PrecipNonConvRefHeight - noahmp%forcing%PrecipShConvRefHeight + PrecipOtherRefHeight = max(0.0, PrecipOtherRefHeight) + noahmp%forcing%PrecipNonConvRefHeight = noahmp%forcing%PrecipNonConvRefHeight + PrecipOtherRefHeight + noahmp%forcing%PrecipSnowRefHeight = noahmp%forcing%PrecipSnowRefHeight + PrecipOtherRefHeight * NoahmpIO%SR(I,J) + + end associate + + end subroutine ForcingVarInTransfer + +end module ForcingVarInTransferMod diff --git a/drivers/lis/ForcingVarOutTransferMod.F90 b/drivers/lis/ForcingVarOutTransferMod.F90 new file mode 100644 index 00000000..87e6da36 --- /dev/null +++ b/drivers/lis/ForcingVarOutTransferMod.F90 @@ -0,0 +1,44 @@ +module ForcingVarOutTransferMod + +!!! Transfer column (1-D) Noah-MP forcing variables to 2D NoahmpIO for output + +! ------------------------ Code history ----------------------------------- +! Original code: Guo-Yue Niu and Noah-MP team (Niu et al. 2011) +! Refactered code: C. He, P. Valayamkunnath, & refactor team (He et al. 2023) +! ------------------------------------------------------------------------- + + use Machine + use NoahmpIOVarType + use NoahmpVarType + + implicit none + +contains + +!=== Transfer model states to output ===== + + subroutine ForcingVarOutTransfer(noahmp, NoahmpIO) + + implicit none + + type(noahmp_type), intent(inout) :: noahmp + type(NoahmpIO_type), intent(inout) :: NoahmpIO + +! ------------------------------------------------------------------------- + associate( & + I => noahmp%config%domain%GridIndexI ,& + J => noahmp%config%domain%GridIndexJ & + ) +! ------------------------------------------------------------------------- + + NoahmpIO%FORCTLSM (I,J) = noahmp%forcing%TemperatureAirRefHeight + NoahmpIO%FORCQLSM (I,J) = noahmp%forcing%SpecHumidityRefHeight + NoahmpIO%FORCPLSM (I,J) = noahmp%forcing%PressureAirRefHeight + NoahmpIO%FORCWLSM (I,J) = sqrt(noahmp%forcing%WindEastwardRefHeight**2 + & + noahmp%forcing%WindNorthwardRefHeight**2) + + end associate + + end subroutine ForcingVarOutTransfer + +end module ForcingVarOutTransferMod diff --git a/drivers/lis/LisNoahmpParamType.F90 b/drivers/lis/LisNoahmpParamType.F90 new file mode 100644 index 00000000..754105c0 --- /dev/null +++ b/drivers/lis/LisNoahmpParamType.F90 @@ -0,0 +1,245 @@ +module LisNoahmpParamType + +!!! Define LIS-Noah-MP table parameter variables + +! ------------------------ Code history ----------------------------------- +! Refactered code: C. He, P. Valayamkunnath & refactor team (He et al. 2023) +! ------------------------------------------------------------------------- + + use Machine + + implicit none + save + private + + integer, private, parameter :: MBAND = 2 + integer, private, parameter :: NSOIL = 4 + integer, private, parameter :: NSTAGE = 8 + + type, public :: LisNoahmpParam_type + +!---------------------------------------------------------------- +! Noahmp Parameters Table +!---------------------------------------------------------------- + + ! vegetation parameters + logical :: URBAN_FLAG ! urban flag + integer :: ISWATER ! water flag + integer :: ISBARREN ! barren ground flag + integer :: ISICE ! ice flag + integer :: ISCROP ! cropland flag + integer :: EBLFOREST ! evergreen broadleaf forest flag + real(kind=kind_noahmp) :: CH2OP ! maximum intercepted h2o per unit lai+sai (mm) + real(kind=kind_noahmp) :: DLEAF ! characteristic leaf dimension (m) + real(kind=kind_noahmp) :: Z0MVT ! momentum roughness length (m) + real(kind=kind_noahmp) :: HVT ! top of canopy (m) + real(kind=kind_noahmp) :: HVB ! bottom of canopy (m) + real(kind=kind_noahmp) :: DEN ! tree density (no. of trunks per m2) + real(kind=kind_noahmp) :: RC ! tree crown radius (m) + real(kind=kind_noahmp) :: MFSNO ! snowmelt curve parameter + real(kind=kind_noahmp) :: SCFFAC ! snow cover factor (m) (replace original hard-coded 2.5*z0 in SCF formulation) + real(kind=kind_noahmp) :: CBIOM ! canopy biomass heat capacity parameter (m) + real(kind=kind_noahmp) :: SAIM(12) ! monthly stem area index, one-sided + real(kind=kind_noahmp) :: LAIM(12) ! monthly leaf area index, one-sided + real(kind=kind_noahmp) :: SLA ! single-side leaf area per Kg [m2/kg] + real(kind=kind_noahmp) :: DILEFC ! coeficient for leaf stress death [1/s] + real(kind=kind_noahmp) :: DILEFW ! coeficient for leaf stress death [1/s] + real(kind=kind_noahmp) :: FRAGR ! fraction of growth respiration !original was 0.3 + real(kind=kind_noahmp) :: LTOVRC ! leaf turnover [1/s] + real(kind=kind_noahmp) :: C3PSN ! photosynthetic pathway: 0. = c4, 1. = c3 + real(kind=kind_noahmp) :: KC25 ! co2 michaelis-menten constant at 25c (pa) + real(kind=kind_noahmp) :: AKC ! q10 for kc25 + real(kind=kind_noahmp) :: KO25 ! o2 michaelis-menten constant at 25c (pa) + real(kind=kind_noahmp) :: AKO ! q10 for ko25 + real(kind=kind_noahmp) :: VCMX25 ! maximum rate of carboxylation at 25c (umol co2/m2/s) + real(kind=kind_noahmp) :: AVCMX ! q10 for vcmx25 + real(kind=kind_noahmp) :: BP ! minimum leaf conductance (umol/m2/s) + real(kind=kind_noahmp) :: MP ! slope of conductance-to-photosynthesis relationship + real(kind=kind_noahmp) :: QE25 ! quantum efficiency at 25c (umol co2 / umol photon) + real(kind=kind_noahmp) :: AQE ! q10 for qe25 + real(kind=kind_noahmp) :: RMF25 ! leaf maintenance respiration at 25c (umol co2/m2/s) + real(kind=kind_noahmp) :: RMS25 ! stem maintenance respiration at 25c (umol co2/kg bio/s) + real(kind=kind_noahmp) :: RMR25 ! root maintenance respiration at 25c (umol co2/kg bio/s) + real(kind=kind_noahmp) :: ARM ! q10 for maintenance respiration + real(kind=kind_noahmp) :: FOLNMX ! foliage nitrogen concentration when f(n)=1 (%) + real(kind=kind_noahmp) :: TMIN ! minimum temperature for photosynthesis (k) + real(kind=kind_noahmp) :: XL ! leaf/stem orientation index + real(kind=kind_noahmp) :: RHOL(MBAND) ! leaf reflectance: 1=vis, 2=nir + real(kind=kind_noahmp) :: RHOS(MBAND) ! stem reflectance: 1=vis, 2=nir + real(kind=kind_noahmp) :: TAUL(MBAND) ! leaf transmittance: 1=vis, 2=nir + real(kind=kind_noahmp) :: TAUS(MBAND) ! stem transmittance: 1=vis, 2=nir + real(kind=kind_noahmp) :: MRP ! microbial respiration parameter (umol co2 /kg c/ s) + real(kind=kind_noahmp) :: CWPVT ! empirical canopy wind parameter + real(kind=kind_noahmp) :: WRRAT ! wood to non-wood ratio + real(kind=kind_noahmp) :: WDPOOL ! wood pool (switch 1 or 0) depending on woody or not [-] + real(kind=kind_noahmp) :: TDLEF ! characteristic T for leaf freezing [K] + real(kind=kind_noahmp) :: NROOT ! number of soil layers with root present + real(kind=kind_noahmp) :: RGL ! Parameter used in radiation stress function + real(kind=kind_noahmp) :: RSMIN ! Minimum stomatal resistance [s m-1] + real(kind=kind_noahmp) :: HS ! Parameter used in vapor pressure deficit function + real(kind=kind_noahmp) :: TOPT ! Optimum transpiration air temperature [K] + real(kind=kind_noahmp) :: RSMAX ! Maximal stomatal resistance [s m-1] + real(kind=kind_noahmp) :: RTOVRC ! root turnover coefficient [1/s] + real(kind=kind_noahmp) :: RSWOODC ! wood respiration coeficient [1/s] + real(kind=kind_noahmp) :: BF ! parameter for present wood allocation [-] + real(kind=kind_noahmp) :: WSTRC ! water stress coeficient [-] + real(kind=kind_noahmp) :: LAIMIN ! minimum leaf area index [m2/m2] + real(kind=kind_noahmp) :: XSAMIN ! minimum stem area index [m2/m2] + + ! radiation parameters + real(kind=kind_noahmp) :: ALBSAT(MBAND) ! saturated soil albedos: 1=vis, 2=nir + real(kind=kind_noahmp) :: ALBDRY(MBAND) ! dry soil albedos: 1=vis, 2=nir + real(kind=kind_noahmp) :: ALBICE(MBAND) ! albedo land ice: 1=vis, 2=nir + real(kind=kind_noahmp) :: ALBLAK(MBAND) ! albedo frozen lakes: 1=vis, 2=nir + real(kind=kind_noahmp) :: OMEGAS(MBAND) ! two-stream parameter omega for snow + real(kind=kind_noahmp) :: BETADS ! two-stream parameter betad for snow + real(kind=kind_noahmp) :: BETAIS ! two-stream parameter betad for snow + real(kind=kind_noahmp) :: EG(2) ! emissivity soil surface + real(kind=kind_noahmp) :: EICE ! ice surface emissivity + + ! global parameters + real(kind=kind_noahmp) :: CO2 ! co2 partial pressure + real(kind=kind_noahmp) :: O2 ! o2 partial pressure + real(kind=kind_noahmp) :: TIMEAN ! gridcell mean topgraphic index (global mean) + real(kind=kind_noahmp) :: FSATMX ! maximum surface saturated fraction (global mean) + real(kind=kind_noahmp) :: Z0SNO ! snow surface roughness length (m) (0.002) + real(kind=kind_noahmp) :: SSI ! liquid water holding capacity for snowpack (m3/m3) (0.03) + real(kind=kind_noahmp) :: SNOW_RET_FAC ! snowpack water release timescale factor (1/s) + real(kind=kind_noahmp) :: SNOW_EMIS ! snow emissivity + real(kind=kind_noahmp) :: SWEMX ! new snow mass to fully cover old snow (mm) + real(kind=kind_noahmp) :: RSURF_SNOW ! surface resistance for snow(s/m) + real(kind=kind_noahmp) :: TAU0 ! tau0 from Yang97 eqn. 10a + real(kind=kind_noahmp) :: GRAIN_GROWTH ! growth from vapor diffusion Yang97 eqn. 10b + real(kind=kind_noahmp) :: EXTRA_GROWTH ! extra growth near freezing Yang97 eqn. 10c + real(kind=kind_noahmp) :: DIRT_SOOT ! dirt and soot term Yang97 eqn. 10d + real(kind=kind_noahmp) :: BATS_COSZ ! zenith angle snow albedo adjustment; b in Yang97 eqn. 15 + real(kind=kind_noahmp) :: BATS_VIS_NEW ! new snow visible albedo + real(kind=kind_noahmp) :: BATS_NIR_NEW ! new snow NIR albedo + real(kind=kind_noahmp) :: BATS_VIS_AGE ! age factor for diffuse visible snow albedo Yang97 eqn. 17 + real(kind=kind_noahmp) :: BATS_NIR_AGE ! age factor for diffuse NIR snow albedo Yang97 eqn. 18 + real(kind=kind_noahmp) :: BATS_VIS_DIR ! cosz factor for direct visible snow albedo Yang97 eqn. 15 + real(kind=kind_noahmp) :: BATS_NIR_DIR ! cosz factor for direct NIR snow albedo Yang97 eqn. 16 + real(kind=kind_noahmp) :: RSURF_EXP ! exponent in the shape parameter for soil resistance option 1 + real(kind=kind_noahmp) :: C2_SNOWCOMPACT ! overburden snow compaction parameter (m3/kg) + real(kind=kind_noahmp) :: C3_SNOWCOMPACT ! snow desctructive metamorphism compaction parameter1 [1/s] + real(kind=kind_noahmp) :: C4_SNOWCOMPACT ! snow desctructive metamorphism compaction parameter2 [1/k] + real(kind=kind_noahmp) :: C5_SNOWCOMPACT ! snow desctructive metamorphism compaction parameter3 + real(kind=kind_noahmp) :: DM_SNOWCOMPACT ! upper Limit on destructive metamorphism compaction [kg/m3] + real(kind=kind_noahmp) :: ETA0_SNOWCOMPACT ! snow viscosity coefficient [kg-s/m2] + real(kind=kind_noahmp) :: SNLIQMAXFRAC ! maximum liquid water fraction in snow + real(kind=kind_noahmp) :: SWEMAXGLA ! Maximum SWE allowed at glaciers (mm) + real(kind=kind_noahmp) :: WSLMAX ! maximum lake water storage (mm) + real(kind=kind_noahmp) :: ROUS ! specific yield [-] for Niu et al. 2007 groundwater scheme + real(kind=kind_noahmp) :: CMIC ! microprore content (0.0-1.0), 0.0: close to free drainage + real(kind=kind_noahmp) :: SNOWDEN_MAX ! maximum fresh snowfall density (kg/m3) + real(kind=kind_noahmp) :: CLASS_ALB_REF ! reference snow albedo in CLASS scheme + real(kind=kind_noahmp) :: CLASS_SNO_AGE ! snow aging e-folding time (s) in CLASS albedo scheme + real(kind=kind_noahmp) :: CLASS_ALB_NEW ! fresh snow albedo in CLASS scheme + real(kind=kind_noahmp) :: PSIWLT ! soil metric potential for wilting point (m) + real(kind=kind_noahmp) :: Z0SOIL ! Bare-soil roughness length (m) (i.e., under the canopy) + real(kind=kind_noahmp) :: Z0LAKE ! Lake surface roughness length (m) + + ! irrigation parameters + integer :: IRR_HAR ! number of days before harvest date to stop irrigation + real(kind=kind_noahmp) :: IRR_FRAC ! irrigation Fraction + real(kind=kind_noahmp) :: IRR_LAI ! Minimum lai to trigger irrigation + real(kind=kind_noahmp) :: IRR_MAD ! management allowable deficit (0-1) + real(kind=kind_noahmp) :: FILOSS ! factor of flood irrigation loss + real(kind=kind_noahmp) :: SPRIR_RATE ! mm/h, sprinkler irrigation rate + real(kind=kind_noahmp) :: MICIR_RATE ! mm/h, micro irrigation rate + real(kind=kind_noahmp) :: FIRTFAC ! flood application rate factor + real(kind=kind_noahmp) :: IR_RAIN ! maximum precipitation to stop irrigation trigger + + ! tile drainage parameters + integer :: DRAIN_LAYER_OPT ! tile drainage layer + integer :: TD_DEPTH ! tile drainage depth (layer number) from soil surface + real(kind=kind_noahmp) :: TDSMC_FAC ! tile drainage soil moisture factor + real(kind=kind_noahmp) :: TD_DC ! tile drainage coefficient [mm/d] + real(kind=kind_noahmp) :: TD_DCOEF ! tile drainage coefficient [mm/d] + real(kind=kind_noahmp) :: TD_D ! depth to impervious layer from drain water level [m] + real(kind=kind_noahmp) :: TD_ADEPTH ! actual depth of impervious layer from land surface [m] + real(kind=kind_noahmp) :: TD_RADI ! effective radius of drain tubes [m] + real(kind=kind_noahmp) :: TD_SPAC ! distance between two drain tubes or tiles [m] + real(kind=kind_noahmp) :: TD_DDRAIN ! tile drainage depth [m] + real(kind=kind_noahmp) :: KLAT_FAC ! hydraulic conductivity mutiplification factor + + ! crop parameters + integer :: PLTDAY ! Planting date + integer :: HSDAY ! Harvest date + real(kind=kind_noahmp) :: PLANTPOP ! Plant density [per ha] - used? + real(kind=kind_noahmp) :: IRRI ! Irrigation strategy 0= non-irrigation 1=irrigation (no water-stress) + real(kind=kind_noahmp) :: GDDTBASE ! Base temperature for GDD accumulation [C] + real(kind=kind_noahmp) :: GDDTCUT ! Upper temperature for GDD accumulation [C] + real(kind=kind_noahmp) :: GDDS1 ! GDD from seeding to emergence + real(kind=kind_noahmp) :: GDDS2 ! GDD from seeding to initial vegetative + real(kind=kind_noahmp) :: GDDS3 ! GDD from seeding to post vegetative + real(kind=kind_noahmp) :: GDDS4 ! GDD from seeding to intial reproductive + real(kind=kind_noahmp) :: GDDS5 ! GDD from seeding to pysical maturity + real(kind=kind_noahmp) :: AREF ! reference maximum CO2 assimulation rate + real(kind=kind_noahmp) :: PSNRF ! CO2 assimulation reduction factor(0-1) (caused by non-modeled part, pest,weeds) + real(kind=kind_noahmp) :: I2PAR ! Fraction of incoming solar radiation to photosynthetically active radiation + real(kind=kind_noahmp) :: TASSIM0 ! Minimum temperature for CO2 assimulation [C] + real(kind=kind_noahmp) :: TASSIM1 ! CO2 assimulation linearly increasing until temperature reaches T1 [C] + real(kind=kind_noahmp) :: TASSIM2 ! CO2 assmilation rate remain at Aref until temperature reaches T2 [C] + real(kind=kind_noahmp) :: K ! light extinction coefficient + real(kind=kind_noahmp) :: EPSI ! initial light use efficiency + real(kind=kind_noahmp) :: Q10MR ! q10 for maintainance respiration + real(kind=kind_noahmp) :: LEFREEZ ! characteristic T for leaf freezing [K] + real(kind=kind_noahmp) :: DILE_FC(NSTAGE) ! coeficient for temperature leaf stress death [1/s] + real(kind=kind_noahmp) :: DILE_FW(NSTAGE) ! coeficient for water leaf stress death [1/s] + real(kind=kind_noahmp) :: FRA_GR ! fraction of growth respiration + real(kind=kind_noahmp) :: LF_OVRC(NSTAGE) ! fraction of leaf turnover [1/s] + real(kind=kind_noahmp) :: ST_OVRC(NSTAGE) ! fraction of stem turnover [1/s] + real(kind=kind_noahmp) :: RT_OVRC(NSTAGE) ! fraction of root tunrover [1/s] + real(kind=kind_noahmp) :: LFMR25 ! leaf maintenance respiration at 25C [umol CO2/m2/s] + real(kind=kind_noahmp) :: STMR25 ! stem maintenance respiration at 25C [umol CO2/kg bio/s] + real(kind=kind_noahmp) :: RTMR25 ! root maintenance respiration at 25C [umol CO2/kg bio/s] + real(kind=kind_noahmp) :: GRAINMR25 ! grain maintenance respiration at 25C [umol CO2/kg bio/s] + real(kind=kind_noahmp) :: LFPT(NSTAGE) ! fraction of carbohydrate flux to leaf + real(kind=kind_noahmp) :: STPT(NSTAGE) ! fraction of carbohydrate flux to stem + real(kind=kind_noahmp) :: RTPT(NSTAGE) ! fraction of carbohydrate flux to root + real(kind=kind_noahmp) :: GRAINPT(NSTAGE) ! fraction of carbohydrate flux to grain + real(kind=kind_noahmp) :: LFCT(NSTAGE) ! fraction of carbohydrate translocation from leaf to grain + real(kind=kind_noahmp) :: STCT(NSTAGE) ! fraction of carbohydrate translocation from stem to grain + real(kind=kind_noahmp) :: RTCT(NSTAGE) ! fraction of carbohydrate translocation from root to grain + real(kind=kind_noahmp) :: BIO2LAI ! leaf area per living leaf biomass [m2/kg] + + ! soil parameters + real(kind=kind_noahmp) :: BEXP(NSOIL) ! soil B parameter + real(kind=kind_noahmp) :: SMCDRY(NSOIL) ! dry soil moisture threshold + real(kind=kind_noahmp) :: SMCMAX(NSOIL) ! porosity, saturated value of soil moisture (volumetric) + real(kind=kind_noahmp) :: SMCREF(NSOIL) ! reference soil moisture (field capacity) (volumetric) + real(kind=kind_noahmp) :: PSISAT(NSOIL) ! saturated soil matric potential + real(kind=kind_noahmp) :: DKSAT(NSOIL) ! saturated soil hydraulic conductivity + real(kind=kind_noahmp) :: DWSAT(NSOIL) ! saturated soil hydraulic diffusivity + real(kind=kind_noahmp) :: SMCWLT(NSOIL) ! wilting point soil moisture (volumetric) + real(kind=kind_noahmp) :: QUARTZ(NSOIL) ! soil quartz content + real(kind=kind_noahmp) :: BVIC ! VIC model infiltration parameter (-) for opt_run=6 + real(kind=kind_noahmp) :: AXAJ ! Xinanjiang: Tension water distribution inflection parameter [-] for opt_run=7 + real(kind=kind_noahmp) :: BXAJ ! Xinanjiang: Tension water distribution shape parameter [-] for opt_run=7 + real(kind=kind_noahmp) :: XXAJ ! Xinanjiang: Free water distribution shape parameter [-] for opt_run=7 + real(kind=kind_noahmp) :: BDVIC ! VIC model infiltration parameter (-) + real(kind=kind_noahmp) :: GDVIC ! mean capilary drive (m) + real(kind=kind_noahmp) :: BBVIC ! heterogeniety parameter for DVIC infiltration [-] + + ! general parameters + real(kind=kind_noahmp) :: SLOPE ! slope factor for soil drainage + real(kind=kind_noahmp) :: CSOIL ! Soil heat capacity [J m-3 K-1] + real(kind=kind_noahmp) :: REFDK ! Parameter in the surface runoff parameterization + real(kind=kind_noahmp) :: REFKDT ! Parameter in the surface runoff parameterization + real(kind=kind_noahmp) :: KDT ! used in compute maximum infiltration rate (in INFIL) + real(kind=kind_noahmp) :: FRZX ! used in compute maximum infiltration rate (in INFIL) + real(kind=kind_noahmp) :: FRZK ! Frozen ground parameter + real(kind=kind_noahmp) :: ZBOT ! Depth [m] of lower boundary soil temperature + real(kind=kind_noahmp) :: CZIL ! Parameter used in the calculation of the roughness length for heat + real(kind=kind_noahmp) :: mxsnalb ! LIS specific: max snow albedo + real(kind=kind_noahmp) :: mnsnalb ! LIS specific: min snow albedo + real(kind=kind_noahmp) :: sndecayexp ! LIS specific: snow age exponential decay + real(kind=kind_noahmp) :: t_ulimit ! LIS specific: + real(kind=kind_noahmp) :: t_mlimit ! LIS specific: + real(kind=kind_noahmp) :: t_llimit ! LIS specific: + real(kind=kind_noahmp) :: snowf_scalef ! LIS specific: snow cover scaling factor + + end type LisNoahmpParam_type + +end module LisNoahmpParamType diff --git a/drivers/lis/Makefile b/drivers/lis/Makefile new file mode 100644 index 00000000..eb85a108 --- /dev/null +++ b/drivers/lis/Makefile @@ -0,0 +1,76 @@ +# Makefile +# +.SUFFIXES: +.SUFFIXES: .o .F90 + +include ../../../hrldas/user_build_options + +OBJS = NoahmpGroundwaterInitMod.o \ + NoahmpSnowInitMod.o \ + NoahmpInitMainMod.o \ + NoahmpDriverMainMod.o \ + NoahmpIOVarType.o \ + NoahmpIOVarInitMod.o \ + NoahmpReadTableMod.o \ + NoahmpReadNamelistMod.o \ + ConfigVarOutTransferMod.o \ + ForcingVarOutTransferMod.o \ + EnergyVarOutTransferMod.o \ + WaterVarOutTransferMod.o \ + BiochemVarOutTransferMod.o \ + ConfigVarInTransferMod.o \ + ForcingVarInTransferMod.o \ + EnergyVarInTransferMod.o \ + WaterVarInTransferMod.o \ + BiochemVarInTransferMod.o \ + PedoTransferSR2006Mod.o + +all: $(OBJS) + +.F90.o: + @echo "" + $(RM) $(*).f90 + $(CPP) $(CPPFLAGS) $(*).F90 > $(*).f90 + $(COMPILERF90) -c -I. -I../../src -I../../utility -I../../../hrldas/Utility_routines \ + -I../../../hrldas/MPP $(F90FLAGS) $(FREESOURCE) $(NETCDFMOD) $(*).f90 + @echo "" + +clean: + rm -f *.o *.mod *.exe *.f90 + +# +# Dependencies: +# + +NoahmpIOVarType.o: ../../utility/Machine.o +NoahmpIOVarInitMod.o: ../../utility/Machine.o NoahmpIOVarType.o +NoahmpReadTableMod.o: ../../utility/Machine.o NoahmpIOVarType.o +NoahmpReadNamelistMod.o: ../../utility/Machine.o NoahmpIOVarType.o +PedoTransferSR2006Mod.o: ../../utility/Machine.o NoahmpIOVarType.o +ConfigVarOutTransferMod.o: ../../utility/Machine.o NoahmpIOVarType.o ../../src/NoahmpVarType.o +ForcingVarOutTransferMod.o: ../../utility/Machine.o NoahmpIOVarType.o ../../src/NoahmpVarType.o +EnergyVarOutTransferMod.o: ../../utility/Machine.o NoahmpIOVarType.o ../../src/NoahmpVarType.o +WaterVarOutTransferMod.o: ../../utility/Machine.o NoahmpIOVarType.o ../../src/NoahmpVarType.o +BiochemVarOutTransferMod.o: ../../utility/Machine.o NoahmpIOVarType.o ../../src/NoahmpVarType.o +ConfigVarInTransferMod.o: ../../utility/Machine.o NoahmpIOVarType.o ../../src/NoahmpVarType.o +ForcingVarInTransferMod.o: ../../utility/Machine.o NoahmpIOVarType.o ../../src/NoahmpVarType.o +EnergyVarInTransferMod.o: ../../utility/Machine.o NoahmpIOVarType.o ../../src/NoahmpVarType.o +BiochemVarInTransferMod.o: ../../utility/Machine.o NoahmpIOVarType.o ../../src/NoahmpVarType.o +WaterVarInTransferMod.o: ../../utility/Machine.o NoahmpIOVarType.o ../../src/NoahmpVarType.o PedoTransferSR2006Mod.o +NoahmpGroundwaterInitMod.o: ../../../hrldas/Utility_routines/module_domain.o \ + ../../utility/Machine.o NoahmpIOVarType.o ../../src/GroundWaterMmfMod.o +NoahmpSnowInitMod.o: ../../utility/Machine.o NoahmpIOVarType.o +NoahmpInitMainMod.o: ../../utility/Machine.o NoahmpIOVarType.o NoahmpSnowInitMod.o \ + ../../../hrldas/Utility_routines/module_wrf_utilities.o +NoahmpDriverMainMod.o: ../../utility/Machine.o ../../src/NoahmpVarType.o NoahmpIOVarType.o \ + ../../src/ConfigVarInitMod.o \ + ../../src/EnergyVarInitMod.o ../../src/ForcingVarInitMod.o \ + ../../src/WaterVarInitMod.o ../../src/BiochemVarInitMod.o \ + ../../src/NoahmpMainMod.o ../../src/NoahmpMainGlacierMod.o \ + ConfigVarOutTransferMod.o EnergyVarOutTransferMod.o \ + WaterVarOutTransferMod.o BiochemVarOutTransferMod.o \ + ForcingVarOutTransferMod.o ConfigVarInTransferMod.o \ + ForcingVarInTransferMod.o EnergyVarInTransferMod.o \ + WaterVarInTransferMod.o BiochemVarInTransferMod.o \ + ../../../hrldas/Utility_routines/module_ra_gfdleta.o + diff --git a/drivers/lis/NoahmpDriverMainMod.F90 b/drivers/lis/NoahmpDriverMainMod.F90 new file mode 100644 index 00000000..a5dbe856 --- /dev/null +++ b/drivers/lis/NoahmpDriverMainMod.F90 @@ -0,0 +1,247 @@ +module NoahmpDriverMainMod + + use Machine + use NoahmpVarType + use NoahmpIOVarType + use LisNoahmpParamType + use ConfigVarInitMod + use EnergyVarInitMod + use ForcingVarInitMod + use WaterVarInitMod + use BiochemVarInitMod + use ConfigVarInTransferMod + use EnergyVarInTransferMod + use ForcingVarInTransferMod + use WaterVarInTransferMod + use BiochemVarInTransferMod + use ConfigVarOutTransferMod + use ForcingVarOutTransferMod + use EnergyVarOutTransferMod + use WaterVarOutTransferMod + use BiochemVarOutTransferMod + use NoahmpMainMod + use NoahmpMainGlacierMod + + implicit none + +contains + + subroutine NoahmpDriverMain(NoahmpIO, LISparam) + +! ------------------------ Code history ----------------------------------- +! Original Noah-MP subroutine: noahmplsm +! Original code: Guo-Yue Niu and Noah-MP team (Niu et al. 2011) +! Refactered code: C. He, P. Valayamkunnath, & refactor team (He et al. 2023) +! ------------------------------------------------------------------------- + + implicit none + + type(LisNoahmpParam_type), intent(in) :: LISparam ! lis/noahmp parameter + type(NoahmpIO_type), intent(inout) :: NoahmpIO + + ! local variables + type(noahmp_type) :: noahmp + integer :: I + integer :: J + integer :: K + integer :: JMONTH, JDAY + real(kind=kind_noahmp) :: SOLAR_TIME + real(kind=kind_noahmp), dimension( 1:NoahmpIO%nsoil ) :: SAND + real(kind=kind_noahmp), dimension( 1:NoahmpIO%nsoil ) :: CLAY + real(kind=kind_noahmp), dimension( 1:NoahmpIO%nsoil ) :: ORGM +! ------------------------------------------------------------------------- + + !--------------------------------------------------------------------- + ! Treatment of Noah-MP soil timestep + !--------------------------------------------------------------------- + NoahmpIO%CALCULATE_SOIL = .false. + NoahmpIO%SOIL_UPDATE_STEPS = nint(NoahmpIO%SOILTSTEP / NoahmpIO%DTBL) + NoahmpIO%SOIL_UPDATE_STEPS = max(NoahmpIO%SOIL_UPDATE_STEPS,1) + + if ( NoahmpIO%SOIL_UPDATE_STEPS == 1 ) then + NoahmpIO%ACC_SSOILXY = 0.0 + NoahmpIO%ACC_QINSURXY = 0.0 + NoahmpIO%ACC_QSEVAXY = 0.0 + NoahmpIO%ACC_ETRANIXY = 0.0 + NoahmpIO%ACC_DWATERXY = 0.0 + NoahmpIO%ACC_PRCPXY = 0.0 + NoahmpIO%ACC_ECANXY = 0.0 + NoahmpIO%ACC_ETRANXY = 0.0 + NoahmpIO%ACC_EDIRXY = 0.0 + endif + + if ( NoahmpIO%SOIL_UPDATE_STEPS > 1 ) then + if ( mod(NoahmpIO%ITIMESTEP, NoahmpIO%SOIL_UPDATE_STEPS) == 1 ) then + NoahmpIO%ACC_SSOILXY = 0.0 + NoahmpIO%ACC_QINSURXY = 0.0 + NoahmpIO%ACC_QSEVAXY = 0.0 + NoahmpIO%ACC_ETRANIXY = 0.0 + NoahmpIO%ACC_DWATERXY = 0.0 + NoahmpIO%ACC_PRCPXY = 0.0 + NoahmpIO%ACC_ECANXY = 0.0 + NoahmpIO%ACC_ETRANXY = 0.0 + NoahmpIO%ACC_EDIRXY = 0.0 + end if + endif + + if ( mod(NoahmpIO%ITIMESTEP, NoahmpIO%SOIL_UPDATE_STEPS) == 0 ) NoahmpIO%CALCULATE_SOIL = .true. + + !--------------------------------------------------------------------- + ! Prepare Noah-MP driver + !--------------------------------------------------------------------- + + ! find length of year for phenology (also S Hemisphere) + NoahmpIO%YEARLEN = 365 + if (mod(NoahmpIO%YR,4) == 0)then + NoahmpIO%YEARLEN = 366 + if (mod(NoahmpIO%YR,100) == 0)then + NoahmpIO%YEARLEN = 365 + if (mod(NoahmpIO%YR,400) == 0)then + NoahmpIO%YEARLEN = 366 + endif + endif + endif + + ! depth to soil interfaces (<0) [m] + NoahmpIO%ZSOIL(1) = -NoahmpIO%DZS(1) + do K = 2, NoahmpIO%NSOIL + NoahmpIO%ZSOIL(K) = -NoahmpIO%DZS(K) + NoahmpIO%ZSOIL(K-1) + enddo + + JLOOP : do J = NoahmpIO%JTS, NoahmpIO%JTE + + NoahmpIO%J = J + if ( NoahmpIO%ITIMESTEP == 1 ) then + do I = NoahmpIO%ITS, NoahmpIO%ITE + if ( (NoahmpIO%XLAND(I,J)-1.5) >= 0.0 ) then ! Open water point + if ( NoahmpIO%XICE(I,J) == 1.0 ) print*,' sea-ice at water point, I=',I,'J=',J + do K = 1, NoahmpIO%NSOIL + NoahmpIO%SMOIS(I,K,J) = 1.0 + NoahmpIO%TSLB(I,K,J) = 273.16 + enddo + else + if ( NoahmpIO%XICE(I,J) == 1.0 ) then ! Sea-ice case + do K = 1, NoahmpIO%NSOIL + NoahmpIO%SMOIS(I,K,J) = 1.0 + enddo + endif + endif + enddo + endif ! end of initialization over ocean + + ILOOP : do I = NoahmpIO%ITS, NoahmpIO%ITE + + NoahmpIO%I = I + if ( NoahmpIO%XICE(I,J) >= NoahmpIO%XICE_THRESHOLD ) then ! Sea-ice point + NoahmpIO%ICE = 1 + NoahmpIO%SH2O(I,1:NoahmpIO%NSOIL,J) = 1.0 + NoahmpIO%LAI (I,J) = 0.01 + cycle ILOOP ! Skip any sea-ice points + else + if ( (NoahmpIO%XLAND(I,J)-1.5) >= 0.0 ) cycle ILOOP ! Skip any open water points + + !------------------------------------------------------------------------------------ + ! initialize Data Types and transfer all the inputs from 2-D to 1-D column variables + !------------------------------------------------------------------------------------ + call ConfigVarInitDefault (noahmp) + call ConfigVarInTransfer (noahmp, NoahmpIO) + call ForcingVarInitDefault (noahmp) + call ForcingVarInTransfer (noahmp, NoahmpIO) + call EnergyVarInitDefault (noahmp) + call EnergyVarInTransfer (noahmp, NoahmpIO, LISparam) + call WaterVarInitDefault (noahmp) + call WaterVarInTransfer (noahmp, NoahmpIO, LISparam) + call BiochemVarInitDefault (noahmp) + call BiochemVarInTransfer (noahmp, NoahmpIO, LISparam) + + !--------------------------------------------------------------------- + ! hydrological processes for vegetation in urban model + ! irrigate vegetaion only in urban area, MAY-SEP, 9-11pm + ! need to be separated from Noah-MP into outside urban specific module + !--------------------------------------------------------------------- + if ( (NoahmpIO%IVGTYP(I,J) == NoahmpIO%ISURBAN_TABLE) .or. & + (NoahmpIO%IVGTYP(I,J) > NoahmpIO%URBTYPE_beg) ) then + if ( (NoahmpIO%SF_URBAN_PHYSICS > 0) .and. (NoahmpIO%IRI_URBAN == 1) ) then + SOLAR_TIME = (NoahmpIO%JULIAN - int(NoahmpIO%JULIAN))*24 + NoahmpIO%XLON(I,J)/15.0 + if ( SOLAR_TIME < 0.0 ) SOLAR_TIME = SOLAR_TIME + 24.0 + call CAL_MON_DAY(int(NoahmpIO%JULIAN), NoahmpIO%YR, JMONTH, JDAY) + if ( (SOLAR_TIME >= 21.0) .and. (SOLAR_TIME <= 23.0) .and. & + (JMONTH >= 5) .and. (JMONTH <= 9) ) then + noahmp%water%state%SoilMoisture(1) = & + max(noahmp%water%state%SoilMoisture(1),noahmp%water%param%SoilMoistureFieldCap(1)) + noahmp%water%state%SoilMoisture(2) = & + max(noahmp%water%state%SoilMoisture(2),noahmp%water%param%SoilMoistureFieldCap(2)) + endif + endif + endif + + !------------------------------------------------------------------------ + ! Call 1D Noah-MP LSM + !------------------------------------------------------------------------ + + ! glacier ice + if (noahmp%config%domain%VegType == noahmp%config%domain%IndexIcePoint ) then + noahmp%config%domain%IndicatorIceSfc = -1 ! Land-ice point + noahmp%forcing%TemperatureSoilBottom = min(noahmp%forcing%TemperatureSoilBottom,263.15) ! set deep glaicer temp to >= -10C + call NoahmpMainGlacier(noahmp) + ! non-glacier land + else + noahmp%config%domain%IndicatorIceSfc = 0 ! land soil point. + call NoahmpMain(noahmp) + endif ! glacial split ends + + !--------------------------------------------------------------------- + ! Transfer 1-D Noah-MP column variables to 2-D output variables + !--------------------------------------------------------------------- + call ConfigVarOutTransfer (noahmp, NoahmpIO) + call ForcingVarOutTransfer(noahmp, NoahmpIO) + call EnergyVarOutTransfer (noahmp, NoahmpIO) + call WaterVarOutTransfer (noahmp, NoahmpIO) + call BiochemVarOutTransfer(noahmp, NoahmpIO) + + endif ! land-sea split ends + + enddo ILOOP ! I loop + enddo JLOOP ! J loop + + end subroutine NoahmpDriverMain + + +! TODO: utility for urban irrigation; need to separate urban-related process out in future + subroutine CAL_MON_DAY(JULDAY,julyr,Jmonth,Jday) + + implicit none + + integer, intent(in) :: JULDAY,julyr + integer, intent(out) :: Jmonth,Jday + ! local + logical :: LEAP,NOT_FIND_DATE + integer :: MONTH (12),itmpday,itmpmon,i + DATA MONTH/31,28,31,30,31,30,31,31,30,31,30,31/ +! ------------------------------------------------------------------------- + + NOT_FIND_DATE = .true. + itmpday = JULDAY + itmpmon = 1 + LEAP = .false. + + if ( mod(julyr, 4) == 0) then + MONTH(2) = 29 + LEAP = .true. + endif + + i = 1 + do while(NOT_FIND_DATE) + if ( itmpday > MONTH(i) ) then + itmpday = itmpday - MONTH(i) + else + Jday = itmpday + Jmonth = i + NOT_FIND_DATE = .false. + endif + i = i+1 + enddo + + end subroutine CAL_MON_DAY + +end module NoahmpDriverMainMod diff --git a/drivers/lis/NoahmpGroundwaterInitMod.F90 b/drivers/lis/NoahmpGroundwaterInitMod.F90 new file mode 100644 index 00000000..ff46f948 --- /dev/null +++ b/drivers/lis/NoahmpGroundwaterInitMod.F90 @@ -0,0 +1,324 @@ +module NoahmpGroundwaterInitMod + +!!! Module to initialize Noah-MP Groundwater (GW) variables for MMF GW scheme + + use Machine + use NoahmpIOVarType + + implicit none + +contains + + subroutine NoahmpGroundwaterInitMain(NoahmpIO) + +! ------------------------ Code history ------------------------------------- +! Original Noah-MP subroutine: GROUNDWATER_INIT +! Original code: Miguez-Macho, Fan et al. (2007) +! Refactered code: C. He, P. Valayamkunnath, & refactor team (He et al. 2023) +! --------------------------------------------------------------------------- + + use GroundWaterMmfMod, only : LATERALFLOW + +#if (EM_CORE == 1) +#ifdef DM_PARALLEL + use module_dm , only : ntasks_x,ntasks_y,local_communicator,mytask,ntasks + use module_comm_dm, only : halo_em_hydro_noahmp_sub +#endif +#endif + + implicit none + + type(NoahmpIO_type), intent(inout) :: NoahmpIO + + ! local variables + logical :: urbanpt_flag ! added to identify urban pixels + integer :: I,J,K,ITER,itf,jtf,NITER,NCOUNT,NS + real(kind=kind_noahmp) :: BEXP,SMCMAX,PSISAT,SMCWLT,DWSAT,DKSAT + real(kind=kind_noahmp) :: FRLIQ,SMCEQDEEP + real(kind=kind_noahmp) :: DELTAT,RCOND,TOTWATER + real(kind=kind_noahmp) :: AA,BBB,CC,DD,DX,FUNC,DFUNC,DDZ,EXPON,SMC,FLUX + real(kind=kind_noahmp), dimension(1:NoahmpIO%NSOIL) :: SMCEQ,ZSOIL + real(kind=kind_noahmp), dimension(NoahmpIO%ims:NoahmpIO%ime, NoahmpIO%jms:NoahmpIO%jme) :: QLAT, QRF + ! landmask: -1 for water (ice or no ice) and glacial areas, 1 for land where the LSM does its soil moisture calculations + integer, dimension(NoahmpIO%ims:NoahmpIO%ime, NoahmpIO%jms:NoahmpIO%jme) :: LANDMASK + +! -------------------------------------------------------------------------------- + associate( & + ids => NoahmpIO%ids ,& + ide => NoahmpIO%ide ,& + jds => NoahmpIO%jds ,& + jde => NoahmpIO%jde ,& + kds => NoahmpIO%kds ,& + kde => NoahmpIO%kde ,& + ims => NoahmpIO%ims ,& + ime => NoahmpIO%ime ,& + jms => NoahmpIO%jms ,& + jme => NoahmpIO%jme ,& + kms => NoahmpIO%kms ,& + kme => NoahmpIO%kme ,& + ips => NoahmpIO%ims ,& + ipe => NoahmpIO%ime ,& + jps => NoahmpIO%jms ,& + jpe => NoahmpIO%jme ,& + kps => NoahmpIO%kms ,& + kpe => NoahmpIO%kme ,& + its => NoahmpIO%its ,& + ite => NoahmpIO%ite ,& + jts => NoahmpIO%jts ,& + jte => NoahmpIO%jte ,& + kts => NoahmpIO%kts ,& + kte => NoahmpIO%kte & + ) +! -------------------------------------------------------------------------------- + + ! Given the soil layer thicknesses (in DZS), calculate the soil layer depths from the surface. + ZSOIL(1) = -NoahmpIO%DZS(1) ! negative + do NS = 2, NoahmpIO%NSOIL + ZSOIL(NS) = ZSOIL(NS-1) - NoahmpIO%DZS(NS) + enddo + + ! initialize grid index + itf = min0(ite,(ide+1)-1) + jtf = min0(jte,(jde+1)-1) + + ! initialize land mask + where ( (NoahmpIO%IVGTYP /= NoahmpIO%ISWATER_TABLE) .and. (NoahmpIO%IVGTYP /= NoahmpIO%ISICE_TABLE) ) + LANDMASK = 1 + elsewhere + LANDMASK = -1 + endwhere + + NoahmpIO%PEXPXY = 1.0 + DELTAT = 365.0*24*3600.0 ! 1 year + + ! read just the raw aggregated water table from hi-res map, so that it is better compatible with topography + ! use WTD here, to use the lateral communication routine + NoahmpIO%ZWTXY = NoahmpIO%EQZWT + NCOUNT = 0 + + do NITER = 1, 500 +#if (EM_CORE == 1) +#ifdef DM_PARALLEL +# include "HALO_EM_HYDRO_NOAHMP.inc" +#endif +#endif + ! Calculate lateral flow + if ( (NCOUNT > 0) .or. (NITER == 1) ) then + QLAT = 0.0 + call LATERALFLOW(NoahmpIO,NoahmpIO%ISLTYP,NoahmpIO%ZWTXY,QLAT,NoahmpIO%FDEPTHXY,& + NoahmpIO%TERRAIN,LANDMASK,DELTAT,NoahmpIO%AREAXY, & + ids,ide,jds,jde,kds,kde,ims,ime,jms,jme,kms,kme, & + its,ite,jts,jte,kts,kte ) + NCOUNT = 0 + do J = jts, jtf + do I = its, itf + if ( LANDMASK(I,J) > 0 ) then + if ( QLAT(i,j) > 1.0e-2 ) then + NCOUNT = NCOUNT + 1 + NoahmpIO%ZWTXY(I,J) = min(NoahmpIO%ZWTXY(I,J)+0.25, 0.0) + endif + endif + enddo + enddo + + endif + enddo !NITER + +#if (EM_CORE == 1) +#ifdef DM_PARALLEL +# include "HALO_EM_HYDRO_NOAHMP.inc" +#endif +#endif + + NoahmpIO%EQZWT=NoahmpIO%ZWTXY + + ! after adjusting, where qlat > 1cm/year now wtd is at the surface. + ! it may still happen that qlat + rech > 0 and eqwtd-rbed <0. There the wtd can + ! rise to the surface (poor drainage) but the et will then increase. + + ! now, calculate river conductivity + do J = jts, jtf + do I = its, itf + DDZ = NoahmpIO%EQZWT(I,J) - (NoahmpIO%RIVERBEDXY(I,J) - NoahmpIO%TERRAIN(I,J)) + ! dont allow riverbed above water table + if ( DDZ < 0.0 ) then + NoahmpIO%RIVERBEDXY(I,J) = NoahmpIO%TERRAIN(I,J) + NoahmpIO%EQZWT(I,J) + DDZ = 0.0 + endif + TOTWATER = NoahmpIO%AREAXY(I,J) * (QLAT(I,J) + NoahmpIO%RECHCLIM(I,J)*0.001) / DELTAT + if ( TOTWATER > 0 ) then + NoahmpIO%RIVERCONDXY(I,J) = TOTWATER / max(DDZ,0.05) + else + NoahmpIO%RIVERCONDXY(I,J) = 0.01 + ! make riverbed equal to eqwtd, otherwise qrf might be too big... + NoahmpIO%RIVERBEDXY(I,J) = NoahmpIO%TERRAIN(I,J) + NoahmpIO%EQZWT(I,J) + endif + enddo + enddo + + ! make riverbed to be height down from the surface instead of above sea level + NoahmpIO%RIVERBEDXY = min(NoahmpIO%RIVERBEDXY-NoahmpIO%TERRAIN, 0.0) + + ! now recompute lateral flow and flow to rivers to initialize deep soil moisture + DELTAT = NoahmpIO%WTDDT * 60.0 !timestep in seconds for this calculation + QLAT = 0.0 + call LATERALFLOW(NoahmpIO,NoahmpIO%ISLTYP,NoahmpIO%ZWTXY,QLAT,NoahmpIO%FDEPTHXY,& + NoahmpIO%TERRAIN,LANDMASK,DELTAT,NoahmpIO%AREAXY, & + ids,ide,jds,jde,kds,kde,ims,ime,jms,jme,kms,kme, & + its,ite,jts,jte,kts,kte ) + + ! compute flux from grounwater to rivers in the cell + do J = jts, jtf + do I = its, itf + if ( LANDMASK(I,J) > 0 ) then + if ( (NoahmpIO%ZWTXY(I,J) > NoahmpIO%RIVERBEDXY(I,J)) .and. & + (NoahmpIO%EQZWT(I,J) > NoahmpIO%RIVERBEDXY(I,J)) ) then + RCOND = NoahmpIO%RIVERCONDXY(I,J) * exp(NoahmpIO%PEXPXY(I,J)*(NoahmpIO%ZWTXY(I,J)-NoahmpIO%EQZWT(I,J))) + else + RCOND = NoahmpIO%RIVERCONDXY(I,J) + endif + QRF(I,J) = RCOND * (NoahmpIO%ZWTXY(I,J)-NoahmpIO%RIVERBEDXY(I,J)) * DELTAT / NoahmpIO%AREAXY(I,J) + ! for now, dont allow it to go from river to groundwater + QRF(I,J) = max(QRF(I,J), 0.0) + else + QRF(I,J) = 0.0 + endif + enddo + enddo + + ! now compute eq. soil moisture, change soil moisture to be compatible with the water table and compute deep soil moisture + do J = jts, jtf + do I = its, itf + + BEXP = NoahmpIO%BEXP_TABLE(NoahmpIO%ISLTYP(I,J)) + SMCMAX = NoahmpIO%SMCMAX_TABLE(NoahmpIO%ISLTYP(I,J)) + SMCWLT = NoahmpIO%SMCWLT_TABLE(NoahmpIO%ISLTYP(I,J)) + ! add urban flag + urbanpt_flag = .false. + if ( (NoahmpIO%IVGTYP(I,J) == NoahmpIO%ISURBAN_TABLE) .or. & + (NoahmpIO%IVGTYP(I,J) > NoahmpIO%URBTYPE_beg) ) urbanpt_flag = .true. + if ( urbanpt_flag .eqv. .true. ) then + SMCMAX = 0.45 + SMCWLT = 0.40 + endif + DWSAT = NoahmpIO%DWSAT_TABLE(NoahmpIO%ISLTYP(I,J)) + DKSAT = NoahmpIO%DKSAT_TABLE(NoahmpIO%ISLTYP(I,J)) + PSISAT = -NoahmpIO%PSISAT_TABLE(NoahmpIO%ISLTYP(I,J)) + if ( (BEXP > 0.0) .and. (SMCMAX > 0.0) .and. (-PSISAT > 0.0) ) then + ! initialize equilibrium soil moisture for water table diagnostic + call EquilibriumSoilMoisture(NoahmpIO%NSOIL, ZSOIL, SMCMAX, SMCWLT, DWSAT, DKSAT, BEXP, SMCEQ) + NoahmpIO%SMOISEQ(I,1:NoahmpIO%NSOIL,J) = SMCEQ(1:NoahmpIO%NSOIL) + + ! make sure that below the water table the layers are saturated and + ! initialize the deep soil moisture + if ( NoahmpIO%ZWTXY(I,J) < (ZSOIL(NoahmpIO%NSOIL)-NoahmpIO%DZS(NoahmpIO%NSOIL)) ) then + ! initialize deep soil moisture so that the flux compensates qlat+qrf + ! use Newton-Raphson method to find soil moisture + EXPON = 2.0 * BEXP + 3.0 + DDZ = ZSOIL(NoahmpIO%NSOIL) - NoahmpIO%ZWTXY(I,J) + CC = PSISAT / DDZ + FLUX = (QLAT(I,J) - QRF(I,J)) / DELTAT + SMC = 0.5 * SMCMAX + do ITER = 1, 100 + DD = (SMC + SMCMAX) / (2.0*SMCMAX) + AA = -DKSAT * DD ** EXPON + BBB = CC * ((SMCMAX / SMC)**BEXP - 1.0) + 1.0 + FUNC = AA * BBB - FLUX + DFUNC = -DKSAT * (EXPON / (2.0*SMCMAX)) * DD ** (EXPON - 1.0) * BBB & + + AA * CC * (-BEXP) * SMCMAX ** BEXP * SMC ** (-BEXP-1.0) + DX = FUNC / DFUNC + SMC = SMC - DX + if ( abs(DX) < 1.0e-6 ) exit + enddo + NoahmpIO%SMCWTDXY(I,J) = max(SMC, 1.0e-4) + elseif ( NoahmpIO%ZWTXY(I,J) < ZSOIL(NoahmpIO%NSOIL) ) then + SMCEQDEEP = SMCMAX * (PSISAT / (PSISAT - NoahmpIO%DZS(NoahmpIO%NSOIL))) ** (1.0/BEXP) + !SMCEQDEEP = MAX(SMCEQDEEP,SMCWLT) + SMCEQDEEP = max(SMCEQDEEP, 1.0e-4) + NoahmpIO%SMCWTDXY(I,J) = SMCMAX * (NoahmpIO%ZWTXY(I,J)-(ZSOIL(NoahmpIO%NSOIL)-NoahmpIO%DZS(NoahmpIO%NSOIL))) + & + SMCEQDEEP * (ZSOIL(NoahmpIO%NSOIL) - NoahmpIO%ZWTXY(I,J)) + else !water table within the resolved layers + NoahmpIO%SMCWTDXY(I,J) = SMCMAX + do K = NoahmpIO%NSOIL, 2, -1 + if ( NoahmpIO%ZWTXY(I,J) >= ZSOIL(K-1) ) then + FRLIQ = NoahmpIO%SH2O(I,K,J) / NoahmpIO%SMOIS(I,K,J) + NoahmpIO%SMOIS(I,K,J) = SMCMAX + NoahmpIO%SH2O(I,K,J) = SMCMAX * FRLIQ + else + if ( NoahmpIO%SMOIS(I,K,J) < SMCEQ(K) ) then + NoahmpIO%ZWTXY(I,J) = ZSOIL(K) + else + NoahmpIO%ZWTXY(I,J) = (NoahmpIO%SMOIS(I,K,J)*NoahmpIO%DZS(K) - SMCEQ(K)*ZSOIL(K-1) + & + SMCMAX*ZSOIL(K)) / (SMCMAX - SMCEQ(K)) + endif + exit + endif + enddo + endif + else + NoahmpIO%SMOISEQ (I,1:NoahmpIO%NSOIL,J) = SMCMAX + NoahmpIO%SMCWTDXY(I,J) = SMCMAX + NoahmpIO%ZWTXY(I,J) = 0.0 + endif + + ! zero out some arrays + NoahmpIO%QLATXY(I,J) = 0.0 + NoahmpIO%QSLATXY(I,J) = 0.0 + NoahmpIO%QRFXY(I,J) = 0.0 + NoahmpIO%QRFSXY(I,J) = 0.0 + NoahmpIO%DEEPRECHXY(I,J) = 0.0 + NoahmpIO%RECHXY(I,J) = 0.0 + NoahmpIO%QSPRINGXY(I,J) = 0.0 + NoahmpIO%QSPRINGSXY(I,J) = 0.0 + + enddo + enddo + + end associate + + end subroutine NoahmpGroundwaterInitMain + + subroutine EquilibriumSoilMoisture(NSOIL, ZSOIL, SMCMAX, SMCWLT, DWSAT, DKSAT, BEXP, SMCEQ) + + implicit none + + integer, intent(in) :: NSOIL !no. of soil layers + real(kind=kind_noahmp), intent(in) :: SMCMAX , SMCWLT, BEXP , DWSAT, DKSAT + real(kind=kind_noahmp), dimension(1:NSOIL), intent(in) :: ZSOIL !depth of soil layer-bottom [m] + real(kind=kind_noahmp), dimension(1:NSOIL), intent(out) :: SMCEQ !equilibrium soil water content [m3/m3] + + ! local variables + integer :: K, ITER + real(kind=kind_noahmp) :: DDZ, SMC, FUNC, DFUNC, AA, BB, EXPON, DX + ! -------------------------------------------------------------------------------- + + ! gmm compute equilibrium soil moisture content for the layer when wtd=zsoil(k) + do K = 1, NSOIL + if ( K == 1 ) then + DDZ = -ZSOIL(K+1) * 0.5 + elseif ( K < NSOIL ) then + DDZ = ( ZSOIL(K-1) - ZSOIL(K+1) ) * 0.5 + else + DDZ = ZSOIL(K-1) - ZSOIL(K) + endif + + ! use Newton-Raphson method to find eq soil moisture + EXPON = BEXP + 1.0 + AA = DWSAT / DDZ + BB = DKSAT / SMCMAX ** EXPON + SMC = 0.5 * SMCMAX + do ITER = 1, 100 + FUNC = (SMC - SMCMAX) * AA + BB * SMC ** EXPON + DFUNC = AA + BB * EXPON * SMC ** BEXP + DX = FUNC / DFUNC + SMC = SMC - DX + if ( abs(DX) < 1.0e-6 ) exit + enddo + +! SMCEQ(K) = min(max(SMC,SMCWLT),SMCMAX*0.99) + SMCEQ(K) = min(max(SMC,1.0e-4), SMCMAX*0.99) + enddo + + end subroutine EquilibriumSoilMoisture + +end module NoahmpGroundwaterInitMod diff --git a/drivers/lis/NoahmpIOVarInitMod.F90 b/drivers/lis/NoahmpIOVarInitMod.F90 new file mode 100644 index 00000000..e2439223 --- /dev/null +++ b/drivers/lis/NoahmpIOVarInitMod.F90 @@ -0,0 +1,861 @@ +module NoahmpIOVarInitMod + +!!! Initialize Noah-MP input/output variables +!!! Input/Output variables should be first defined in NoahmpIOVarType.F90 + +! ------------------------ Code history ----------------------------------- +! Original code: Guo-Yue Niu and Noah-MP team (Niu et al. 2011) +! Refactered code: C. He, P. Valayamkunnath, & refactor team (He et al. 2023) +! ------------------------------------------------------------------------- + + use Machine + use NoahmpIOVarType + + implicit none + +contains + +!=== initialize with default values + + subroutine NoahmpIOVarInitDefault(NoahmpIO) + + implicit none + type(NoahmpIO_type), intent(inout) :: NoahmpIO + +! ------------------------------------------------- + associate( & + XSTART => NoahmpIO%XSTART ,& + XEND => NoahmpIO%XEND ,& + YSTART => NoahmpIO%YSTART ,& + YEND => NoahmpIO%YEND ,& + KDS => NoahmpIO%KDS ,& + KDE => NoahmpIO%KDE ,& + NSOIL => NoahmpIO%NSOIL ,& + NSNOW => NoahmpIO%NSNOW & + ) +! ------------------------------------------------- + + ! Input variables + if ( .not. allocated (NoahmpIO%COSZEN) ) allocate ( NoahmpIO%COSZEN (XSTART:XEND, YSTART:YEND) ) ! cosine zenith angle + if ( .not. allocated (NoahmpIO%XLAT) ) allocate ( NoahmpIO%XLAT (XSTART:XEND, YSTART:YEND) ) ! latitude [radians] + if ( .not. allocated (NoahmpIO%XLON) ) allocate ( NoahmpIO%XLON (XSTART:XEND, YSTART:YEND) ) ! longitude [radians] + if ( .not. allocated (NoahmpIO%DZS) ) allocate ( NoahmpIO%DZS (1:NSOIL) ) ! thickness of soil layers [m] + if ( .not. allocated (NoahmpIO%ZSOIL) ) allocate ( NoahmpIO%ZSOIL (1:NSOIL) ) ! depth to soil interfaces [m] + if ( .not. allocated (NoahmpIO%IVGTYP) ) allocate ( NoahmpIO%IVGTYP (XSTART:XEND, YSTART:YEND) ) ! vegetation type + if ( .not. allocated (NoahmpIO%ISLTYP) ) allocate ( NoahmpIO%ISLTYP (XSTART:XEND, YSTART:YEND) ) ! soil type + if ( .not. allocated (NoahmpIO%urban_vegtype)) allocate ( NoahmpIO%urban_vegtype(XSTART:XEND, YSTART:YEND) ) ! urban veg type + if ( .not. allocated (NoahmpIO%VEGFRA) ) allocate ( NoahmpIO%VEGFRA (XSTART:XEND, YSTART:YEND) ) ! vegetation fraction [] + if ( .not. allocated (NoahmpIO%TMN) ) allocate ( NoahmpIO%TMN (XSTART:XEND, YSTART:YEND) ) ! deep soil temperature [K] + if ( .not. allocated (NoahmpIO%XLAND) ) allocate ( NoahmpIO%XLAND (XSTART:XEND, YSTART:YEND) ) ! =2 ocean; =1 land/seaice + if ( .not. allocated (NoahmpIO%XICE) ) allocate ( NoahmpIO%XICE (XSTART:XEND, YSTART:YEND) ) ! fraction of grid that is seaice + if ( .not. allocated (NoahmpIO%SWDOWN) ) allocate ( NoahmpIO%SWDOWN (XSTART:XEND, YSTART:YEND) ) ! solar down at surface [W m-2] + if ( .not. allocated (NoahmpIO%SWDDIR) ) allocate ( NoahmpIO%SWDDIR (XSTART:XEND, YSTART:YEND) ) ! solar down at surface [W m-2] for new urban solar panel + if ( .not. allocated (NoahmpIO%SWDDIF) ) allocate ( NoahmpIO%SWDDIF (XSTART:XEND, YSTART:YEND) ) ! solar down at surface [W m-2] for new urban solar panel + if ( .not. allocated (NoahmpIO%GLW) ) allocate ( NoahmpIO%GLW (XSTART:XEND, YSTART:YEND) ) ! longwave down at surface [W m-2] + if ( .not. allocated (NoahmpIO%RAINBL) ) allocate ( NoahmpIO%RAINBL (XSTART:XEND, YSTART:YEND) ) ! total precipitation entering land model [mm] per time step + if ( .not. allocated (NoahmpIO%SNOWBL) ) allocate ( NoahmpIO%SNOWBL (XSTART:XEND, YSTART:YEND) ) ! snow entering land model [mm] per time step + if ( .not. allocated (NoahmpIO%SR) ) allocate ( NoahmpIO%SR (XSTART:XEND, YSTART:YEND) ) ! frozen precip ratio entering land model [-] + if ( .not. allocated (NoahmpIO%RAINCV) ) allocate ( NoahmpIO%RAINCV (XSTART:XEND, YSTART:YEND) ) ! convective precip forcing [mm] + if ( .not. allocated (NoahmpIO%RAINNCV) ) allocate ( NoahmpIO%RAINNCV (XSTART:XEND, YSTART:YEND) ) ! non-convective precip forcing [mm] + if ( .not. allocated (NoahmpIO%RAINSHV) ) allocate ( NoahmpIO%RAINSHV (XSTART:XEND, YSTART:YEND) ) ! shallow conv. precip forcing [mm] + if ( .not. allocated (NoahmpIO%SNOWNCV) ) allocate ( NoahmpIO%SNOWNCV (XSTART:XEND, YSTART:YEND) ) ! non-covective snow forcing (subset of rainncv) [mm] + if ( .not. allocated (NoahmpIO%GRAUPELNCV)) allocate ( NoahmpIO%GRAUPELNCV (XSTART:XEND, YSTART:YEND) ) ! non-convective graupel forcing (subset of rainncv) [mm] + if ( .not. allocated (NoahmpIO%HAILNCV) ) allocate ( NoahmpIO%HAILNCV (XSTART:XEND, YSTART:YEND) ) ! non-convective hail forcing (subset of rainncv) [mm] + if ( .not. allocated (NoahmpIO%MP_RAINC) ) allocate ( NoahmpIO%MP_RAINC (XSTART:XEND, YSTART:YEND) ) ! convective precip forcing [mm] + if ( .not. allocated (NoahmpIO%MP_RAINNC) ) allocate ( NoahmpIO%MP_RAINNC (XSTART:XEND, YSTART:YEND) ) ! non-convective precip forcing [mm] + if ( .not. allocated (NoahmpIO%MP_SHCV) ) allocate ( NoahmpIO%MP_SHCV (XSTART:XEND, YSTART:YEND) ) ! shallow conv. precip forcing [mm] + if ( .not. allocated (NoahmpIO%MP_SNOW) ) allocate ( NoahmpIO%MP_SNOW (XSTART:XEND, YSTART:YEND) ) ! non-covective snow (subset of rainnc) [mm] + if ( .not. allocated (NoahmpIO%MP_GRAUP) ) allocate ( NoahmpIO%MP_GRAUP (XSTART:XEND, YSTART:YEND) ) ! non-convective graupel (subset of rainnc) [mm] + if ( .not. allocated (NoahmpIO%MP_HAIL) ) allocate ( NoahmpIO%MP_HAIL (XSTART:XEND, YSTART:YEND) ) ! non-convective hail (subset of rainnc) [mm] + if ( .not. allocated (NoahmpIO%SEAICE) ) allocate ( NoahmpIO%SEAICE (XSTART:XEND, YSTART:YEND) ) ! seaice fraction + if ( .not. allocated (NoahmpIO%DZ8W) ) allocate ( NoahmpIO%DZ8W (XSTART:XEND,KDS:KDE,YSTART:YEND) ) ! thickness of atmo layers [m] + if ( .not. allocated (NoahmpIO%T_PHY) ) allocate ( NoahmpIO%T_PHY (XSTART:XEND,KDS:KDE,YSTART:YEND) ) ! 3D atmospheric temperature valid at mid-levels [K] + if ( .not. allocated (NoahmpIO%QV_CURR) ) allocate ( NoahmpIO%QV_CURR (XSTART:XEND,KDS:KDE,YSTART:YEND) ) ! 3D water vapor mixing ratio [kg/kg_dry] + if ( .not. allocated (NoahmpIO%U_PHY) ) allocate ( NoahmpIO%U_PHY (XSTART:XEND,KDS:KDE,YSTART:YEND) ) ! 3D U wind component [m/s] + if ( .not. allocated (NoahmpIO%V_PHY) ) allocate ( NoahmpIO%V_PHY (XSTART:XEND,KDS:KDE,YSTART:YEND) ) ! 3D V wind component [m/s] + if ( .not. allocated (NoahmpIO%P8W) ) allocate ( NoahmpIO%P8W (XSTART:XEND,KDS:KDE,YSTART:YEND) ) ! 3D pressure, valid at interface [Pa] + if ( .not. allocated (NoahmpIO%shdfac_monthly)) allocate ( NoahmpIO%shdfac_monthly(XSTART:XEND,12,YSTART:YEND) ) ! monthly vegetation fraction + + ! spatial varying parameter map + if ( NoahmpIO%IOPT_SOIL > 1 ) then + if ( .not. allocated (NoahmpIO%soilcomp)) allocate ( NoahmpIO%soilcomp (XSTART:XEND,1:2*NSOIL,YSTART:YEND) ) ! Soil sand and clay content [fraction] + if ( .not. allocated (NoahmpIO%soilcl1) ) allocate ( NoahmpIO%soilcl1 (XSTART:XEND, YSTART:YEND) ) ! Soil texture class with depth + if ( .not. allocated (NoahmpIO%soilcl2) ) allocate ( NoahmpIO%soilcl2 (XSTART:XEND, YSTART:YEND) ) ! Soil texture class with depth + if ( .not. allocated (NoahmpIO%soilcl3) ) allocate ( NoahmpIO%soilcl3 (XSTART:XEND, YSTART:YEND) ) ! Soil texture class with depth + if ( .not. allocated (NoahmpIO%soilcl4) ) allocate ( NoahmpIO%soilcl4 (XSTART:XEND, YSTART:YEND) ) ! Soil texture class with depth + endif + if ( NoahmpIO%IOPT_SOIL == 4 ) then + if ( .not. allocated (NoahmpIO%bexp_3d) ) allocate ( NoahmpIO%bexp_3d (XSTART:XEND,1:NSOIL,YSTART:YEND) ) ! C-H B exponent + if ( .not. allocated (NoahmpIO%smcdry_3D) ) allocate ( NoahmpIO%smcdry_3D (XSTART:XEND,1:NSOIL,YSTART:YEND) ) ! Soil Moisture Limit: Dry + if ( .not. allocated (NoahmpIO%smcwlt_3D) ) allocate ( NoahmpIO%smcwlt_3D (XSTART:XEND,1:NSOIL,YSTART:YEND) ) ! Soil Moisture Limit: Wilt + if ( .not. allocated (NoahmpIO%smcref_3D) ) allocate ( NoahmpIO%smcref_3D (XSTART:XEND,1:NSOIL,YSTART:YEND) ) ! Soil Moisture Limit: Reference + if ( .not. allocated (NoahmpIO%smcmax_3D) ) allocate ( NoahmpIO%smcmax_3D (XSTART:XEND,1:NSOIL,YSTART:YEND) ) ! Soil Moisture Limit: Max + if ( .not. allocated (NoahmpIO%dksat_3D) ) allocate ( NoahmpIO%dksat_3D (XSTART:XEND,1:NSOIL,YSTART:YEND) ) ! Saturated Soil Conductivity + if ( .not. allocated (NoahmpIO%dwsat_3D) ) allocate ( NoahmpIO%dwsat_3D (XSTART:XEND,1:NSOIL,YSTART:YEND) ) ! Saturated Soil Diffusivity + if ( .not. allocated (NoahmpIO%psisat_3D) ) allocate ( NoahmpIO%psisat_3D (XSTART:XEND,1:NSOIL,YSTART:YEND) ) ! Saturated Matric Potential + if ( .not. allocated (NoahmpIO%quartz_3D) ) allocate ( NoahmpIO%quartz_3D (XSTART:XEND,1:NSOIL,YSTART:YEND) ) ! Soil quartz content + if ( .not. allocated (NoahmpIO%refdk_2D) ) allocate ( NoahmpIO%refdk_2D (XSTART:XEND, YSTART:YEND) ) ! Reference Soil Conductivity + if ( .not. allocated (NoahmpIO%refkdt_2D) ) allocate ( NoahmpIO%refkdt_2D (XSTART:XEND, YSTART:YEND) ) ! Soil Infiltration Parameter + if ( .not. allocated (NoahmpIO%irr_frac_2D) ) allocate ( NoahmpIO%irr_frac_2D (XSTART:XEND, YSTART:YEND) ) ! irrigation Fraction + if ( .not. allocated (NoahmpIO%irr_har_2D) ) allocate ( NoahmpIO%irr_har_2D (XSTART:XEND, YSTART:YEND) ) ! number of days before harvest date to stop irrigation + if ( .not. allocated (NoahmpIO%irr_lai_2D) ) allocate ( NoahmpIO%irr_lai_2D (XSTART:XEND, YSTART:YEND) ) ! Minimum lai to trigger irrigation + if ( .not. allocated (NoahmpIO%irr_mad_2D) ) allocate ( NoahmpIO%irr_mad_2D (XSTART:XEND, YSTART:YEND) ) ! management allowable deficit (0-1) + if ( .not. allocated (NoahmpIO%filoss_2D) ) allocate ( NoahmpIO%filoss_2D (XSTART:XEND, YSTART:YEND) ) ! fraction of flood irrigation loss (0-1) + if ( .not. allocated (NoahmpIO%sprir_rate_2D)) allocate ( NoahmpIO%sprir_rate_2D (XSTART:XEND, YSTART:YEND) ) ! mm/h, sprinkler irrigation rate + if ( .not. allocated (NoahmpIO%micir_rate_2D)) allocate ( NoahmpIO%micir_rate_2D (XSTART:XEND, YSTART:YEND) ) ! mm/h, micro irrigation rate + if ( .not. allocated (NoahmpIO%firtfac_2D) ) allocate ( NoahmpIO%firtfac_2D (XSTART:XEND, YSTART:YEND) ) ! flood application rate factor + if ( .not. allocated (NoahmpIO%ir_rain_2D) ) allocate ( NoahmpIO%ir_rain_2D (XSTART:XEND, YSTART:YEND) ) ! maximum precipitation to stop irrigation trigger + if ( .not. allocated (NoahmpIO%bvic_2D) ) allocate ( NoahmpIO%bvic_2D (XSTART:XEND, YSTART:YEND) ) ! VIC model infiltration parameter [-] + if ( .not. allocated (NoahmpIO%axaj_2D) ) allocate ( NoahmpIO%axaj_2D (XSTART:XEND, YSTART:YEND) ) ! Tension water distribution inflection parameter [-] + if ( .not. allocated (NoahmpIO%bxaj_2D) ) allocate ( NoahmpIO%bxaj_2D (XSTART:XEND, YSTART:YEND) ) ! Tension water distribution shape parameter [-] + if ( .not. allocated (NoahmpIO%xxaj_2D) ) allocate ( NoahmpIO%xxaj_2D (XSTART:XEND, YSTART:YEND) ) ! Free water distribution shape parameter [-] + if ( .not. allocated (NoahmpIO%bdvic_2D) ) allocate ( NoahmpIO%bdvic_2D (XSTART:XEND, YSTART:YEND) ) ! DVIC model infiltration parameter [-] + if ( .not. allocated (NoahmpIO%gdvic_2D) ) allocate ( NoahmpIO%gdvic_2D (XSTART:XEND, YSTART:YEND) ) ! Mean Capillary Drive (m) for infiltration models + if ( .not. allocated (NoahmpIO%bbvic_2D) ) allocate ( NoahmpIO%bbvic_2D (XSTART:XEND, YSTART:YEND) ) ! DVIC heterogeniety parameter for infiltration [-] + if ( .not. allocated (NoahmpIO%KLAT_FAC) ) allocate ( NoahmpIO%KLAT_FAC (XSTART:XEND, YSTART:YEND) ) ! factor multiplier to hydraulic conductivity + if ( .not. allocated (NoahmpIO%TDSMC_FAC) ) allocate ( NoahmpIO%TDSMC_FAC (XSTART:XEND, YSTART:YEND) ) ! factor multiplier to field capacity + if ( .not. allocated (NoahmpIO%TD_DC) ) allocate ( NoahmpIO%TD_DC (XSTART:XEND, YSTART:YEND) ) ! drainage coefficient for simple + if ( .not. allocated (NoahmpIO%TD_DCOEF) ) allocate ( NoahmpIO%TD_DCOEF (XSTART:XEND, YSTART:YEND) ) ! drainge coefficient for Hooghoudt + if ( .not. allocated (NoahmpIO%TD_DDRAIN) ) allocate ( NoahmpIO%TD_DDRAIN (XSTART:XEND, YSTART:YEND) ) ! depth of drain + if ( .not. allocated (NoahmpIO%TD_RADI) ) allocate ( NoahmpIO%TD_RADI (XSTART:XEND, YSTART:YEND) ) ! tile radius + if ( .not. allocated (NoahmpIO%TD_SPAC) ) allocate ( NoahmpIO%TD_SPAC (XSTART:XEND, YSTART:YEND) ) ! tile spacing + endif + + ! INOUT (with generic LSM equivalent) (as defined in WRF) + if ( .not. allocated (NoahmpIO%TSK) ) allocate ( NoahmpIO%TSK (XSTART:XEND, YSTART:YEND) ) ! surface radiative temperature [K] + if ( .not. allocated (NoahmpIO%HFX) ) allocate ( NoahmpIO%HFX (XSTART:XEND, YSTART:YEND) ) ! sensible heat flux [W m-2] + if ( .not. allocated (NoahmpIO%QFX) ) allocate ( NoahmpIO%QFX (XSTART:XEND, YSTART:YEND) ) ! latent heat flux [kg s-1 m-2] + if ( .not. allocated (NoahmpIO%LH) ) allocate ( NoahmpIO%LH (XSTART:XEND, YSTART:YEND) ) ! latent heat flux [W m-2] + if ( .not. allocated (NoahmpIO%GRDFLX) ) allocate ( NoahmpIO%GRDFLX (XSTART:XEND, YSTART:YEND) ) ! ground/snow heat flux [W m-2] + if ( .not. allocated (NoahmpIO%SFCRUNOFF)) allocate ( NoahmpIO%SFCRUNOFF (XSTART:XEND, YSTART:YEND) ) ! accumulated surface runoff [m] + if ( .not. allocated (NoahmpIO%UDRUNOFF) ) allocate ( NoahmpIO%UDRUNOFF (XSTART:XEND, YSTART:YEND) ) ! accumulated sub-surface runoff [m] + if ( .not. allocated (NoahmpIO%ALBEDO) ) allocate ( NoahmpIO%ALBEDO (XSTART:XEND, YSTART:YEND) ) ! total grid albedo [] + if ( .not. allocated (NoahmpIO%SNOWC) ) allocate ( NoahmpIO%SNOWC (XSTART:XEND, YSTART:YEND) ) ! snow cover fraction [] + if ( .not. allocated (NoahmpIO%SNOW) ) allocate ( NoahmpIO%SNOW (XSTART:XEND, YSTART:YEND) ) ! snow water equivalent [mm] + if ( .not. allocated (NoahmpIO%SNOWH) ) allocate ( NoahmpIO%SNOWH (XSTART:XEND, YSTART:YEND) ) ! physical snow depth [m] + if ( .not. allocated (NoahmpIO%CANWAT) ) allocate ( NoahmpIO%CANWAT (XSTART:XEND, YSTART:YEND) ) ! total canopy water + ice [mm] + if ( .not. allocated (NoahmpIO%ACSNOM) ) allocate ( NoahmpIO%ACSNOM (XSTART:XEND, YSTART:YEND) ) ! accumulated snow melt leaving pack + if ( .not. allocated (NoahmpIO%ACSNOW) ) allocate ( NoahmpIO%ACSNOW (XSTART:XEND, YSTART:YEND) ) ! accumulated snow on grid + if ( .not. allocated (NoahmpIO%EMISS) ) allocate ( NoahmpIO%EMISS (XSTART:XEND, YSTART:YEND) ) ! surface bulk emissivity + if ( .not. allocated (NoahmpIO%QSFC) ) allocate ( NoahmpIO%QSFC (XSTART:XEND, YSTART:YEND) ) ! bulk surface specific humidity + if ( .not. allocated (NoahmpIO%SMOISEQ) ) allocate ( NoahmpIO%SMOISEQ (XSTART:XEND,1:NSOIL,YSTART:YEND) ) ! equilibrium volumetric soil moisture [m3/m3] + if ( .not. allocated (NoahmpIO%SMOIS) ) allocate ( NoahmpIO%SMOIS (XSTART:XEND,1:NSOIL,YSTART:YEND) ) ! volumetric soil moisture [m3/m3] + if ( .not. allocated (NoahmpIO%SH2O) ) allocate ( NoahmpIO%SH2O (XSTART:XEND,1:NSOIL,YSTART:YEND) ) ! volumetric liquid soil moisture [m3/m3] + if ( .not. allocated (NoahmpIO%TSLB) ) allocate ( NoahmpIO%TSLB (XSTART:XEND,1:NSOIL,YSTART:YEND) ) ! soil temperature [K] + if ( .not. allocated (NoahmpIO%RELSMC) ) allocate ( NoahmpIO%RELSMC (XSTART:XEND,1:NSOIL,YSTART:YEND) ) ! relative soil moisture + + ! INOUT (with no Noah LSM equivalent) (as defined in WRF) + if ( .not. allocated (NoahmpIO%ISNOWXY) ) allocate ( NoahmpIO%ISNOWXY (XSTART:XEND, YSTART:YEND) ) ! actual no. of snow layers + if ( .not. allocated (NoahmpIO%TVXY) ) allocate ( NoahmpIO%TVXY (XSTART:XEND, YSTART:YEND) ) ! vegetation leaf temperature + if ( .not. allocated (NoahmpIO%TGXY) ) allocate ( NoahmpIO%TGXY (XSTART:XEND, YSTART:YEND) ) ! bulk ground surface temperature + if ( .not. allocated (NoahmpIO%CANICEXY) ) allocate ( NoahmpIO%CANICEXY (XSTART:XEND, YSTART:YEND) ) ! canopy-intercepted ice (mm) + if ( .not. allocated (NoahmpIO%CANLIQXY) ) allocate ( NoahmpIO%CANLIQXY (XSTART:XEND, YSTART:YEND) ) ! canopy-intercepted liquid water (mm) + if ( .not. allocated (NoahmpIO%EAHXY) ) allocate ( NoahmpIO%EAHXY (XSTART:XEND, YSTART:YEND) ) ! canopy air vapor pressure (pa) + if ( .not. allocated (NoahmpIO%TAHXY) ) allocate ( NoahmpIO%TAHXY (XSTART:XEND, YSTART:YEND) ) ! canopy air temperature (k) + if ( .not. allocated (NoahmpIO%CMXY) ) allocate ( NoahmpIO%CMXY (XSTART:XEND, YSTART:YEND) ) ! bulk momentum drag coefficient + if ( .not. allocated (NoahmpIO%CHXY) ) allocate ( NoahmpIO%CHXY (XSTART:XEND, YSTART:YEND) ) ! bulk sensible heat exchange coefficient + if ( .not. allocated (NoahmpIO%FWETXY) ) allocate ( NoahmpIO%FWETXY (XSTART:XEND, YSTART:YEND) ) ! wetted or snowed fraction of the canopy (-) + if ( .not. allocated (NoahmpIO%SNEQVOXY) ) allocate ( NoahmpIO%SNEQVOXY (XSTART:XEND, YSTART:YEND) ) ! snow mass at last time step(mm h2o) + if ( .not. allocated (NoahmpIO%ALBOLDXY) ) allocate ( NoahmpIO%ALBOLDXY (XSTART:XEND, YSTART:YEND) ) ! snow albedo at last time step (-) + if ( .not. allocated (NoahmpIO%QSNOWXY) ) allocate ( NoahmpIO%QSNOWXY (XSTART:XEND, YSTART:YEND) ) ! snowfall on the ground [mm/s] + if ( .not. allocated (NoahmpIO%QRAINXY) ) allocate ( NoahmpIO%QRAINXY (XSTART:XEND, YSTART:YEND) ) ! rainfall on the ground [mm/s] + if ( .not. allocated (NoahmpIO%WSLAKEXY) ) allocate ( NoahmpIO%WSLAKEXY (XSTART:XEND, YSTART:YEND) ) ! lake water storage [mm] + if ( .not. allocated (NoahmpIO%ZWTXY) ) allocate ( NoahmpIO%ZWTXY (XSTART:XEND, YSTART:YEND) ) ! water table depth [m] + if ( .not. allocated (NoahmpIO%WAXY) ) allocate ( NoahmpIO%WAXY (XSTART:XEND, YSTART:YEND) ) ! water in the "aquifer" [mm] + if ( .not. allocated (NoahmpIO%WTXY) ) allocate ( NoahmpIO%WTXY (XSTART:XEND, YSTART:YEND) ) ! groundwater storage [mm] + if ( .not. allocated (NoahmpIO%SMCWTDXY) ) allocate ( NoahmpIO%SMCWTDXY (XSTART:XEND, YSTART:YEND) ) ! soil moisture below the bottom of the column (m3m-3) + if ( .not. allocated (NoahmpIO%DEEPRECHXY)) allocate ( NoahmpIO%DEEPRECHXY (XSTART:XEND, YSTART:YEND) ) ! recharge to the water table when deep (m) + if ( .not. allocated (NoahmpIO%RECHXY) ) allocate ( NoahmpIO%RECHXY (XSTART:XEND, YSTART:YEND) ) ! recharge to the water table (diagnostic) (m) + if ( .not. allocated (NoahmpIO%LFMASSXY) ) allocate ( NoahmpIO%LFMASSXY (XSTART:XEND, YSTART:YEND) ) ! leaf mass [g/m2] + if ( .not. allocated (NoahmpIO%RTMASSXY) ) allocate ( NoahmpIO%RTMASSXY (XSTART:XEND, YSTART:YEND) ) ! mass of fine roots [g/m2] + if ( .not. allocated (NoahmpIO%STMASSXY) ) allocate ( NoahmpIO%STMASSXY (XSTART:XEND, YSTART:YEND) ) ! stem mass [g/m2] + if ( .not. allocated (NoahmpIO%WOODXY) ) allocate ( NoahmpIO%WOODXY (XSTART:XEND, YSTART:YEND) ) ! mass of wood (incl. woody roots) [g/m2] + if ( .not. allocated (NoahmpIO%GRAINXY) ) allocate ( NoahmpIO%GRAINXY (XSTART:XEND, YSTART:YEND) ) ! mass of grain XING [g/m2] + if ( .not. allocated (NoahmpIO%GDDXY) ) allocate ( NoahmpIO%GDDXY (XSTART:XEND, YSTART:YEND) ) ! growing degree days XING FOUR + if ( .not. allocated (NoahmpIO%STBLCPXY) ) allocate ( NoahmpIO%STBLCPXY (XSTART:XEND, YSTART:YEND) ) ! stable carbon in deep soil [g/m2] + if ( .not. allocated (NoahmpIO%FASTCPXY) ) allocate ( NoahmpIO%FASTCPXY (XSTART:XEND, YSTART:YEND) ) ! short-lived carbon, shallow soil [g/m2] + if ( .not. allocated (NoahmpIO%LAI) ) allocate ( NoahmpIO%LAI (XSTART:XEND, YSTART:YEND) ) ! leaf area index + if ( .not. allocated (NoahmpIO%XSAIXY) ) allocate ( NoahmpIO%XSAIXY (XSTART:XEND, YSTART:YEND) ) ! stem area index + if ( .not. allocated (NoahmpIO%TAUSSXY) ) allocate ( NoahmpIO%TAUSSXY (XSTART:XEND, YSTART:YEND) ) ! snow age factor + if ( .not. allocated (NoahmpIO%rivsto) ) allocate ( NoahmpIO%rivsto (XSTART:XEND, YSTART:YEND) ) ! river storage [m/s] + if ( .not. allocated (NoahmpIO%fldsto) ) allocate ( NoahmpIO%fldsto (XSTART:XEND, YSTART:YEND) ) ! flood storage [m/s] + if ( .not. allocated (NoahmpIO%fldfrc) ) allocate ( NoahmpIO%fldfrc (XSTART:XEND, YSTART:YEND) ) ! flooded fraction [-] + if ( .not. allocated (NoahmpIO%TSNOXY) ) allocate ( NoahmpIO%TSNOXY (XSTART:XEND,-NSNOW+1:0, YSTART:YEND) ) ! snow temperature [K] + if ( .not. allocated (NoahmpIO%ZSNSOXY) ) allocate ( NoahmpIO%ZSNSOXY (XSTART:XEND,-NSNOW+1:NSOIL,YSTART:YEND) ) ! snow layer depth [m] + if ( .not. allocated (NoahmpIO%SNICEXY) ) allocate ( NoahmpIO%SNICEXY (XSTART:XEND,-NSNOW+1:0, YSTART:YEND) ) ! snow layer ice [mm] + if ( .not. allocated (NoahmpIO%SNLIQXY) ) allocate ( NoahmpIO%SNLIQXY (XSTART:XEND,-NSNOW+1:0, YSTART:YEND) ) ! snow layer liquid water [mm] + + ! irrigation + if ( .not. allocated (NoahmpIO%IRFRACT) ) allocate ( NoahmpIO%IRFRACT (XSTART:XEND,YSTART:YEND) ) ! irrigation fraction + if ( .not. allocated (NoahmpIO%SIFRACT) ) allocate ( NoahmpIO%SIFRACT (XSTART:XEND,YSTART:YEND) ) ! sprinkler irrigation fraction + if ( .not. allocated (NoahmpIO%MIFRACT) ) allocate ( NoahmpIO%MIFRACT (XSTART:XEND,YSTART:YEND) ) ! micro irrigation fraction + if ( .not. allocated (NoahmpIO%FIFRACT) ) allocate ( NoahmpIO%FIFRACT (XSTART:XEND,YSTART:YEND) ) ! flood irrigation fraction + if ( .not. allocated (NoahmpIO%IRNUMSI) ) allocate ( NoahmpIO%IRNUMSI (XSTART:XEND,YSTART:YEND) ) ! irrigation event number, Sprinkler + if ( .not. allocated (NoahmpIO%IRNUMMI) ) allocate ( NoahmpIO%IRNUMMI (XSTART:XEND,YSTART:YEND) ) ! irrigation event number, Micro + if ( .not. allocated (NoahmpIO%IRNUMFI) ) allocate ( NoahmpIO%IRNUMFI (XSTART:XEND,YSTART:YEND) ) ! irrigation event number, Flood + if ( .not. allocated (NoahmpIO%IRWATSI) ) allocate ( NoahmpIO%IRWATSI (XSTART:XEND,YSTART:YEND) ) ! irrigation water amount [m] to be applied, Sprinkler + if ( .not. allocated (NoahmpIO%IRWATMI) ) allocate ( NoahmpIO%IRWATMI (XSTART:XEND,YSTART:YEND) ) ! irrigation water amount [m] to be applied, Micro + if ( .not. allocated (NoahmpIO%IRWATFI) ) allocate ( NoahmpIO%IRWATFI (XSTART:XEND,YSTART:YEND) ) ! irrigation water amount [m] to be applied, Flood + if ( .not. allocated (NoahmpIO%IRELOSS) ) allocate ( NoahmpIO%IRELOSS (XSTART:XEND,YSTART:YEND) ) ! loss of irrigation water to evaporation,sprinkler [mm] + if ( .not. allocated (NoahmpIO%IRSIVOL) ) allocate ( NoahmpIO%IRSIVOL (XSTART:XEND,YSTART:YEND) ) ! amount of irrigation by sprinkler (mm) + if ( .not. allocated (NoahmpIO%IRMIVOL) ) allocate ( NoahmpIO%IRMIVOL (XSTART:XEND,YSTART:YEND) ) ! amount of irrigation by micro (mm) + if ( .not. allocated (NoahmpIO%IRFIVOL) ) allocate ( NoahmpIO%IRFIVOL (XSTART:XEND,YSTART:YEND) ) ! amount of irrigation by micro (mm) + if ( .not. allocated (NoahmpIO%IRRSPLH) ) allocate ( NoahmpIO%IRRSPLH (XSTART:XEND,YSTART:YEND) ) ! latent heating from sprinkler evaporation (w/m2) + if ( .not. allocated (NoahmpIO%LOCTIM) ) allocate ( NoahmpIO%LOCTIM (XSTART:XEND,YSTART:YEND) ) ! local time + + ! OUT (with no Noah LSM equivalent) (as defined in WRF) + if ( .not. allocated (NoahmpIO%T2MVXY) ) allocate ( NoahmpIO%T2MVXY (XSTART:XEND,YSTART:YEND) ) ! 2m temperature of vegetation part + if ( .not. allocated (NoahmpIO%T2MBXY) ) allocate ( NoahmpIO%T2MBXY (XSTART:XEND,YSTART:YEND) ) ! 2m temperature of bare ground part + if ( .not. allocated (NoahmpIO%Q2MVXY) ) allocate ( NoahmpIO%Q2MVXY (XSTART:XEND,YSTART:YEND) ) ! 2m mixing ratio of vegetation part + if ( .not. allocated (NoahmpIO%Q2MBXY) ) allocate ( NoahmpIO%Q2MBXY (XSTART:XEND,YSTART:YEND) ) ! 2m mixing ratio of bare ground part + if ( .not. allocated (NoahmpIO%TRADXY) ) allocate ( NoahmpIO%TRADXY (XSTART:XEND,YSTART:YEND) ) ! surface radiative temperature (k) + if ( .not. allocated (NoahmpIO%NEEXY) ) allocate ( NoahmpIO%NEEXY (XSTART:XEND,YSTART:YEND) ) ! net ecosys exchange (g/m2/s CO2) + if ( .not. allocated (NoahmpIO%GPPXY) ) allocate ( NoahmpIO%GPPXY (XSTART:XEND,YSTART:YEND) ) ! gross primary assimilation [g/m2/s C] + if ( .not. allocated (NoahmpIO%NPPXY) ) allocate ( NoahmpIO%NPPXY (XSTART:XEND,YSTART:YEND) ) ! net primary productivity [g/m2/s C] + if ( .not. allocated (NoahmpIO%FVEGXY) ) allocate ( NoahmpIO%FVEGXY (XSTART:XEND,YSTART:YEND) ) ! Noah-MP vegetation fraction [-] + if ( .not. allocated (NoahmpIO%RUNSFXY) ) allocate ( NoahmpIO%RUNSFXY (XSTART:XEND,YSTART:YEND) ) ! surface runoff [mm per soil timestep] + if ( .not. allocated (NoahmpIO%RUNSBXY) ) allocate ( NoahmpIO%RUNSBXY (XSTART:XEND,YSTART:YEND) ) ! subsurface runoff [mm per soil timestep] + if ( .not. allocated (NoahmpIO%ECANXY) ) allocate ( NoahmpIO%ECANXY (XSTART:XEND,YSTART:YEND) ) ! evaporation of intercepted water (mm/s) + if ( .not. allocated (NoahmpIO%EDIRXY) ) allocate ( NoahmpIO%EDIRXY (XSTART:XEND,YSTART:YEND) ) ! soil surface evaporation rate (mm/s] + if ( .not. allocated (NoahmpIO%ETRANXY) ) allocate ( NoahmpIO%ETRANXY (XSTART:XEND,YSTART:YEND) ) ! transpiration rate (mm/s) + if ( .not. allocated (NoahmpIO%FSAXY) ) allocate ( NoahmpIO%FSAXY (XSTART:XEND,YSTART:YEND) ) ! total absorbed solar radiation (w/m2) + if ( .not. allocated (NoahmpIO%FIRAXY) ) allocate ( NoahmpIO%FIRAXY (XSTART:XEND,YSTART:YEND) ) ! total net longwave rad (w/m2) [+ to atm] + if ( .not. allocated (NoahmpIO%APARXY) ) allocate ( NoahmpIO%APARXY (XSTART:XEND,YSTART:YEND) ) ! photosyn active energy by canopy (w/m2) + if ( .not. allocated (NoahmpIO%PSNXY) ) allocate ( NoahmpIO%PSNXY (XSTART:XEND,YSTART:YEND) ) ! total photosynthesis (umol co2/m2/s) [+] + if ( .not. allocated (NoahmpIO%SAVXY) ) allocate ( NoahmpIO%SAVXY (XSTART:XEND,YSTART:YEND) ) ! solar rad absorbed by veg. (w/m2) + if ( .not. allocated (NoahmpIO%SAGXY) ) allocate ( NoahmpIO%SAGXY (XSTART:XEND,YSTART:YEND) ) ! solar rad absorbed by ground (w/m2) + if ( .not. allocated (NoahmpIO%RSSUNXY) ) allocate ( NoahmpIO%RSSUNXY (XSTART:XEND,YSTART:YEND) ) ! sunlit leaf stomatal resistance (s/m) + if ( .not. allocated (NoahmpIO%RSSHAXY) ) allocate ( NoahmpIO%RSSHAXY (XSTART:XEND,YSTART:YEND) ) ! shaded leaf stomatal resistance (s/m) + if ( .not. allocated (NoahmpIO%BGAPXY) ) allocate ( NoahmpIO%BGAPXY (XSTART:XEND,YSTART:YEND) ) ! between gap fraction + if ( .not. allocated (NoahmpIO%WGAPXY) ) allocate ( NoahmpIO%WGAPXY (XSTART:XEND,YSTART:YEND) ) ! within gap fraction + if ( .not. allocated (NoahmpIO%TGVXY) ) allocate ( NoahmpIO%TGVXY (XSTART:XEND,YSTART:YEND) ) ! under canopy ground temperature[K] + if ( .not. allocated (NoahmpIO%TGBXY) ) allocate ( NoahmpIO%TGBXY (XSTART:XEND,YSTART:YEND) ) ! bare ground temperature [K] + if ( .not. allocated (NoahmpIO%CHVXY) ) allocate ( NoahmpIO%CHVXY (XSTART:XEND,YSTART:YEND) ) ! sensible heat exchange coefficient vegetated + if ( .not. allocated (NoahmpIO%CHBXY) ) allocate ( NoahmpIO%CHBXY (XSTART:XEND,YSTART:YEND) ) ! sensible heat exchange coefficient bare-ground + if ( .not. allocated (NoahmpIO%SHGXY) ) allocate ( NoahmpIO%SHGXY (XSTART:XEND,YSTART:YEND) ) ! veg ground sen. heat [w/m2] [+ to atm] + if ( .not. allocated (NoahmpIO%SHCXY) ) allocate ( NoahmpIO%SHCXY (XSTART:XEND,YSTART:YEND) ) ! canopy sen. heat [w/m2] [+ to atm] + if ( .not. allocated (NoahmpIO%SHBXY) ) allocate ( NoahmpIO%SHBXY (XSTART:XEND,YSTART:YEND) ) ! bare sensible heat [w/m2] [+ to atm] + if ( .not. allocated (NoahmpIO%EVGXY) ) allocate ( NoahmpIO%EVGXY (XSTART:XEND,YSTART:YEND) ) ! veg ground evap. heat [w/m2] [+ to atm] + if ( .not. allocated (NoahmpIO%EVBXY) ) allocate ( NoahmpIO%EVBXY (XSTART:XEND,YSTART:YEND) ) ! bare soil evaporation [w/m2] [+ to atm] + if ( .not. allocated (NoahmpIO%GHVXY) ) allocate ( NoahmpIO%GHVXY (XSTART:XEND,YSTART:YEND) ) ! veg ground heat flux [w/m2] [+ to soil] + if ( .not. allocated (NoahmpIO%GHBXY) ) allocate ( NoahmpIO%GHBXY (XSTART:XEND,YSTART:YEND) ) ! bare ground heat flux [w/m2] [+ to soil] + if ( .not. allocated (NoahmpIO%IRGXY) ) allocate ( NoahmpIO%IRGXY (XSTART:XEND,YSTART:YEND) ) ! veg ground net LW rad. [w/m2] [+ to atm] + if ( .not. allocated (NoahmpIO%IRCXY) ) allocate ( NoahmpIO%IRCXY (XSTART:XEND,YSTART:YEND) ) ! canopy net LW rad. [w/m2] [+ to atm] + if ( .not. allocated (NoahmpIO%IRBXY) ) allocate ( NoahmpIO%IRBXY (XSTART:XEND,YSTART:YEND) ) ! bare net longwave rad. [w/m2] [+ to atm] + if ( .not. allocated (NoahmpIO%TRXY) ) allocate ( NoahmpIO%TRXY (XSTART:XEND,YSTART:YEND) ) ! transpiration [w/m2] [+ to atm] + if ( .not. allocated (NoahmpIO%EVCXY) ) allocate ( NoahmpIO%EVCXY (XSTART:XEND,YSTART:YEND) ) ! canopy evaporation heat [w/m2] [+ to atm] + if ( .not. allocated (NoahmpIO%CHLEAFXY) ) allocate ( NoahmpIO%CHLEAFXY (XSTART:XEND,YSTART:YEND) ) ! leaf exchange coefficient + if ( .not. allocated (NoahmpIO%CHUCXY) ) allocate ( NoahmpIO%CHUCXY (XSTART:XEND,YSTART:YEND) ) ! under canopy exchange coefficient + if ( .not. allocated (NoahmpIO%CHV2XY) ) allocate ( NoahmpIO%CHV2XY (XSTART:XEND,YSTART:YEND) ) ! veg 2m exchange coefficient + if ( .not. allocated (NoahmpIO%CHB2XY) ) allocate ( NoahmpIO%CHB2XY (XSTART:XEND,YSTART:YEND) ) ! bare 2m exchange coefficient + if ( .not. allocated (NoahmpIO%RS) ) allocate ( NoahmpIO%RS (XSTART:XEND,YSTART:YEND) ) ! Total stomatal resistance (s/m) + if ( .not. allocated (NoahmpIO%Z0) ) allocate ( NoahmpIO%Z0 (XSTART:XEND,YSTART:YEND) ) ! roughness length output to WRF + if ( .not. allocated (NoahmpIO%ZNT) ) allocate ( NoahmpIO%ZNT (XSTART:XEND,YSTART:YEND) ) ! roughness length output to WRF + if ( .not. allocated (NoahmpIO%QTDRAIN) ) allocate ( NoahmpIO%QTDRAIN (XSTART:XEND,YSTART:YEND) ) ! tile drainage (mm) + if ( .not. allocated (NoahmpIO%TD_FRACTION)) allocate ( NoahmpIO%TD_FRACTION (XSTART:XEND,YSTART:YEND) ) ! tile drainage fraction + if ( .not. allocated (NoahmpIO%TERRAIN) ) allocate ( NoahmpIO%TERRAIN (XSTART:XEND,YSTART:YEND) ) ! terrain height + if ( .not. allocated (NoahmpIO%GVFMIN) ) allocate ( NoahmpIO%GVFMIN (XSTART:XEND,YSTART:YEND) ) ! annual minimum in vegetation fraction + if ( .not. allocated (NoahmpIO%GVFMAX) ) allocate ( NoahmpIO%GVFMAX (XSTART:XEND,YSTART:YEND) ) ! annual maximum in vegetation fraction + + ! additional output variables + if ( .not. allocated (NoahmpIO%PAHXY) ) allocate ( NoahmpIO%PAHXY (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%PAHGXY) ) allocate ( NoahmpIO%PAHGXY (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%PAHBXY) ) allocate ( NoahmpIO%PAHBXY (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%PAHVXY) ) allocate ( NoahmpIO%PAHVXY (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%QINTSXY) ) allocate ( NoahmpIO%QINTSXY (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%QINTRXY) ) allocate ( NoahmpIO%QINTRXY (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%QDRIPSXY) ) allocate ( NoahmpIO%QDRIPSXY (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%QDRIPRXY) ) allocate ( NoahmpIO%QDRIPRXY (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%QTHROSXY) ) allocate ( NoahmpIO%QTHROSXY (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%QTHRORXY) ) allocate ( NoahmpIO%QTHRORXY (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%QSNSUBXY) ) allocate ( NoahmpIO%QSNSUBXY (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%QSNFROXY) ) allocate ( NoahmpIO%QSNFROXY (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%QSUBCXY) ) allocate ( NoahmpIO%QSUBCXY (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%QFROCXY) ) allocate ( NoahmpIO%QFROCXY (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%QEVACXY) ) allocate ( NoahmpIO%QEVACXY (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%QDEWCXY) ) allocate ( NoahmpIO%QDEWCXY (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%QFRZCXY) ) allocate ( NoahmpIO%QFRZCXY (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%QMELTCXY) ) allocate ( NoahmpIO%QMELTCXY (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%QSNBOTXY) ) allocate ( NoahmpIO%QSNBOTXY (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%QMELTXY) ) allocate ( NoahmpIO%QMELTXY (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%PONDINGXY) ) allocate ( NoahmpIO%PONDINGXY (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%FPICEXY) ) allocate ( NoahmpIO%FPICEXY (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%RAINLSM) ) allocate ( NoahmpIO%RAINLSM (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%SNOWLSM) ) allocate ( NoahmpIO%SNOWLSM (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%FORCTLSM) ) allocate ( NoahmpIO%FORCTLSM (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%FORCQLSM) ) allocate ( NoahmpIO%FORCQLSM (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%FORCPLSM) ) allocate ( NoahmpIO%FORCPLSM (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%FORCZLSM) ) allocate ( NoahmpIO%FORCZLSM (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%FORCWLSM) ) allocate ( NoahmpIO%FORCWLSM (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%EFLXBXY) ) allocate ( NoahmpIO%EFLXBXY (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%SOILENERGY) ) allocate ( NoahmpIO%SOILENERGY (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%SNOWENERGY) ) allocate ( NoahmpIO%SNOWENERGY (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%CANHSXY) ) allocate ( NoahmpIO%CANHSXY (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%ACC_DWATERXY)) allocate ( NoahmpIO%ACC_DWATERXY (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%ACC_PRCPXY) ) allocate ( NoahmpIO%ACC_PRCPXY (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%ACC_ECANXY) ) allocate ( NoahmpIO%ACC_ECANXY (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%ACC_ETRANXY) ) allocate ( NoahmpIO%ACC_ETRANXY (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%ACC_EDIRXY) ) allocate ( NoahmpIO%ACC_EDIRXY (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%ACC_SSOILXY) ) allocate ( NoahmpIO%ACC_SSOILXY (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%ACC_QINSURXY)) allocate ( NoahmpIO%ACC_QINSURXY (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%ACC_QSEVAXY) ) allocate ( NoahmpIO%ACC_QSEVAXY (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%ACC_ETRANIXY)) allocate ( NoahmpIO%ACC_ETRANIXY (XSTART:XEND,1:NSOIL,YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%FGEV_PET) ) allocate ( NoahmpIO%FGEV_PET (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%FCEV_PET) ) allocate ( NoahmpIO%FCEV_PET (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%FCTR_PET) ) allocate ( NoahmpIO%FCTR_PET (XSTART:XEND, YSTART:YEND) ) + + ! Needed for MMF_RUNOFF (IOPT_RUN = 5); not part of MP driver in WRF + if ( .not. allocated (NoahmpIO%MSFTX) ) allocate ( NoahmpIO%MSFTX (XSTART:XEND,YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%MSFTY) ) allocate ( NoahmpIO%MSFTY (XSTART:XEND,YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%EQZWT) ) allocate ( NoahmpIO%EQZWT (XSTART:XEND,YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%RIVERBEDXY) ) allocate ( NoahmpIO%RIVERBEDXY (XSTART:XEND,YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%RIVERCONDXY)) allocate ( NoahmpIO%RIVERCONDXY (XSTART:XEND,YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%PEXPXY) ) allocate ( NoahmpIO%PEXPXY (XSTART:XEND,YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%FDEPTHXY) ) allocate ( NoahmpIO%FDEPTHXY (XSTART:XEND,YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%AREAXY) ) allocate ( NoahmpIO%AREAXY (XSTART:XEND,YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%QRFSXY) ) allocate ( NoahmpIO%QRFSXY (XSTART:XEND,YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%QSPRINGSXY) ) allocate ( NoahmpIO%QSPRINGSXY (XSTART:XEND,YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%QRFXY) ) allocate ( NoahmpIO%QRFXY (XSTART:XEND,YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%QSPRINGXY) ) allocate ( NoahmpIO%QSPRINGXY (XSTART:XEND,YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%QSLATXY) ) allocate ( NoahmpIO%QSLATXY (XSTART:XEND,YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%QLATXY) ) allocate ( NoahmpIO%QLATXY (XSTART:XEND,YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%RECHCLIM) ) allocate ( NoahmpIO%RECHCLIM (XSTART:XEND,YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%RIVERMASK) ) allocate ( NoahmpIO%RIVERMASK (XSTART:XEND,YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%NONRIVERXY) ) allocate ( NoahmpIO%NONRIVERXY (XSTART:XEND,YSTART:YEND) ) + + ! Needed for crop model (OPT_CROP=1) + if ( .not. allocated (NoahmpIO%PGSXY) ) allocate ( NoahmpIO%PGSXY (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%CROPCAT) ) allocate ( NoahmpIO%CROPCAT (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%PLANTING) ) allocate ( NoahmpIO%PLANTING (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%HARVEST) ) allocate ( NoahmpIO%HARVEST (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%SEASON_GDD)) allocate ( NoahmpIO%SEASON_GDD (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%CROPTYPE) ) allocate ( NoahmpIO%CROPTYPE (XSTART:XEND,5,YSTART:YEND) ) + + ! Single- and Multi-layer Urban Models + if ( NoahmpIO%SF_URBAN_PHYSICS > 0 ) then + if ( .not. allocated (NoahmpIO%sh_urb2d) ) allocate ( NoahmpIO%sh_urb2d (XSTART:XEND,YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%lh_urb2d) ) allocate ( NoahmpIO%lh_urb2d (XSTART:XEND,YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%g_urb2d) ) allocate ( NoahmpIO%g_urb2d (XSTART:XEND,YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%rn_urb2d) ) allocate ( NoahmpIO%rn_urb2d (XSTART:XEND,YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%ts_urb2d) ) allocate ( NoahmpIO%ts_urb2d (XSTART:XEND,YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%HRANG) ) allocate ( NoahmpIO%HRANG (XSTART:XEND,YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%frc_urb2d) ) allocate ( NoahmpIO%frc_urb2d (XSTART:XEND,YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%utype_urb2d)) allocate ( NoahmpIO%utype_urb2d (XSTART:XEND,YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%lp_urb2d) ) allocate ( NoahmpIO%lp_urb2d (XSTART:XEND,YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%lb_urb2d) ) allocate ( NoahmpIO%lb_urb2d (XSTART:XEND,YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%hgt_urb2d) ) allocate ( NoahmpIO%hgt_urb2d (XSTART:XEND,YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%ust) ) allocate ( NoahmpIO%ust (XSTART:XEND,YSTART:YEND) ) + !ENDIF + + !IF(NoahmpIO%SF_URBAN_PHYSICS == 1 ) THEN ! single layer urban model + if ( .not. allocated (NoahmpIO%cmr_sfcdif) ) allocate ( NoahmpIO%cmr_sfcdif (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%chr_sfcdif) ) allocate ( NoahmpIO%chr_sfcdif (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%cmc_sfcdif) ) allocate ( NoahmpIO%cmc_sfcdif (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%chc_sfcdif) ) allocate ( NoahmpIO%chc_sfcdif (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%cmgr_sfcdif) ) allocate ( NoahmpIO%cmgr_sfcdif (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%chgr_sfcdif) ) allocate ( NoahmpIO%chgr_sfcdif (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%tr_urb2d) ) allocate ( NoahmpIO%tr_urb2d (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%tb_urb2d) ) allocate ( NoahmpIO%tb_urb2d (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%tg_urb2d) ) allocate ( NoahmpIO%tg_urb2d (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%tc_urb2d) ) allocate ( NoahmpIO%tc_urb2d (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%qc_urb2d) ) allocate ( NoahmpIO%qc_urb2d (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%uc_urb2d) ) allocate ( NoahmpIO%uc_urb2d (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%xxxr_urb2d) ) allocate ( NoahmpIO%xxxr_urb2d (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%xxxb_urb2d) ) allocate ( NoahmpIO%xxxb_urb2d (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%xxxg_urb2d) ) allocate ( NoahmpIO%xxxg_urb2d (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%xxxc_urb2d) ) allocate ( NoahmpIO%xxxc_urb2d (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%psim_urb2d) ) allocate ( NoahmpIO%psim_urb2d (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%psih_urb2d) ) allocate ( NoahmpIO%psih_urb2d (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%u10_urb2d) ) allocate ( NoahmpIO%u10_urb2d (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%v10_urb2d) ) allocate ( NoahmpIO%v10_urb2d (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%GZ1OZ0_urb2d) ) allocate ( NoahmpIO%GZ1OZ0_urb2d (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%AKMS_URB2D) ) allocate ( NoahmpIO%AKMS_URB2D (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%th2_urb2d) ) allocate ( NoahmpIO%th2_urb2d (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%q2_urb2d) ) allocate ( NoahmpIO%q2_urb2d (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%ust_urb2d) ) allocate ( NoahmpIO%ust_urb2d (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%cmcr_urb2d) ) allocate ( NoahmpIO%cmcr_urb2d (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%tgr_urb2d) ) allocate ( NoahmpIO%tgr_urb2d (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%drelr_urb2d) ) allocate ( NoahmpIO%drelr_urb2d (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%drelb_urb2d) ) allocate ( NoahmpIO%drelb_urb2d (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%drelg_urb2d) ) allocate ( NoahmpIO%drelg_urb2d (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%flxhumr_urb2d)) allocate ( NoahmpIO%flxhumr_urb2d (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%flxhumb_urb2d)) allocate ( NoahmpIO%flxhumb_urb2d (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%flxhumg_urb2d)) allocate ( NoahmpIO%flxhumg_urb2d (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%chs) ) allocate ( NoahmpIO%chs (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%chs2) ) allocate ( NoahmpIO%chs2 (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%cqs2) ) allocate ( NoahmpIO%cqs2 (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%mh_urb2d) ) allocate ( NoahmpIO%mh_urb2d (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%stdh_urb2d) ) allocate ( NoahmpIO%stdh_urb2d (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%lf_urb2d) ) allocate ( NoahmpIO%lf_urb2d (XSTART:XEND,4, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%trl_urb3d) ) allocate ( NoahmpIO%trl_urb3d (XSTART:XEND,1:NSOIL,YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%tbl_urb3d) ) allocate ( NoahmpIO%tbl_urb3d (XSTART:XEND,1:NSOIL,YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%tgl_urb3d) ) allocate ( NoahmpIO%tgl_urb3d (XSTART:XEND,1:NSOIL,YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%tgrl_urb3d) ) allocate ( NoahmpIO%tgrl_urb3d (XSTART:XEND,1:NSOIL,YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%smr_urb3d) ) allocate ( NoahmpIO%smr_urb3d (XSTART:XEND,1:NSOIL,YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%dzr) ) allocate ( NoahmpIO%dzr ( 1:NSOIL ) ) + if ( .not. allocated (NoahmpIO%dzb) ) allocate ( NoahmpIO%dzb ( 1:NSOIL ) ) + if ( .not. allocated (NoahmpIO%dzg) ) allocate ( NoahmpIO%dzg ( 1:NSOIL ) ) + !ENDIF + + !IF(SF_URBAN_PHYSICS == 2 .or. SF_URBAN_PHYSICS == 3) THEN ! BEP or BEM urban models + if ( .not. allocated (NoahmpIO%trb_urb4d) ) allocate ( NoahmpIO%trb_urb4d (XSTART:XEND,NoahmpIO%urban_map_zrd,YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%tw1_urb4d) ) allocate ( NoahmpIO%tw1_urb4d (XSTART:XEND,NoahmpIO%urban_map_zwd,YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%tw2_urb4d) ) allocate ( NoahmpIO%tw2_urb4d (XSTART:XEND,NoahmpIO%urban_map_zwd,YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%tgb_urb4d) ) allocate ( NoahmpIO%tgb_urb4d (XSTART:XEND,NoahmpIO%urban_map_gd, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%sfw1_urb3d) ) allocate ( NoahmpIO%sfw1_urb3d (XSTART:XEND,NoahmpIO%urban_map_zd, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%sfw2_urb3d) ) allocate ( NoahmpIO%sfw2_urb3d (XSTART:XEND,NoahmpIO%urban_map_zd, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%sfr_urb3d) ) allocate ( NoahmpIO%sfr_urb3d (XSTART:XEND,NoahmpIO%urban_map_zdf,YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%sfg_urb3d) ) allocate ( NoahmpIO%sfg_urb3d (XSTART:XEND,NoahmpIO%num_urban_ndm,YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%hi_urb2d) ) allocate ( NoahmpIO%hi_urb2d (XSTART:XEND,NoahmpIO%num_urban_hi, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%theta_urban)) allocate ( NoahmpIO%theta_urban (XSTART:XEND,KDS:KDE, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%u_urban) ) allocate ( NoahmpIO%u_urban (XSTART:XEND,KDS:KDE, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%v_urban) ) allocate ( NoahmpIO%v_urban (XSTART:XEND,KDS:KDE, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%dz_urban) ) allocate ( NoahmpIO%dz_urban (XSTART:XEND,KDS:KDE, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%rho_urban) ) allocate ( NoahmpIO%rho_urban (XSTART:XEND,KDS:KDE, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%p_urban) ) allocate ( NoahmpIO%p_urban (XSTART:XEND,KDS:KDE, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%a_u_bep) ) allocate ( NoahmpIO%a_u_bep (XSTART:XEND,KDS:KDE, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%a_v_bep) ) allocate ( NoahmpIO%a_v_bep (XSTART:XEND,KDS:KDE, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%a_t_bep) ) allocate ( NoahmpIO%a_t_bep (XSTART:XEND,KDS:KDE, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%a_q_bep) ) allocate ( NoahmpIO%a_q_bep (XSTART:XEND,KDS:KDE, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%a_e_bep) ) allocate ( NoahmpIO%a_e_bep (XSTART:XEND,KDS:KDE, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%b_u_bep) ) allocate ( NoahmpIO%b_u_bep (XSTART:XEND,KDS:KDE, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%b_v_bep) ) allocate ( NoahmpIO%b_v_bep (XSTART:XEND,KDS:KDE, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%b_t_bep) ) allocate ( NoahmpIO%b_t_bep (XSTART:XEND,KDS:KDE, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%b_q_bep) ) allocate ( NoahmpIO%b_q_bep (XSTART:XEND,KDS:KDE, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%b_e_bep) ) allocate ( NoahmpIO%b_e_bep (XSTART:XEND,KDS:KDE, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%dlg_bep) ) allocate ( NoahmpIO%dlg_bep (XSTART:XEND,KDS:KDE, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%dl_u_bep) ) allocate ( NoahmpIO%dl_u_bep (XSTART:XEND,KDS:KDE, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%sf_bep) ) allocate ( NoahmpIO%sf_bep (XSTART:XEND,KDS:KDE, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%vl_bep) ) allocate ( NoahmpIO%vl_bep (XSTART:XEND,KDS:KDE, YSTART:YEND) ) + !ENDIF + + !IF(SF_URBAN_PHYSICS == 3) THEN ! BEM urban model + if ( .not. allocated (NoahmpIO%tlev_urb3d) ) allocate ( NoahmpIO%tlev_urb3d (XSTART:XEND,NoahmpIO%urban_map_bd, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%qlev_urb3d) ) allocate ( NoahmpIO%qlev_urb3d (XSTART:XEND,NoahmpIO%urban_map_bd, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%tw1lev_urb3d) ) allocate ( NoahmpIO%tw1lev_urb3d (XSTART:XEND,NoahmpIO%urban_map_wd, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%tw2lev_urb3d) ) allocate ( NoahmpIO%tw2lev_urb3d (XSTART:XEND,NoahmpIO%urban_map_wd, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%tglev_urb3d) ) allocate ( NoahmpIO%tglev_urb3d (XSTART:XEND,NoahmpIO%urban_map_gbd, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%tflev_urb3d) ) allocate ( NoahmpIO%tflev_urb3d (XSTART:XEND,NoahmpIO%urban_map_fbd, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%sf_ac_urb3d) ) allocate ( NoahmpIO%sf_ac_urb3d (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%lf_ac_urb3d) ) allocate ( NoahmpIO%lf_ac_urb3d (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%cm_ac_urb3d) ) allocate ( NoahmpIO%cm_ac_urb3d (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%sfvent_urb3d) ) allocate ( NoahmpIO%sfvent_urb3d (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%lfvent_urb3d) ) allocate ( NoahmpIO%lfvent_urb3d (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%sfwin1_urb3d) ) allocate ( NoahmpIO%sfwin1_urb3d (XSTART:XEND,NoahmpIO%urban_map_wd, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%sfwin2_urb3d) ) allocate ( NoahmpIO%sfwin2_urb3d (XSTART:XEND,NoahmpIO%urban_map_wd, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%ep_pv_urb3d) ) allocate ( NoahmpIO%ep_pv_urb3d (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%t_pv_urb3d) ) allocate ( NoahmpIO%t_pv_urb3d (XSTART:XEND,NoahmpIO%urban_map_zdf, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%trv_urb4d) ) allocate ( NoahmpIO%trv_urb4d (XSTART:XEND,NoahmpIO%urban_map_zgrd,YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%qr_urb4d) ) allocate ( NoahmpIO%qr_urb4d (XSTART:XEND,NoahmpIO%urban_map_zgrd,YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%qgr_urb3d) ) allocate ( NoahmpIO%qgr_urb3d (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%tgr_urb3d) ) allocate ( NoahmpIO%tgr_urb3d (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%drain_urb4d) ) allocate ( NoahmpIO%drain_urb4d (XSTART:XEND,NoahmpIO%urban_map_zdf, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%draingr_urb3d)) allocate ( NoahmpIO%draingr_urb3d (XSTART:XEND, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%sfrv_urb3d) ) allocate ( NoahmpIO%sfrv_urb3d (XSTART:XEND,NoahmpIO%urban_map_zdf, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%lfrv_urb3d) ) allocate ( NoahmpIO%lfrv_urb3d (XSTART:XEND,NoahmpIO%urban_map_zdf, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%dgr_urb3d) ) allocate ( NoahmpIO%dgr_urb3d (XSTART:XEND,NoahmpIO%urban_map_zdf, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%dg_urb3d) ) allocate ( NoahmpIO%dg_urb3d (XSTART:XEND,NoahmpIO%num_urban_ndm, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%lfr_urb3d) ) allocate ( NoahmpIO%lfr_urb3d (XSTART:XEND,NoahmpIO%urban_map_zdf, YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%lfg_urb3d) ) allocate ( NoahmpIO%lfg_urb3d (XSTART:XEND,NoahmpIO%num_urban_ndm, YSTART:YEND) ) + + endif + + if ( .not. allocated (NoahmpIO%infxsrt) ) allocate ( NoahmpIO%infxsrt (XSTART:XEND,YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%sfcheadrt) ) allocate ( NoahmpIO%sfcheadrt (XSTART:XEND,YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%soldrain) ) allocate ( NoahmpIO%soldrain (XSTART:XEND,YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%qtiledrain)) allocate ( NoahmpIO%qtiledrain (XSTART:XEND,YSTART:YEND) ) + if ( .not. allocated (NoahmpIO%ZWATBLE2D) ) allocate ( NoahmpIO%ZWATBLE2D (XSTART:XEND,YSTART:YEND) ) + + !------------------------------------------------------------------- + ! Initialize variables with default values + !------------------------------------------------------------------- + + NoahmpIO%ICE = undefined_int + NoahmpIO%IVGTYP = undefined_int + NoahmpIO%ISLTYP = undefined_int + NoahmpIO%ISNOWXY = undefined_int + NoahmpIO%COSZEN = undefined_real + NoahmpIO%XLAT = undefined_real + NoahmpIO%XLON = undefined_real + NoahmpIO%DZ8W = undefined_real + NoahmpIO%DZS = undefined_real + NoahmpIO%ZSOIL = undefined_real + NoahmpIO%VEGFRA = undefined_real + NoahmpIO%TMN = undefined_real + NoahmpIO%XLAND = undefined_real + NoahmpIO%XICE = undefined_real + NoahmpIO%T_PHY = undefined_real + NoahmpIO%QV_CURR = undefined_real + NoahmpIO%U_PHY = undefined_real + NoahmpIO%V_PHY = undefined_real + NoahmpIO%SWDOWN = undefined_real + NoahmpIO%SWDDIR = undefined_real + NoahmpIO%SWDDIF = undefined_real + NoahmpIO%GLW = undefined_real + NoahmpIO%P8W = undefined_real + NoahmpIO%RAINBL = undefined_real + NoahmpIO%SNOWBL = undefined_real + NoahmpIO%SR = undefined_real + NoahmpIO%RAINCV = undefined_real + NoahmpIO%RAINNCV = undefined_real + NoahmpIO%RAINSHV = undefined_real + NoahmpIO%SNOWNCV = undefined_real + NoahmpIO%GRAUPELNCV = undefined_real + NoahmpIO%HAILNCV = undefined_real + NoahmpIO%QSFC = undefined_real + NoahmpIO%TSK = undefined_real + NoahmpIO%QFX = undefined_real + NoahmpIO%SMOIS = undefined_real + NoahmpIO%SH2O = undefined_real + NoahmpIO%TSLB = undefined_real + NoahmpIO%SNOW = undefined_real + NoahmpIO%SNOWH = undefined_real + NoahmpIO%CANWAT = undefined_real + NoahmpIO%SMOISEQ = undefined_real + NoahmpIO%ALBEDO = undefined_real + NoahmpIO%TVXY = undefined_real + NoahmpIO%TGXY = undefined_real + NoahmpIO%CANICEXY = undefined_real + NoahmpIO%CANLIQXY = undefined_real + NoahmpIO%EAHXY = undefined_real + NoahmpIO%TAHXY = undefined_real + NoahmpIO%CMXY = undefined_real + NoahmpIO%CHXY = undefined_real + NoahmpIO%FWETXY = undefined_real + NoahmpIO%SNEQVOXY = undefined_real + NoahmpIO%ALBOLDXY = undefined_real + NoahmpIO%QSNOWXY = undefined_real + NoahmpIO%QRAINXY = undefined_real + NoahmpIO%WSLAKEXY = undefined_real + NoahmpIO%ZWTXY = undefined_real + NoahmpIO%WAXY = undefined_real + NoahmpIO%WTXY = undefined_real + NoahmpIO%TSNOXY = undefined_real + NoahmpIO%SNICEXY = undefined_real + NoahmpIO%SNLIQXY = undefined_real + NoahmpIO%LFMASSXY = undefined_real + NoahmpIO%RTMASSXY = undefined_real + NoahmpIO%STMASSXY = undefined_real + NoahmpIO%WOODXY = undefined_real + NoahmpIO%STBLCPXY = undefined_real + NoahmpIO%FASTCPXY = undefined_real + NoahmpIO%LAI = undefined_real + NoahmpIO%XSAIXY = undefined_real + NoahmpIO%SEAICE = undefined_real + NoahmpIO%SMCWTDXY = undefined_real + NoahmpIO%ZSNSOXY = undefined_real + NoahmpIO%GRDFLX = undefined_real + NoahmpIO%HFX = undefined_real + NoahmpIO%LH = undefined_real + NoahmpIO%EMISS = undefined_real + NoahmpIO%SNOWC = undefined_real + NoahmpIO%T2MVXY = undefined_real + NoahmpIO%T2MBXY = undefined_real + NoahmpIO%Q2MVXY = undefined_real + NoahmpIO%Q2MBXY = undefined_real + NoahmpIO%TRADXY = undefined_real + NoahmpIO%NEEXY = undefined_real + NoahmpIO%GPPXY = undefined_real + NoahmpIO%NPPXY = undefined_real + NoahmpIO%FVEGXY = undefined_real + NoahmpIO%RUNSFXY = undefined_real + NoahmpIO%RUNSBXY = undefined_real + NoahmpIO%ECANXY = undefined_real + NoahmpIO%EDIRXY = undefined_real + NoahmpIO%ETRANXY = undefined_real + NoahmpIO%FSAXY = undefined_real + NoahmpIO%FIRAXY = undefined_real + NoahmpIO%APARXY = undefined_real + NoahmpIO%PSNXY = undefined_real + NoahmpIO%SAVXY = undefined_real + NoahmpIO%SAGXY = undefined_real + NoahmpIO%RSSUNXY = undefined_real + NoahmpIO%RSSHAXY = undefined_real + NoahmpIO%BGAPXY = undefined_real + NoahmpIO%WGAPXY = undefined_real + NoahmpIO%TGVXY = undefined_real + NoahmpIO%TGBXY = undefined_real + NoahmpIO%CHVXY = undefined_real + NoahmpIO%CHBXY = undefined_real + NoahmpIO%SHGXY = undefined_real + NoahmpIO%SHCXY = undefined_real + NoahmpIO%SHBXY = undefined_real + NoahmpIO%EVGXY = undefined_real + NoahmpIO%EVBXY = undefined_real + NoahmpIO%GHVXY = undefined_real + NoahmpIO%GHBXY = undefined_real + NoahmpIO%IRGXY = undefined_real + NoahmpIO%IRCXY = undefined_real + NoahmpIO%IRBXY = undefined_real + NoahmpIO%TRXY = undefined_real + NoahmpIO%EVCXY = undefined_real + NoahmpIO%CHLEAFXY = undefined_real + NoahmpIO%CHUCXY = undefined_real + NoahmpIO%CHV2XY = undefined_real + NoahmpIO%CHB2XY = undefined_real + NoahmpIO%RS = undefined_real + NoahmpIO%CANHSXY = undefined_real + NoahmpIO%Z0 = undefined_real + NoahmpIO%ZNT = undefined_real + NoahmpIO%rivsto = undefined_real + NoahmpIO%fldsto = undefined_real + NoahmpIO%fldfrc = undefined_real + NoahmpIO%TAUSSXY = 0.0 + NoahmpIO%DEEPRECHXY = 0.0 + NoahmpIO%RECHXY = 0.0 + NoahmpIO%ACSNOM = 0.0 + NoahmpIO%ACSNOW = 0.0 + NoahmpIO%MP_RAINC = 0.0 + NoahmpIO%MP_RAINNC = 0.0 + NoahmpIO%MP_SHCV = 0.0 + NoahmpIO%MP_SNOW = 0.0 + NoahmpIO%MP_GRAUP = 0.0 + NoahmpIO%MP_HAIL = 0.0 + NoahmpIO%SFCRUNOFF = 0.0 + NoahmpIO%UDRUNOFF = 0.0 + + ! additional output + NoahmpIO%PAHXY = undefined_real + NoahmpIO%PAHGXY = undefined_real + NoahmpIO%PAHBXY = undefined_real + NoahmpIO%PAHVXY = undefined_real + NoahmpIO%QINTSXY = undefined_real + NoahmpIO%QINTRXY = undefined_real + NoahmpIO%QDRIPSXY = undefined_real + NoahmpIO%QDRIPRXY = undefined_real + NoahmpIO%QTHROSXY = undefined_real + NoahmpIO%QTHRORXY = undefined_real + NoahmpIO%QSNSUBXY = undefined_real + NoahmpIO%QSNFROXY = undefined_real + NoahmpIO%QSUBCXY = undefined_real + NoahmpIO%QFROCXY = undefined_real + NoahmpIO%QEVACXY = undefined_real + NoahmpIO%QDEWCXY = undefined_real + NoahmpIO%QFRZCXY = undefined_real + NoahmpIO%QMELTCXY = undefined_real + NoahmpIO%QSNBOTXY = undefined_real + NoahmpIO%QMELTXY = undefined_real + NoahmpIO%FPICEXY = undefined_real + NoahmpIO%RAINLSM = undefined_real + NoahmpIO%SNOWLSM = undefined_real + NoahmpIO%FORCTLSM = undefined_real + NoahmpIO%FORCQLSM = undefined_real + NoahmpIO%FORCPLSM = undefined_real + NoahmpIO%FORCZLSM = undefined_real + NoahmpIO%FORCWLSM = undefined_real + NoahmpIO%EFLXBXY = undefined_real + NoahmpIO%SOILENERGY = undefined_real + NoahmpIO%SNOWENERGY = undefined_real + NoahmpIO%PONDINGXY = 0.0 + NoahmpIO%ACC_SSOILXY = 0.0 + NoahmpIO%ACC_QINSURXY = 0.0 + NoahmpIO%ACC_QSEVAXY = 0.0 + NoahmpIO%ACC_ETRANIXY = 0.0 + NoahmpIO%ACC_DWATERXY = 0.0 + NoahmpIO%ACC_PRCPXY = 0.0 + NoahmpIO%ACC_ECANXY = 0.0 + NoahmpIO%ACC_ETRANXY = 0.0 + NoahmpIO%ACC_EDIRXY = 0.0 + NoahmpIO%FGEV_PET = undefined_real + NoahmpIO%FCEV_PET = undefined_real + NoahmpIO%FCTR_PET = undefined_real + + ! MMF Groundwater + NoahmpIO%TERRAIN = undefined_real + NoahmpIO%GVFMIN = undefined_real + NoahmpIO%GVFMAX = undefined_real + NoahmpIO%MSFTX = undefined_real + NoahmpIO%MSFTY = undefined_real + NoahmpIO%EQZWT = undefined_real + NoahmpIO%RIVERBEDXY = undefined_real + NoahmpIO%RIVERCONDXY = undefined_real + NoahmpIO%PEXPXY = undefined_real + NoahmpIO%FDEPTHXY = undefined_real + NoahmpIO%AREAXY = undefined_real + NoahmpIO%QRFSXY = undefined_real + NoahmpIO%QSPRINGSXY = undefined_real + NoahmpIO%QRFXY = undefined_real + NoahmpIO%QSPRINGXY = undefined_real + NoahmpIO%QSLATXY = undefined_real + NoahmpIO%QLATXY = undefined_real + + ! crop model + NoahmpIO%PGSXY = undefined_int + NoahmpIO%CROPCAT = undefined_int + NoahmpIO%PLANTING = undefined_real + NoahmpIO%HARVEST = undefined_real + NoahmpIO%SEASON_GDD = undefined_real + NoahmpIO%CROPTYPE = undefined_real + + ! tile drainage + NoahmpIO%QTDRAIN = 0.0 + NoahmpIO%TD_FRACTION = undefined_real + + ! irrigation + NoahmpIO%IRFRACT = 0.0 + NoahmpIO%SIFRACT = 0.0 + NoahmpIO%MIFRACT = 0.0 + NoahmpIO%FIFRACT = 0.0 + NoahmpIO%IRNUMSI = 0 + NoahmpIO%IRNUMMI = 0 + NoahmpIO%IRNUMFI = 0 + NoahmpIO%IRWATSI = 0.0 + NoahmpIO%IRWATMI = 0.0 + NoahmpIO%IRWATFI = 0.0 + NoahmpIO%IRELOSS = 0.0 + NoahmpIO%IRSIVOL = 0.0 + NoahmpIO%IRMIVOL = 0.0 + NoahmpIO%IRFIVOL = 0.0 + NoahmpIO%IRRSPLH = 0.0 + NoahmpIO%LOCTIM = undefined_real + + ! spatial varying soil texture + if ( NoahmpIO%IOPT_SOIL > 1 ) then + NoahmpIO%SOILCL1 = undefined_real + NoahmpIO%SOILCL2 = undefined_real + NoahmpIO%SOILCL3 = undefined_real + NoahmpIO%SOILCL4 = undefined_real + NoahmpIO%SOILCOMP = undefined_real + endif + + ! urban model + if ( NoahmpIO%SF_URBAN_PHYSICS > 0 ) then + NoahmpIO%JULDAY = undefined_int_neg + NoahmpIO%IRI_URBAN = undefined_int_neg + NoahmpIO%utype_urb2d = undefined_int_neg + NoahmpIO%HRANG = undefined_real_neg + NoahmpIO%DECLIN = undefined_real_neg + NoahmpIO%sh_urb2d = undefined_real_neg + NoahmpIO%lh_urb2d = undefined_real_neg + NoahmpIO%g_urb2d = undefined_real_neg + NoahmpIO%rn_urb2d = undefined_real_neg + NoahmpIO%ts_urb2d = undefined_real_neg + NoahmpIO%GMT = undefined_real_neg + NoahmpIO%frc_urb2d = undefined_real_neg + NoahmpIO%lp_urb2d = undefined_real_neg + NoahmpIO%lb_urb2d = undefined_real_neg + NoahmpIO%hgt_urb2d = undefined_real_neg + NoahmpIO%ust = undefined_real_neg + NoahmpIO%cmr_sfcdif = 1.0e-4 + NoahmpIO%chr_sfcdif = 1.0e-4 + NoahmpIO%cmc_sfcdif = 1.0e-4 + NoahmpIO%chc_sfcdif = 1.0e-4 + NoahmpIO%cmgr_sfcdif = 1.0e-4 + NoahmpIO%chgr_sfcdif = 1.0e-4 + NoahmpIO%tr_urb2d = undefined_real_neg + NoahmpIO%tb_urb2d = undefined_real_neg + NoahmpIO%tg_urb2d = undefined_real_neg + NoahmpIO%tc_urb2d = undefined_real_neg + NoahmpIO%qc_urb2d = undefined_real_neg + NoahmpIO%uc_urb2d = undefined_real_neg + NoahmpIO%xxxr_urb2d = undefined_real_neg + NoahmpIO%xxxb_urb2d = undefined_real_neg + NoahmpIO%xxxg_urb2d = undefined_real_neg + NoahmpIO%xxxc_urb2d = undefined_real_neg + NoahmpIO%trl_urb3d = undefined_real_neg + NoahmpIO%tbl_urb3d = undefined_real_neg + NoahmpIO%tgl_urb3d = undefined_real_neg + NoahmpIO%psim_urb2d = undefined_real_neg + NoahmpIO%psih_urb2d = undefined_real_neg + NoahmpIO%u10_urb2d = undefined_real_neg + NoahmpIO%v10_urb2d = undefined_real_neg + NoahmpIO%GZ1OZ0_urb2d = undefined_real_neg + NoahmpIO%AKMS_URB2D = undefined_real_neg + NoahmpIO%th2_urb2d = undefined_real_neg + NoahmpIO%q2_urb2d = undefined_real_neg + NoahmpIO%ust_urb2d = undefined_real_neg + NoahmpIO%dzr = undefined_real_neg + NoahmpIO%dzb = undefined_real_neg + NoahmpIO%dzg = undefined_real_neg + NoahmpIO%cmcr_urb2d = undefined_real_neg + NoahmpIO%tgr_urb2d = undefined_real_neg + NoahmpIO%tgrl_urb3d = undefined_real_neg + NoahmpIO%smr_urb3d = undefined_real_neg + NoahmpIO%drelr_urb2d = undefined_real_neg + NoahmpIO%drelb_urb2d = undefined_real_neg + NoahmpIO%drelg_urb2d = undefined_real_neg + NoahmpIO%flxhumr_urb2d = undefined_real_neg + NoahmpIO%flxhumb_urb2d = undefined_real_neg + NoahmpIO%flxhumg_urb2d = undefined_real_neg + NoahmpIO%chs = 1.0e-4 + NoahmpIO%chs2 = 1.0e-4 + NoahmpIO%cqs2 = 1.0e-4 + NoahmpIO%mh_urb2d = undefined_real_neg + NoahmpIO%stdh_urb2d = undefined_real_neg + NoahmpIO%lf_urb2d = undefined_real_neg + NoahmpIO%trb_urb4d = undefined_real_neg + NoahmpIO%tw1_urb4d = undefined_real_neg + NoahmpIO%tw2_urb4d = undefined_real_neg + NoahmpIO%tgb_urb4d = undefined_real_neg + NoahmpIO%sfw1_urb3d = undefined_real_neg + NoahmpIO%sfw2_urb3d = undefined_real_neg + NoahmpIO%sfr_urb3d = undefined_real_neg + NoahmpIO%sfg_urb3d = undefined_real_neg + NoahmpIO%hi_urb2d = undefined_real_neg + NoahmpIO%theta_urban = undefined_real_neg + NoahmpIO%u_urban = undefined_real_neg + NoahmpIO%v_urban = undefined_real_neg + NoahmpIO%dz_urban = undefined_real_neg + NoahmpIO%rho_urban = undefined_real_neg + NoahmpIO%p_urban = undefined_real_neg + NoahmpIO%a_u_bep = undefined_real_neg + NoahmpIO%a_v_bep = undefined_real_neg + NoahmpIO%a_t_bep = undefined_real_neg + NoahmpIO%a_q_bep = undefined_real_neg + NoahmpIO%a_e_bep = undefined_real_neg + NoahmpIO%b_u_bep = undefined_real_neg + NoahmpIO%b_v_bep = undefined_real_neg + NoahmpIO%b_t_bep = undefined_real_neg + NoahmpIO%b_q_bep = undefined_real_neg + NoahmpIO%b_e_bep = undefined_real_neg + NoahmpIO%dlg_bep = undefined_real_neg + NoahmpIO%dl_u_bep = undefined_real_neg + NoahmpIO%sf_bep = undefined_real_neg + NoahmpIO%vl_bep = undefined_real_neg + NoahmpIO%tlev_urb3d = undefined_real_neg + NoahmpIO%qlev_urb3d = undefined_real_neg + NoahmpIO%tw1lev_urb3d = undefined_real_neg + NoahmpIO%tw2lev_urb3d = undefined_real_neg + NoahmpIO%tglev_urb3d = undefined_real_neg + NoahmpIO%tflev_urb3d = undefined_real_neg + NoahmpIO%sf_ac_urb3d = undefined_real_neg + NoahmpIO%lf_ac_urb3d = undefined_real_neg + NoahmpIO%cm_ac_urb3d = undefined_real_neg + NoahmpIO%sfvent_urb3d = undefined_real_neg + NoahmpIO%lfvent_urb3d = undefined_real_neg + NoahmpIO%sfwin1_urb3d = undefined_real_neg + NoahmpIO%sfwin2_urb3d = undefined_real_neg + NoahmpIO%ep_pv_urb3d = undefined_real_neg + NoahmpIO%t_pv_urb3d = undefined_real_neg + NoahmpIO%trv_urb4d = undefined_real_neg + NoahmpIO%qr_urb4d = undefined_real_neg + NoahmpIO%qgr_urb3d = undefined_real_neg + NoahmpIO%tgr_urb3d = undefined_real_neg + NoahmpIO%drain_urb4d = undefined_real_neg + NoahmpIO%draingr_urb3d = undefined_real_neg + NoahmpIO%sfrv_urb3d = undefined_real_neg + NoahmpIO%lfrv_urb3d = undefined_real_neg + NoahmpIO%dgr_urb3d = undefined_real_neg + NoahmpIO%dg_urb3d = undefined_real_neg + NoahmpIO%lfr_urb3d = undefined_real_neg + NoahmpIO%lfg_urb3d = undefined_real_neg + endif + + NoahmpIO%XLAND = 1.0 ! water = 2.0, land = 1.0 + NoahmpIO%XICE = 0.0 ! fraction of grid that is seaice + NoahmpIO%XICE_THRESHOLD = 0.5 ! fraction of grid determining seaice (from WRF) + NoahmpIO%SLOPETYP = 1 ! soil parameter slope type + NoahmpIO%soil_update_steps = 1 ! number of model time step to update soil proces + NoahmpIO%calculate_soil = .false. ! index for if do soil process + NoahmpIO%ITIMESTEP = 0 ! model time step count + NoahmpIO%infxsrt = 0.0 + NoahmpIO%sfcheadrt = 0.0 + NoahmpIO%soldrain = 0.0 + NoahmpIO%qtiledrain = 0.0 + NoahmpIO%ZWATBLE2D = 0.0 + + end associate + + end subroutine NoahmpIOVarInitDefault + +end module NoahmpIOVarInitMod diff --git a/drivers/lis/NoahmpIOVarType.F90 b/drivers/lis/NoahmpIOVarType.F90 new file mode 100644 index 00000000..f0e80fd6 --- /dev/null +++ b/drivers/lis/NoahmpIOVarType.F90 @@ -0,0 +1,960 @@ +module NoahmpIOVarType + +!!! Define Noah-MP Input variables (2D forcing, namelist, table, static) +!!! Input variable initialization is done in NoahmpIOVarInitMod.F90 + +! ------------------------ Code history ----------------------------------- +! Original code: Guo-Yue Niu and Noah-MP team (Niu et al. 2011) +! Refactered code: C. He, P. Valayamkunnath & refactor team (He et al. 2023) +! ------------------------------------------------------------------------- + + use Machine + + implicit none + save + private + + public :: NoahmpIO + + type, public :: NoahmpIO_type + +!------------------------------------------------------------------------ +! general 2-D/3-D Noah-MP variables +!------------------------------------------------------------------------ + + ! IN only (as defined in WRF) + integer :: ids,ide, & ! d -> domain + jds,jde, & ! d -> domain + kds,kde, & ! d -> domain + ims,ime, & ! m -> memory + jms,jme, & ! m -> memory + kms,kme, & ! m -> memory + its,ite, & ! t -> tile + jts,jte, & ! t -> tile + kts,kte ! t -> tile + ! namelist options + integer :: IOPT_DVEG ! dynamic vegetation + integer :: IOPT_CRS ! canopy stomatal resistance (1-> Ball-Berry; 2->Jarvis) + integer :: IOPT_BTR ! soil moisture factor for stomatal resistance (1-> Noah; 2-> CLM; 3-> SSiB) + integer :: IOPT_RUNSRF ! surface runoff and groundwater (1->SIMGM; 2->SIMTOP; 3->Schaake96; 4->BATS) + integer :: IOPT_RUNSUB ! subsurface runoff option + integer :: IOPT_SFC ! surface layer drag coeff (CH & CM) (1->M-O; 2->Chen97) + integer :: IOPT_FRZ ! supercooled liquid water (1-> NY06; 2->Koren99) + integer :: IOPT_INF ! frozen soil permeability (1-> NY06; 2->Koren99) + integer :: IOPT_RAD ! radiation transfer (1->gap=F(3D,cosz); 2->gap=0; 3->gap=1-Fveg) + integer :: IOPT_ALB ! snow surface albedo (1->BATS; 2->CLASS) + integer :: IOPT_SNF ! rainfall & snowfall (1-Jordan91; 2->BATS; 3->Noah) + integer :: IOPT_TKSNO ! snow thermal conductivity: 1 -> Stieglitz(yen,1965) scheme (default), 2 -> Anderson, 1976 scheme, 3 -> constant, 4 -> Verseghy (1991) scheme, 5 -> Douvill(Yen, 1981) scheme + integer :: IOPT_TBOT ! lower boundary of soil temperature (1->zero-flux; 2->Noah) + integer :: IOPT_STC ! snow/soil temperature time scheme + integer :: IOPT_GLA ! glacier option (1->phase change; 2->simple) + integer :: IOPT_RSF ! surface resistance option (1->Zeng; 2->simple) + integer :: IZ0TLND ! option of Chen adjustment of Czil (not used) + integer :: IOPT_SOIL ! soil configuration option + integer :: IOPT_PEDO ! soil pedotransfer function option + integer :: IOPT_CROP ! crop model option (0->none; 1->Liu et al.) + integer :: IOPT_IRR ! irrigation scheme (0->none; >1 irrigation scheme ON) + integer :: IOPT_IRRM ! irrigation method (0->dynamic; 1-> sprinkler; 2-> micro; 3-> flood) + integer :: IOPT_INFDV ! infiltration options for dynamic VIC (1->Philip; 2-> Green-Ampt;3->Smith-Parlange) + integer :: IOPT_TDRN ! drainage option (0->off; 1->simple scheme; 2->Hooghoudt's scheme) + integer :: sf_urban_physics ! urban physics option + + ! basic model info + integer :: year ! year of the current time step [-] + integer :: month ! month of the current time step [-] + integer :: day ! day of the current time step [-] + integer :: hour ! hour of the current time step [-] + integer :: minute ! minute of the current time step [-] + integer :: ttile ! tile No. [-] + integer :: itimestep ! timestep number [-] + integer :: nsoil ! number of soil layers + integer :: nsnow ! number of snow layers + integer :: YR ! 4-digit year + integer, allocatable, dimension(:,:) :: ivgtyp ! vegetation type + integer, allocatable, dimension(:,:) :: isltyp ! soil type + integer, allocatable, dimension(:,:) :: urban_vegtype ! urban land cover type index [-] + real(kind=kind_noahmp) :: dtbl ! timestep [s] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: xlat ! latitude in decimal degree [rad] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: xlon ! longitude in decimal year [rad] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: tmn ! deep soil temperature [K] + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: shdfac_monthly ! monthly values for green vegetation fraction [] + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: DZ8W ! thickness of atmo layers [m] + integer :: ICE ! Sea-ice point + real(kind=kind_noahmp) :: XICE_THRESHOLD ! fraction of grid determining seaice + real(kind=kind_noahmp) :: JULIAN ! Julian day + real(kind=kind_noahmp) :: DX ! horizontal grid spacing [m] + real(kind=kind_noahmp) :: soiltstep ! soil time step (s) (default=0: same as main NoahMP timstep) + logical :: FNDSNOWH ! snow depth present in input + logical :: calculate_soil ! logical index for if do soil calculation + integer :: soil_update_steps ! number of model time steps to update soil process + real(kind=kind_noahmp), allocatable, dimension(:,:) :: COSZEN ! cosine zenith angle + real(kind=kind_noahmp), allocatable, dimension(:) :: DZS ! thickness of soil layers [m] + real(kind=kind_noahmp), allocatable, dimension(:) :: ZSOIL ! depth to soil interfaces [m] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: XLAND ! =2 ocean; =1 land/seaice + real(kind=kind_noahmp), allocatable, dimension(:,:) :: XICE ! fraction of grid that is seaice + real(kind=kind_noahmp), allocatable, dimension(:,:) :: SEAICE ! seaice fraction + + ! Needed for crop model (OPT_CROP=1) + integer, allocatable, dimension(:,:) :: PGSXY ! plant growth stage + integer, allocatable, dimension(:,:) :: CROPCAT ! crop category + real(kind=kind_noahmp), allocatable, dimension(:,:) :: PLANTING ! planting day + real(kind=kind_noahmp), allocatable, dimension(:,:) :: HARVEST ! harvest day + real(kind=kind_noahmp), allocatable, dimension(:,:) :: SEASON_GDD ! seasonal GDD + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: CROPTYPE ! crop type + + ! needed for soil option 2 & 3 + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: soilcomp ! Soil sand and clay content [fraction] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: soilcl1 ! Soil texture class with depth + real(kind=kind_noahmp), allocatable, dimension(:,:) :: soilcl2 ! Soil texture class with depth + real(kind=kind_noahmp), allocatable, dimension(:,:) :: soilcl3 ! Soil texture class with depth + real(kind=kind_noahmp), allocatable, dimension(:,:) :: soilcl4 ! Soil texture class with depth + + ! Needed for TILE DRAINAGE IF IOPT_TDRN = 1 OR 2 + real(kind=kind_noahmp), allocatable, dimension(:,:) :: TD_FRACTION ! tile drainage fraction + + ! atmospheric forcing + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: T_PHY ! 3D atmospheric temperature valid at mid-levels [K] + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: QV_CURR ! 3D specific humidity [kg/kg] + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: U_PHY ! 3D U wind component [m/s] + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: V_PHY ! 3D V wind component [m/s] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: SWDOWN ! solar down at surface [W m-2] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: GLW ! longwave down at surface [W m-2] + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: P8W ! 3D pressure, valid at interface [Pa] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: RAINBL ! precipitation entering land model [mm] per time step + real(kind=kind_noahmp), allocatable, dimension(:,:) :: SNOWBL ! snow entering land model [mm] per time step + real(kind=kind_noahmp), allocatable, dimension(:,:) :: SR ! frozen precip ratio entering land model [-] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: RAINCV ! convective precip forcing [mm] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: RAINNCV ! non-convective precip forcing [mm] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: RAINSHV ! shallow conv. precip forcing [mm] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: SNOWNCV ! non-covective snow forcing (subset of rainncv) [mm] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: GRAUPELNCV ! non-convective graupel forcing (subset of rainncv) [mm] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: HAILNCV ! non-convective hail forcing (subset of rainncv) [mm] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: MP_RAINC ! convective precipitation entering land model [mm] ! MB/AN : v3.7 + real(kind=kind_noahmp), allocatable, dimension(:,:) :: MP_RAINNC ! large-scale precipitation entering land model [mm]! MB/AN : v3.7 + real(kind=kind_noahmp), allocatable, dimension(:,:) :: MP_SHCV ! shallow conv precip entering land model [mm] ! MB/AN : v3.7 + real(kind=kind_noahmp), allocatable, dimension(:,:) :: MP_SNOW ! snow precipitation entering land model [mm] ! MB/AN : v3.7 + real(kind=kind_noahmp), allocatable, dimension(:,:) :: MP_GRAUP ! graupel precipitation entering land model [mm] ! MB/AN : v3.7 + real(kind=kind_noahmp), allocatable, dimension(:,:) :: MP_HAIL ! hail precipitation entering land model [mm] ! MB/AN : v3.7 + + ! INOUT (with generic LSM equivalent) (as defined in WRF) + integer, allocatable, dimension(:,:) :: ISNOWXY ! actual no. of snow layers + real(kind=kind_noahmp), allocatable, dimension(:,:) :: TSK ! surface radiative temperature [K] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: HFX ! sensible heat flux [W m-2] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: QFX ! latent heat flux [kg s-1 m-2] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: LH ! latent heat flux [W m-2] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: GRDFLX ! ground/snow heat flux [W m-2] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: SFCRUNOFF ! accumulated surface runoff [m] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: UDRUNOFF ! accumulated sub-surface runoff [m] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: ALBEDO ! total grid albedo [] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: SNOWC ! snow cover fraction [] + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: SMOISEQ ! volumetric soil moisture [m3/m3] + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: SMOIS ! volumetric soil moisture [m3/m3] + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: SH2O ! volumetric liquid soil moisture [m3/m3] + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: TSLB ! soil temperature [K] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: SNOW ! snow water equivalent [mm] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: SNOWH ! physical snow depth [m] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: CANWAT ! total canopy water + ice [mm] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: ACSNOM ! accumulated snow melt leaving pack + real(kind=kind_noahmp), allocatable, dimension(:,:) :: ACSNOW ! accumulated snow on grid + real(kind=kind_noahmp), allocatable, dimension(:,:) :: EMISS ! surface bulk emissivity + real(kind=kind_noahmp), allocatable, dimension(:,:) :: QSFC ! bulk surface specific humidity + real(kind=kind_noahmp), allocatable, dimension(:,:) :: rivsto ! river storage [m s-1] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: fldsto ! flood storage [m s-1] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: fldfrc ! flooded fraction [-] + + ! INOUT (with no Noah LSM equivalent) (as defined in WRF) + real(kind=kind_noahmp), allocatable, dimension(:,:) :: TVXY ! vegetation leaf temperature + real(kind=kind_noahmp), allocatable, dimension(:,:) :: TGXY ! bulk ground surface temperature + real(kind=kind_noahmp), allocatable, dimension(:,:) :: CANICEXY ! canopy-intercepted ice (mm) + real(kind=kind_noahmp), allocatable, dimension(:,:) :: CANLIQXY ! canopy-intercepted liquid water (mm) + real(kind=kind_noahmp), allocatable, dimension(:,:) :: EAHXY ! canopy air vapor pressure (pa) + real(kind=kind_noahmp), allocatable, dimension(:,:) :: TAHXY ! canopy air temperature (k) + real(kind=kind_noahmp), allocatable, dimension(:,:) :: CMXY ! bulk momentum drag coefficient + real(kind=kind_noahmp), allocatable, dimension(:,:) :: CHXY ! bulk sensible heat exchange coefficient + real(kind=kind_noahmp), allocatable, dimension(:,:) :: FWETXY ! wetted or snowed fraction of the canopy (-) + real(kind=kind_noahmp), allocatable, dimension(:,:) :: SNEQVOXY ! snow mass at last time step(mm h2o) + real(kind=kind_noahmp), allocatable, dimension(:,:) :: ALBOLDXY ! snow albedo at last time step (-) + real(kind=kind_noahmp), allocatable, dimension(:,:) :: QSNOWXY ! snowfall on the ground [mm/s] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: QRAINXY ! rainfall on the ground [mm/s] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: WSLAKEXY ! lake water storage [mm] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: ZWTXY ! water table depth [m] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: WAXY ! water in the "aquifer" [mm] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: WTXY ! groundwater storage [mm] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: SMCWTDXY ! groundwater storage [mm] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: DEEPRECHXY ! groundwater storage [mm] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: RECHXY ! groundwater storage [mm] + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: TSNOXY ! snow temperature [K] + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: ZSNSOXY ! snow layer depth [m] + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: SNICEXY ! snow layer ice [mm] + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: SNLIQXY ! snow layer liquid water [mm] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: LFMASSXY ! leaf mass [g/m2] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: RTMASSXY ! mass of fine roots [g/m2] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: STMASSXY ! stem mass [g/m2] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: WOODXY ! mass of wood (incl. woody roots) [g/m2] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: GRAINXY ! XING mass of grain!THREE + real(kind=kind_noahmp), allocatable, dimension(:,:) :: GDDXY ! XINGgrowingdegressday + real(kind=kind_noahmp), allocatable, dimension(:,:) :: STBLCPXY ! stable carbon in deep soil [g/m2] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: FASTCPXY ! short-lived carbon, shallow soil [g/m2] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: LAI ! leaf area index + real(kind=kind_noahmp), allocatable, dimension(:,:) :: XSAIXY ! stem area index + real(kind=kind_noahmp), allocatable, dimension(:,:) :: TAUSSXY ! snow age factor + + ! irrigation + real(kind=kind_noahmp), allocatable, dimension(:,:) :: IRFRACT ! irrigation fraction + real(kind=kind_noahmp), allocatable, dimension(:,:) :: SIFRACT ! sprinkler irrigation fraction + real(kind=kind_noahmp), allocatable, dimension(:,:) :: MIFRACT ! micro irrigation fraction + real(kind=kind_noahmp), allocatable, dimension(:,:) :: FIFRACT ! flood irrigation fraction + integer, allocatable, dimension(:,:) :: IRNUMSI ! irrigation event number, Sprinkler + integer, allocatable, dimension(:,:) :: IRNUMMI ! irrigation event number, Micro + integer, allocatable, dimension(:,:) :: IRNUMFI ! irrigation event number, Flood + real(kind=kind_noahmp), allocatable, dimension(:,:) :: IRWATSI ! irrigation water amount [m] to be applied, Sprinkler + real(kind=kind_noahmp), allocatable, dimension(:,:) :: IRWATMI ! irrigation water amount [m] to be applied, Micro + real(kind=kind_noahmp), allocatable, dimension(:,:) :: IRWATFI ! irrigation water amount [m] to be applied, Flood + real(kind=kind_noahmp), allocatable, dimension(:,:) :: IRELOSS ! loss of irrigation water to evaporation,sprinkler [m/timestep] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: IRSIVOL ! amount of irrigation by sprinkler (mm) + real(kind=kind_noahmp), allocatable, dimension(:,:) :: IRMIVOL ! amount of irrigation by micro (mm) + real(kind=kind_noahmp), allocatable, dimension(:,:) :: IRFIVOL ! amount of irrigation by micro (mm) + real(kind=kind_noahmp), allocatable, dimension(:,:) :: IRRSPLH ! latent heating from sprinkler evaporation (w/m2) + real(kind=kind_noahmp), allocatable, dimension(:,:) :: LOCTIM ! local time + + ! OUT (with no Noah LSM equivalent) (as defined in WRF) + real(kind=kind_noahmp), allocatable, dimension(:,:) :: T2MVXY ! 2m temperature of vegetation part + real(kind=kind_noahmp), allocatable, dimension(:,:) :: T2MBXY ! 2m temperature of bare ground part + real(kind=kind_noahmp), allocatable, dimension(:,:) :: Q2MVXY ! 2m mixing ratio of vegetation part + real(kind=kind_noahmp), allocatable, dimension(:,:) :: Q2MBXY ! 2m mixing ratio of bare ground part + real(kind=kind_noahmp), allocatable, dimension(:,:) :: TRADXY ! surface radiative temperature (k) + real(kind=kind_noahmp), allocatable, dimension(:,:) :: NEEXY ! net ecosys exchange (g/m2/s CO2) + real(kind=kind_noahmp), allocatable, dimension(:,:) :: GPPXY ! gross primary assimilation [g/m2/s C] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: NPPXY ! net primary productivity [g/m2/s C] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: FVEGXY ! Noah-MP vegetation fraction [-] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: RUNSFXY ! surface runoff [mm per soil timestep] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: RUNSBXY ! subsurface runoff [mm per soil timestep] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: ECANXY ! evaporation of intercepted water (mm/s) + real(kind=kind_noahmp), allocatable, dimension(:,:) :: EDIRXY ! soil surface evaporation rate (mm/s] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: ETRANXY ! transpiration rate (mm/s) + real(kind=kind_noahmp), allocatable, dimension(:,:) :: FSAXY ! total absorbed solar radiation (w/m2) + real(kind=kind_noahmp), allocatable, dimension(:,:) :: FIRAXY ! total net longwave rad (w/m2) [+ to atm] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: APARXY ! photosyn active energy by canopy (w/m2) + real(kind=kind_noahmp), allocatable, dimension(:,:) :: PSNXY ! total photosynthesis (umol co2/m2/s) [+] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: SAVXY ! solar rad absorbed by veg. (w/m2) + real(kind=kind_noahmp), allocatable, dimension(:,:) :: SAGXY ! solar rad absorbed by ground (w/m2) + real(kind=kind_noahmp), allocatable, dimension(:,:) :: RSSUNXY ! sunlit leaf stomatal resistance (s/m) + real(kind=kind_noahmp), allocatable, dimension(:,:) :: RSSHAXY ! shaded leaf stomatal resistance (s/m) + real(kind=kind_noahmp), allocatable, dimension(:,:) :: BGAPXY ! between gap fraction + real(kind=kind_noahmp), allocatable, dimension(:,:) :: WGAPXY ! within gap fraction + real(kind=kind_noahmp), allocatable, dimension(:,:) :: TGVXY ! under canopy ground temperature[K] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: TGBXY ! bare ground temperature [K] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: CHVXY ! sensible heat exchange coefficient vegetated + real(kind=kind_noahmp), allocatable, dimension(:,:) :: CHBXY ! sensible heat exchange coefficient bare-ground + real(kind=kind_noahmp), allocatable, dimension(:,:) :: SHGXY ! veg ground sen. heat [w/m2] [+ to atm] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: SHCXY ! canopy sen. heat [w/m2] [+ to atm] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: SHBXY ! bare sensible heat [w/m2] [+ to atm] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: EVGXY ! veg ground evap. heat [w/m2] [+ to atm] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: EVBXY ! bare soil evaporation [w/m2] [+ to atm] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: GHVXY ! veg ground heat flux [w/m2] [+ to soil] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: GHBXY ! bare ground heat flux [w/m2] [+ to soil] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: IRGXY ! veg ground net LW rad. [w/m2] [+ to atm] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: IRCXY ! canopy net LW rad. [w/m2] [+ to atm] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: IRBXY ! bare net longwave rad. [w/m2] [+ to atm] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: TRXY ! transpiration [w/m2] [+ to atm] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: EVCXY ! canopy evaporation heat [w/m2] [+ to atm] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: CHLEAFXY ! leaf exchange coefficient + real(kind=kind_noahmp), allocatable, dimension(:,:) :: CHUCXY ! under canopy exchange coefficient + real(kind=kind_noahmp), allocatable, dimension(:,:) :: CHV2XY ! veg 2m exchange coefficient + real(kind=kind_noahmp), allocatable, dimension(:,:) :: CHB2XY ! bare 2m exchange coefficient + real(kind=kind_noahmp), allocatable, dimension(:,:) :: Z0 ! roughness length output to WRF + real(kind=kind_noahmp), allocatable, dimension(:,:) :: ZNT ! roughness length output to WRF + real(kind=kind_noahmp), allocatable, dimension(:,:) :: QTDRAIN ! tile drain discharge [mm] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: RS ! Total stomatal resistance [s/m] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: infxsrt ! surface infiltration + real(kind=kind_noahmp), allocatable, dimension(:,:) :: sfcheadrt ! surface water head + real(kind=kind_noahmp), allocatable, dimension(:,:) :: soldrain ! soil drainage + real(kind=kind_noahmp), allocatable, dimension(:,:) :: qtiledrain ! tile drainage + real(kind=kind_noahmp), allocatable, dimension(:,:) :: ZWATBLE2D ! water table depth + + ! additional output variables + real(kind=kind_noahmp), allocatable, dimension(:,:) :: PAHXY ! precipitation advected heat [W/m2] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: PAHGXY ! precipitation advected heat [W/m2] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: PAHBXY ! precipitation advected heat [W/m2] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: PAHVXY ! precipitation advected heat [W/m2] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: QINTSXY ! canopy intercepted snow [mm/s] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: QINTRXY ! canopy intercepted rain [mm/s] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: QDRIPSXY ! canopy dripping snow [mm/s] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: QDRIPRXY ! canopy dripping rain [mm/s] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: QTHROSXY ! canopy throughfall snow [mm/s] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: QTHRORXY ! canopy throughfall rain [mm/s] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: QSNSUBXY ! snowpack sublimation rate [mm/s] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: QMELTXY ! snowpack melting rate due to phase change [mm/s] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: QSNFROXY ! snowpack frost rate [mm/s] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: QSUBCXY ! canopy snow sublimation rate [mm/s] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: QFROCXY ! canopy snow frost rate [mm/s] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: QEVACXY ! canopy water evaporation rate [mm/s] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: QDEWCXY ! canopy water dew rate [mm/s] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: QFRZCXY ! canopy water freezing rate [mm/s] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: QMELTCXY ! canopy snow melting rate [mm/s] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: QSNBOTXY ! total water (melt+rain through snow) out of snowpack bottom [mm/s] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: PONDINGXY ! total surface ponding [mm] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: FPICEXY ! fraction of ice in total precipitation + real(kind=kind_noahmp), allocatable, dimension(:,:) :: RAINLSM ! total rain rate at the surface [mm/s] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: SNOWLSM ! total snow rate at the surface [mm/s] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: FORCTLSM ! surface temperature as LSM forcing [K] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: FORCQLSM ! surface specific humidity as LSM forcing [kg/kg] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: FORCPLSM ! surface pressure as LSM forcing [Pa] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: FORCZLSM ! reference height as LSM input [m] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: FORCWLSM ! surface wind speed as LSM forcing [m/s] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: ACC_SSOILXY ! accumulated ground heat flux [W/m2 * dt_soil/dt_main] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: ACC_QINSURXY ! accumulated water flux into soil [m/s * dt_soil/dt_main] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: ACC_QSEVAXY ! accumulated soil surface evaporation [m/s * dt_soil/dt_main] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: EFLXBXY ! accumulated heat flux through soil bottom per soil timestep [J/m2] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: SOILENERGY ! energy content in soil relative to 273.16 [KJ/m2] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: SNOWENERGY ! energy content in snow relative to 273.16 [KJ/m2] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: CANHSXY ! canopy heat storage change [W/m2] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: ACC_DWATERXY ! accumulated snow,soil,canopy water change per soil timestep [mm] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: ACC_PRCPXY ! accumulated precipitation per soil timestep [mm] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: ACC_ECANXY ! accumulated net canopy evaporation per soil timestep [mm] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: ACC_ETRANXY ! accumulated transpiration per soil timestep [mm] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: ACC_EDIRXY ! accumulated net ground (soil/snow) evaporation per soil timestep [mm] + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: ACC_ETRANIXY ! accumualted transpiration rate within soil timestep [m/s * dt_soil/dt_main] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: FGEV_PET ! ground evapo flux due to PET [W/m2] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: FCEV_PET ! canopy evapo flux due to PET [W/m2] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: FCTR_PET ! transpiration flux due to PET [W/m2] + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: RELSMC ! relative soil moisture + +!------------------------------------------------------------------------ +! Needed for MMF_RUNOFF (IOPT_RUN = 5); not part of MP driver in WRF +!------------------------------------------------------------------------ + + real(kind=kind_noahmp), allocatable, dimension(:,:) :: MSFTX ! mapping factor x + real(kind=kind_noahmp), allocatable, dimension(:,:) :: MSFTY ! mapping factor y + real(kind=kind_noahmp), allocatable, dimension(:,:) :: EQZWT ! equilibrium water table + real(kind=kind_noahmp), allocatable, dimension(:,:) :: RIVERBEDXY ! riverbed depth + real(kind=kind_noahmp), allocatable, dimension(:,:) :: RIVERCONDXY ! river conductivity + real(kind=kind_noahmp), allocatable, dimension(:,:) :: PEXPXY ! exponential factor + real(kind=kind_noahmp), allocatable, dimension(:,:) :: FDEPTHXY ! depth + real(kind=kind_noahmp), allocatable, dimension(:,:) :: AREAXY ! river area + real(kind=kind_noahmp), allocatable, dimension(:,:) :: QRFSXY ! accumulated groundwater baseflow [mm] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: QSPRINGSXY ! accumulated seeping water [mm] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: QRFXY ! groundwater baselow [m] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: QSPRINGXY ! seeping water [m] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: QSLATXY ! accumulated lateral flow [mm] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: QLATXY ! lateral flow [m] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: RECHCLIM ! climatology recharge + real(kind=kind_noahmp), allocatable, dimension(:,:) :: RIVERMASK ! river mask + real(kind=kind_noahmp), allocatable, dimension(:,:) :: NONRIVERXY ! non-river portion + real(kind=kind_noahmp) :: WTDDT = 30.0 ! frequency of groundwater call [minutes] + integer :: STEPWTD ! step of groundwater call + + +!------------------------------------------------------------------------ +! Single- and Multi-layer Urban Models +!------------------------------------------------------------------------ + + integer :: num_urban_atmosphere ! atmospheric levels including ZLVL for BEP/BEM models + integer :: IRI_URBAN ! urban irrigation flag (move from module_sf_urban to here) + real(kind=kind_noahmp) :: GMT ! Hour of day (fractional) (needed for urban) + integer :: JULDAY ! Integer day (needed for urban) + real(kind=kind_noahmp), allocatable, dimension(:,:) :: HRANG ! hour angle (needed for urban) + real(kind=kind_noahmp) :: DECLIN ! declination (needed for urban) + integer :: num_roof_layers = 4 ! roof layer number + integer :: num_road_layers = 4 ! road layer number + integer :: num_wall_layers = 4 ! wall layer number + real(kind=kind_noahmp), allocatable, dimension(:,:) :: cmr_sfcdif + real(kind=kind_noahmp), allocatable, dimension(:,:) :: chr_sfcdif + real(kind=kind_noahmp), allocatable, dimension(:,:) :: cmc_sfcdif + real(kind=kind_noahmp), allocatable, dimension(:,:) :: chc_sfcdif + real(kind=kind_noahmp), allocatable, dimension(:,:) :: cmgr_sfcdif + real(kind=kind_noahmp), allocatable, dimension(:,:) :: chgr_sfcdif + real(kind=kind_noahmp), allocatable, dimension(:,:) :: tr_urb2d + real(kind=kind_noahmp), allocatable, dimension(:,:) :: tb_urb2d + real(kind=kind_noahmp), allocatable, dimension(:,:) :: tg_urb2d + real(kind=kind_noahmp), allocatable, dimension(:,:) :: tc_urb2d + real(kind=kind_noahmp), allocatable, dimension(:,:) :: qc_urb2d + real(kind=kind_noahmp), allocatable, dimension(:,:) :: uc_urb2d + real(kind=kind_noahmp), allocatable, dimension(:,:) :: xxxr_urb2d + real(kind=kind_noahmp), allocatable, dimension(:,:) :: xxxb_urb2d + real(kind=kind_noahmp), allocatable, dimension(:,:) :: xxxg_urb2d + real(kind=kind_noahmp), allocatable, dimension(:,:) :: xxxc_urb2d + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: trl_urb3d + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: tbl_urb3d + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: tgl_urb3d + real(kind=kind_noahmp), allocatable, dimension(:,:) :: sh_urb2d + real(kind=kind_noahmp), allocatable, dimension(:,:) :: lh_urb2d + real(kind=kind_noahmp), allocatable, dimension(:,:) :: g_urb2d + real(kind=kind_noahmp), allocatable, dimension(:,:) :: rn_urb2d + real(kind=kind_noahmp), allocatable, dimension(:,:) :: ts_urb2d + real(kind=kind_noahmp), allocatable, dimension(:,:) :: psim_urb2d + real(kind=kind_noahmp), allocatable, dimension(:,:) :: psih_urb2d + real(kind=kind_noahmp), allocatable, dimension(:,:) :: u10_urb2d + real(kind=kind_noahmp), allocatable, dimension(:,:) :: v10_urb2d + real(kind=kind_noahmp), allocatable, dimension(:,:) :: GZ1OZ0_urb2d + real(kind=kind_noahmp), allocatable, dimension(:,:) :: AKMS_URB2D + real(kind=kind_noahmp), allocatable, dimension(:,:) :: th2_urb2d + real(kind=kind_noahmp), allocatable, dimension(:,:) :: q2_urb2d + real(kind=kind_noahmp), allocatable, dimension(:,:) :: ust_urb2d + real(kind=kind_noahmp), allocatable, dimension(:) :: dzr + real(kind=kind_noahmp), allocatable, dimension(:) :: dzb + real(kind=kind_noahmp), allocatable, dimension(:) :: dzg + real(kind=kind_noahmp), allocatable, dimension(:,:) :: cmcr_urb2d + real(kind=kind_noahmp), allocatable, dimension(:,:) :: tgr_urb2d + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: tgrl_urb3d + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: smr_urb3d + real(kind=kind_noahmp), allocatable, dimension(:,:) :: drelr_urb2d + real(kind=kind_noahmp), allocatable, dimension(:,:) :: drelb_urb2d + real(kind=kind_noahmp), allocatable, dimension(:,:) :: drelg_urb2d + real(kind=kind_noahmp), allocatable, dimension(:,:) :: flxhumr_urb2d + real(kind=kind_noahmp), allocatable, dimension(:,:) :: flxhumb_urb2d + real(kind=kind_noahmp), allocatable, dimension(:,:) :: flxhumg_urb2d + real(kind=kind_noahmp), allocatable, dimension(:,:) :: frc_urb2d + integer, allocatable, dimension(:,:) :: utype_urb2d + real(kind=kind_noahmp), allocatable, dimension(:,:) :: chs + real(kind=kind_noahmp), allocatable, dimension(:,:) :: chs2 + real(kind=kind_noahmp), allocatable, dimension(:,:) :: cqs2 + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: trb_urb4d + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: tw1_urb4d + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: tw2_urb4d + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: tgb_urb4d + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: tlev_urb3d + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: qlev_urb3d + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: tw1lev_urb3d + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: tw2lev_urb3d + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: tglev_urb3d + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: tflev_urb3d + real(kind=kind_noahmp), allocatable, dimension(:,:) :: sf_ac_urb3d + real(kind=kind_noahmp), allocatable, dimension(:,:) :: lf_ac_urb3d + real(kind=kind_noahmp), allocatable, dimension(:,:) :: cm_ac_urb3d + real(kind=kind_noahmp), allocatable, dimension(:,:) :: sfvent_urb3d + real(kind=kind_noahmp), allocatable, dimension(:,:) :: lfvent_urb3d + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: sfwin1_urb3d + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: sfwin2_urb3d + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: sfw1_urb3d + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: sfw2_urb3d + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: sfr_urb3d + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: sfg_urb3d + real(kind=kind_noahmp), allocatable, dimension(:,:) :: lp_urb2d + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: hi_urb2d + real(kind=kind_noahmp), allocatable, dimension(:,:) :: lb_urb2d + real(kind=kind_noahmp), allocatable, dimension(:,:) :: hgt_urb2d + real(kind=kind_noahmp), allocatable, dimension(:,:) :: mh_urb2d + real(kind=kind_noahmp), allocatable, dimension(:,:) :: stdh_urb2d + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: lf_urb2d + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: theta_urban + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: u_urban + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: v_urban + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: dz_urban + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: rho_urban + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: p_urban + real(kind=kind_noahmp), allocatable, dimension(:,:) :: ust + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: a_u_bep + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: a_v_bep + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: a_t_bep + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: a_q_bep + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: a_e_bep + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: b_u_bep + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: b_v_bep + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: b_t_bep + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: b_q_bep + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: b_e_bep + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: dlg_bep + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: dl_u_bep + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: sf_bep + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: vl_bep + real(kind=kind_noahmp) :: height_urban + + ! new urban variables for green roof, PVP for BEP_BEM scheme=3, Zonato et al., 2021 + real(kind=kind_noahmp), allocatable, dimension(:,:) :: EP_PV_URB3D + real(kind=kind_noahmp), allocatable, dimension(:,:) :: QGR_URB3D + real(kind=kind_noahmp), allocatable, dimension(:,:) :: TGR_URB3D + real(kind=kind_noahmp), allocatable, dimension(:,:) :: DRAINGR_URB3D + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: T_PV_URB3D + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: TRV_URB4D + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: QR_URB4D + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: DRAIN_URB4D + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: SFRV_URB3D + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: LFRV_URB3D + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: DGR_URB3D + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: DG_URB3D + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: LFR_URB3D + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: LFG_URB3D + real(kind=kind_noahmp), allocatable, dimension(:,:) :: SWDDIR ! solar down at surface [W m-2] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: SWDDIF + + +!------------------------------------------------------------------------ +! 2D variables not used in WRF - should be removed? +!------------------------------------------------------------------------ + + real(kind=kind_noahmp), allocatable, dimension(:,:) :: TERRAIN ! terrain height + real(kind=kind_noahmp), allocatable, dimension(:,:) :: GVFMIN ! annual minimum in vegetation fraction + real(kind=kind_noahmp), allocatable, dimension(:,:) :: GVFMAX ! annual maximum in vegetation fraction + real(kind=kind_noahmp), allocatable, dimension(:,:) :: VEGFRA ! vegetation fraction + +!------------------------------------------------------------------------ +! End 2D variables not used in WRF +!------------------------------------------------------------------------ + + CHARACTER(LEN=256) :: MMINSL = 'STAS' ! soil classification + CHARACTER(LEN=256) :: LLANDUSE ! (=USGS, using USGS landuse classification) + +!------------------------------------------------------------------------ +! Timing: +!------------------------------------------------------------------------ + + integer :: NTIME ! timesteps + integer :: clock_count_1 = 0 + integer :: clock_count_2 = 0 + integer :: clock_rate = 0 + real(kind=kind_noahmp) :: timing_sum = 0.0 + integer :: sflx_count_sum + integer :: count_before_sflx + integer :: count_after_sflx + +!--------------------------------------------------------------------- +! DECLARE/Initialize constants +!--------------------------------------------------------------------- + + integer :: I + integer :: J + integer :: SLOPETYP + integer :: YEARLEN + logical :: update_lai, update_veg + integer :: spinup_loop + logical :: reset_spinup_date + +!--------------------------------------------------------------------- +! File naming, parallel +!--------------------------------------------------------------------- + + character(len=19) :: olddate, & + newdate, & + startdate + character :: hgrid + integer :: igrid + logical :: lexist + integer :: imode + integer :: ixfull + integer :: jxfull + integer :: ixpar + integer :: jxpar + integer :: xstartpar + integer :: ystartpar + integer :: rank = 0 + character(len=256) :: inflnm, & + outflnm, & + inflnm_template + logical :: restart_flag + character(len=256) :: restart_flnm + integer :: ierr + +!--------------------------------------------------------------------- +! Attributes from LDASIN input file (or HRLDAS_SETUP_FILE, as the case may be) +!--------------------------------------------------------------------- + + integer :: IX + integer :: JX + real(kind=kind_noahmp) :: DY + real(kind=kind_noahmp) :: TRUELAT1 + real(kind=kind_noahmp) :: TRUELAT2 + real(kind=kind_noahmp) :: CEN_LON + integer :: MAPPROJ + real(kind=kind_noahmp) :: LAT1 + real(kind=kind_noahmp) :: LON1 + +!--------------------------------------------------------------------- +! NAMELIST start +!--------------------------------------------------------------------- + + character(len=256) :: indir + ! nsoil defined above + integer :: forcing_timestep + integer :: noah_timestep + integer :: start_year + integer :: start_month + integer :: start_day + integer :: start_hour + integer :: start_min + character(len=256) :: outdir + character(len=256) :: restart_filename_requested + integer :: restart_frequency_hours + integer :: output_timestep + integer :: spinup_loops + + integer :: use_wudapt_lcz + integer :: num_urban_ndm + integer :: num_urban_ng + integer :: num_urban_nwr + integer :: num_urban_ngb + integer :: num_urban_nf + integer :: num_urban_nz + integer :: num_urban_nbui + integer :: num_urban_hi + integer :: num_urban_ngr + real(kind=kind_noahmp) :: urban_atmosphere_thickness + + ! derived urban dimensions + integer :: urban_map_zrd + integer :: urban_map_zwd + integer :: urban_map_gd + integer :: urban_map_zd + integer :: urban_map_zdf + integer :: urban_map_bd + integer :: urban_map_wd + integer :: urban_map_gbd + integer :: urban_map_fbd + integer :: urban_map_zgrd + integer :: max_urban_dim ! C. He: maximum urban dimension for urban variable + + character(len=256) :: forcing_name_T + character(len=256) :: forcing_name_Q + character(len=256) :: forcing_name_U + character(len=256) :: forcing_name_V + character(len=256) :: forcing_name_P + character(len=256) :: forcing_name_LW + character(len=256) :: forcing_name_SW + character(len=256) :: forcing_name_PR + character(len=256) :: forcing_name_SN + + integer :: noahmp_output ! =0: default output; >0 include additional output + integer :: split_output_count + logical :: skip_first_output + integer :: khour + integer :: kday + real(kind=kind_noahmp) :: zlvl + character(len=256) :: hrldas_setup_file + character(len=256) :: spatial_filename + character(len=256) :: external_veg_filename_template + character(len=256) :: external_lai_filename_template + character(len=256) :: agdata_flnm + character(len=256) :: tdinput_flnm + integer :: xstart + integer :: ystart + integer :: xend + integer :: yend + integer :: MAX_SOIL_LEVELS + real(kind=kind_noahmp), allocatable, dimension(:) :: soil_thick_input + +!---------------------------------------------------------------- +! Noahmp Parameters Table +!---------------------------------------------------------------- + + ! vegetation parameters + character(len=256) :: VEG_DATASET_DESCRIPTION_TABLE + integer :: NVEG_TABLE ! number of vegetation types + integer :: ISURBAN ! urban flag + integer :: ISURBAN_TABLE ! urban flag + integer :: ISWATER_TABLE ! water flag + integer :: ISBARREN_TABLE ! barren ground flag + integer :: ISICE_TABLE ! ice flag + integer :: ISCROP_TABLE ! cropland flag + integer :: EBLFOREST_TABLE ! evergreen broadleaf forest flag + integer :: NATURAL_TABLE ! natural vegetation type + integer :: LCZ_1_TABLE ! urban LCZ 1 + integer :: LCZ_2_TABLE ! urban LCZ 2 + integer :: LCZ_3_TABLE ! urban LCZ 3 + integer :: LCZ_4_TABLE ! urban LCZ 4 + integer :: LCZ_5_TABLE ! urban LCZ 5 + integer :: LCZ_6_TABLE ! urban LCZ 6 + integer :: LCZ_7_TABLE ! urban LCZ 7 + integer :: LCZ_8_TABLE ! urban LCZ 8 + integer :: LCZ_9_TABLE ! urban LCZ 9 + integer :: LCZ_10_TABLE ! urban LCZ 10 + integer :: LCZ_11_TABLE ! urban LCZ 11 + integer :: URBTYPE_beg ! urban type start number - 1 + real(kind=kind_noahmp), allocatable, dimension(:) :: CH2OP_TABLE ! maximum intercepted h2o per unit lai+sai (mm) + real(kind=kind_noahmp), allocatable, dimension(:) :: DLEAF_TABLE ! characteristic leaf dimension (m) + real(kind=kind_noahmp), allocatable, dimension(:) :: Z0MVT_TABLE ! momentum roughness length (m) + real(kind=kind_noahmp), allocatable, dimension(:) :: HVT_TABLE ! top of canopy (m) + real(kind=kind_noahmp), allocatable, dimension(:) :: HVB_TABLE ! bottom of canopy (m) + real(kind=kind_noahmp), allocatable, dimension(:) :: DEN_TABLE ! tree density (no. of trunks per m2) + real(kind=kind_noahmp), allocatable, dimension(:) :: RC_TABLE ! tree crown radius (m) + real(kind=kind_noahmp), allocatable, dimension(:) :: MFSNO_TABLE ! snowmelt curve parameter + real(kind=kind_noahmp), allocatable, dimension(:) :: SCFFAC_TABLE ! snow cover factor (m) (replace original hard-coded 2.5*z0 in SCF formulation) + real(kind=kind_noahmp), allocatable, dimension(:) :: CBIOM_TABLE ! canopy biomass heat capacity parameter (m) + real(kind=kind_noahmp), allocatable, dimension(:,:) :: SAIM_TABLE ! monthly stem area index, one-sided + real(kind=kind_noahmp), allocatable, dimension(:,:) :: LAIM_TABLE ! monthly leaf area index, one-sided + real(kind=kind_noahmp), allocatable, dimension(:) :: SLA_TABLE ! single-side leaf area per Kg [m2/kg] + real(kind=kind_noahmp), allocatable, dimension(:) :: DILEFC_TABLE ! coeficient for leaf stress death [1/s] + real(kind=kind_noahmp), allocatable, dimension(:) :: DILEFW_TABLE ! coeficient for leaf stress death [1/s] + real(kind=kind_noahmp), allocatable, dimension(:) :: FRAGR_TABLE ! fraction of growth respiration !original was 0.3 + real(kind=kind_noahmp), allocatable, dimension(:) :: LTOVRC_TABLE ! leaf turnover [1/s] + real(kind=kind_noahmp), allocatable, dimension(:) :: C3PSN_TABLE ! photosynthetic pathway: 0. = c4, 1. = c3 + real(kind=kind_noahmp), allocatable, dimension(:) :: KC25_TABLE ! co2 michaelis-menten constant at 25c (pa) + real(kind=kind_noahmp), allocatable, dimension(:) :: AKC_TABLE ! q10 for kc25 + real(kind=kind_noahmp), allocatable, dimension(:) :: KO25_TABLE ! o2 michaelis-menten constant at 25c (pa) + real(kind=kind_noahmp), allocatable, dimension(:) :: AKO_TABLE ! q10 for ko25 + real(kind=kind_noahmp), allocatable, dimension(:) :: VCMX25_TABLE ! maximum rate of carboxylation at 25c (umol co2/m2/s) + real(kind=kind_noahmp), allocatable, dimension(:) :: AVCMX_TABLE ! q10 for vcmx25 + real(kind=kind_noahmp), allocatable, dimension(:) :: BP_TABLE ! minimum leaf conductance (umol/m2/s) + real(kind=kind_noahmp), allocatable, dimension(:) :: MP_TABLE ! slope of conductance-to-photosynthesis relationship + real(kind=kind_noahmp), allocatable, dimension(:) :: QE25_TABLE ! quantum efficiency at 25c (umol co2 / umol photon) + real(kind=kind_noahmp), allocatable, dimension(:) :: AQE_TABLE ! q10 for qe25 + real(kind=kind_noahmp), allocatable, dimension(:) :: RMF25_TABLE ! leaf maintenance respiration at 25c (umol co2/m2/s) + real(kind=kind_noahmp), allocatable, dimension(:) :: RMS25_TABLE ! stem maintenance respiration at 25c (umol co2/kg bio/s) + real(kind=kind_noahmp), allocatable, dimension(:) :: RMR25_TABLE ! root maintenance respiration at 25c (umol co2/kg bio/s) + real(kind=kind_noahmp), allocatable, dimension(:) :: ARM_TABLE ! q10 for maintenance respiration + real(kind=kind_noahmp), allocatable, dimension(:) :: FOLNMX_TABLE ! foliage nitrogen concentration when f(n)=1 (%) + real(kind=kind_noahmp), allocatable, dimension(:) :: TMIN_TABLE ! minimum temperature for photosynthesis (k) + real(kind=kind_noahmp), allocatable, dimension(:) :: XL_TABLE ! leaf/stem orientation index + real(kind=kind_noahmp), allocatable, dimension(:,:) :: RHOL_TABLE ! leaf reflectance: 1=vis, 2=nir + real(kind=kind_noahmp), allocatable, dimension(:,:) :: RHOS_TABLE ! stem reflectance: 1=vis, 2=nir + real(kind=kind_noahmp), allocatable, dimension(:,:) :: TAUL_TABLE ! leaf transmittance: 1=vis, 2=nir + real(kind=kind_noahmp), allocatable, dimension(:,:) :: TAUS_TABLE ! stem transmittance: 1=vis, 2=nir + real(kind=kind_noahmp), allocatable, dimension(:) :: MRP_TABLE ! microbial respiration parameter (umol co2 /kg c/ s) + real(kind=kind_noahmp), allocatable, dimension(:) :: CWPVT_TABLE ! empirical canopy wind parameter + real(kind=kind_noahmp), allocatable, dimension(:) :: WRRAT_TABLE ! wood to non-wood ratio + real(kind=kind_noahmp), allocatable, dimension(:) :: WDPOOL_TABLE ! wood pool (switch 1 or 0) depending on woody or not [-] + real(kind=kind_noahmp), allocatable, dimension(:) :: TDLEF_TABLE ! characteristic T for leaf freezing [K] + real(kind=kind_noahmp), allocatable, dimension(:) :: NROOT_TABLE ! number of soil layers with root present + real(kind=kind_noahmp), allocatable, dimension(:) :: RGL_TABLE ! Parameter used in radiation stress function + real(kind=kind_noahmp), allocatable, dimension(:) :: RS_TABLE ! Minimum stomatal resistance [s m-1] + real(kind=kind_noahmp), allocatable, dimension(:) :: HS_TABLE ! Parameter used in vapor pressure deficit function + real(kind=kind_noahmp), allocatable, dimension(:) :: TOPT_TABLE ! Optimum transpiration air temperature [K] + real(kind=kind_noahmp), allocatable, dimension(:) :: RSMAX_TABLE ! Maximal stomatal resistance [s m-1] + real(kind=kind_noahmp), allocatable, dimension(:) :: RTOVRC_TABLE ! root turnover coefficient [1/s] + real(kind=kind_noahmp), allocatable, dimension(:) :: RSWOODC_TABLE ! wood respiration coeficient [1/s] + real(kind=kind_noahmp), allocatable, dimension(:) :: BF_TABLE ! parameter for present wood allocation [-] + real(kind=kind_noahmp), allocatable, dimension(:) :: WSTRC_TABLE ! water stress coeficient [-] + real(kind=kind_noahmp), allocatable, dimension(:) :: LAIMIN_TABLE ! minimum leaf area index [m2/m2] + real(kind=kind_noahmp), allocatable, dimension(:) :: XSAMIN_TABLE ! minimum stem area index [m2/m2] + + ! radiation parameters + real(kind=kind_noahmp), allocatable, dimension(:,:) :: ALBSAT_TABLE ! saturated soil albedos: 1=vis, 2=nir + real(kind=kind_noahmp), allocatable, dimension(:,:) :: ALBDRY_TABLE ! dry soil albedos: 1=vis, 2=nir + real(kind=kind_noahmp), allocatable, dimension(:) :: ALBICE_TABLE ! albedo land ice: 1=vis, 2=nir + real(kind=kind_noahmp), allocatable, dimension(:) :: ALBLAK_TABLE ! albedo frozen lakes: 1=vis, 2=nir + real(kind=kind_noahmp), allocatable, dimension(:) :: OMEGAS_TABLE ! two-stream parameter omega for snow + real(kind=kind_noahmp) :: BETADS_TABLE ! two-stream parameter betad for snow + real(kind=kind_noahmp) :: BETAIS_TABLE ! two-stream parameter betad for snow + real(kind=kind_noahmp), allocatable, dimension(:) :: EG_TABLE ! emissivity soil surface + real(kind=kind_noahmp) :: EICE_TABLE ! ice surface emissivity + + ! global parameters + real(kind=kind_noahmp) :: CO2_TABLE ! co2 partial pressure + real(kind=kind_noahmp) :: O2_TABLE ! o2 partial pressure + real(kind=kind_noahmp) :: TIMEAN_TABLE ! gridcell mean topgraphic index (global mean) + real(kind=kind_noahmp) :: FSATMX_TABLE ! maximum surface saturated fraction (global mean) + real(kind=kind_noahmp) :: Z0SNO_TABLE ! snow surface roughness length (m) (0.002) + real(kind=kind_noahmp) :: SSI_TABLE ! liquid water holding capacity for snowpack (m3/m3) (0.03) + real(kind=kind_noahmp) :: SNOW_RET_FAC_TABLE ! snowpack water release timescale factor (1/s) + real(kind=kind_noahmp) :: SNOW_EMIS_TABLE ! snow emissivity + real(kind=kind_noahmp) :: SWEMX_TABLE ! new snow mass to fully cover old snow (mm) + real(kind=kind_noahmp) :: TAU0_TABLE ! tau0 from Yang97 eqn. 10a + real(kind=kind_noahmp) :: GRAIN_GROWTH_TABLE ! growth from vapor diffusion Yang97 eqn. 10b + real(kind=kind_noahmp) :: EXTRA_GROWTH_TABLE ! extra growth near freezing Yang97 eqn. 10c + real(kind=kind_noahmp) :: DIRT_SOOT_TABLE ! dirt and soot term Yang97 eqn. 10d + real(kind=kind_noahmp) :: BATS_COSZ_TABLE ! zenith angle snow albedo adjustment; b in Yang97 eqn. 15 + real(kind=kind_noahmp) :: BATS_VIS_NEW_TABLE ! new snow visible albedo + real(kind=kind_noahmp) :: BATS_NIR_NEW_TABLE ! new snow NIR albedo + real(kind=kind_noahmp) :: BATS_VIS_AGE_TABLE ! age factor for diffuse visible snow albedo Yang97 eqn. 17 + real(kind=kind_noahmp) :: BATS_NIR_AGE_TABLE ! age factor for diffuse NIR snow albedo Yang97 eqn. 18 + real(kind=kind_noahmp) :: BATS_VIS_DIR_TABLE ! cosz factor for direct visible snow albedo Yang97 eqn. 15 + real(kind=kind_noahmp) :: BATS_NIR_DIR_TABLE ! cosz factor for direct NIR snow albedo Yang97 eqn. 16 + real(kind=kind_noahmp) :: RSURF_SNOW_TABLE ! surface resistance for snow(s/m) + real(kind=kind_noahmp) :: RSURF_EXP_TABLE ! exponent in the shape parameter for soil resistance option 1 + real(kind=kind_noahmp) :: C2_SNOWCOMPACT_TABLE ! overburden snow compaction parameter (m3/kg) + real(kind=kind_noahmp) :: C3_SNOWCOMPACT_TABLE ! snow desctructive metamorphism compaction parameter1 [1/s] + real(kind=kind_noahmp) :: C4_SNOWCOMPACT_TABLE ! snow desctructive metamorphism compaction parameter2 [1/k] + real(kind=kind_noahmp) :: C5_SNOWCOMPACT_TABLE ! snow desctructive metamorphism compaction parameter3 + real(kind=kind_noahmp) :: DM_SNOWCOMPACT_TABLE ! upper Limit on destructive metamorphism compaction [kg/m3] + real(kind=kind_noahmp) :: ETA0_SNOWCOMPACT_TABLE ! snow viscosity coefficient [kg-s/m2] + real(kind=kind_noahmp) :: SNLIQMAXFRAC_TABLE ! maximum liquid water fraction in snow + real(kind=kind_noahmp) :: SWEMAXGLA_TABLE ! Maximum SWE allowed at glaciers (mm) + real(kind=kind_noahmp) :: WSLMAX_TABLE ! maximum lake water storage (mm) + real(kind=kind_noahmp) :: ROUS_TABLE ! specific yield [-] for Niu et al. 2007 groundwater scheme + real(kind=kind_noahmp) :: CMIC_TABLE ! microprore content (0.0-1.0), 0.0: close to free drainage + real(kind=kind_noahmp) :: SNOWDEN_MAX_TABLE ! maximum fresh snowfall density (kg/m3) + real(kind=kind_noahmp) :: CLASS_ALB_REF_TABLE ! reference snow albedo in CLASS scheme + real(kind=kind_noahmp) :: CLASS_SNO_AGE_TABLE ! snow aging e-folding time (s) in CLASS albedo scheme + real(kind=kind_noahmp) :: CLASS_ALB_NEW_TABLE ! fresh snow albedo in CLASS scheme + real(kind=kind_noahmp) :: PSIWLT_TABLE ! soil metric potential for wilting point (m) + real(kind=kind_noahmp) :: Z0SOIL_TABLE ! Bare-soil roughness length (m) (i.e., under the canopy) + real(kind=kind_noahmp) :: Z0LAKE_TABLE ! Lake surface roughness length (m) + + ! irrigation parameters + integer :: IRR_HAR_TABLE ! number of days before harvest date to stop irrigation + real(kind=kind_noahmp) :: IRR_FRAC_TABLE ! irrigation Fraction + real(kind=kind_noahmp) :: IRR_LAI_TABLE ! Minimum lai to trigger irrigation + real(kind=kind_noahmp) :: IRR_MAD_TABLE ! management allowable deficit (0-1) + real(kind=kind_noahmp) :: FILOSS_TABLE ! factor of flood irrigation loss + real(kind=kind_noahmp) :: SPRIR_RATE_TABLE ! mm/h, sprinkler irrigation rate + real(kind=kind_noahmp) :: MICIR_RATE_TABLE ! mm/h, micro irrigation rate + real(kind=kind_noahmp) :: FIRTFAC_TABLE ! flood application rate factor + real(kind=kind_noahmp) :: IR_RAIN_TABLE ! maximum precipitation to stop irrigation trigger + + ! tile drainage parameters + integer :: DRAIN_LAYER_OPT_TABLE ! tile drainage layer + integer , allocatable, dimension(:) :: TD_DEPTH_TABLE ! tile drainage depth (layer number) from soil surface + real(kind=kind_noahmp), allocatable, dimension(:) :: TDSMC_FAC_TABLE ! tile drainage soil moisture factor + real(kind=kind_noahmp), allocatable, dimension(:) :: TD_DC_TABLE ! tile drainage coefficient [mm/d] + real(kind=kind_noahmp), allocatable, dimension(:) :: TD_DCOEF_TABLE ! tile drainage coefficient [mm/d] + real(kind=kind_noahmp), allocatable, dimension(:) :: TD_D_TABLE ! depth to impervious layer from drain water level [m] + real(kind=kind_noahmp), allocatable, dimension(:) :: TD_ADEPTH_TABLE ! actual depth of impervious layer from land surface [m] + real(kind=kind_noahmp), allocatable, dimension(:) :: TD_RADI_TABLE ! effective radius of drain tubes [m] + real(kind=kind_noahmp), allocatable, dimension(:) :: TD_SPAC_TABLE ! distance between two drain tubes or tiles [m] + real(kind=kind_noahmp), allocatable, dimension(:) :: TD_DDRAIN_TABLE ! tile drainage depth [m] + real(kind=kind_noahmp), allocatable, dimension(:) :: KLAT_FAC_TABLE ! hydraulic conductivity mutiplification factor + + ! crop parameters + integer :: DEFAULT_CROP_TABLE ! Default crop index + integer , allocatable, dimension(:) :: PLTDAY_TABLE ! Planting date + integer , allocatable, dimension(:) :: HSDAY_TABLE ! Harvest date + real(kind=kind_noahmp), allocatable, dimension(:) :: PLANTPOP_TABLE ! Plant density [per ha] - used? + real(kind=kind_noahmp), allocatable, dimension(:) :: IRRI_TABLE ! Irrigation strategy 0= non-irrigation 1=irrigation (no water-stress) + real(kind=kind_noahmp), allocatable, dimension(:) :: GDDTBASE_TABLE ! Base temperature for GDD accumulation [C] + real(kind=kind_noahmp), allocatable, dimension(:) :: GDDTCUT_TABLE ! Upper temperature for GDD accumulation [C] + real(kind=kind_noahmp), allocatable, dimension(:) :: GDDS1_TABLE ! GDD from seeding to emergence + real(kind=kind_noahmp), allocatable, dimension(:) :: GDDS2_TABLE ! GDD from seeding to initial vegetative + real(kind=kind_noahmp), allocatable, dimension(:) :: GDDS3_TABLE ! GDD from seeding to post vegetative + real(kind=kind_noahmp), allocatable, dimension(:) :: GDDS4_TABLE ! GDD from seeding to intial reproductive + real(kind=kind_noahmp), allocatable, dimension(:) :: GDDS5_TABLE ! GDD from seeding to pysical maturity + real(kind=kind_noahmp), allocatable, dimension(:) :: C3PSNI_TABLE ! photosynthetic pathway: 0. = c4, 1. = c3 ! Zhe Zhang 2020-07-03 + real(kind=kind_noahmp), allocatable, dimension(:) :: KC25I_TABLE ! co2 michaelis-menten constant at 25c (pa) + real(kind=kind_noahmp), allocatable, dimension(:) :: AKCI_TABLE ! q10 for kc25 + real(kind=kind_noahmp), allocatable, dimension(:) :: KO25I_TABLE ! o2 michaelis-menten constant at 25c (pa) + real(kind=kind_noahmp), allocatable, dimension(:) :: AKOI_TABLE ! q10 for ko25 + real(kind=kind_noahmp), allocatable, dimension(:) :: VCMX25I_TABLE ! maximum rate of carboxylation at 25c (umol co2/m2/s) + real(kind=kind_noahmp), allocatable, dimension(:) :: AVCMXI_TABLE ! q10 for vcmx25 + real(kind=kind_noahmp), allocatable, dimension(:) :: BPI_TABLE ! minimum leaf conductance (umol/m2/s) + real(kind=kind_noahmp), allocatable, dimension(:) :: MPI_TABLE ! slope of conductance-to-photosynthesis relationship + real(kind=kind_noahmp), allocatable, dimension(:) :: QE25I_TABLE ! quantum efficiency at 25c (umol co2 / umol photon) + real(kind=kind_noahmp), allocatable, dimension(:) :: FOLNMXI_TABLE ! foliage nitrogen concentration when f(n)=1 (%) + real(kind=kind_noahmp), allocatable, dimension(:) :: AREF_TABLE ! reference maximum CO2 assimulation rate + real(kind=kind_noahmp), allocatable, dimension(:) :: PSNRF_TABLE ! CO2 assimulation reduction factor(0-1) (caused by non-modeled part, pest,weeds) + real(kind=kind_noahmp), allocatable, dimension(:) :: I2PAR_TABLE ! Fraction of incoming solar radiation to photosynthetically active radiation + real(kind=kind_noahmp), allocatable, dimension(:) :: TASSIM0_TABLE ! Minimum temperature for CO2 assimulation [C] + real(kind=kind_noahmp), allocatable, dimension(:) :: TASSIM1_TABLE ! CO2 assimulation linearly increasing until temperature reaches T1 [C] + real(kind=kind_noahmp), allocatable, dimension(:) :: TASSIM2_TABLE ! CO2 assmilation rate remain at Aref until temperature reaches T2 [C] + real(kind=kind_noahmp), allocatable, dimension(:) :: K_TABLE ! light extinction coefficient + real(kind=kind_noahmp), allocatable, dimension(:) :: EPSI_TABLE ! initial light use efficiency + real(kind=kind_noahmp), allocatable, dimension(:) :: Q10MR_TABLE ! q10 for maintainance respiration + real(kind=kind_noahmp), allocatable, dimension(:) :: LEFREEZ_TABLE ! characteristic T for leaf freezing [K] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: DILE_FC_TABLE ! coeficient for temperature leaf stress death [1/s] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: DILE_FW_TABLE ! coeficient for water leaf stress death [1/s] + real(kind=kind_noahmp), allocatable, dimension(:) :: FRA_GR_TABLE ! fraction of growth respiration + real(kind=kind_noahmp), allocatable, dimension(:,:) :: LF_OVRC_TABLE ! fraction of leaf turnover [1/s] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: ST_OVRC_TABLE ! fraction of stem turnover [1/s] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: RT_OVRC_TABLE ! fraction of root tunrover [1/s] + real(kind=kind_noahmp), allocatable, dimension(:) :: LFMR25_TABLE ! leaf maintenance respiration at 25C [umol CO2/m2/s] + real(kind=kind_noahmp), allocatable, dimension(:) :: STMR25_TABLE ! stem maintenance respiration at 25C [umol CO2/kg bio/s] + real(kind=kind_noahmp), allocatable, dimension(:) :: RTMR25_TABLE ! root maintenance respiration at 25C [umol CO2/kg bio/s] + real(kind=kind_noahmp), allocatable, dimension(:) :: GRAINMR25_TABLE ! grain maintenance respiration at 25C [umol CO2/kg bio/s] + real(kind=kind_noahmp), allocatable, dimension(:,:) :: LFPT_TABLE ! fraction of carbohydrate flux to leaf + real(kind=kind_noahmp), allocatable, dimension(:,:) :: STPT_TABLE ! fraction of carbohydrate flux to stem + real(kind=kind_noahmp), allocatable, dimension(:,:) :: RTPT_TABLE ! fraction of carbohydrate flux to root + real(kind=kind_noahmp), allocatable, dimension(:,:) :: GRAINPT_TABLE ! fraction of carbohydrate flux to grain + real(kind=kind_noahmp), allocatable, dimension(:,:) :: LFCT_TABLE ! fraction of carbohydrate translocation from leaf to grain + real(kind=kind_noahmp), allocatable, dimension(:,:) :: STCT_TABLE ! fraction of carbohydrate translocation from stem to grain + real(kind=kind_noahmp), allocatable, dimension(:,:) :: RTCT_TABLE ! fraction of carbohydrate translocation from root to grain + real(kind=kind_noahmp), allocatable, dimension(:) :: BIO2LAI_TABLE ! leaf area per living leaf biomass [m2/kg] + + ! soil parameters + integer :: SLCATS_TABLE ! number of soil categories + real(kind=kind_noahmp), allocatable, dimension(:) :: BEXP_TABLE ! soil B parameter + real(kind=kind_noahmp), allocatable, dimension(:) :: SMCDRY_TABLE ! dry soil moisture threshold + real(kind=kind_noahmp), allocatable, dimension(:) :: SMCMAX_TABLE ! porosity, saturated value of soil moisture (volumetric) + real(kind=kind_noahmp), allocatable, dimension(:) :: SMCREF_TABLE ! reference soil moisture (field capacity) (volumetric) + real(kind=kind_noahmp), allocatable, dimension(:) :: PSISAT_TABLE ! saturated soil matric potential + real(kind=kind_noahmp), allocatable, dimension(:) :: DKSAT_TABLE ! saturated soil hydraulic conductivity + real(kind=kind_noahmp), allocatable, dimension(:) :: DWSAT_TABLE ! saturated soil hydraulic diffusivity + real(kind=kind_noahmp), allocatable, dimension(:) :: SMCWLT_TABLE ! wilting point soil moisture (volumetric) + real(kind=kind_noahmp), allocatable, dimension(:) :: QUARTZ_TABLE ! soil quartz content + real(kind=kind_noahmp), allocatable, dimension(:) :: BVIC_TABLE ! VIC model infiltration parameter (-) for opt_run=6 + real(kind=kind_noahmp), allocatable, dimension(:) :: AXAJ_TABLE ! Xinanjiang: Tension water distribution inflection parameter [-] for opt_run=7 + real(kind=kind_noahmp), allocatable, dimension(:) :: BXAJ_TABLE ! Xinanjiang: Tension water distribution shape parameter [-] for opt_run=7 + real(kind=kind_noahmp), allocatable, dimension(:) :: XXAJ_TABLE ! Xinanjiang: Free water distribution shape parameter [-] for opt_run=7 + real(kind=kind_noahmp), allocatable, dimension(:) :: BDVIC_TABLE ! VIC model infiltration parameter (-) + real(kind=kind_noahmp), allocatable, dimension(:) :: GDVIC_TABLE ! mean capilary drive (m) + real(kind=kind_noahmp), allocatable, dimension(:) :: BBVIC_TABLE ! heterogeniety parameter for DVIC infiltration [-] + + ! general parameters + real(kind=kind_noahmp), allocatable, dimension(:) :: SLOPE_TABLE ! slope factor for soil drainage + real(kind=kind_noahmp) :: CSOIL_TABLE ! Soil heat capacity [J m-3 K-1] + real(kind=kind_noahmp) :: REFDK_TABLE ! Parameter in the surface runoff parameterization + real(kind=kind_noahmp) :: REFKDT_TABLE ! Parameter in the surface runoff parameterization + real(kind=kind_noahmp) :: FRZK_TABLE ! Frozen ground parameter + real(kind=kind_noahmp) :: ZBOT_TABLE ! Depth [m] of lower boundary soil temperature + real(kind=kind_noahmp) :: CZIL_TABLE ! Parameter used in the calculation of the roughness length for heat + + ! optional parameters + real(kind=kind_noahmp) :: sr2006_theta_1500t_a_TABLE ! sand coefficient + real(kind=kind_noahmp) :: sr2006_theta_1500t_b_TABLE ! clay coefficient + real(kind=kind_noahmp) :: sr2006_theta_1500t_c_TABLE ! orgm coefficient + real(kind=kind_noahmp) :: sr2006_theta_1500t_d_TABLE ! sand*orgm coefficient + real(kind=kind_noahmp) :: sr2006_theta_1500t_e_TABLE ! clay*orgm coefficient + real(kind=kind_noahmp) :: sr2006_theta_1500t_f_TABLE ! sand*clay coefficient + real(kind=kind_noahmp) :: sr2006_theta_1500t_g_TABLE ! constant adjustment + real(kind=kind_noahmp) :: sr2006_theta_1500_a_TABLE ! theta_1500t coefficient + real(kind=kind_noahmp) :: sr2006_theta_1500_b_TABLE ! constant adjustment + real(kind=kind_noahmp) :: sr2006_theta_33t_a_TABLE ! sand coefficient + real(kind=kind_noahmp) :: sr2006_theta_33t_b_TABLE ! clay coefficient + real(kind=kind_noahmp) :: sr2006_theta_33t_c_TABLE ! orgm coefficient + real(kind=kind_noahmp) :: sr2006_theta_33t_d_TABLE ! sand*orgm coefficient + real(kind=kind_noahmp) :: sr2006_theta_33t_e_TABLE ! clay*orgm coefficient + real(kind=kind_noahmp) :: sr2006_theta_33t_f_TABLE ! sand*clay coefficient + real(kind=kind_noahmp) :: sr2006_theta_33t_g_TABLE ! constant adjustment + real(kind=kind_noahmp) :: sr2006_theta_33_a_TABLE ! theta_33t*theta_33t coefficient + real(kind=kind_noahmp) :: sr2006_theta_33_b_TABLE ! theta_33t coefficient + real(kind=kind_noahmp) :: sr2006_theta_33_c_TABLE ! constant adjustment + real(kind=kind_noahmp) :: sr2006_theta_s33t_a_TABLE ! sand coefficient + real(kind=kind_noahmp) :: sr2006_theta_s33t_b_TABLE ! clay coefficient + real(kind=kind_noahmp) :: sr2006_theta_s33t_c_TABLE ! orgm coefficient + real(kind=kind_noahmp) :: sr2006_theta_s33t_d_TABLE ! sand*orgm coefficient + real(kind=kind_noahmp) :: sr2006_theta_s33t_e_TABLE ! clay*orgm coefficient + real(kind=kind_noahmp) :: sr2006_theta_s33t_f_TABLE ! sand*clay coefficient + real(kind=kind_noahmp) :: sr2006_theta_s33t_g_TABLE ! constant adjustment + real(kind=kind_noahmp) :: sr2006_theta_s33_a_TABLE ! theta_s33t coefficient + real(kind=kind_noahmp) :: sr2006_theta_s33_b_TABLE ! constant adjustment + real(kind=kind_noahmp) :: sr2006_psi_et_a_TABLE ! sand coefficient + real(kind=kind_noahmp) :: sr2006_psi_et_b_TABLE ! clay coefficient + real(kind=kind_noahmp) :: sr2006_psi_et_c_TABLE ! theta_s33 coefficient + real(kind=kind_noahmp) :: sr2006_psi_et_d_TABLE ! sand*theta_s33 coefficient + real(kind=kind_noahmp) :: sr2006_psi_et_e_TABLE ! clay*theta_s33 coefficient + real(kind=kind_noahmp) :: sr2006_psi_et_f_TABLE ! sand*clay coefficient + real(kind=kind_noahmp) :: sr2006_psi_et_g_TABLE ! constant adjustment + real(kind=kind_noahmp) :: sr2006_psi_e_a_TABLE ! psi_et*psi_et coefficient + real(kind=kind_noahmp) :: sr2006_psi_e_b_TABLE ! psi_et coefficient + real(kind=kind_noahmp) :: sr2006_psi_e_c_TABLE ! constant adjustment + real(kind=kind_noahmp) :: sr2006_smcmax_a_TABLE ! sand adjustment + real(kind=kind_noahmp) :: sr2006_smcmax_b_TABLE ! constant adjustment + + + ! Spatially varying fields (for now it is de-activated) + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: bexp_3D ! C-H B exponent + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: smcdry_3D ! Soil Moisture Limit: Dry + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: smcwlt_3D ! Soil Moisture Limit: Wilt + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: smcref_3D ! Soil Moisture Limit: Reference + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: smcmax_3D ! Soil Moisture Limit: Max + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: dksat_3D ! Saturated Soil Conductivity + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: dwsat_3D ! Saturated Soil Diffusivity + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: psisat_3D ! Saturated Matric Potential + real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: quartz_3D ! Soil quartz content + real(kind=kind_noahmp), allocatable, dimension(:,:) :: refdk_2D ! Reference Soil Conductivity + real(kind=kind_noahmp), allocatable, dimension(:,:) :: refkdt_2D ! Soil Infiltration Parameter + real(kind=kind_noahmp), allocatable, dimension(:,:) :: irr_frac_2D ! irrigation Fraction + real(kind=kind_noahmp), allocatable, dimension(:,:) :: irr_har_2D ! number of days before harvest date to stop irrigation + real(kind=kind_noahmp), allocatable, dimension(:,:) :: irr_lai_2D ! Minimum lai to trigger irrigation + real(kind=kind_noahmp), allocatable, dimension(:,:) :: irr_mad_2D ! management allowable deficit (0-1) + real(kind=kind_noahmp), allocatable, dimension(:,:) :: filoss_2D ! fraction of flood irrigation loss (0-1) + real(kind=kind_noahmp), allocatable, dimension(:,:) :: sprir_rate_2D ! mm/h, sprinkler irrigation rate + real(kind=kind_noahmp), allocatable, dimension(:,:) :: micir_rate_2D ! mm/h, micro irrigation rate + real(kind=kind_noahmp), allocatable, dimension(:,:) :: firtfac_2D ! flood application rate factor + real(kind=kind_noahmp), allocatable, dimension(:,:) :: ir_rain_2D ! maximum precipitation to stop irrigation trigger + real(kind=kind_noahmp), allocatable, dimension(:,:) :: bvic_2d ! VIC model infiltration parameter [-] opt_run=6 + real(kind=kind_noahmp), allocatable, dimension(:,:) :: axaj_2D ! Tension water distribution inflection parameter [-] opt_run=7 + real(kind=kind_noahmp), allocatable, dimension(:,:) :: bxaj_2D ! Tension water distribution shape parameter [-] opt_run=7 + real(kind=kind_noahmp), allocatable, dimension(:,:) :: xxaj_2D ! Free water distribution shape parameter [-] opt_run=7 + real(kind=kind_noahmp), allocatable, dimension(:,:) :: bdvic_2d ! VIC model infiltration parameter [-] opt_run=8 + real(kind=kind_noahmp), allocatable, dimension(:,:) :: gdvic_2d ! Mean Capillary Drive (m) for infiltration models opt_run=8 + real(kind=kind_noahmp), allocatable, dimension(:,:) :: bbvic_2d ! DVIC heterogeniety parameter for infiltration [-] opt_run=8 + real(kind=kind_noahmp), allocatable, dimension(:,:) :: KLAT_FAC ! factor multiplier to hydraulic conductivity + real(kind=kind_noahmp), allocatable, dimension(:,:) :: TDSMC_FAC ! factor multiplier to field capacity + real(kind=kind_noahmp), allocatable, dimension(:,:) :: TD_DC ! drainage coefficient for simple + real(kind=kind_noahmp), allocatable, dimension(:,:) :: TD_DCOEF ! drainge coefficient for Hooghoudt + real(kind=kind_noahmp), allocatable, dimension(:,:) :: TD_DDRAIN ! depth of drain + real(kind=kind_noahmp), allocatable, dimension(:,:) :: TD_RADI ! tile radius + real(kind=kind_noahmp), allocatable, dimension(:,:) :: TD_SPAC ! tile spacing + + end type NoahmpIO_type + + type(NoahmpIO_type) :: NoahmpIO + +end module NoahmpIOVarType diff --git a/drivers/lis/NoahmpInitMainMod.F90 b/drivers/lis/NoahmpInitMainMod.F90 new file mode 100644 index 00000000..7a590791 --- /dev/null +++ b/drivers/lis/NoahmpInitMainMod.F90 @@ -0,0 +1,272 @@ +module NoahmpInitMainMod + +!!! Module to initialize Noah-MP 2-D variables + + use Machine + use NoahmpIOVarType + use NoahmpSnowInitMod + + implicit none + +contains + + subroutine NoahmpInitMain(NoahmpIO) + +! ------------------------ Code history ------------------------------------- +! Original Noah-MP subroutine: NOAHMP_INIT +! Original code: Guo-Yue Niu and Noah-MP team (Niu et al. 2011) +! Refactered code: C. He, P. Valayamkunnath, & refactor team (He et al. 2023) +! --------------------------------------------------------------------------- + + implicit none + + type(NoahmpIO_type), intent(inout) :: NoahmpIO + + ! local variables + integer :: ide,jde,its,jts,itf,jtf + integer :: I,J,errflag,NS + logical :: urbanpt_flag + real(kind=kind_noahmp) :: BEXP, SMCMAX, PSISAT, FK + real(kind=kind_noahmp), parameter :: BLIM = 5.5 + real(kind=kind_noahmp), parameter :: HLICE = 3.335E5 + real(kind=kind_noahmp), parameter :: GRAV0 = 9.81 + real(kind=kind_noahmp), parameter :: T0 = 273.15 +! --------------------------------------------------------------------------- + + ! initialize + ide = NoahmpIO%ide+1 + jde = NoahmpIO%jde+1 + its = NoahmpIO%its + jts = NoahmpIO%jts + + ! only initialize for non-restart case + if ( .not. NoahmpIO%restart_flag ) then + + itf = min0(NoahmpIO%ite, ide-1) + jtf = min0(NoahmpIO%jte, jde-1) + + ! initialize physical snow height SNOWH + if ( .not. NoahmpIO%FNDSNOWH ) then + ! If no SNOWH do the following + print*, 'SNOW HEIGHT NOT FOUND - VALUE DEFINED IN LSMINIT' + do J = jts, jtf + do I = its, itf + NoahmpIO%SNOWH(I,J) = NoahmpIO%SNOW(I,J) * 0.005 ! SNOW in mm and SNOWH in m + enddo + enddo + endif + + ! Check if snow/snowh are consistent and cap SWE at 2000mm + ! the Noah-MP code does it internally but if we don't do it here, problems ensue + do J = jts, jtf + do I = its, itf + if ( NoahmpIO%SNOW(I,J) < 0.0 ) NoahmpIO%SNOW(I,J) = 0.0 + if ( NoahmpIO%SNOWH(I,J) < 0.0 ) NoahmpIO%SNOWH(I,J) = 0.0 + if ( (NoahmpIO%SNOW(I,J) > 0.0) .and. (NoahmpIO%SNOWH(I,J) == 0.0) ) & + NoahmpIO%SNOWH(I,J) = NoahmpIO%SNOW(I,J) * 0.005 + if ( (NoahmpIO%SNOWH(I,J) > 0.0) .and. (NoahmpIO%SNOW(I,J) == 0.0) ) & + NoahmpIO%SNOW(I,J) = NoahmpIO%SNOWH(I,J) / 0.005 + if ( NoahmpIO%SNOW(I,J) > 2000.0 ) then + NoahmpIO%SNOWH(I,J) = NoahmpIO%SNOWH(I,J) * 2000.0 / NoahmpIO%SNOW(I,J) ! SNOW in mm and SNOWH in m + NoahmpIO%SNOW (I,J) = 2000.0 ! cap SNOW at 2000, maintain density + endif + enddo + enddo + + ! check soil type + errflag = 0 + do J = jts, jtf + do I = its, itf + if ( NoahmpIO%ISLTYP(I,J) < 1 ) then + errflag = 1 + write(*,*) "lsminit: out of range ISLTYP ",I,J,NoahmpIO%ISLTYP(I,J) + stop + endif + enddo + enddo + + ! initialize soil liquid water content SH2O + do J = jts , jtf + do I = its , itf + if ( (NoahmpIO%IVGTYP(I,J) == NoahmpIO%ISICE_TABLE) .and. & + (NoahmpIO%XICE(I,J) <= 0.0) ) then + do NS = 1, NoahmpIO%NSOIL + NoahmpIO%SMOIS(I,NS,J) = 1.0 ! glacier starts all frozen + NoahmpIO%SH2O(I,NS,J) = 0.0 + NoahmpIO%TSLB(I,NS,J) = min(NoahmpIO%TSLB(I,NS,J), 263.15) ! set glacier temp to at most -10C + enddo + ! NoahmpIO%TMN(I,J) = min(NoahmpIO%TMN(I,J), 263.15) ! set deep temp to at most -10C + NoahmpIO%SNOW(I,J) = max(NoahmpIO%SNOW(I,J), 10.0) ! set SWE to at least 10mm + NoahmpIO%SNOWH(I,J) = NoahmpIO%SNOW(I,J) * 0.01 ! SNOW in mm and SNOWH in m + else + BEXP = NoahmpIO%BEXP_TABLE (NoahmpIO%ISLTYP(I,J)) + SMCMAX = NoahmpIO%SMCMAX_TABLE(NoahmpIO%ISLTYP(I,J)) + PSISAT = NoahmpIO%PSISAT_TABLE(NoahmpIO%ISLTYP(I,J)) + do NS = 1, NoahmpIO%NSOIL + if ( NoahmpIO%SMOIS(I,NS,J) > SMCMAX ) NoahmpIO%SMOIS(I,NS,J) = SMCMAX + enddo + if ( (BEXP > 0.0) .and. (SMCMAX > 0.0) .and. (PSISAT > 0.0) ) then + do NS = 1, NoahmpIO%NSOIL + if ( NoahmpIO%TSLB(I,NS,J) < 273.149 ) then + FK = (((HLICE / (GRAV0*(-PSISAT))) * & + ((NoahmpIO%TSLB(I,NS,J)-T0) / NoahmpIO%TSLB(I,NS,J)))**(-1/BEXP))*SMCMAX + FK = max(FK, 0.02) + NoahmpIO%SH2O(I,NS,J) = min(FK, NoahmpIO%SMOIS(I,NS,J)) + else + NoahmpIO%SH2O(I,NS,J) = NoahmpIO%SMOIS(I,NS,J) + endif + enddo + else + do NS = 1, NoahmpIO%NSOIL + NoahmpIO%SH2O(I,NS,J) = NoahmpIO%SMOIS(I,NS,J) + enddo + endif + endif + enddo ! I + enddo ! J + + ! initilize other quantities + do J = jts, jtf + do I = its, itf + NoahmpIO%QTDRAIN(I,J) = 0.0 + NoahmpIO%TVXY(I,J) = NoahmpIO%TSK(I,J) + NoahmpIO%TGXY(I,J) = NoahmpIO%TSK(I,J) + if ( (NoahmpIO%SNOW(I,J) > 0.0) .and. (NoahmpIO%TSK(i,j) > 273.15) ) NoahmpIO%TVXY(I,J) = 273.15 + if ( (NoahmpIO%SNOW(I,J) > 0.0) .and. (NoahmpIO%TSK(I,J) > 273.15) ) NoahmpIO%TGXY(I,J) = 273.15 + NoahmpIO%CANWAT(I,J) = 0.0 + NoahmpIO%CANLIQXY(I,J) = NoahmpIO%CANWAT(I,J) + NoahmpIO%CANICEXY(I,J) = 0.0 + NoahmpIO%EAHXY(I,J) = 2000.0 + NoahmpIO%TAHXY(I,J) = NoahmpIO%TSK(I,J) + NoahmpIO%T2MVXY(I,J) = NoahmpIO%TSK(I,J) + NoahmpIO%T2MBXY(I,J) = NoahmpIO%TSK(I,J) + if ( (NoahmpIO%SNOW(I,J) > 0.0) .and. (NoahmpIO%TSK(I,J) > 273.15) ) NoahmpIO%TAHXY(I,J) = 273.15 + if ( (NoahmpIO%SNOW(I,J) > 0.0) .and. (NoahmpIO%TSK(I,J) > 273.15) ) NoahmpIO%T2MVXY(I,J) = 273.15 + if ( (NoahmpIO%SNOW(I,J) > 0.0) .and. (NoahmpIO%TSK(I,J) > 273.15) ) NoahmpIO%T2MBXY(I,J) = 273.15 + NoahmpIO%CMXY(I,J) = 0.0 + NoahmpIO%CHXY(I,J) = 0.0 + NoahmpIO%FWETXY(I,J) = 0.0 + NoahmpIO%SNEQVOXY(I,J) = 0.0 + NoahmpIO%ALBOLDXY(I,J) = 0.65 + NoahmpIO%QSNOWXY(I,J) = 0.0 + NoahmpIO%QRAINXY(I,J) = 0.0 + NoahmpIO%WSLAKEXY(I,J) = 0.0 + if ( NoahmpIO%IOPT_RUNSUB /= 5 ) then + NoahmpIO%WAXY(I,J) = 4900.0 + NoahmpIO%WTXY(I,J) = NoahmpIO%WAXY(i,j) + NoahmpIO%ZWTXY(I,J) = (25.0 + 2.0) - NoahmpIO%WAXY(i,j)/1000/0.2 + else + NoahmpIO%WAXY(I,J) = 0.0 + NoahmpIO%WTXY(I,J) = 0.0 + NoahmpIO%AREAXY(I,J) = (NoahmpIO%DX*NoahmpIO%DY) / (NoahmpIO%MSFTX(I,J)*NoahmpIO%MSFTY(I,J)) + endif + + urbanpt_flag = .false. + if ( (NoahmpIO%IVGTYP(I,J) == NoahmpIO%ISURBAN_TABLE) .or. & + (NoahmpIO%IVGTYP(I,J) > NoahmpIO%URBTYPE_beg) ) then + urbanpt_flag = .true. + endif + + if ( (NoahmpIO%IVGTYP(I,J) == NoahmpIO%ISBARREN_TABLE) .or. & + (NoahmpIO%IVGTYP(I,J) == NoahmpIO%ISICE_TABLE) .or. & + ((NoahmpIO%SF_URBAN_PHYSICS == 0) .and. (urbanpt_flag .eqv. .true.)) .or. & + (NoahmpIO%IVGTYP(I,J) == NoahmpIO%ISWATER_TABLE) ) then + NoahmpIO%LAI(I,J) = 0.0 + NoahmpIO%XSAIXY(I,J) = 0.0 + NoahmpIO%LFMASSXY(I,J) = 0.0 + NoahmpIO%STMASSXY(I,J) = 0.0 + NoahmpIO%RTMASSXY(I,J) = 0.0 + NoahmpIO%WOODXY(I,J) = 0.0 + NoahmpIO%STBLCPXY(I,J) = 0.0 + NoahmpIO%FASTCPXY(I,J) = 0.0 + NoahmpIO%GRAINXY(I,J) = 1.0e-10 + NoahmpIO%GDDXY(I,J) = 0 + NoahmpIO%CROPCAT(I,J) = 0 + else + if ( (NoahmpIO%LAI(I,J) > 100) .or. (NoahmpIO%LAI(I,J) < 0) ) & + NoahmpIO%LAI(I,J) = 0.0 + NoahmpIO%LAI(I,J) = max(NoahmpIO%LAI(I,J), 0.05) ! at least start with 0.05 for arbitrary initialization (v3.7) + NoahmpIO%XSAIXY(I,J) = max(0.1*NoahmpIO%LAI(I,J), 0.05) ! MB: arbitrarily initialize SAI using input LAI (v3.7) + if ( urbanpt_flag .eqv. .true. ) then + NoahmpIO%LFMASSXY(I,J) = NoahmpIO%LAI(I,J) * 1000.0 / & + max(NoahmpIO%SLA_TABLE(NoahmpIO%NATURAL_TABLE),1.0)! use LAI to initialize (v3.7) + else + NoahmpIO%LFMASSXY(I,J) = NoahmpIO%LAI(I,J) * 1000.0 / & + max(NoahmpIO%SLA_TABLE(NoahmpIO%IVGTYP(I,J)),1.0) ! use LAI to initialize (v3.7) + endif + NoahmpIO%STMASSXY(I,J) = NoahmpIO%XSAIXY(I,J) * 1000.0 / 3.0 ! use SAI to initialize (v3.7) + NoahmpIO%RTMASSXY(I,J) = 500.0 ! these are all arbitrary and probably should be + NoahmpIO%WOODXY(I,J) = 500.0 ! in the table or read from initialization + NoahmpIO%STBLCPXY(I,J) = 1000.0 + NoahmpIO%FASTCPXY(I,J) = 1000.0 + NoahmpIO%GRAINXY(I,J) = 1.0e-10 + NoahmpIO%GDDXY(I,J) = 0 + + ! Initialize crop for crop model + if ( NoahmpIO%IOPT_CROP == 1 ) then + NoahmpIO%CROPCAT(I,J) = NoahmpIO%default_crop_table + if ( NoahmpIO%CROPTYPE(I,5,J) >= 0.5 ) then + NoahmpIO%RTMASSXY(I,J) = 0.0 + NoahmpIO%WOODXY (I,J) = 0.0 + if ( (NoahmpIO%CROPTYPE(I,1,J) > NoahmpIO%CROPTYPE(I,2,J)) .and. & + (NoahmpIO%CROPTYPE(I,1,J) > NoahmpIO%CROPTYPE(I,3,J)) .and. & + (NoahmpIO%CROPTYPE(I,1,J) > NoahmpIO%CROPTYPE(I,4,J)) ) then ! choose corn + NoahmpIO%CROPCAT(I,J) = 1 + NoahmpIO%LFMASSXY(I,J) = NoahmpIO%LAI(I,J) / 0.015 ! Initialize lfmass Zhe Zhang 2020-07-13 + NoahmpIO%STMASSXY(I,J) = NoahmpIO%XSAIXY(I,J) / 0.003 + elseif ( (NoahmpIO%CROPTYPE(I,2,J) > NoahmpIO%CROPTYPE(I,1,J)) .and. & + (NoahmpIO%CROPTYPE(I,2,J) > NoahmpIO%CROPTYPE(I,3,J)) .and. & + (NoahmpIO%CROPTYPE(I,2,J) > NoahmpIO%CROPTYPE(I,4,J)) ) then ! choose soybean + NoahmpIO%CROPCAT(I,J) = 2 + NoahmpIO%LFMASSXY(I,J) = NoahmpIO%LAI(I,J) / 0.030 ! Initialize lfmass Zhe Zhang 2020-07-13 + NoahmpIO%STMASSXY(I,J) = NoahmpIO%XSAIXY(I,J) / 0.003 + else + NoahmpIO%CROPCAT(I,J) = NoahmpIO%default_crop_table + NoahmpIO%LFMASSXY(I,J) = NoahmpIO%LAI(I,J) / 0.035 + NoahmpIO%STMASSXY(I,J) = NoahmpIO%XSAIXY(I,J) / 0.003 + endif + endif + endif + + ! Noah-MP irrigation scheme + if ( (NoahmpIO%IOPT_IRR >= 1) .and. (NoahmpIO%IOPT_IRR <= 3) ) then + if ( (NoahmpIO%IOPT_IRRM == 0) .or. (NoahmpIO%IOPT_IRRM ==1) ) then ! sprinkler + NoahmpIO%IRNUMSI(I,J) = 0 + NoahmpIO%IRWATSI(I,J) = 0.0 + NoahmpIO%IRELOSS(I,J) = 0.0 + NoahmpIO%IRRSPLH(I,J) = 0.0 + elseif ( (NoahmpIO%IOPT_IRRM == 0) .or. (NoahmpIO%IOPT_IRRM == 2) ) then ! micro or drip + NoahmpIO%IRNUMMI(I,J) = 0 + NoahmpIO%IRWATMI(I,J) = 0.0 + NoahmpIO%IRMIVOL(I,J) = 0.0 + elseif ( (NoahmpIO%IOPT_IRRM == 0) .or. (NoahmpIO%IOPT_IRRM == 3) ) then ! flood + NoahmpIO%IRNUMFI(I,J) = 0 + NoahmpIO%IRWATFI(I,J) = 0.0 + NoahmpIO%IRFIVOL(I,J) = 0.0 + endif + endif + endif + enddo ! I + enddo ! J + + ! Given the soil layer thicknesses (in DZS), initialize the soil layer + ! depths from the surface. + NoahmpIO%ZSOIL(1) = -NoahmpIO%DZS(1) ! negative + do NS = 2, NoahmpIO%NSOIL + NoahmpIO%ZSOIL(NS) = NoahmpIO%ZSOIL(NS-1) - NoahmpIO%DZS(NS) + enddo + + ! Initialize Noah-MP Snow + call NoahmpSnowinitMain(NoahmpIO) + + !initialize arrays for groundwater dynamics iopt_runsub=5 + if ( NoahmpIO%IOPT_RUNSUB == 5 ) then + NoahmpIO%STEPWTD = nint(NoahmpIO%WTDDT * 60.0 / NoahmpIO%DTBL) + NoahmpIO%STEPWTD = max(NoahmpIO%STEPWTD,1) + endif + + endif ! NoahmpIO%restart_flag + + end subroutine NoahmpInitMain + +end module NoahmpInitMainMod diff --git a/drivers/lis/NoahmpReadTableMod.F90 b/drivers/lis/NoahmpReadTableMod.F90 new file mode 100644 index 00000000..c56c7ac0 --- /dev/null +++ b/drivers/lis/NoahmpReadTableMod.F90 @@ -0,0 +1,1192 @@ +module NoahmpReadTableMod + +!!! Initialize Noah-MP look-up table variables +!!! Table variables should be first defined in NoahmpIOVarType.F90 + +! ------------------------ Code history ----------------------------------- +! Original code: Guo-Yue Niu and Noah-MP team (Niu et al. 2011) +! Refactered code: C. He, P. Valayamkunnath, & refactor team (He et al. 2023) +! ------------------------------------------------------------------------- + + use Machine + use NoahmpIOVarType + + implicit none + +contains + +!=== read Noahmp Table values + + subroutine NoahmpReadTable(LANDDATA_name,MPTABLE_file) + + implicit none + + character(len=*), intent(in) :: LANDDATA_name + character(len=*), intent(in) :: MPTABLE_file + + !------------------------------------------------------- + !=== define key dimensional variables + !------------------------------------------------------- + integer, parameter :: MVT = 27 ! number of vegetation types + integer, parameter :: MBAND = 2 ! number of radiation bands + integer, parameter :: MSC = 8 ! number of soil texture + integer, parameter :: MAX_SOILTYP = 30 ! max number of soil types + integer, parameter :: NCROP = 5 ! number of crop types + integer, parameter :: NSTAGE = 8 ! number of crop growth stages + integer, parameter :: NUM_SLOPE = 9 ! number of slope + + !------------------------------------------------------- + !=== define local variables to store NoahmpTable values + !------------------------------------------------------- + + ! vegetation parameters + character(len=256) :: VEG_DATASET_DESCRIPTION + logical :: file_named + integer :: ierr, IK, IM + integer :: NVEG, ISURBAN, ISWATER, ISBARREN, ISICE, ISCROP, EBLFOREST, NATURAL, URBTYPE_beg + integer :: LCZ_1, LCZ_2, LCZ_3, LCZ_4, LCZ_5, LCZ_6, LCZ_7, LCZ_8, LCZ_9, LCZ_10, LCZ_11 + real(kind=kind_noahmp), dimension(MVT) :: SAI_JAN, SAI_FEB, SAI_MAR, SAI_APR, SAI_MAY, SAI_JUN, SAI_JUL, SAI_AUG, & + SAI_SEP, SAI_OCT, SAI_NOV, SAI_DEC, LAI_JAN, LAI_FEB, LAI_MAR, LAI_APR, & + LAI_MAY, LAI_JUN, LAI_JUL, LAI_AUG, LAI_SEP, LAI_OCT, LAI_NOV, LAI_DEC, & + RHOL_VIS, RHOL_NIR, RHOS_VIS, RHOS_NIR, TAUL_VIS, TAUL_NIR, TAUS_VIS, TAUS_NIR,& + CH2OP, DLEAF, Z0MVT, HVT, HVB, DEN, RC, MFSNO, SCFFAC, XL, CWPVT, C3PSN, KC25, & + AKC, KO25, AKO, AVCMX, AQE, LTOVRC, DILEFC, DILEFW, RMF25, SLA, FRAGR, TMIN, & + VCMX25, TDLEF, BP, MP, QE25, RMS25, RMR25, ARM, FOLNMX, WDPOOL, WRRAT, MRP, & + NROOT, RGL, RS, HS, TOPT, RSMAX, RTOVRC, RSWOODC, BF, WSTRC, LAIMIN, CBIOM, & + XSAMIN + namelist / noahmp_usgs_veg_categories / VEG_DATASET_DESCRIPTION, NVEG + namelist / noahmp_usgs_parameters / ISURBAN, ISWATER, ISBARREN, ISICE, ISCROP, EBLFOREST, NATURAL, URBTYPE_beg, & + LCZ_1, LCZ_2, LCZ_3, LCZ_4, LCZ_5, LCZ_6, LCZ_7, LCZ_8, LCZ_9, LCZ_10, LCZ_11, & + CH2OP, DLEAF, Z0MVT, HVT, HVB, DEN, RC, MFSNO, SCFFAC, XL, CWPVT, C3PSN, KC25, & + AKC, KO25, AKO, AVCMX, AQE, LTOVRC, DILEFC, DILEFW, RMF25, SLA, FRAGR, TMIN, & + VCMX25, TDLEF, BP, MP, QE25, RMS25, RMR25, ARM, FOLNMX, WDPOOL, WRRAT, MRP, & + NROOT, RGL, RS, HS, TOPT, RSMAX, RTOVRC, RSWOODC, BF, WSTRC, LAIMIN, CBIOM, & + XSAMIN, SAI_JAN, SAI_FEB, SAI_MAR, SAI_APR, SAI_MAY, & + SAI_JUN, SAI_JUL, SAI_AUG, SAI_SEP, SAI_OCT, SAI_NOV, SAI_DEC, LAI_JAN, & + LAI_FEB, LAI_MAR, LAI_APR, LAI_MAY, LAI_JUN, LAI_JUL, LAI_AUG, LAI_SEP, & + LAI_OCT, LAI_NOV, LAI_DEC, RHOL_VIS, RHOL_NIR, RHOS_VIS, RHOS_NIR, TAUL_VIS, & + TAUL_NIR, TAUS_VIS, TAUS_NIR + namelist / noahmp_modis_veg_categories / VEG_DATASET_DESCRIPTION, NVEG + namelist / noahmp_modis_parameters / ISURBAN, ISWATER, ISBARREN, ISICE, ISCROP, EBLFOREST, NATURAL, URBTYPE_beg, & + LCZ_1, LCZ_2, LCZ_3, LCZ_4, LCZ_5, LCZ_6, LCZ_7, LCZ_8, LCZ_9, LCZ_10, LCZ_11, & + CH2OP, DLEAF, Z0MVT, HVT, HVB, DEN, RC, MFSNO, SCFFAC, XL, CWPVT, C3PSN, KC25, & + AKC, KO25, AKO, AVCMX, AQE, LTOVRC, DILEFC, DILEFW, RMF25, SLA, FRAGR, TMIN, & + VCMX25, TDLEF, BP, MP, QE25, RMS25, RMR25, ARM, FOLNMX, WDPOOL, WRRAT, MRP, & + NROOT, RGL, RS, HS, TOPT, RSMAX, RTOVRC, RSWOODC, BF, WSTRC, LAIMIN, CBIOM, & + XSAMIN, SAI_JAN, SAI_FEB, SAI_MAR, SAI_APR, SAI_MAY, & + SAI_JUN, SAI_JUL, SAI_AUG, SAI_SEP, SAI_OCT, SAI_NOV, SAI_DEC, LAI_JAN, & + LAI_FEB, LAI_MAR, LAI_APR, LAI_MAY, LAI_JUN, LAI_JUL, LAI_AUG, LAI_SEP, & + LAI_OCT, LAI_NOV, LAI_DEC, RHOL_VIS, RHOL_NIR, RHOS_VIS, RHOS_NIR, TAUL_VIS, & + TAUL_NIR, TAUS_VIS, TAUS_NIR + + ! soil parameters + character(len=256) :: message + character(len=10) :: SLTYPE + integer :: SLCATS + real(kind=kind_noahmp), dimension(MAX_SOILTYP) :: BB, DRYSMC, MAXSMC, REFSMC, SATPSI, SATDK, SATDW, WLTSMC, QTZ, & + BVIC, AXAJ, BXAJ, XXAJ, BDVIC, BBVIC, GDVIC, HC + namelist / noahmp_stas_soil_categories / SLTYPE, SLCATS + namelist / noahmp_soil_stas_parameters / BB, DRYSMC, MAXSMC, REFSMC, SATPSI, SATDK, SATDW, WLTSMC, QTZ, & + BVIC, AXAJ, BXAJ, XXAJ, BDVIC, BBVIC, GDVIC + namelist / noahmp_soil_stas_ruc_parameters / BB, DRYSMC, HC, MAXSMC, REFSMC, SATPSI, SATDK, SATDW, WLTSMC, QTZ, & + BVIC, AXAJ, BXAJ, XXAJ, BDVIC, BBVIC, GDVIC + + ! general parameters + real(kind=kind_noahmp) :: CSOIL_DATA, REFDK_DATA, REFKDT_DATA, FRZK_DATA, ZBOT_DATA, CZIL_DATA + real(kind=kind_noahmp), dimension(NUM_SLOPE) :: SLOPE_DATA + namelist / noahmp_general_parameters / SLOPE_DATA, CSOIL_DATA, REFDK_DATA, REFKDT_DATA, FRZK_DATA, ZBOT_DATA, & + CZIL_DATA + + ! radiation parameters + real(kind=kind_noahmp) :: BETADS, BETAIS, EICE + real(kind=kind_noahmp), dimension(MBAND) :: ALBICE, ALBLAK, OMEGAS + real(kind=kind_noahmp), dimension(2) :: EG + real(kind=kind_noahmp), dimension(MSC) :: ALBSAT_VIS, ALBSAT_NIR, ALBDRY_VIS, ALBDRY_NIR + namelist / noahmp_rad_parameters / ALBSAT_VIS, ALBSAT_NIR, ALBDRY_VIS, ALBDRY_NIR, ALBICE, ALBLAK, OMEGAS, & + BETADS, BETAIS, EG, EICE + + ! global parameters + real(kind=kind_noahmp) :: CO2, O2, TIMEAN, FSATMX, Z0SNO, SSI, SNOW_RET_FAC ,SNOW_EMIS, SWEMX, TAU0, & + GRAIN_GROWTH, EXTRA_GROWTH, DIRT_SOOT, BATS_COSZ, BATS_VIS_NEW, & + BATS_NIR_NEW, BATS_VIS_AGE, BATS_NIR_AGE, BATS_VIS_DIR, BATS_NIR_DIR, & + RSURF_SNOW, RSURF_EXP, C2_SNOWCOMPACT, C3_SNOWCOMPACT, C4_SNOWCOMPACT, & + C5_SNOWCOMPACT, DM_SNOWCOMPACT, ETA0_SNOWCOMPACT, SNLIQMAXFRAC, SWEMAXGLA, & + WSLMAX, ROUS, CMIC, SNOWDEN_MAX, CLASS_ALB_REF, CLASS_SNO_AGE, CLASS_ALB_NEW,& + PSIWLT, Z0SOIL, Z0LAKE + namelist / noahmp_global_parameters / CO2, O2, TIMEAN, FSATMX, Z0SNO, SSI, SNOW_RET_FAC ,SNOW_EMIS, SWEMX, TAU0, & + GRAIN_GROWTH, EXTRA_GROWTH, DIRT_SOOT, BATS_COSZ, BATS_VIS_NEW, & + BATS_NIR_NEW, BATS_VIS_AGE, BATS_NIR_AGE, BATS_VIS_DIR, BATS_NIR_DIR, & + RSURF_SNOW, RSURF_EXP, C2_SNOWCOMPACT, C3_SNOWCOMPACT, C4_SNOWCOMPACT, & + C5_SNOWCOMPACT, DM_SNOWCOMPACT, ETA0_SNOWCOMPACT, SNLIQMAXFRAC, SWEMAXGLA, & + WSLMAX, ROUS, CMIC, SNOWDEN_MAX, CLASS_ALB_REF, CLASS_SNO_AGE, CLASS_ALB_NEW,& + PSIWLT, Z0SOIL, Z0LAKE + + ! irrigation parameters + integer :: IRR_HAR + real(kind=kind_noahmp) :: IRR_FRAC, IRR_LAI, IRR_MAD, FILOSS, SPRIR_RATE, MICIR_RATE, FIRTFAC, IR_RAIN + namelist / noahmp_irrigation_parameters / IRR_FRAC, IRR_HAR, IRR_LAI, IRR_MAD, FILOSS, SPRIR_RATE, MICIR_RATE, FIRTFAC,& + IR_RAIN + + ! crop parameters + integer :: DEFAULT_CROP + integer , dimension(NCROP) :: PLTDAY, HSDAY + real(kind=kind_noahmp), dimension(NCROP) :: PLANTPOP, IRRI, GDDTBASE, GDDTCUT, GDDS1, GDDS2, GDDS3, GDDS4, GDDS5, C3PSNI,& + KC25I, AKCI, KO25I, AKOI, AVCMXI, VCMX25I, BPI, MPI, FOLNMXI, QE25I, AREF, & + PSNRF, I2PAR, TASSIM0, TASSIM1, TASSIM2, K, EPSI, Q10MR, LEFREEZ, & + DILE_FC_S1, DILE_FC_S2, DILE_FC_S3, DILE_FC_S4, DILE_FC_S5, DILE_FC_S6, & + DILE_FC_S7, DILE_FC_S8, DILE_FW_S1, DILE_FW_S2, DILE_FW_S3, DILE_FW_S4, & + DILE_FW_S5, DILE_FW_S6, DILE_FW_S7, DILE_FW_S8, FRA_GR, LF_OVRC_S1, & + LF_OVRC_S2, LF_OVRC_S3, LF_OVRC_S4, LF_OVRC_S5, LF_OVRC_S6, LF_OVRC_S7, & + LF_OVRC_S8, ST_OVRC_S1, ST_OVRC_S2, ST_OVRC_S3, ST_OVRC_S4, ST_OVRC_S5, & + ST_OVRC_S6, ST_OVRC_S7, ST_OVRC_S8, RT_OVRC_S1, RT_OVRC_S2, RT_OVRC_S3, & + RT_OVRC_S4, RT_OVRC_S5, RT_OVRC_S6, RT_OVRC_S7, RT_OVRC_S8, LFMR25, STMR25, & + RTMR25, GRAINMR25, LFPT_S1, LFPT_S2, LFPT_S3, LFPT_S4, LFPT_S5, LFPT_S6, & + LFPT_S7, LFPT_S8, STPT_S1, STPT_S2, STPT_S3, STPT_S4, STPT_S5, STPT_S6, & + STPT_S7, STPT_S8, RTPT_S1, RTPT_S2, RTPT_S3, RTPT_S4, RTPT_S5, RTPT_S6, & + RTPT_S7, RTPT_S8, GRAINPT_S1, GRAINPT_S2, GRAINPT_S3, GRAINPT_S4, GRAINPT_S5,& + GRAINPT_S6, GRAINPT_S7, GRAINPT_S8, LFCT_S1, LFCT_S2, LFCT_S3, LFCT_S4, & + LFCT_S5, LFCT_S6, LFCT_S7, LFCT_S8, STCT_S1, STCT_S2, STCT_S3, STCT_S4, & + STCT_S5, STCT_S6, STCT_S7, STCT_S8, RTCT_S1, RTCT_S2, RTCT_S3, RTCT_S4, & + RTCT_S5, RTCT_S6, RTCT_S7, RTCT_S8, BIO2LAI + namelist / noahmp_crop_parameters / DEFAULT_CROP, PLTDAY, HSDAY, PLANTPOP, IRRI, GDDTBASE, GDDTCUT, GDDS1, GDDS2,& + GDDS3, GDDS4, GDDS5, C3PSNI, KC25I, AKCI, KO25I, AKOI, AVCMXI, VCMX25I, BPI, & + MPI, FOLNMXI, QE25I, AREF, PSNRF, I2PAR, TASSIM0, TASSIM1, TASSIM2, K, & + EPSI,Q10MR, LEFREEZ, DILE_FC_S1, DILE_FC_S2, DILE_FC_S3, DILE_FC_S4, & + DILE_FC_S5, DILE_FC_S6, DILE_FC_S7, DILE_FC_S8, DILE_FW_S1, DILE_FW_S2, & + DILE_FW_S3, DILE_FW_S4, DILE_FW_S5, DILE_FW_S6, DILE_FW_S7, DILE_FW_S8, & + FRA_GR, LF_OVRC_S1, LF_OVRC_S2, LF_OVRC_S3, LF_OVRC_S4, LF_OVRC_S5, & + LF_OVRC_S6, LF_OVRC_S7, LF_OVRC_S8, ST_OVRC_S1, ST_OVRC_S2, ST_OVRC_S3, & + ST_OVRC_S4, ST_OVRC_S5, ST_OVRC_S6, ST_OVRC_S7, ST_OVRC_S8, RT_OVRC_S1, & + RT_OVRC_S2, RT_OVRC_S3, RT_OVRC_S4, RT_OVRC_S5, RT_OVRC_S6, RT_OVRC_S7, & + RT_OVRC_S8, LFMR25, STMR25, RTMR25, GRAINMR25, LFPT_S1, LFPT_S2, LFPT_S3, & + LFPT_S4, LFPT_S5, LFPT_S6, LFPT_S7, LFPT_S8, STPT_S1, STPT_S2, STPT_S3, & + STPT_S4, STPT_S5, STPT_S6, STPT_S7, STPT_S8, RTPT_S1, RTPT_S2, RTPT_S3, & + RTPT_S4, RTPT_S5, RTPT_S6, RTPT_S7, RTPT_S8, GRAINPT_S1, GRAINPT_S2, & + GRAINPT_S3, GRAINPT_S4, GRAINPT_S5, GRAINPT_S6, GRAINPT_S7, GRAINPT_S8, & + LFCT_S1, LFCT_S2, LFCT_S3, LFCT_S4, LFCT_S5, LFCT_S6, LFCT_S7, LFCT_S8, & + STCT_S1, STCT_S2, STCT_S3, STCT_S4, STCT_S5, STCT_S6, STCT_S7, STCT_S8, & + RTCT_S1, RTCT_S2, RTCT_S3, RTCT_S4, RTCT_S5, RTCT_S6, RTCT_S7, RTCT_S8, & + BIO2LAI + + ! tile drainage parameters + integer :: NSOILTYPE, DRAIN_LAYER_OPT + integer , dimension(MAX_SOILTYP) :: TD_DEPTH + real(kind=kind_noahmp), dimension(MAX_SOILTYP) :: TDSMC_FAC, TD_DC, TD_DCOEF, TD_D, TD_ADEPTH, TD_RADI, TD_SPAC, & + TD_DDRAIN, KLAT_FAC + namelist / noahmp_tiledrain_parameters / NSOILTYPE, DRAIN_LAYER_OPT, TDSMC_FAC, TD_DEPTH, TD_DC, TD_DCOEF, TD_D,& + TD_ADEPTH, TD_RADI, TD_SPAC, TD_DDRAIN, KLAT_FAC + + ! optional parameters + real(kind=kind_noahmp) :: sr2006_theta_1500t_a, sr2006_theta_1500t_b, sr2006_theta_1500t_c, & + sr2006_theta_1500t_d, sr2006_theta_1500t_e, sr2006_theta_1500t_f, & + sr2006_theta_1500t_g, sr2006_theta_1500_a , sr2006_theta_1500_b, & + sr2006_theta_33t_a, sr2006_theta_33t_b, sr2006_theta_33t_c, & + sr2006_theta_33t_d, sr2006_theta_33t_e, sr2006_theta_33t_f, & + sr2006_theta_33t_g, sr2006_theta_33_a, sr2006_theta_33_b, & + sr2006_theta_33_c, sr2006_theta_s33t_a, sr2006_theta_s33t_b, & + sr2006_theta_s33t_c, sr2006_theta_s33t_d, sr2006_theta_s33t_e, & + sr2006_theta_s33t_f, sr2006_theta_s33t_g, sr2006_theta_s33_a, & + sr2006_theta_s33_b, sr2006_psi_et_a, sr2006_psi_et_b, sr2006_psi_et_c, & + sr2006_psi_et_d, sr2006_psi_et_e, sr2006_psi_et_f, sr2006_psi_et_g, & + sr2006_psi_e_a, sr2006_psi_e_b, sr2006_psi_e_c, sr2006_smcmax_a, & + sr2006_smcmax_b + namelist / noahmp_optional_parameters / sr2006_theta_1500t_a, sr2006_theta_1500t_b, sr2006_theta_1500t_c, & + sr2006_theta_1500t_d, sr2006_theta_1500t_e, sr2006_theta_1500t_f, & + sr2006_theta_1500t_g, sr2006_theta_1500_a, sr2006_theta_1500_b, & + sr2006_theta_33t_a, sr2006_theta_33t_b, sr2006_theta_33t_c, & + sr2006_theta_33t_d, sr2006_theta_33t_e, sr2006_theta_33t_f, & + sr2006_theta_33t_g, sr2006_theta_33_a, sr2006_theta_33_b, & + sr2006_theta_33_c, sr2006_theta_s33t_a, sr2006_theta_s33t_b, & + sr2006_theta_s33t_c, sr2006_theta_s33t_d, sr2006_theta_s33t_e, & + sr2006_theta_s33t_f, sr2006_theta_s33t_g, sr2006_theta_s33_a, & + sr2006_theta_s33_b, sr2006_psi_et_a, sr2006_psi_et_b, sr2006_psi_et_c, & + sr2006_psi_et_d, sr2006_psi_et_e, sr2006_psi_et_f, sr2006_psi_et_g, & + sr2006_psi_e_a, sr2006_psi_e_b, sr2006_psi_e_c, sr2006_smcmax_a, & + sr2006_smcmax_b + + !-------------------------------------------------- + !=== allocate multi-dim input table variables + !-------------------------------------------------- + + ! vegetation parameters + if ( .not. allocated (NoahmpIO%CH2OP_TABLE) ) allocate( NoahmpIO%CH2OP_TABLE (MVT) ) + if ( .not. allocated (NoahmpIO%DLEAF_TABLE) ) allocate( NoahmpIO%DLEAF_TABLE (MVT) ) + if ( .not. allocated (NoahmpIO%Z0MVT_TABLE) ) allocate( NoahmpIO%Z0MVT_TABLE (MVT) ) + if ( .not. allocated (NoahmpIO%HVT_TABLE) ) allocate( NoahmpIO%HVT_TABLE (MVT) ) + if ( .not. allocated (NoahmpIO%HVB_TABLE) ) allocate( NoahmpIO%HVB_TABLE (MVT) ) + if ( .not. allocated (NoahmpIO%DEN_TABLE) ) allocate( NoahmpIO%DEN_TABLE (MVT) ) + if ( .not. allocated (NoahmpIO%RC_TABLE) ) allocate( NoahmpIO%RC_TABLE (MVT) ) + if ( .not. allocated (NoahmpIO%MFSNO_TABLE) ) allocate( NoahmpIO%MFSNO_TABLE (MVT) ) + if ( .not. allocated (NoahmpIO%SCFFAC_TABLE) ) allocate( NoahmpIO%SCFFAC_TABLE (MVT) ) + if ( .not. allocated (NoahmpIO%CBIOM_TABLE) ) allocate( NoahmpIO%CBIOM_TABLE (MVT) ) + if ( .not. allocated (NoahmpIO%SAIM_TABLE) ) allocate( NoahmpIO%SAIM_TABLE (MVT,12) ) + if ( .not. allocated (NoahmpIO%LAIM_TABLE) ) allocate( NoahmpIO%LAIM_TABLE (MVT,12) ) + if ( .not. allocated (NoahmpIO%SLA_TABLE) ) allocate( NoahmpIO%SLA_TABLE (MVT) ) + if ( .not. allocated (NoahmpIO%DILEFC_TABLE) ) allocate( NoahmpIO%DILEFC_TABLE (MVT) ) + if ( .not. allocated (NoahmpIO%DILEFW_TABLE) ) allocate( NoahmpIO%DILEFW_TABLE (MVT) ) + if ( .not. allocated (NoahmpIO%FRAGR_TABLE) ) allocate( NoahmpIO%FRAGR_TABLE (MVT) ) + if ( .not. allocated (NoahmpIO%LTOVRC_TABLE) ) allocate( NoahmpIO%LTOVRC_TABLE (MVT) ) + if ( .not. allocated (NoahmpIO%C3PSN_TABLE) ) allocate( NoahmpIO%C3PSN_TABLE (MVT) ) + if ( .not. allocated (NoahmpIO%KC25_TABLE) ) allocate( NoahmpIO%KC25_TABLE (MVT) ) + if ( .not. allocated (NoahmpIO%AKC_TABLE) ) allocate( NoahmpIO%AKC_TABLE (MVT) ) + if ( .not. allocated (NoahmpIO%KO25_TABLE) ) allocate( NoahmpIO%KO25_TABLE (MVT) ) + if ( .not. allocated (NoahmpIO%AKO_TABLE) ) allocate( NoahmpIO%AKO_TABLE (MVT) ) + if ( .not. allocated (NoahmpIO%VCMX25_TABLE) ) allocate( NoahmpIO%VCMX25_TABLE (MVT) ) + if ( .not. allocated (NoahmpIO%AVCMX_TABLE) ) allocate( NoahmpIO%AVCMX_TABLE (MVT) ) + if ( .not. allocated (NoahmpIO%BP_TABLE) ) allocate( NoahmpIO%BP_TABLE (MVT) ) + if ( .not. allocated (NoahmpIO%MP_TABLE) ) allocate( NoahmpIO%MP_TABLE (MVT) ) + if ( .not. allocated (NoahmpIO%QE25_TABLE) ) allocate( NoahmpIO%QE25_TABLE (MVT) ) + if ( .not. allocated (NoahmpIO%AQE_TABLE) ) allocate( NoahmpIO%AQE_TABLE (MVT) ) + if ( .not. allocated (NoahmpIO%RMF25_TABLE) ) allocate( NoahmpIO%RMF25_TABLE (MVT) ) + if ( .not. allocated (NoahmpIO%RMS25_TABLE) ) allocate( NoahmpIO%RMS25_TABLE (MVT) ) + if ( .not. allocated (NoahmpIO%RMR25_TABLE) ) allocate( NoahmpIO%RMR25_TABLE (MVT) ) + if ( .not. allocated (NoahmpIO%ARM_TABLE) ) allocate( NoahmpIO%ARM_TABLE (MVT) ) + if ( .not. allocated (NoahmpIO%FOLNMX_TABLE) ) allocate( NoahmpIO%FOLNMX_TABLE (MVT) ) + if ( .not. allocated (NoahmpIO%TMIN_TABLE) ) allocate( NoahmpIO%TMIN_TABLE (MVT) ) + if ( .not. allocated (NoahmpIO%XL_TABLE) ) allocate( NoahmpIO%XL_TABLE (MVT) ) + if ( .not. allocated (NoahmpIO%RHOL_TABLE) ) allocate( NoahmpIO%RHOL_TABLE (MVT,MBAND) ) + if ( .not. allocated (NoahmpIO%RHOS_TABLE) ) allocate( NoahmpIO%RHOS_TABLE (MVT,MBAND) ) + if ( .not. allocated (NoahmpIO%TAUL_TABLE) ) allocate( NoahmpIO%TAUL_TABLE (MVT,MBAND) ) + if ( .not. allocated (NoahmpIO%TAUS_TABLE) ) allocate( NoahmpIO%TAUS_TABLE (MVT,MBAND) ) + if ( .not. allocated (NoahmpIO%MRP_TABLE) ) allocate( NoahmpIO%MRP_TABLE (MVT) ) + if ( .not. allocated (NoahmpIO%CWPVT_TABLE) ) allocate( NoahmpIO%CWPVT_TABLE (MVT) ) + if ( .not. allocated (NoahmpIO%WRRAT_TABLE) ) allocate( NoahmpIO%WRRAT_TABLE (MVT) ) + if ( .not. allocated (NoahmpIO%WDPOOL_TABLE) ) allocate( NoahmpIO%WDPOOL_TABLE (MVT) ) + if ( .not. allocated (NoahmpIO%TDLEF_TABLE) ) allocate( NoahmpIO%TDLEF_TABLE (MVT) ) + if ( .not. allocated (NoahmpIO%NROOT_TABLE) ) allocate( NoahmpIO%NROOT_TABLE (MVT) ) + if ( .not. allocated (NoahmpIO%RGL_TABLE) ) allocate( NoahmpIO%RGL_TABLE (MVT) ) + if ( .not. allocated (NoahmpIO%RS_TABLE) ) allocate( NoahmpIO%RS_TABLE (MVT) ) + if ( .not. allocated (NoahmpIO%HS_TABLE) ) allocate( NoahmpIO%HS_TABLE (MVT) ) + if ( .not. allocated (NoahmpIO%TOPT_TABLE) ) allocate( NoahmpIO%TOPT_TABLE (MVT) ) + if ( .not. allocated (NoahmpIO%RSMAX_TABLE) ) allocate( NoahmpIO%RSMAX_TABLE (MVT) ) + if ( .not. allocated (NoahmpIO%RTOVRC_TABLE) ) allocate( NoahmpIO%RTOVRC_TABLE (MVT) ) + if ( .not. allocated (NoahmpIO%RSWOODC_TABLE)) allocate( NoahmpIO%RSWOODC_TABLE(MVT) ) + if ( .not. allocated (NoahmpIO%BF_TABLE) ) allocate( NoahmpIO%BF_TABLE (MVT) ) + if ( .not. allocated (NoahmpIO%WSTRC_TABLE) ) allocate( NoahmpIO%WSTRC_TABLE (MVT) ) + if ( .not. allocated (NoahmpIO%LAIMIN_TABLE) ) allocate( NoahmpIO%LAIMIN_TABLE (MVT) ) + if ( .not. allocated (NoahmpIO%XSAMIN_TABLE) ) allocate( NoahmpIO%XSAMIN_TABLE (MVT) ) + + ! soil parameters + if ( .not. allocated (NoahmpIO%BEXP_TABLE) ) allocate( NoahmpIO%BEXP_TABLE (MAX_SOILTYP) ) + if ( .not. allocated (NoahmpIO%SMCDRY_TABLE) ) allocate( NoahmpIO%SMCDRY_TABLE(MAX_SOILTYP) ) + if ( .not. allocated (NoahmpIO%SMCMAX_TABLE) ) allocate( NoahmpIO%SMCMAX_TABLE(MAX_SOILTYP) ) + if ( .not. allocated (NoahmpIO%SMCREF_TABLE) ) allocate( NoahmpIO%SMCREF_TABLE(MAX_SOILTYP) ) + if ( .not. allocated (NoahmpIO%PSISAT_TABLE) ) allocate( NoahmpIO%PSISAT_TABLE(MAX_SOILTYP) ) + if ( .not. allocated (NoahmpIO%DKSAT_TABLE) ) allocate( NoahmpIO%DKSAT_TABLE (MAX_SOILTYP) ) + if ( .not. allocated (NoahmpIO%DWSAT_TABLE) ) allocate( NoahmpIO%DWSAT_TABLE (MAX_SOILTYP) ) + if ( .not. allocated (NoahmpIO%SMCWLT_TABLE) ) allocate( NoahmpIO%SMCWLT_TABLE(MAX_SOILTYP) ) + if ( .not. allocated (NoahmpIO%QUARTZ_TABLE) ) allocate( NoahmpIO%QUARTZ_TABLE(MAX_SOILTYP) ) + if ( .not. allocated (NoahmpIO%BVIC_TABLE) ) allocate( NoahmpIO%BVIC_TABLE (MAX_SOILTYP) ) + if ( .not. allocated (NoahmpIO%AXAJ_TABLE) ) allocate( NoahmpIO%AXAJ_TABLE (MAX_SOILTYP) ) + if ( .not. allocated (NoahmpIO%BXAJ_TABLE) ) allocate( NoahmpIO%BXAJ_TABLE (MAX_SOILTYP) ) + if ( .not. allocated (NoahmpIO%XXAJ_TABLE) ) allocate( NoahmpIO%XXAJ_TABLE (MAX_SOILTYP) ) + if ( .not. allocated (NoahmpIO%BDVIC_TABLE) ) allocate( NoahmpIO%BDVIC_TABLE (MAX_SOILTYP) ) + if ( .not. allocated (NoahmpIO%GDVIC_TABLE) ) allocate( NoahmpIO%GDVIC_TABLE (MAX_SOILTYP) ) + if ( .not. allocated (NoahmpIO%BBVIC_TABLE) ) allocate( NoahmpIO%BBVIC_TABLE (MAX_SOILTYP) ) + + ! general parameters + if ( .not. allocated (NoahmpIO%SLOPE_TABLE) ) allocate( NoahmpIO%SLOPE_TABLE(NUM_SLOPE) ) + + ! radiation parameters + if ( .not. allocated (NoahmpIO%ALBSAT_TABLE) ) allocate( NoahmpIO%ALBSAT_TABLE(MSC,MBAND) ) + if ( .not. allocated (NoahmpIO%ALBDRY_TABLE) ) allocate( NoahmpIO%ALBDRY_TABLE(MSC,MBAND) ) + if ( .not. allocated (NoahmpIO%ALBICE_TABLE) ) allocate( NoahmpIO%ALBICE_TABLE(MBAND) ) + if ( .not. allocated (NoahmpIO%ALBLAK_TABLE) ) allocate( NoahmpIO%ALBLAK_TABLE(MBAND) ) + if ( .not. allocated (NoahmpIO%OMEGAS_TABLE) ) allocate( NoahmpIO%OMEGAS_TABLE(MBAND) ) + if ( .not. allocated (NoahmpIO%EG_TABLE) ) allocate( NoahmpIO%EG_TABLE(2) ) + + ! tile drainage parameters + if ( .not. allocated (NoahmpIO%TDSMC_FAC_TABLE) ) allocate( NoahmpIO%TDSMC_FAC_TABLE(MAX_SOILTYP) ) + if ( .not. allocated (NoahmpIO%TD_DC_TABLE) ) allocate( NoahmpIO%TD_DC_TABLE (MAX_SOILTYP) ) + if ( .not. allocated (NoahmpIO%TD_DEPTH_TABLE) ) allocate( NoahmpIO%TD_DEPTH_TABLE (MAX_SOILTYP) ) + if ( .not. allocated (NoahmpIO%TD_DCOEF_TABLE) ) allocate( NoahmpIO%TD_DCOEF_TABLE (MAX_SOILTYP) ) + if ( .not. allocated (NoahmpIO%TD_D_TABLE) ) allocate( NoahmpIO%TD_D_TABLE (MAX_SOILTYP) ) + if ( .not. allocated (NoahmpIO%TD_ADEPTH_TABLE) ) allocate( NoahmpIO%TD_ADEPTH_TABLE(MAX_SOILTYP) ) + if ( .not. allocated (NoahmpIO%TD_RADI_TABLE) ) allocate( NoahmpIO%TD_RADI_TABLE (MAX_SOILTYP) ) + if ( .not. allocated (NoahmpIO%TD_SPAC_TABLE) ) allocate( NoahmpIO%TD_SPAC_TABLE (MAX_SOILTYP) ) + if ( .not. allocated (NoahmpIO%TD_DDRAIN_TABLE) ) allocate( NoahmpIO%TD_DDRAIN_TABLE(MAX_SOILTYP) ) + if ( .not. allocated (NoahmpIO%KLAT_FAC_TABLE) ) allocate( NoahmpIO%KLAT_FAC_TABLE (MAX_SOILTYP) ) + + ! crop parameters + if ( .not. allocated (NoahmpIO%PLTDAY_TABLE) ) allocate( NoahmpIO%PLTDAY_TABLE (NCROP) ) + if ( .not. allocated (NoahmpIO%HSDAY_TABLE) ) allocate( NoahmpIO%HSDAY_TABLE (NCROP) ) + if ( .not. allocated (NoahmpIO%PLANTPOP_TABLE) ) allocate( NoahmpIO%PLANTPOP_TABLE (NCROP) ) + if ( .not. allocated (NoahmpIO%IRRI_TABLE) ) allocate( NoahmpIO%IRRI_TABLE (NCROP) ) + if ( .not. allocated (NoahmpIO%GDDTBASE_TABLE) ) allocate( NoahmpIO%GDDTBASE_TABLE (NCROP) ) + if ( .not. allocated (NoahmpIO%GDDTCUT_TABLE) ) allocate( NoahmpIO%GDDTCUT_TABLE (NCROP) ) + if ( .not. allocated (NoahmpIO%GDDS1_TABLE) ) allocate( NoahmpIO%GDDS1_TABLE (NCROP) ) + if ( .not. allocated (NoahmpIO%GDDS2_TABLE) ) allocate( NoahmpIO%GDDS2_TABLE (NCROP) ) + if ( .not. allocated (NoahmpIO%GDDS3_TABLE) ) allocate( NoahmpIO%GDDS3_TABLE (NCROP) ) + if ( .not. allocated (NoahmpIO%GDDS4_TABLE) ) allocate( NoahmpIO%GDDS4_TABLE (NCROP) ) + if ( .not. allocated (NoahmpIO%GDDS5_TABLE) ) allocate( NoahmpIO%GDDS5_TABLE (NCROP) ) + if ( .not. allocated (NoahmpIO%C3PSNI_TABLE) ) allocate( NoahmpIO%C3PSNI_TABLE (NCROP) ) + if ( .not. allocated (NoahmpIO%KC25I_TABLE) ) allocate( NoahmpIO%KC25I_TABLE (NCROP) ) + if ( .not. allocated (NoahmpIO%AKCI_TABLE) ) allocate( NoahmpIO%AKCI_TABLE (NCROP) ) + if ( .not. allocated (NoahmpIO%KO25I_TABLE) ) allocate( NoahmpIO%KO25I_TABLE (NCROP) ) + if ( .not. allocated (NoahmpIO%AKOI_TABLE) ) allocate( NoahmpIO%AKOI_TABLE (NCROP) ) + if ( .not. allocated (NoahmpIO%VCMX25I_TABLE) ) allocate( NoahmpIO%VCMX25I_TABLE (NCROP) ) + if ( .not. allocated (NoahmpIO%AVCMXI_TABLE) ) allocate( NoahmpIO%AVCMXI_TABLE (NCROP) ) + if ( .not. allocated (NoahmpIO%BPI_TABLE) ) allocate( NoahmpIO%BPI_TABLE (NCROP) ) + if ( .not. allocated (NoahmpIO%MPI_TABLE) ) allocate( NoahmpIO%MPI_TABLE (NCROP) ) + if ( .not. allocated (NoahmpIO%QE25I_TABLE) ) allocate( NoahmpIO%QE25I_TABLE (NCROP) ) + if ( .not. allocated (NoahmpIO%FOLNMXI_TABLE) ) allocate( NoahmpIO%FOLNMXI_TABLE (NCROP) ) + if ( .not. allocated (NoahmpIO%AREF_TABLE) ) allocate( NoahmpIO%AREF_TABLE (NCROP) ) + if ( .not. allocated (NoahmpIO%PSNRF_TABLE) ) allocate( NoahmpIO%PSNRF_TABLE (NCROP) ) + if ( .not. allocated (NoahmpIO%I2PAR_TABLE) ) allocate( NoahmpIO%I2PAR_TABLE (NCROP) ) + if ( .not. allocated (NoahmpIO%TASSIM0_TABLE) ) allocate( NoahmpIO%TASSIM0_TABLE (NCROP) ) + if ( .not. allocated (NoahmpIO%TASSIM1_TABLE) ) allocate( NoahmpIO%TASSIM1_TABLE (NCROP) ) + if ( .not. allocated (NoahmpIO%TASSIM2_TABLE) ) allocate( NoahmpIO%TASSIM2_TABLE (NCROP) ) + if ( .not. allocated (NoahmpIO%K_TABLE) ) allocate( NoahmpIO%K_TABLE (NCROP) ) + if ( .not. allocated (NoahmpIO%EPSI_TABLE) ) allocate( NoahmpIO%EPSI_TABLE (NCROP) ) + if ( .not. allocated (NoahmpIO%Q10MR_TABLE) ) allocate( NoahmpIO%Q10MR_TABLE (NCROP) ) + if ( .not. allocated (NoahmpIO%LEFREEZ_TABLE) ) allocate( NoahmpIO%LEFREEZ_TABLE (NCROP) ) + if ( .not. allocated (NoahmpIO%DILE_FC_TABLE) ) allocate( NoahmpIO%DILE_FC_TABLE (NCROP,NSTAGE) ) + if ( .not. allocated (NoahmpIO%DILE_FW_TABLE) ) allocate( NoahmpIO%DILE_FW_TABLE (NCROP,NSTAGE) ) + if ( .not. allocated (NoahmpIO%FRA_GR_TABLE) ) allocate( NoahmpIO%FRA_GR_TABLE (NCROP) ) + if ( .not. allocated (NoahmpIO%LF_OVRC_TABLE) ) allocate( NoahmpIO%LF_OVRC_TABLE (NCROP,NSTAGE) ) + if ( .not. allocated (NoahmpIO%ST_OVRC_TABLE) ) allocate( NoahmpIO%ST_OVRC_TABLE (NCROP,NSTAGE) ) + if ( .not. allocated (NoahmpIO%RT_OVRC_TABLE) ) allocate( NoahmpIO%RT_OVRC_TABLE (NCROP,NSTAGE) ) + if ( .not. allocated (NoahmpIO%LFMR25_TABLE) ) allocate( NoahmpIO%LFMR25_TABLE (NCROP) ) + if ( .not. allocated (NoahmpIO%STMR25_TABLE) ) allocate( NoahmpIO%STMR25_TABLE (NCROP) ) + if ( .not. allocated (NoahmpIO%RTMR25_TABLE) ) allocate( NoahmpIO%RTMR25_TABLE (NCROP) ) + if ( .not. allocated (NoahmpIO%GRAINMR25_TABLE) ) allocate( NoahmpIO%GRAINMR25_TABLE(NCROP) ) + if ( .not. allocated (NoahmpIO%LFPT_TABLE) ) allocate( NoahmpIO%LFPT_TABLE (NCROP,NSTAGE) ) + if ( .not. allocated (NoahmpIO%STPT_TABLE) ) allocate( NoahmpIO%STPT_TABLE (NCROP,NSTAGE) ) + if ( .not. allocated (NoahmpIO%RTPT_TABLE) ) allocate( NoahmpIO%RTPT_TABLE (NCROP,NSTAGE) ) + if ( .not. allocated (NoahmpIO%GRAINPT_TABLE) ) allocate( NoahmpIO%GRAINPT_TABLE (NCROP,NSTAGE) ) + if ( .not. allocated (NoahmpIO%LFCT_TABLE) ) allocate( NoahmpIO%LFCT_TABLE (NCROP,NSTAGE) ) + if ( .not. allocated (NoahmpIO%STCT_TABLE) ) allocate( NoahmpIO%STCT_TABLE (NCROP,NSTAGE) ) + if ( .not. allocated (NoahmpIO%RTCT_TABLE) ) allocate( NoahmpIO%RTCT_TABLE (NCROP,NSTAGE) ) + if ( .not. allocated (NoahmpIO%BIO2LAI_TABLE) ) allocate( NoahmpIO%BIO2LAI_TABLE (NCROP) ) + + !--------------------------------------------------------------- + ! intialization to bad value, so that if the namelist read fails, + ! we come to a screeching halt as soon as we try to use anything + !--------------------------------------------------------------- + + ! vegetation parameters + NoahmpIO%ISURBAN_TABLE = undefined_int + NoahmpIO%ISWATER_TABLE = undefined_int + NoahmpIO%ISBARREN_TABLE = undefined_int + NoahmpIO%ISICE_TABLE = undefined_int + NoahmpIO%ISCROP_TABLE = undefined_int + NoahmpIO%EBLFOREST_TABLE = undefined_int + NoahmpIO%NATURAL_TABLE = undefined_int + NoahmpIO%URBTYPE_beg = undefined_int + NoahmpIO%LCZ_1_TABLE = undefined_int + NoahmpIO%LCZ_2_TABLE = undefined_int + NoahmpIO%LCZ_3_TABLE = undefined_int + NoahmpIO%LCZ_4_TABLE = undefined_int + NoahmpIO%LCZ_5_TABLE = undefined_int + NoahmpIO%LCZ_6_TABLE = undefined_int + NoahmpIO%LCZ_7_TABLE = undefined_int + NoahmpIO%LCZ_8_TABLE = undefined_int + NoahmpIO%LCZ_9_TABLE = undefined_int + NoahmpIO%LCZ_10_TABLE = undefined_int + NoahmpIO%LCZ_11_TABLE = undefined_int + NoahmpIO%CH2OP_TABLE = undefined_real + NoahmpIO%DLEAF_TABLE = undefined_real + NoahmpIO%Z0MVT_TABLE = undefined_real + NoahmpIO%HVT_TABLE = undefined_real + NoahmpIO%HVB_TABLE = undefined_real + NoahmpIO%DEN_TABLE = undefined_real + NoahmpIO%RC_TABLE = undefined_real + NoahmpIO%MFSNO_TABLE = undefined_real + NoahmpIO%SCFFAC_TABLE = undefined_real + NoahmpIO%CBIOM_TABLE = undefined_real + NoahmpIO%RHOL_TABLE = undefined_real + NoahmpIO%RHOS_TABLE = undefined_real + NoahmpIO%TAUL_TABLE = undefined_real + NoahmpIO%TAUS_TABLE = undefined_real + NoahmpIO%XL_TABLE = undefined_real + NoahmpIO%CWPVT_TABLE = undefined_real + NoahmpIO%C3PSN_TABLE = undefined_real + NoahmpIO%KC25_TABLE = undefined_real + NoahmpIO%AKC_TABLE = undefined_real + NoahmpIO%KO25_TABLE = undefined_real + NoahmpIO%AKO_TABLE = undefined_real + NoahmpIO%AVCMX_TABLE = undefined_real + NoahmpIO%AQE_TABLE = undefined_real + NoahmpIO%LTOVRC_TABLE = undefined_real + NoahmpIO%DILEFC_TABLE = undefined_real + NoahmpIO%DILEFW_TABLE = undefined_real + NoahmpIO%RMF25_TABLE = undefined_real + NoahmpIO%SLA_TABLE = undefined_real + NoahmpIO%FRAGR_TABLE = undefined_real + NoahmpIO%TMIN_TABLE = undefined_real + NoahmpIO%VCMX25_TABLE = undefined_real + NoahmpIO%TDLEF_TABLE = undefined_real + NoahmpIO%BP_TABLE = undefined_real + NoahmpIO%MP_TABLE = undefined_real + NoahmpIO%QE25_TABLE = undefined_real + NoahmpIO%RMS25_TABLE = undefined_real + NoahmpIO%RMR25_TABLE = undefined_real + NoahmpIO%ARM_TABLE = undefined_real + NoahmpIO%FOLNMX_TABLE = undefined_real + NoahmpIO%WDPOOL_TABLE = undefined_real + NoahmpIO%WRRAT_TABLE = undefined_real + NoahmpIO%MRP_TABLE = undefined_real + NoahmpIO%SAIM_TABLE = undefined_real + NoahmpIO%LAIM_TABLE = undefined_real + NoahmpIO%NROOT_TABLE = undefined_real + NoahmpIO%RGL_TABLE = undefined_real + NoahmpIO%RS_TABLE = undefined_real + NoahmpIO%HS_TABLE = undefined_real + NoahmpIO%TOPT_TABLE = undefined_real + NoahmpIO%RSMAX_TABLE = undefined_real + NoahmpIO%RTOVRC_TABLE = undefined_real + NoahmpIO%RSWOODC_TABLE = undefined_real + NoahmpIO%BF_TABLE = undefined_real + NoahmpIO%WSTRC_TABLE = undefined_real + NoahmpIO%LAIMIN_TABLE = undefined_real + NoahmpIO%XSAMIN_TABLE = undefined_real + + ! soil parameters + NoahmpIO%SLCATS_TABLE = undefined_int + NoahmpIO%BEXP_TABLE = undefined_real + NoahmpIO%SMCDRY_TABLE = undefined_real + NoahmpIO%SMCMAX_TABLE = undefined_real + NoahmpIO%SMCREF_TABLE = undefined_real + NoahmpIO%PSISAT_TABLE = undefined_real + NoahmpIO%DKSAT_TABLE = undefined_real + NoahmpIO%DWSAT_TABLE = undefined_real + NoahmpIO%SMCWLT_TABLE = undefined_real + NoahmpIO%QUARTZ_TABLE = undefined_real + NoahmpIO%BVIC_TABLE = undefined_real + NoahmpIO%AXAJ_TABLE = undefined_real + NoahmpIO%BXAJ_TABLE = undefined_real + NoahmpIO%XXAJ_TABLE = undefined_real + NoahmpIO%BDVIC_TABLE = undefined_real + NoahmpIO%GDVIC_TABLE = undefined_real + NoahmpIO%BBVIC_TABLE = undefined_real + + ! general parameters + NoahmpIO%SLOPE_TABLE = undefined_real + NoahmpIO%CSOIL_TABLE = undefined_real + NoahmpIO%REFDK_TABLE = undefined_real + NoahmpIO%REFKDT_TABLE = undefined_real + NoahmpIO%FRZK_TABLE = undefined_real + NoahmpIO%ZBOT_TABLE = undefined_real + NoahmpIO%CZIL_TABLE = undefined_real + + ! radiation parameters + NoahmpIO%ALBSAT_TABLE = undefined_real + NoahmpIO%ALBDRY_TABLE = undefined_real + NoahmpIO%ALBICE_TABLE = undefined_real + NoahmpIO%ALBLAK_TABLE = undefined_real + NoahmpIO%OMEGAS_TABLE = undefined_real + NoahmpIO%BETADS_TABLE = undefined_real + NoahmpIO%BETAIS_TABLE = undefined_real + NoahmpIO%EG_TABLE = undefined_real + NoahmpIO%EICE_TABLE = undefined_real + + ! global parameters + NoahmpIO%CO2_TABLE = undefined_real + NoahmpIO%O2_TABLE = undefined_real + NoahmpIO%TIMEAN_TABLE = undefined_real + NoahmpIO%FSATMX_TABLE = undefined_real + NoahmpIO%Z0SNO_TABLE = undefined_real + NoahmpIO%SSI_TABLE = undefined_real + NoahmpIO%SNOW_RET_FAC_TABLE = undefined_real + NoahmpIO%SNOW_EMIS_TABLE = undefined_real + NoahmpIO%SWEMX_TABLE = undefined_real + NoahmpIO%TAU0_TABLE = undefined_real + NoahmpIO%GRAIN_GROWTH_TABLE = undefined_real + NoahmpIO%EXTRA_GROWTH_TABLE = undefined_real + NoahmpIO%DIRT_SOOT_TABLE = undefined_real + NoahmpIO%BATS_COSZ_TABLE = undefined_real + NoahmpIO%BATS_VIS_NEW_TABLE = undefined_real + NoahmpIO%BATS_NIR_NEW_TABLE = undefined_real + NoahmpIO%BATS_VIS_AGE_TABLE = undefined_real + NoahmpIO%BATS_NIR_AGE_TABLE = undefined_real + NoahmpIO%BATS_VIS_DIR_TABLE = undefined_real + NoahmpIO%BATS_NIR_DIR_TABLE = undefined_real + NoahmpIO%RSURF_SNOW_TABLE = undefined_real + NoahmpIO%RSURF_EXP_TABLE = undefined_real + NoahmpIO%C2_SNOWCOMPACT_TABLE = undefined_real + NoahmpIO%C3_SNOWCOMPACT_TABLE = undefined_real + NoahmpIO%C4_SNOWCOMPACT_TABLE = undefined_real + NoahmpIO%C5_SNOWCOMPACT_TABLE = undefined_real + NoahmpIO%DM_SNOWCOMPACT_TABLE = undefined_real + NoahmpIO%ETA0_SNOWCOMPACT_TABLE = undefined_real + NoahmpIO%SNLIQMAXFRAC_TABLE = undefined_real + NoahmpIO%SWEMAXGLA_TABLE = undefined_real + NoahmpIO%WSLMAX_TABLE = undefined_real + NoahmpIO%ROUS_TABLE = undefined_real + NoahmpIO%CMIC_TABLE = undefined_real + NoahmpIO%SNOWDEN_MAX_TABLE = undefined_real + NoahmpIO%CLASS_ALB_REF_TABLE = undefined_real + NoahmpIO%CLASS_SNO_AGE_TABLE = undefined_real + NoahmpIO%CLASS_ALB_NEW_TABLE = undefined_real + NoahmpIO%PSIWLT_TABLE = undefined_real + NoahmpIO%Z0SOIL_TABLE = undefined_real + NoahmpIO%Z0LAKE_TABLE = undefined_real + + ! irrigation parameters + NoahmpIO%IRR_HAR_TABLE = undefined_int + NoahmpIO%IRR_FRAC_TABLE = undefined_real + NoahmpIO%IRR_LAI_TABLE = undefined_real + NoahmpIO%IRR_MAD_TABLE = undefined_real + NoahmpIO%FILOSS_TABLE = undefined_real + NoahmpIO%SPRIR_RATE_TABLE = undefined_real + NoahmpIO%MICIR_RATE_TABLE = undefined_real + NoahmpIO%FIRTFAC_TABLE = undefined_real + NoahmpIO%IR_RAIN_TABLE = undefined_real + + ! crop parameters + NoahmpIO%DEFAULT_CROP_TABLE = undefined_int + NoahmpIO%PLTDAY_TABLE = undefined_int + NoahmpIO%HSDAY_TABLE = undefined_int + NoahmpIO%PLANTPOP_TABLE = undefined_real + NoahmpIO%IRRI_TABLE = undefined_real + NoahmpIO%GDDTBASE_TABLE = undefined_real + NoahmpIO%GDDTCUT_TABLE = undefined_real + NoahmpIO%GDDS1_TABLE = undefined_real + NoahmpIO%GDDS2_TABLE = undefined_real + NoahmpIO%GDDS3_TABLE = undefined_real + NoahmpIO%GDDS4_TABLE = undefined_real + NoahmpIO%GDDS5_TABLE = undefined_real + NoahmpIO%C3PSNI_TABLE = undefined_real + NoahmpIO%KC25I_TABLE = undefined_real + NoahmpIO%AKCI_TABLE = undefined_real + NoahmpIO%KO25I_TABLE = undefined_real + NoahmpIO%AKOI_TABLE = undefined_real + NoahmpIO%AVCMXI_TABLE = undefined_real + NoahmpIO%VCMX25I_TABLE = undefined_real + NoahmpIO%BPI_TABLE = undefined_real + NoahmpIO%MPI_TABLE = undefined_real + NoahmpIO%FOLNMXI_TABLE = undefined_real + NoahmpIO%QE25I_TABLE = undefined_real + NoahmpIO%AREF_TABLE = undefined_real + NoahmpIO%PSNRF_TABLE = undefined_real + NoahmpIO%I2PAR_TABLE = undefined_real + NoahmpIO%TASSIM0_TABLE = undefined_real + NoahmpIO%TASSIM1_TABLE = undefined_real + NoahmpIO%TASSIM2_TABLE = undefined_real + NoahmpIO%K_TABLE = undefined_real + NoahmpIO%EPSI_TABLE = undefined_real + NoahmpIO%Q10MR_TABLE = undefined_real + NoahmpIO%LEFREEZ_TABLE = undefined_real + NoahmpIO%DILE_FC_TABLE = undefined_real + NoahmpIO%DILE_FW_TABLE = undefined_real + NoahmpIO%FRA_GR_TABLE = undefined_real + NoahmpIO%LF_OVRC_TABLE = undefined_real + NoahmpIO%ST_OVRC_TABLE = undefined_real + NoahmpIO%RT_OVRC_TABLE = undefined_real + NoahmpIO%LFMR25_TABLE = undefined_real + NoahmpIO%STMR25_TABLE = undefined_real + NoahmpIO%RTMR25_TABLE = undefined_real + NoahmpIO%GRAINMR25_TABLE = undefined_real + NoahmpIO%LFPT_TABLE = undefined_real + NoahmpIO%STPT_TABLE = undefined_real + NoahmpIO%RTPT_TABLE = undefined_real + NoahmpIO%GRAINPT_TABLE = undefined_real + NoahmpIO%LFCT_TABLE = undefined_real + NoahmpIO%STCT_TABLE = undefined_real + NoahmpIO%RTCT_TABLE = undefined_real + NoahmpIO%BIO2LAI_TABLE = undefined_real + + ! tile drainage parameters + NoahmpIO%DRAIN_LAYER_OPT_TABLE = undefined_int + NoahmpIO%TD_DEPTH_TABLE = undefined_int + NoahmpIO%TDSMC_FAC_TABLE = undefined_real + NoahmpIO%TD_DC_TABLE = undefined_real + NoahmpIO%TD_DCOEF_TABLE = undefined_real + NoahmpIO%TD_D_TABLE = undefined_real + NoahmpIO%TD_ADEPTH_TABLE = undefined_real + NoahmpIO%TD_RADI_TABLE = undefined_real + NoahmpIO%TD_SPAC_TABLE = undefined_real + NoahmpIO%TD_DDRAIN_TABLE = undefined_real + NoahmpIO%KLAT_FAC_TABLE = undefined_real + + ! optional parameters + NoahmpIO%sr2006_theta_1500t_a_TABLE = undefined_real + NoahmpIO%sr2006_theta_1500t_b_TABLE = undefined_real + NoahmpIO%sr2006_theta_1500t_c_TABLE = undefined_real + NoahmpIO%sr2006_theta_1500t_d_TABLE = undefined_real + NoahmpIO%sr2006_theta_1500t_e_TABLE = undefined_real + NoahmpIO%sr2006_theta_1500t_f_TABLE = undefined_real + NoahmpIO%sr2006_theta_1500t_g_TABLE = undefined_real + NoahmpIO%sr2006_theta_1500_a_TABLE = undefined_real + NoahmpIO%sr2006_theta_1500_b_TABLE = undefined_real + NoahmpIO%sr2006_theta_33t_a_TABLE = undefined_real + NoahmpIO%sr2006_theta_33t_b_TABLE = undefined_real + NoahmpIO%sr2006_theta_33t_c_TABLE = undefined_real + NoahmpIO%sr2006_theta_33t_d_TABLE = undefined_real + NoahmpIO%sr2006_theta_33t_e_TABLE = undefined_real + NoahmpIO%sr2006_theta_33t_f_TABLE = undefined_real + NoahmpIO%sr2006_theta_33t_g_TABLE = undefined_real + NoahmpIO%sr2006_theta_33_a_TABLE = undefined_real + NoahmpIO%sr2006_theta_33_b_TABLE = undefined_real + NoahmpIO%sr2006_theta_33_c_TABLE = undefined_real + NoahmpIO%sr2006_theta_s33t_a_TABLE = undefined_real + NoahmpIO%sr2006_theta_s33t_b_TABLE = undefined_real + NoahmpIO%sr2006_theta_s33t_c_TABLE = undefined_real + NoahmpIO%sr2006_theta_s33t_d_TABLE = undefined_real + NoahmpIO%sr2006_theta_s33t_e_TABLE = undefined_real + NoahmpIO%sr2006_theta_s33t_f_TABLE = undefined_real + NoahmpIO%sr2006_theta_s33t_g_TABLE = undefined_real + NoahmpIO%sr2006_theta_s33_a_TABLE = undefined_real + NoahmpIO%sr2006_theta_s33_b_TABLE = undefined_real + NoahmpIO%sr2006_psi_et_a_TABLE = undefined_real + NoahmpIO%sr2006_psi_et_b_TABLE = undefined_real + NoahmpIO%sr2006_psi_et_c_TABLE = undefined_real + NoahmpIO%sr2006_psi_et_d_TABLE = undefined_real + NoahmpIO%sr2006_psi_et_e_TABLE = undefined_real + NoahmpIO%sr2006_psi_et_f_TABLE = undefined_real + NoahmpIO%sr2006_psi_et_g_TABLE = undefined_real + NoahmpIO%sr2006_psi_e_a_TABLE = undefined_real + NoahmpIO%sr2006_psi_e_b_TABLE = undefined_real + NoahmpIO%sr2006_psi_e_c_TABLE = undefined_real + NoahmpIO%sr2006_smcmax_a_TABLE = undefined_real + NoahmpIO%sr2006_smcmax_b_TABLE = undefined_real + + !--------------------------------------------------------------- + ! transfer values from table to input variables + !--------------------------------------------------------------- + + !---------------- NoahmpTable.TBL vegetation parameters + + inquire( file=trim(MPTABLE_file), exist=file_named ) + if ( file_named ) then + open(15, file=trim(MPTABLE_file), status='old', form='formatted', action='read', iostat=ierr) + else + open(15, status='old', form='formatted', action='read', iostat=ierr) + end if + if ( ierr /= 0 ) then + write(*,'("WARNING: Cannot find file NoahmpTable.TBL")') + stop "ERROR: NoahmpTable.TBL vegetation parameter" + endif + + if ( trim(LANDDATA_name) == "USGS" ) then + read(15, noahmp_usgs_veg_categories) + read(15, noahmp_usgs_parameters) + elseif ( trim(LANDDATA_name) == "MODIFIED_IGBP_MODIS_NOAH" ) then + read(15,noahmp_modis_veg_categories) + read(15,noahmp_modis_parameters) + else + write(*,'("WARNING: Unrecognized LANDDATA_name in subroutine ReadNoahmpTable")') + write(*,'("WARNING: LANDDATA_name = ''", A, "''")') trim(LANDDATA_name) + stop "ERROR: land dataset name" + endif + close(15) + + ! assign values + NoahmpIO%ISURBAN_TABLE = ISURBAN + NoahmpIO%ISURBAN = ISURBAN + NoahmpIO%ISWATER_TABLE = ISWATER + NoahmpIO%ISBARREN_TABLE = ISBARREN + NoahmpIO%ISICE_TABLE = ISICE + NoahmpIO%ISCROP_TABLE = ISCROP + NoahmpIO%EBLFOREST_TABLE = EBLFOREST + NoahmpIO%NATURAL_TABLE = NATURAL + NoahmpIO%URBTYPE_beg = URBTYPE_beg + NoahmpIO%LCZ_1_TABLE = LCZ_1 + NoahmpIO%LCZ_2_TABLE = LCZ_2 + NoahmpIO%LCZ_3_TABLE = LCZ_3 + NoahmpIO%LCZ_4_TABLE = LCZ_4 + NoahmpIO%LCZ_5_TABLE = LCZ_5 + NoahmpIO%LCZ_6_TABLE = LCZ_6 + NoahmpIO%LCZ_7_TABLE = LCZ_7 + NoahmpIO%LCZ_8_TABLE = LCZ_8 + NoahmpIO%LCZ_9_TABLE = LCZ_9 + NoahmpIO%LCZ_10_TABLE = LCZ_10 + NoahmpIO%LCZ_11_TABLE = LCZ_11 + NoahmpIO%CH2OP_TABLE (1:NVEG) = CH2OP (1:NVEG) + NoahmpIO%DLEAF_TABLE (1:NVEG) = DLEAF (1:NVEG) + NoahmpIO%Z0MVT_TABLE (1:NVEG) = Z0MVT (1:NVEG) + NoahmpIO%HVT_TABLE (1:NVEG) = HVT (1:NVEG) + NoahmpIO%HVB_TABLE (1:NVEG) = HVB (1:NVEG) + NoahmpIO%DEN_TABLE (1:NVEG) = DEN (1:NVEG) + NoahmpIO%RC_TABLE (1:NVEG) = RC (1:NVEG) + NoahmpIO%MFSNO_TABLE (1:NVEG) = MFSNO (1:NVEG) + NoahmpIO%SCFFAC_TABLE (1:NVEG) = SCFFAC (1:NVEG) + NoahmpIO%CBIOM_TABLE (1:NVEG) = CBIOM (1:NVEG) + NoahmpIO%XL_TABLE (1:NVEG) = XL (1:NVEG) + NoahmpIO%CWPVT_TABLE (1:NVEG) = CWPVT (1:NVEG) + NoahmpIO%C3PSN_TABLE (1:NVEG) = C3PSN (1:NVEG) + NoahmpIO%KC25_TABLE (1:NVEG) = KC25 (1:NVEG) + NoahmpIO%AKC_TABLE (1:NVEG) = AKC (1:NVEG) + NoahmpIO%KO25_TABLE (1:NVEG) = KO25 (1:NVEG) + NoahmpIO%AKO_TABLE (1:NVEG) = AKO (1:NVEG) + NoahmpIO%AVCMX_TABLE (1:NVEG) = AVCMX (1:NVEG) + NoahmpIO%AQE_TABLE (1:NVEG) = AQE (1:NVEG) + NoahmpIO%LTOVRC_TABLE (1:NVEG) = LTOVRC (1:NVEG) + NoahmpIO%DILEFC_TABLE (1:NVEG) = DILEFC (1:NVEG) + NoahmpIO%DILEFW_TABLE (1:NVEG) = DILEFW (1:NVEG) + NoahmpIO%RMF25_TABLE (1:NVEG) = RMF25 (1:NVEG) + NoahmpIO%SLA_TABLE (1:NVEG) = SLA (1:NVEG) + NoahmpIO%FRAGR_TABLE (1:NVEG) = FRAGR (1:NVEG) + NoahmpIO%TMIN_TABLE (1:NVEG) = TMIN (1:NVEG) + NoahmpIO%VCMX25_TABLE (1:NVEG) = VCMX25 (1:NVEG) + NoahmpIO%TDLEF_TABLE (1:NVEG) = TDLEF (1:NVEG) + NoahmpIO%BP_TABLE (1:NVEG) = BP (1:NVEG) + NoahmpIO%MP_TABLE (1:NVEG) = MP (1:NVEG) + NoahmpIO%QE25_TABLE (1:NVEG) = QE25 (1:NVEG) + NoahmpIO%RMS25_TABLE (1:NVEG) = RMS25 (1:NVEG) + NoahmpIO%RMR25_TABLE (1:NVEG) = RMR25 (1:NVEG) + NoahmpIO%ARM_TABLE (1:NVEG) = ARM (1:NVEG) + NoahmpIO%FOLNMX_TABLE (1:NVEG) = FOLNMX (1:NVEG) + NoahmpIO%WDPOOL_TABLE (1:NVEG) = WDPOOL (1:NVEG) + NoahmpIO%WRRAT_TABLE (1:NVEG) = WRRAT (1:NVEG) + NoahmpIO%MRP_TABLE (1:NVEG) = MRP (1:NVEG) + NoahmpIO%NROOT_TABLE (1:NVEG) = NROOT (1:NVEG) + NoahmpIO%RGL_TABLE (1:NVEG) = RGL (1:NVEG) + NoahmpIO%RS_TABLE (1:NVEG) = RS (1:NVEG) + NoahmpIO%HS_TABLE (1:NVEG) = HS (1:NVEG) + NoahmpIO%TOPT_TABLE (1:NVEG) = TOPT (1:NVEG) + NoahmpIO%RSMAX_TABLE (1:NVEG) = RSMAX (1:NVEG) + NoahmpIO%RTOVRC_TABLE (1:NVEG) = RTOVRC (1:NVEG) + NoahmpIO%RSWOODC_TABLE(1:NVEG) = RSWOODC(1:NVEG) + NoahmpIO%BF_TABLE (1:NVEG) = BF (1:NVEG) + NoahmpIO%WSTRC_TABLE (1:NVEG) = WSTRC (1:NVEG) + NoahmpIO%LAIMIN_TABLE (1:NVEG) = LAIMIN (1:NVEG) + NoahmpIO%XSAMIN_TABLE (1:NVEG) = XSAMIN (1:NVEG) + + NoahmpIO%SAIM_TABLE(1:NVEG, 1) = SAI_JAN(1:NVEG) + NoahmpIO%SAIM_TABLE(1:NVEG, 2) = SAI_FEB(1:NVEG) + NoahmpIO%SAIM_TABLE(1:NVEG, 3) = SAI_MAR(1:NVEG) + NoahmpIO%SAIM_TABLE(1:NVEG, 4) = SAI_APR(1:NVEG) + NoahmpIO%SAIM_TABLE(1:NVEG, 5) = SAI_MAY(1:NVEG) + NoahmpIO%SAIM_TABLE(1:NVEG, 6) = SAI_JUN(1:NVEG) + NoahmpIO%SAIM_TABLE(1:NVEG, 7) = SAI_JUL(1:NVEG) + NoahmpIO%SAIM_TABLE(1:NVEG, 8) = SAI_AUG(1:NVEG) + NoahmpIO%SAIM_TABLE(1:NVEG, 9) = SAI_SEP(1:NVEG) + NoahmpIO%SAIM_TABLE(1:NVEG,10) = SAI_OCT(1:NVEG) + NoahmpIO%SAIM_TABLE(1:NVEG,11) = SAI_NOV(1:NVEG) + NoahmpIO%SAIM_TABLE(1:NVEG,12) = SAI_DEC(1:NVEG) + NoahmpIO%LAIM_TABLE(1:NVEG, 1) = LAI_JAN(1:NVEG) + NoahmpIO%LAIM_TABLE(1:NVEG, 2) = LAI_FEB(1:NVEG) + NoahmpIO%LAIM_TABLE(1:NVEG, 3) = LAI_MAR(1:NVEG) + NoahmpIO%LAIM_TABLE(1:NVEG, 4) = LAI_APR(1:NVEG) + NoahmpIO%LAIM_TABLE(1:NVEG, 5) = LAI_MAY(1:NVEG) + NoahmpIO%LAIM_TABLE(1:NVEG, 6) = LAI_JUN(1:NVEG) + NoahmpIO%LAIM_TABLE(1:NVEG, 7) = LAI_JUL(1:NVEG) + NoahmpIO%LAIM_TABLE(1:NVEG, 8) = LAI_AUG(1:NVEG) + NoahmpIO%LAIM_TABLE(1:NVEG, 9) = LAI_SEP(1:NVEG) + NoahmpIO%LAIM_TABLE(1:NVEG,10) = LAI_OCT(1:NVEG) + NoahmpIO%LAIM_TABLE(1:NVEG,11) = LAI_NOV(1:NVEG) + NoahmpIO%LAIM_TABLE(1:NVEG,12) = LAI_DEC(1:NVEG) + NoahmpIO%RHOL_TABLE(1:NVEG,1) = RHOL_VIS(1:NVEG) !leaf reflectance: 1=vis, 2=nir + NoahmpIO%RHOL_TABLE(1:NVEG,2) = RHOL_NIR(1:NVEG) !leaf reflectance: 1=vis, 2=nir + NoahmpIO%RHOS_TABLE(1:NVEG,1) = RHOS_VIS(1:NVEG) !stem reflectance: 1=vis, 2=nir + NoahmpIO%RHOS_TABLE(1:NVEG,2) = RHOS_NIR(1:NVEG) !stem reflectance: 1=vis, 2=nir + NoahmpIO%TAUL_TABLE(1:NVEG,1) = TAUL_VIS(1:NVEG) !leaf transmittance: 1=vis, 2=nir + NoahmpIO%TAUL_TABLE(1:NVEG,2) = TAUL_NIR(1:NVEG) !leaf transmittance: 1=vis, 2=nir + NoahmpIO%TAUS_TABLE(1:NVEG,1) = TAUS_VIS(1:NVEG) !stem transmittance: 1=vis, 2=nir + NoahmpIO%TAUS_TABLE(1:NVEG,2) = TAUS_NIR(1:NVEG) !stem transmittance: 1=vis, 2=nir + + !---------------- NoahmpTable.TBL soil parameters + inquire( file=trim(MPTABLE_file), exist=file_named ) + if ( file_named ) then + open(15, file=trim(MPTABLE_file), status='old', form='formatted', action='read', iostat=ierr) + else + open(15, status='old', form='formatted', action='read', iostat=ierr) + end if + if ( ierr /= 0 ) then + write(*,'("WARNING: Cannot find file NoahmpTable.TBL")') + stop "ERROR: NoahmpTable.TBL soil parameter" + endif + read(15, noahmp_stas_soil_categories) + if ( trim(SLTYPE) == "STAS" ) then + read(15, noahmp_soil_stas_parameters) + elseif ( trim(SLTYPE) == "STAS_RUC" ) then + read(15, noahmp_soil_stas_ruc_parameters) + else + write(*,'("WARNING: Unrecognized SOILTYPE in subroutine ReadNoahmpTable")') + write(*,'("WARNING: SOIL Dataset = ''", A, "''")') trim(SLTYPE) + stop "ERROR: Soil dataset" + endif + close(15) + + ! assign values + NoahmpIO%SLCATS_TABLE = SLCATS + NoahmpIO%BEXP_TABLE (1:SLCATS) = BB (1:SLCATS) + NoahmpIO%SMCDRY_TABLE(1:SLCATS) = DRYSMC(1:SLCATS) + NoahmpIO%SMCMAX_TABLE(1:SLCATS) = MAXSMC(1:SLCATS) + NoahmpIO%SMCREF_TABLE(1:SLCATS) = REFSMC(1:SLCATS) + NoahmpIO%PSISAT_TABLE(1:SLCATS) = SATPSI(1:SLCATS) + NoahmpIO%DKSAT_TABLE (1:SLCATS) = SATDK (1:SLCATS) + NoahmpIO%DWSAT_TABLE (1:SLCATS) = SATDW (1:SLCATS) + NoahmpIO%SMCWLT_TABLE(1:SLCATS) = WLTSMC(1:SLCATS) + NoahmpIO%QUARTZ_TABLE(1:SLCATS) = QTZ (1:SLCATS) + NoahmpIO%BVIC_TABLE (1:SLCATS) = BVIC (1:SLCATS) + NoahmpIO%AXAJ_TABLE (1:SLCATS) = AXAJ (1:SLCATS) + NoahmpIO%BXAJ_TABLE (1:SLCATS) = BXAJ (1:SLCATS) + NoahmpIO%XXAJ_TABLE (1:SLCATS) = XXAJ (1:SLCATS) + NoahmpIO%BDVIC_TABLE (1:SLCATS) = BDVIC (1:SLCATS) + NoahmpIO%GDVIC_TABLE (1:SLCATS) = GDVIC (1:SLCATS) + NoahmpIO%BBVIC_TABLE (1:SLCATS) = BBVIC (1:SLCATS) + + !---------------- NoahmpTable.TBL general parameters + inquire( file=trim(MPTABLE_file), exist=file_named ) + if ( file_named ) then + open(15, file=trim(MPTABLE_file), status='old', form='formatted', action='read', iostat=ierr) + else + open(15, status='old', form='formatted', action='read', iostat=ierr) + end if + if ( ierr /= 0 ) then + write(*,'("WARNING: Cannot find file NoahmpTable.TBL")') + stop "ERROR: NoahmpTable.TBL general parameter" + endif + read(15, noahmp_general_parameters) + close(15) + + ! assign values + NoahmpIO%SLOPE_TABLE(1:NUM_SLOPE) = SLOPE_DATA(1:NUM_SLOPE) + NoahmpIO%CSOIL_TABLE = CSOIL_DATA + NoahmpIO%REFDK_TABLE = REFDK_DATA + NoahmpIO%REFKDT_TABLE = REFKDT_DATA + NoahmpIO%FRZK_TABLE = FRZK_DATA + NoahmpIO%ZBOT_TABLE = ZBOT_DATA + NoahmpIO%CZIL_TABLE = CZIL_DATA + + !---------------- NoahmpTable.TBL radiation parameters + inquire( file=trim(MPTABLE_file), exist=file_named ) + if ( file_named ) then + open(15, file=trim(MPTABLE_file), status='old', form='formatted', action='read', iostat=ierr) + else + open(15, status='old', form='formatted', action='read', iostat=ierr) + end if + if (ierr /= 0) then + write(*,'("WARNING: Cannot find file NoahmpTable.TBL")') + stop "ERROR: NoahmpTable.TBL radiation parameter" + endif + read(15,noahmp_rad_parameters) + close(15) + + ! assign values + NoahmpIO%ALBSAT_TABLE(:,1) = ALBSAT_VIS ! saturated soil albedos: 1=vis, 2=nir + NoahmpIO%ALBSAT_TABLE(:,2) = ALBSAT_NIR ! saturated soil albedos: 1=vis, 2=nir + NoahmpIO%ALBDRY_TABLE(:,1) = ALBDRY_VIS ! dry soil albedos: 1=vis, 2=nir + NoahmpIO%ALBDRY_TABLE(:,2) = ALBDRY_NIR ! dry soil albedos: 1=vis, 2=nir + NoahmpIO%ALBICE_TABLE = ALBICE + NoahmpIO%ALBLAK_TABLE = ALBLAK + NoahmpIO%OMEGAS_TABLE = OMEGAS + NoahmpIO%BETADS_TABLE = BETADS + NoahmpIO%BETAIS_TABLE = BETAIS + NoahmpIO%EG_TABLE = EG + NoahmpIO%EICE_TABLE = EICE + + !---------------- NoahmpTable.TBL global parameters + inquire( file=trim(MPTABLE_file), exist=file_named ) + if ( file_named ) then + open(15, file=trim(MPTABLE_file), status='old', form='formatted', action='read', iostat=ierr) + else + open(15, status='old', form='formatted', action='read', iostat=ierr) + end if + if (ierr /= 0) then + write(*,'("WARNING: Cannot find file NoahmpTable.TBL")') + stop "ERROR: NoahmpTable.TBL global parameter" + endif + read(15,noahmp_global_parameters) + close(15) + + ! assign values + NoahmpIO%CO2_TABLE = CO2 + NoahmpIO%O2_TABLE = O2 + NoahmpIO%TIMEAN_TABLE = TIMEAN + NoahmpIO%FSATMX_TABLE = FSATMX + NoahmpIO%Z0SNO_TABLE = Z0SNO + NoahmpIO%SSI_TABLE = SSI + NoahmpIO%SNOW_RET_FAC_TABLE = SNOW_RET_FAC + NoahmpIO%SNOW_EMIS_TABLE = SNOW_EMIS + NoahmpIO%SWEMX_TABLE = SWEMX + NoahmpIO%TAU0_TABLE = TAU0 + NoahmpIO%GRAIN_GROWTH_TABLE = GRAIN_GROWTH + NoahmpIO%EXTRA_GROWTH_TABLE = EXTRA_GROWTH + NoahmpIO%DIRT_SOOT_TABLE = DIRT_SOOT + NoahmpIO%BATS_COSZ_TABLE = BATS_COSZ + NoahmpIO%BATS_VIS_NEW_TABLE = BATS_VIS_NEW + NoahmpIO%BATS_NIR_NEW_TABLE = BATS_NIR_NEW + NoahmpIO%BATS_VIS_AGE_TABLE = BATS_VIS_AGE + NoahmpIO%BATS_NIR_AGE_TABLE = BATS_NIR_AGE + NoahmpIO%BATS_VIS_DIR_TABLE = BATS_VIS_DIR + NoahmpIO%BATS_NIR_DIR_TABLE = BATS_NIR_DIR + NoahmpIO%RSURF_SNOW_TABLE = RSURF_SNOW + NoahmpIO%RSURF_EXP_TABLE = RSURF_EXP + NoahmpIO%C2_SNOWCOMPACT_TABLE = C2_SNOWCOMPACT + NoahmpIO%C3_SNOWCOMPACT_TABLE = C3_SNOWCOMPACT + NoahmpIO%C4_SNOWCOMPACT_TABLE = C4_SNOWCOMPACT + NoahmpIO%C5_SNOWCOMPACT_TABLE = C5_SNOWCOMPACT + NoahmpIO%DM_SNOWCOMPACT_TABLE = DM_SNOWCOMPACT + NoahmpIO%ETA0_SNOWCOMPACT_TABLE = ETA0_SNOWCOMPACT + NoahmpIO%SNLIQMAXFRAC_TABLE = SNLIQMAXFRAC + NoahmpIO%SWEMAXGLA_TABLE = SWEMAXGLA + NoahmpIO%WSLMAX_TABLE = WSLMAX + NoahmpIO%ROUS_TABLE = ROUS + NoahmpIO%CMIC_TABLE = CMIC + NoahmpIO%SNOWDEN_MAX_TABLE = SNOWDEN_MAX + NoahmpIO%CLASS_ALB_REF_TABLE = CLASS_ALB_REF + NoahmpIO%CLASS_SNO_AGE_TABLE = CLASS_SNO_AGE + NoahmpIO%CLASS_ALB_NEW_TABLE = CLASS_ALB_NEW + NoahmpIO%PSIWLT_TABLE = PSIWLT + NoahmpIO%Z0SOIL_TABLE = Z0SOIL + NoahmpIO%Z0LAKE_TABLE = Z0LAKE + + !---------------- NoahmpTable.TBL irrigation parameters + inquire( file=trim(MPTABLE_file), exist=file_named ) + if ( file_named ) then + open(15, file=trim(MPTABLE_file), status='old', form='formatted', action='read', iostat=ierr) + else + open(15, status='old', form='formatted', action='read', iostat=ierr) + end if + if (ierr /= 0) then + write(*,'("WARNING: Cannot find file NoahmpTable.TBL")') + stop "ERROR: NoahmpTable.TBL irrigation parameter" + endif + read(15,noahmp_irrigation_parameters) + close(15) + if ( (FILOSS < 0.0) .or. (FILOSS > 0.99) ) then + write(*,'("WARNING: FILOSS should be >=0.0 and <=0.99")') + stop "STOP in NoahMP_irrigation_parameters" + endif + + ! assign values + NoahmpIO%IRR_FRAC_TABLE = IRR_FRAC + NoahmpIO%IRR_HAR_TABLE = IRR_HAR + NoahmpIO%IRR_LAI_TABLE = IRR_LAI + NoahmpIO%IRR_MAD_TABLE = IRR_MAD + NoahmpIO%FILOSS_TABLE = FILOSS + NoahmpIO%SPRIR_RATE_TABLE = SPRIR_RATE + NoahmpIO%MICIR_RATE_TABLE = MICIR_RATE + NoahmpIO%FIRTFAC_TABLE = FIRTFAC + NoahmpIO%IR_RAIN_TABLE = IR_RAIN + + !---------------- NoahmpTable.TBL crop parameters + inquire( file=trim(MPTABLE_file), exist=file_named ) + if ( file_named ) then + open(15, file=trim(MPTABLE_file), status='old', form='formatted', action='read', iostat=ierr) + else + open(15, status='old', form='formatted', action='read', iostat=ierr) + end if + if (ierr /= 0) then + write(*,'("WARNING: Cannot find file NoahmpTable.TBL")') + stop "ERROR: NoahmpTable.TBL crop parameter" + endif + read(15,noahmp_crop_parameters) + close(15) + + ! assign values + NoahmpIO%DEFAULT_CROP_TABLE = DEFAULT_CROP + NoahmpIO%PLTDAY_TABLE = PLTDAY + NoahmpIO%HSDAY_TABLE = HSDAY + NoahmpIO%PLANTPOP_TABLE = PLANTPOP + NoahmpIO%IRRI_TABLE = IRRI + NoahmpIO%GDDTBASE_TABLE = GDDTBASE + NoahmpIO%GDDTCUT_TABLE = GDDTCUT + NoahmpIO%GDDS1_TABLE = GDDS1 + NoahmpIO%GDDS2_TABLE = GDDS2 + NoahmpIO%GDDS3_TABLE = GDDS3 + NoahmpIO%GDDS4_TABLE = GDDS4 + NoahmpIO%GDDS5_TABLE = GDDS5 + NoahmpIO%C3PSNI_TABLE (1:5) = C3PSNI (1:5) + NoahmpIO%KC25I_TABLE (1:5) = KC25I (1:5) + NoahmpIO%AKCI_TABLE (1:5) = AKCI (1:5) + NoahmpIO%KO25I_TABLE (1:5) = KO25I (1:5) + NoahmpIO%AKOI_TABLE (1:5) = AKOI (1:5) + NoahmpIO%AVCMXI_TABLE (1:5) = AVCMXI (1:5) + NoahmpIO%VCMX25I_TABLE(1:5) = VCMX25I(1:5) + NoahmpIO%BPI_TABLE (1:5) = BPI (1:5) + NoahmpIO%MPI_TABLE (1:5) = MPI (1:5) + NoahmpIO%FOLNMXI_TABLE(1:5) = FOLNMXI(1:5) + NoahmpIO%QE25I_TABLE (1:5) = QE25I (1:5) + NoahmpIO%AREF_TABLE = AREF + NoahmpIO%PSNRF_TABLE = PSNRF + NoahmpIO%I2PAR_TABLE = I2PAR + NoahmpIO%TASSIM0_TABLE = TASSIM0 + NoahmpIO%TASSIM1_TABLE = TASSIM1 + NoahmpIO%TASSIM2_TABLE = TASSIM2 + NoahmpIO%K_TABLE = K + NoahmpIO%EPSI_TABLE = EPSI + NoahmpIO%Q10MR_TABLE = Q10MR + NoahmpIO%LEFREEZ_TABLE = LEFREEZ + NoahmpIO%FRA_GR_TABLE = FRA_GR + NoahmpIO%LFMR25_TABLE = LFMR25 + NoahmpIO%STMR25_TABLE = STMR25 + NoahmpIO%RTMR25_TABLE = RTMR25 + NoahmpIO%GRAINMR25_TABLE = GRAINMR25 + NoahmpIO%BIO2LAI_TABLE = BIO2LAI + NoahmpIO%DILE_FC_TABLE(:,1) = DILE_FC_S1 + NoahmpIO%DILE_FC_TABLE(:,2) = DILE_FC_S2 + NoahmpIO%DILE_FC_TABLE(:,3) = DILE_FC_S3 + NoahmpIO%DILE_FC_TABLE(:,4) = DILE_FC_S4 + NoahmpIO%DILE_FC_TABLE(:,5) = DILE_FC_S5 + NoahmpIO%DILE_FC_TABLE(:,6) = DILE_FC_S6 + NoahmpIO%DILE_FC_TABLE(:,7) = DILE_FC_S7 + NoahmpIO%DILE_FC_TABLE(:,8) = DILE_FC_S8 + NoahmpIO%DILE_FW_TABLE(:,1) = DILE_FW_S1 + NoahmpIO%DILE_FW_TABLE(:,2) = DILE_FW_S2 + NoahmpIO%DILE_FW_TABLE(:,3) = DILE_FW_S3 + NoahmpIO%DILE_FW_TABLE(:,4) = DILE_FW_S4 + NoahmpIO%DILE_FW_TABLE(:,5) = DILE_FW_S5 + NoahmpIO%DILE_FW_TABLE(:,6) = DILE_FW_S6 + NoahmpIO%DILE_FW_TABLE(:,7) = DILE_FW_S7 + NoahmpIO%DILE_FW_TABLE(:,8) = DILE_FW_S8 + NoahmpIO%LF_OVRC_TABLE(:,1) = LF_OVRC_S1 + NoahmpIO%LF_OVRC_TABLE(:,2) = LF_OVRC_S2 + NoahmpIO%LF_OVRC_TABLE(:,3) = LF_OVRC_S3 + NoahmpIO%LF_OVRC_TABLE(:,4) = LF_OVRC_S4 + NoahmpIO%LF_OVRC_TABLE(:,5) = LF_OVRC_S5 + NoahmpIO%LF_OVRC_TABLE(:,6) = LF_OVRC_S6 + NoahmpIO%LF_OVRC_TABLE(:,7) = LF_OVRC_S7 + NoahmpIO%LF_OVRC_TABLE(:,8) = LF_OVRC_S8 + NoahmpIO%ST_OVRC_TABLE(:,1) = ST_OVRC_S1 + NoahmpIO%ST_OVRC_TABLE(:,2) = ST_OVRC_S2 + NoahmpIO%ST_OVRC_TABLE(:,3) = ST_OVRC_S3 + NoahmpIO%ST_OVRC_TABLE(:,4) = ST_OVRC_S4 + NoahmpIO%ST_OVRC_TABLE(:,5) = ST_OVRC_S5 + NoahmpIO%ST_OVRC_TABLE(:,6) = ST_OVRC_S6 + NoahmpIO%ST_OVRC_TABLE(:,7) = ST_OVRC_S7 + NoahmpIO%ST_OVRC_TABLE(:,8) = ST_OVRC_S8 + NoahmpIO%RT_OVRC_TABLE(:,1) = RT_OVRC_S1 + NoahmpIO%RT_OVRC_TABLE(:,2) = RT_OVRC_S2 + NoahmpIO%RT_OVRC_TABLE(:,3) = RT_OVRC_S3 + NoahmpIO%RT_OVRC_TABLE(:,4) = RT_OVRC_S4 + NoahmpIO%RT_OVRC_TABLE(:,5) = RT_OVRC_S5 + NoahmpIO%RT_OVRC_TABLE(:,6) = RT_OVRC_S6 + NoahmpIO%RT_OVRC_TABLE(:,7) = RT_OVRC_S7 + NoahmpIO%RT_OVRC_TABLE(:,8) = RT_OVRC_S8 + NoahmpIO%LFPT_TABLE (:,1) = LFPT_S1 + NoahmpIO%LFPT_TABLE (:,2) = LFPT_S2 + NoahmpIO%LFPT_TABLE (:,3) = LFPT_S3 + NoahmpIO%LFPT_TABLE (:,4) = LFPT_S4 + NoahmpIO%LFPT_TABLE (:,5) = LFPT_S5 + NoahmpIO%LFPT_TABLE (:,6) = LFPT_S6 + NoahmpIO%LFPT_TABLE (:,7) = LFPT_S7 + NoahmpIO%LFPT_TABLE (:,8) = LFPT_S8 + NoahmpIO%STPT_TABLE (:,1) = STPT_S1 + NoahmpIO%STPT_TABLE (:,2) = STPT_S2 + NoahmpIO%STPT_TABLE (:,3) = STPT_S3 + NoahmpIO%STPT_TABLE (:,4) = STPT_S4 + NoahmpIO%STPT_TABLE (:,5) = STPT_S5 + NoahmpIO%STPT_TABLE (:,6) = STPT_S6 + NoahmpIO%STPT_TABLE (:,7) = STPT_S7 + NoahmpIO%STPT_TABLE (:,8) = STPT_S8 + NoahmpIO%RTPT_TABLE (:,1) = RTPT_S1 + NoahmpIO%RTPT_TABLE (:,2) = RTPT_S2 + NoahmpIO%RTPT_TABLE (:,3) = RTPT_S3 + NoahmpIO%RTPT_TABLE (:,4) = RTPT_S4 + NoahmpIO%RTPT_TABLE (:,5) = RTPT_S5 + NoahmpIO%RTPT_TABLE (:,6) = RTPT_S6 + NoahmpIO%RTPT_TABLE (:,7) = RTPT_S7 + NoahmpIO%RTPT_TABLE (:,8) = RTPT_S8 + NoahmpIO%GRAINPT_TABLE(:,1) = GRAINPT_S1 + NoahmpIO%GRAINPT_TABLE(:,2) = GRAINPT_S2 + NoahmpIO%GRAINPT_TABLE(:,3) = GRAINPT_S3 + NoahmpIO%GRAINPT_TABLE(:,4) = GRAINPT_S4 + NoahmpIO%GRAINPT_TABLE(:,5) = GRAINPT_S5 + NoahmpIO%GRAINPT_TABLE(:,6) = GRAINPT_S6 + NoahmpIO%GRAINPT_TABLE(:,7) = GRAINPT_S7 + NoahmpIO%GRAINPT_TABLE(:,8) = GRAINPT_S8 + NoahmpIO%LFCT_TABLE (:,1) = LFCT_S1 + NoahmpIO%LFCT_TABLE (:,2) = LFCT_S2 + NoahmpIO%LFCT_TABLE (:,3) = LFCT_S3 + NoahmpIO%LFCT_TABLE (:,4) = LFCT_S4 + NoahmpIO%LFCT_TABLE (:,5) = LFCT_S5 + NoahmpIO%LFCT_TABLE (:,6) = LFCT_S6 + NoahmpIO%LFCT_TABLE (:,7) = LFCT_S7 + NoahmpIO%LFCT_TABLE (:,8) = LFCT_S8 + NoahmpIO%STCT_TABLE (:,1) = STCT_S1 + NoahmpIO%STCT_TABLE (:,2) = STCT_S2 + NoahmpIO%STCT_TABLE (:,3) = STCT_S3 + NoahmpIO%STCT_TABLE (:,4) = STCT_S4 + NoahmpIO%STCT_TABLE (:,5) = STCT_S5 + NoahmpIO%STCT_TABLE (:,6) = STCT_S6 + NoahmpIO%STCT_TABLE (:,7) = STCT_S7 + NoahmpIO%STCT_TABLE (:,8) = STCT_S8 + NoahmpIO%RTCT_TABLE (:,1) = RTCT_S1 + NoahmpIO%RTCT_TABLE (:,2) = RTCT_S2 + NoahmpIO%RTCT_TABLE (:,3) = RTCT_S3 + NoahmpIO%RTCT_TABLE (:,4) = RTCT_S4 + NoahmpIO%RTCT_TABLE (:,5) = RTCT_S5 + NoahmpIO%RTCT_TABLE (:,6) = RTCT_S6 + NoahmpIO%RTCT_TABLE (:,7) = RTCT_S7 + NoahmpIO%RTCT_TABLE (:,8) = RTCT_S8 + + !---------------- NoahmpTable.TBL tile drainage parameters + inquire( file=trim(MPTABLE_file), exist=file_named ) + if ( file_named ) then + open(15, file=trim(MPTABLE_file), status='old', form='formatted', action='read', iostat=ierr) + else + open(15, status='old', form='formatted', action='read', iostat=ierr) + end if + if (ierr /= 0) then + write(*,'("WARNING: Cannot find file NoahmpTable.TBL")') + stop "ERROR: NoahmpTable.TBL tile drainage parameter" + endif + read(15,noahmp_tiledrain_parameters) + close(15) + + ! assign values + NoahmpIO%DRAIN_LAYER_OPT_TABLE = DRAIN_LAYER_OPT + NoahmpIO%TDSMC_FAC_TABLE(1:NSOILTYPE) = TDSMC_FAC(1:NSOILTYPE) + NoahmpIO%TD_DEPTH_TABLE (1:NSOILTYPE) = TD_DEPTH (1:NSOILTYPE) + NoahmpIO%TD_DC_TABLE (1:NSOILTYPE) = TD_DC (1:NSOILTYPE) + NoahmpIO%TD_DCOEF_TABLE (1:NSOILTYPE) = TD_DCOEF (1:NSOILTYPE) + NoahmpIO%TD_D_TABLE (1:NSOILTYPE) = TD_D (1:NSOILTYPE) + NoahmpIO%TD_ADEPTH_TABLE(1:NSOILTYPE) = TD_ADEPTH(1:NSOILTYPE) + NoahmpIO%TD_RADI_TABLE (1:NSOILTYPE) = TD_RADI (1:NSOILTYPE) + NoahmpIO%TD_SPAC_TABLE (1:NSOILTYPE) = TD_SPAC (1:NSOILTYPE) + NoahmpIO%TD_DDRAIN_TABLE(1:NSOILTYPE) = TD_DDRAIN(1:NSOILTYPE) + NoahmpIO%KLAT_FAC_TABLE (1:NSOILTYPE) = KLAT_FAC (1:NSOILTYPE) + + !---------------- NoahmpTable.TBL optional parameters + inquire( file=trim(MPTABLE_file), exist=file_named ) + if ( file_named ) then + open(15, file=trim(MPTABLE_file), status='old', form='formatted', action='read', iostat=ierr) + else + open(15, status='old', form='formatted', action='read', iostat=ierr) + end if + if (ierr /= 0) then + write(*,'("WARNING: Cannot find file NoahmpTable.TBL")') + stop "ERROR: NoahmpTable.TBL optional parameter" + endif + read(15,noahmp_optional_parameters) + close(15) + + ! assign values + NoahmpIO%sr2006_theta_1500t_a_TABLE = sr2006_theta_1500t_a + NoahmpIO%sr2006_theta_1500t_b_TABLE = sr2006_theta_1500t_b + NoahmpIO%sr2006_theta_1500t_c_TABLE = sr2006_theta_1500t_c + NoahmpIO%sr2006_theta_1500t_d_TABLE = sr2006_theta_1500t_d + NoahmpIO%sr2006_theta_1500t_e_TABLE = sr2006_theta_1500t_e + NoahmpIO%sr2006_theta_1500t_f_TABLE = sr2006_theta_1500t_f + NoahmpIO%sr2006_theta_1500t_g_TABLE = sr2006_theta_1500t_g + NoahmpIO%sr2006_theta_1500_a_TABLE = sr2006_theta_1500_a + NoahmpIO%sr2006_theta_1500_b_TABLE = sr2006_theta_1500_b + NoahmpIO%sr2006_theta_33t_a_TABLE = sr2006_theta_33t_a + NoahmpIO%sr2006_theta_33t_b_TABLE = sr2006_theta_33t_b + NoahmpIO%sr2006_theta_33t_c_TABLE = sr2006_theta_33t_c + NoahmpIO%sr2006_theta_33t_d_TABLE = sr2006_theta_33t_d + NoahmpIO%sr2006_theta_33t_e_TABLE = sr2006_theta_33t_e + NoahmpIO%sr2006_theta_33t_f_TABLE = sr2006_theta_33t_f + NoahmpIO%sr2006_theta_33t_g_TABLE = sr2006_theta_33t_g + NoahmpIO%sr2006_theta_33_a_TABLE = sr2006_theta_33_a + NoahmpIO%sr2006_theta_33_b_TABLE = sr2006_theta_33_b + NoahmpIO%sr2006_theta_33_c_TABLE = sr2006_theta_33_c + NoahmpIO%sr2006_theta_s33t_a_TABLE = sr2006_theta_s33t_a + NoahmpIO%sr2006_theta_s33t_b_TABLE = sr2006_theta_s33t_b + NoahmpIO%sr2006_theta_s33t_c_TABLE = sr2006_theta_s33t_c + NoahmpIO%sr2006_theta_s33t_d_TABLE = sr2006_theta_s33t_d + NoahmpIO%sr2006_theta_s33t_e_TABLE = sr2006_theta_s33t_e + NoahmpIO%sr2006_theta_s33t_f_TABLE = sr2006_theta_s33t_f + NoahmpIO%sr2006_theta_s33t_g_TABLE = sr2006_theta_s33t_g + NoahmpIO%sr2006_theta_s33_a_TABLE = sr2006_theta_s33_a + NoahmpIO%sr2006_theta_s33_b_TABLE = sr2006_theta_s33_b + NoahmpIO%sr2006_psi_et_a_TABLE = sr2006_psi_et_a + NoahmpIO%sr2006_psi_et_b_TABLE = sr2006_psi_et_b + NoahmpIO%sr2006_psi_et_c_TABLE = sr2006_psi_et_c + NoahmpIO%sr2006_psi_et_d_TABLE = sr2006_psi_et_d + NoahmpIO%sr2006_psi_et_e_TABLE = sr2006_psi_et_e + NoahmpIO%sr2006_psi_et_f_TABLE = sr2006_psi_et_f + NoahmpIO%sr2006_psi_et_g_TABLE = sr2006_psi_et_g + NoahmpIO%sr2006_psi_e_a_TABLE = sr2006_psi_e_a + NoahmpIO%sr2006_psi_e_b_TABLE = sr2006_psi_e_b + NoahmpIO%sr2006_psi_e_c_TABLE = sr2006_psi_e_c + NoahmpIO%sr2006_smcmax_a_TABLE = sr2006_smcmax_a + NoahmpIO%sr2006_smcmax_b_TABLE = sr2006_smcmax_b + + end subroutine NoahmpReadTable + +end module NoahmpReadTableMod diff --git a/drivers/lis/NoahmpSnowInitMod.F90 b/drivers/lis/NoahmpSnowInitMod.F90 new file mode 100644 index 00000000..6c5dd3c8 --- /dev/null +++ b/drivers/lis/NoahmpSnowInitMod.F90 @@ -0,0 +1,117 @@ +module NoahmpSnowInitMod + +! Module to initialize Noah-MP Snow variables + + use Machine + use NoahmpIOVarType + + implicit none + +contains + + subroutine NoahmpSnowInitMain(NoahmpIO) + +! ------------------------ Code history ----------------------------------- +! Original Noah-MP subroutine: SNOW_INIT +! Original code: Guo-Yue Niu and Noah-MP team (Niu et al. 2011) +! Refactered code: C. He, P. Valayamkunnath, & refactor team (He et al. 2023) +! ------------------------------------------------------------------------- + + implicit none + + type(NoahmpIO_type), intent(inout) :: NoahmpIO + +! local variables + integer :: I,J,IZ,itf,jtf + real(kind=kind_noahmp), dimension(-NoahmpIO%NSNOW+1: 0) :: DZSNO + real(kind=kind_noahmp), dimension(-NoahmpIO%NSNOW+1:NoahmpIO%NSOIL) :: DZSNSO + +!------------------------------------------------------------------------------------------ +! Initialize snow arrays for Noah-MP LSM, based in input SNOWDEP, NSNOW +! ISNOWXY is an index array, indicating the index of the top snow layer. Valid indices +! for snow layers range from 0 (no snow) and -1 (shallow snow) to (-NSNOW)+1 (deep snow). +! TSNOXY holds the temperature of the snow layer. Snow layers are initialized with +! temperature = ground temperature [?]. Snow-free levels in the array have value 0.0 +! SNICEXY is the frozen content of a snow layer. Initial estimate based on SNOWH and SNOW +! SNLIQXY is the liquid content of a snow layer. Initialized to 0.0 +! ZNSNOXY is the layer depth from the surface. +!------------------------------------------------------------------------------------------ + + itf = min0(NoahmpIO%ite, (NoahmpIO%ide+1)-1) + jtf = min0(NoahmpIO%jte, (NoahmpIO%jde+1)-1) + + do J = NoahmpIO%jts, jtf + do I = NoahmpIO%its, itf + + ! initialize snow layers and thickness + ! no explicit snow layer + if ( NoahmpIO%SNOWH(I,J) < 0.025 ) then + NoahmpIO%ISNOWXY(I,J) = 0 + DZSNO(-NoahmpIO%NSNOW+1:0) = 0.0 + else + ! 1 layer snow + if ( (NoahmpIO%SNOWH(I,J) >= 0.025) .and. (NoahmpIO%SNOWH(I,J) <= 0.05) ) then + NoahmpIO%ISNOWXY(I,J) = -1 + DZSNO(0) = NoahmpIO%SNOWH(I,J) + ! 2 layer snow + elseif ( (NoahmpIO%SNOWH(I,J) > 0.05) .and. (NoahmpIO%SNOWH(I,J) <= 0.10) ) then + NoahmpIO%ISNOWXY(I,J) = -2 + DZSNO(-1) = NoahmpIO%SNOWH(I,J) / 2.0 + DZSNO( 0) = NoahmpIO%SNOWH(I,J) / 2.0 + ! 2 layer thick snow + elseif ( (NoahmpIO%SNOWH(I,J) > 0.10) .and. (NoahmpIO%SNOWH(I,J) <= 0.25) ) then + NoahmpIO%ISNOWXY(I,J) = -2 + DZSNO(-1) = 0.05 + DZSNO( 0) = NoahmpIO%SNOWH(I,J) - DZSNO(-1) + ! 3 layer snow + elseif ( (NoahmpIO%SNOWH(I,J) > 0.25) .and. (NoahmpIO%SNOWH(I,J) <= 0.45) ) then + NoahmpIO%ISNOWXY(I,J) = -3 + DZSNO(-2) = 0.05 + DZSNO(-1) = 0.5 * (NoahmpIO%SNOWH(I,J)-DZSNO(-2)) + DZSNO( 0) = 0.5 * (NoahmpIO%SNOWH(I,J)-DZSNO(-2)) + ! 3 layer thick snow + elseif ( NoahmpIO%SNOWH(I,J) > 0.45 ) then + NoahmpIO%ISNOWXY(I,J) = -3 + DZSNO(-2) = 0.05 + DZSNO(-1) = 0.20 + DZSNO( 0) = NoahmpIO%SNOWH(I,J) - DZSNO(-1) - DZSNO(-2) + else + print*, "Problem with the logic assigning snow layers." + stop + endif + endif + + ! initialize snow temperatuer and ice/liquid content + NoahmpIO%TSNOXY (I,-NoahmpIO%NSNOW+1:0,J) = 0.0 + NoahmpIO%SNICEXY(I,-NoahmpIO%NSNOW+1:0,J) = 0.0 + NoahmpIO%SNLIQXY(I,-NoahmpIO%NSNOW+1:0,J) = 0.0 + do IZ = NoahmpIO%ISNOWXY(I,J)+1, 0 + NoahmpIO%TSNOXY(I,IZ,J) = NoahmpIO%TGXY(I,J) + NoahmpIO%SNLIQXY(I,IZ,J) = 0.0 + NoahmpIO%SNICEXY(I,IZ,J) = 1.0 * DZSNO(IZ) * (NoahmpIO%SNOW(I,J)/NoahmpIO%SNOWH(I,J)) + enddo + + ! Assign local variable DZSNSO, the soil/snow layer thicknesses, for snow layers + do IZ = NoahmpIO%ISNOWXY(I,J)+1, 0 + DZSNSO(IZ) = -DZSNO(IZ) + enddo + + ! Assign local variable DZSNSO, the soil/snow layer thicknesses, for soil layers + DZSNSO(1) = NoahmpIO%ZSOIL(1) + do IZ = 2, NoahmpIO%NSOIL + DZSNSO(IZ) = NoahmpIO%ZSOIL(IZ) - NoahmpIO%ZSOIL(IZ-1) + enddo + + ! Assign ZSNSOXY, the layer depths, for soil and snow layers + NoahmpIO%ZSNSOXY(I,NoahmpIO%ISNOWXY(I,J)+1,J) = DZSNSO(NoahmpIO%ISNOWXY(I,J)+1) + do IZ = NoahmpIO%ISNOWXY(I,J)+2, NoahmpIO%NSOIL + NoahmpIO%ZSNSOXY(I,IZ,J) = NoahmpIO%ZSNSOXY(I,IZ-1,J) + DZSNSO(IZ) + enddo + + enddo ! I + enddo ! J + + end subroutine NoahmpSnowInitMain + +end module NoahmpSnowInitMod + diff --git a/drivers/lis/PedoTransferSR2006Mod.F90 b/drivers/lis/PedoTransferSR2006Mod.F90 new file mode 100644 index 00000000..02090e82 --- /dev/null +++ b/drivers/lis/PedoTransferSR2006Mod.F90 @@ -0,0 +1,210 @@ +module PedoTransferSR2006Mod + +!!! Compute soil water infiltration based on different soil composition + + use Machine + use NoahmpIOVarType + use NoahmpVarType + + implicit none + +contains + + subroutine PedoTransferSR2006(NoahmpIO, noahmp, Sand, Clay, Orgm) + +! ------------------------ Code history ----------------------------------- +! Original Noah-MP subroutine: PEDOTRANSFER_SR2006 +! Original code: Guo-Yue Niu and Noah-MP team (Niu et al. 2011) +! Refactered code: C. He, P. Valayamkunnath, & refactor team (He et al. 2023) +! ------------------------------------------------------------------------- + + implicit none + + type(NoahmpIO_type), intent(inout) :: NoahmpIO + type(noahmp_type) , intent(inout) :: noahmp + + real(kind=kind_noahmp), dimension(1:NoahmpIO%NSOIL), intent(inout) :: Sand + real(kind=kind_noahmp), dimension(1:NoahmpIO%NSOIL), intent(inout) :: Clay + real(kind=kind_noahmp), dimension(1:NoahmpIO%NSOIL), intent(inout) :: Orgm + +! local + integer :: k + real(kind=kind_noahmp), dimension( 1:NoahmpIO%NSOIL ) :: theta_1500t + real(kind=kind_noahmp), dimension( 1:NoahmpIO%NSOIL ) :: theta_1500 + real(kind=kind_noahmp), dimension( 1:NoahmpIO%NSOIL ) :: theta_33t + real(kind=kind_noahmp), dimension( 1:NoahmpIO%NSOIL ) :: theta_33 + real(kind=kind_noahmp), dimension( 1:NoahmpIO%NSOIL ) :: theta_s33t + real(kind=kind_noahmp), dimension( 1:NoahmpIO%NSOIL ) :: theta_s33 + real(kind=kind_noahmp), dimension( 1:NoahmpIO%NSOIL ) :: psi_et + real(kind=kind_noahmp), dimension( 1:NoahmpIO%NSOIL ) :: psi_e + real(kind=kind_noahmp), dimension( 1:NoahmpIO%NSOIL ) :: smcmax + real(kind=kind_noahmp), dimension( 1:NoahmpIO%NSOIL ) :: smcref + real(kind=kind_noahmp), dimension( 1:NoahmpIO%NSOIL ) :: smcwlt + real(kind=kind_noahmp), dimension( 1:NoahmpIO%NSOIL ) :: smcdry + real(kind=kind_noahmp), dimension( 1:NoahmpIO%NSOIL ) :: bexp + real(kind=kind_noahmp), dimension( 1:NoahmpIO%NSOIL ) :: psisat + real(kind=kind_noahmp), dimension( 1:NoahmpIO%NSOIL ) :: dksat + real(kind=kind_noahmp), dimension( 1:NoahmpIO%NSOIL ) :: dwsat + real(kind=kind_noahmp), dimension( 1:NoahmpIO%NSOIL ) :: quartz + +! ------------------------------------------------------------------------------ + associate( & + sr2006_theta_1500t_a => NoahmpIO%sr2006_theta_1500t_a_TABLE ,& + sr2006_theta_1500t_b => NoahmpIO%sr2006_theta_1500t_b_TABLE ,& + sr2006_theta_1500t_c => NoahmpIO%sr2006_theta_1500t_c_TABLE ,& + sr2006_theta_1500t_d => NoahmpIO%sr2006_theta_1500t_d_TABLE ,& + sr2006_theta_1500t_e => NoahmpIO%sr2006_theta_1500t_e_TABLE ,& + sr2006_theta_1500t_f => NoahmpIO%sr2006_theta_1500t_f_TABLE ,& + sr2006_theta_1500t_g => NoahmpIO%sr2006_theta_1500t_g_TABLE ,& + sr2006_theta_1500_a => NoahmpIO%sr2006_theta_1500_a_TABLE ,& + sr2006_theta_1500_b => NoahmpIO%sr2006_theta_1500_b_TABLE ,& + sr2006_theta_33t_a => NoahmpIO%sr2006_theta_33t_a_TABLE ,& + sr2006_theta_33t_b => NoahmpIO%sr2006_theta_33t_b_TABLE ,& + sr2006_theta_33t_c => NoahmpIO%sr2006_theta_33t_c_TABLE ,& + sr2006_theta_33t_d => NoahmpIO%sr2006_theta_33t_d_TABLE ,& + sr2006_theta_33t_e => NoahmpIO%sr2006_theta_33t_e_TABLE ,& + sr2006_theta_33t_f => NoahmpIO%sr2006_theta_33t_f_TABLE ,& + sr2006_theta_33t_g => NoahmpIO%sr2006_theta_33t_g_TABLE ,& + sr2006_theta_33_a => NoahmpIO%sr2006_theta_33_a_TABLE ,& + sr2006_theta_33_b => NoahmpIO%sr2006_theta_33_b_TABLE ,& + sr2006_theta_33_c => NoahmpIO%sr2006_theta_33_c_TABLE ,& + sr2006_theta_s33t_a => NoahmpIO%sr2006_theta_s33t_a_TABLE ,& + sr2006_theta_s33t_b => NoahmpIO%sr2006_theta_s33t_b_TABLE ,& + sr2006_theta_s33t_c => NoahmpIO%sr2006_theta_s33t_c_TABLE ,& + sr2006_theta_s33t_d => NoahmpIO%sr2006_theta_s33t_d_TABLE ,& + sr2006_theta_s33t_e => NoahmpIO%sr2006_theta_s33t_e_TABLE ,& + sr2006_theta_s33t_f => NoahmpIO%sr2006_theta_s33t_f_TABLE ,& + sr2006_theta_s33t_g => NoahmpIO%sr2006_theta_s33t_g_TABLE ,& + sr2006_theta_s33_a => NoahmpIO%sr2006_theta_s33_a_TABLE ,& + sr2006_theta_s33_b => NoahmpIO%sr2006_theta_s33_b_TABLE ,& + sr2006_psi_et_a => NoahmpIO%sr2006_psi_et_a_TABLE ,& + sr2006_psi_et_b => NoahmpIO%sr2006_psi_et_b_TABLE ,& + sr2006_psi_et_c => NoahmpIO%sr2006_psi_et_c_TABLE ,& + sr2006_psi_et_d => NoahmpIO%sr2006_psi_et_d_TABLE ,& + sr2006_psi_et_e => NoahmpIO%sr2006_psi_et_e_TABLE ,& + sr2006_psi_et_f => NoahmpIO%sr2006_psi_et_f_TABLE ,& + sr2006_psi_et_g => NoahmpIO%sr2006_psi_et_g_TABLE ,& + sr2006_psi_e_a => NoahmpIO%sr2006_psi_e_a_TABLE ,& + sr2006_psi_e_b => NoahmpIO%sr2006_psi_e_b_TABLE ,& + sr2006_psi_e_c => NoahmpIO%sr2006_psi_e_c_TABLE ,& + sr2006_smcmax_a => NoahmpIO%sr2006_smcmax_a_TABLE ,& + sr2006_smcmax_b => NoahmpIO%sr2006_smcmax_b_TABLE & + ) +! ------------------------------------------------------------------------------- + + ! initialize + smcmax = 0.0 + smcref = 0.0 + smcwlt = 0.0 + smcdry = 0.0 + bexp = 0.0 + psisat = 0.0 + dksat = 0.0 + dwsat = 0.0 + quartz = 0.0 + + do k = 1,4 + if(Sand(k) <= 0 .or. Clay(k) <= 0) then + Sand(k) = 0.41 + Clay(k) = 0.18 + end if + if(Orgm(k) <= 0 ) Orgm(k) = 0.0 + end do + + ! compute soil properties + theta_1500t = sr2006_theta_1500t_a*Sand & + + sr2006_theta_1500t_b*Clay & + + sr2006_theta_1500t_c*Orgm & + + sr2006_theta_1500t_d*Sand*Orgm & + + sr2006_theta_1500t_e*Clay*Orgm & + + sr2006_theta_1500t_f*Sand*Clay & + + sr2006_theta_1500t_g + + theta_1500 = theta_1500t & + + sr2006_theta_1500_a*theta_1500t & + + sr2006_theta_1500_b + + theta_33t = sr2006_theta_33t_a*Sand & + + sr2006_theta_33t_b*Clay & + + sr2006_theta_33t_c*Orgm & + + sr2006_theta_33t_d*Sand*Orgm & + + sr2006_theta_33t_e*Clay*Orgm & + + sr2006_theta_33t_f*Sand*Clay & + + sr2006_theta_33t_g + + theta_33 = theta_33t & + + sr2006_theta_33_a*theta_33t*theta_33t & + + sr2006_theta_33_b*theta_33t & + + sr2006_theta_33_c + + theta_s33t = sr2006_theta_s33t_a*Sand & + + sr2006_theta_s33t_b*Clay & + + sr2006_theta_s33t_c*Orgm & + + sr2006_theta_s33t_d*Sand*Orgm & + + sr2006_theta_s33t_e*Clay*Orgm & + + sr2006_theta_s33t_f*Sand*Clay & + + sr2006_theta_s33t_g + + theta_s33 = theta_s33t & + + sr2006_theta_s33_a*theta_s33t & + + sr2006_theta_s33_b + + psi_et = sr2006_psi_et_a*Sand & + + sr2006_psi_et_b*Clay & + + sr2006_psi_et_c*theta_s33 & + + sr2006_psi_et_d*Sand*theta_s33 & + + sr2006_psi_et_e*Clay*theta_s33 & + + sr2006_psi_et_f*Sand*Clay & + + sr2006_psi_et_g + + psi_e = psi_et & + + sr2006_psi_e_a*psi_et*psi_et & + + sr2006_psi_e_b*psi_et & + + sr2006_psi_e_c + + ! assign property values + smcwlt = theta_1500 + smcref = theta_33 + smcmax = theta_33 & + + theta_s33 & + + sr2006_smcmax_a*Sand & + + sr2006_smcmax_b + + bexp = 3.816712826 / (log(theta_33) - log(theta_1500) ) + psisat = psi_e + dksat = 1930.0 * (smcmax - theta_33) ** (3.0 - 1.0/bexp) + quartz = Sand + + ! Units conversion + psisat = max(0.1, psisat) ! arbitrarily impose a limit of 0.1kpa + psisat = 0.101997 * psisat ! convert kpa to m + dksat = dksat / 3600000.0 ! convert mm/h to m/s + dwsat = dksat * psisat * bexp / smcmax ! units should be m*m/s + smcdry = smcwlt + + ! Introducing somewhat arbitrary limits (based on NoahmpTable soil) to prevent bad things + smcmax = max(0.32 ,min(smcmax, 0.50 )) + smcref = max(0.17 ,min(smcref, smcmax)) + smcwlt = max(0.01 ,min(smcwlt, smcref)) + smcdry = max(0.01 ,min(smcdry, smcref)) + bexp = max(2.50 ,min(bexp, 12.0 )) + psisat = max(0.03 ,min(psisat, 1.00 )) + dksat = max(5.e-7,min(dksat, 1.e-5)) + dwsat = max(1.e-6,min(dwsat, 3.e-5)) + quartz = max(0.05 ,min(quartz, 0.95 )) + + noahmp%water%param%SoilMoistureWilt = smcwlt + noahmp%water%param%SoilMoistureFieldCap = smcref + noahmp%water%param%SoilMoistureSat = smcmax + noahmp%water%param%SoilMoistureDry = smcdry + noahmp%water%param%SoilExpCoeffB = bexp + noahmp%water%param%SoilMatPotentialSat = psisat + noahmp%water%param%SoilWatConductivitySat = dksat + noahmp%water%param%SoilWatDiffusivitySat = dwsat + noahmp%energy%param%SoilQuartzFrac = quartz + + end associate + + end subroutine PedoTransferSR2006 + +end module PedoTransferSR2006Mod diff --git a/drivers/lis/WaterVarInTransferMod.F90 b/drivers/lis/WaterVarInTransferMod.F90 new file mode 100644 index 00000000..8925810d --- /dev/null +++ b/drivers/lis/WaterVarInTransferMod.F90 @@ -0,0 +1,244 @@ +module WaterVarInTransferMod + +!!! Transfer input 2-D NoahmpIO Water variables to 1-D column variable +!!! 1-D variables should be first defined in /src/WaterVarType.F90 +!!! 2-D variables should be first defined in NoahmpIOVarType.F90 + +! ------------------------ Code history ----------------------------------- +! Original code: Guo-Yue Niu and Noah-MP team (Niu et al. 2011) +! Refactered code: C. He, P. Valayamkunnath, & refactor team (He et al. 2023) +! ------------------------------------------------------------------------- + + use Machine + use NoahmpIOVarType + use NoahmpVarType + use PedoTransferSR2006Mod + use LisNoahmpParamType + + implicit none + +contains + +!=== initialize with input data or table values + + subroutine WaterVarInTransfer(noahmp, NoahmpIO, LISparam) + + implicit none + + type(noahmp_type), intent(inout) :: noahmp + type(NoahmpIO_type), intent(inout) :: NoahmpIO + type(LisNoahmpParam_type), intent(in) :: LISparam ! lis/noahmp parameter + + ! local variables + integer :: IndexSoilLayer + real(kind=kind_noahmp), allocatable, dimension(:) :: SoilSand + real(kind=kind_noahmp), allocatable, dimension(:) :: SoilClay + real(kind=kind_noahmp), allocatable, dimension(:) :: SoilOrg + +! ------------------------------------------------------------------------- + associate( & + I => noahmp%config%domain%GridIndexI ,& + J => noahmp%config%domain%GridIndexJ ,& + NumSnowLayerMax => noahmp%config%domain%NumSnowLayerMax ,& + NumSoilLayer => noahmp%config%domain%NumSoilLayer ,& + VegType => noahmp%config%domain%VegType ,& + SoilType => noahmp%config%domain%SoilType ,& + FlagUrban => noahmp%config%domain%FlagUrban ,& + RunoffSlopeType => noahmp%config%domain%RunoffSlopeType ,& + NumSnowLayerNeg => noahmp%config%domain%NumSnowLayerNeg & + ) +! ------------------------------------------------------------------------- + + ! water state variables + noahmp%water%state%CanopyLiqWater = NoahmpIO%CANLIQXY (I,J) + noahmp%water%state%CanopyIce = NoahmpIO%CANICEXY (I,J) + noahmp%water%state%CanopyWetFrac = NoahmpIO%FWETXY (I,J) + noahmp%water%state%SnowWaterEquiv = NoahmpIO%SNOW (I,J) + noahmp%water%state%SnowWaterEquivPrev = NoahmpIO%SNEQVOXY (I,J) + noahmp%water%state%SnowDepth = NoahmpIO%SNOWH (I,J) + noahmp%water%state%IrrigationFracFlood = NoahmpIO%FIFRACT (I,J) + noahmp%water%state%IrrigationAmtFlood = NoahmpIO%IRWATFI (I,J) + noahmp%water%state%IrrigationFracMicro = NoahmpIO%MIFRACT (I,J) + noahmp%water%state%IrrigationAmtMicro = NoahmpIO%IRWATMI (I,J) + noahmp%water%state%IrrigationFracSprinkler = NoahmpIO%SIFRACT (I,J) + noahmp%water%state%IrrigationAmtSprinkler = NoahmpIO%IRWATSI (I,J) + noahmp%water%state%WaterTableDepth = NoahmpIO%ZWTXY (I,J) + noahmp%water%state%SoilMoistureToWT = NoahmpIO%SMCWTDXY (I,J) + noahmp%water%state%TileDrainFrac = NoahmpIO%TD_FRACTION(I,J) + noahmp%water%state%WaterStorageAquifer = NoahmpIO%WAXY (I,J) + noahmp%water%state%WaterStorageSoilAqf = NoahmpIO%WTXY (I,J) + noahmp%water%state%WaterStorageLake = NoahmpIO%WSLAKEXY (I,J) + noahmp%water%state%IrrigationFracGrid = NoahmpIO%IRFRACT (I,J) + noahmp%water%state%IrrigationCntSprinkler = NoahmpIO%IRNUMSI (I,J) + noahmp%water%state%IrrigationCntMicro = NoahmpIO%IRNUMMI (I,J) + noahmp%water%state%IrrigationCntFlood = NoahmpIO%IRNUMFI (I,J) + noahmp%water%state%SnowIce (-NumSnowLayerMax+1:0) = NoahmpIO%SNICEXY (I,-NumSnowLayerMax+1:0,J) + noahmp%water%state%SnowLiqWater(-NumSnowLayerMax+1:0) = NoahmpIO%SNLIQXY (I,-NumSnowLayerMax+1:0,J) + noahmp%water%state%SoilLiqWater (1:NumSoilLayer) = NoahmpIO%SH2O (I,1:NumSoilLayer,J) + noahmp%water%state%SoilMoisture (1:NumSoilLayer) = NoahmpIO%SMOIS (I,1:NumSoilLayer,J) + noahmp%water%state%SoilMoistureEqui (1:NumSoilLayer) = NoahmpIO%SMOISEQ (I,1:NumSoilLayer,J) + noahmp%water%state%RechargeGwDeepWT = 0.0 + noahmp%water%state%RechargeGwShallowWT = 0.0 +#ifdef WRF_HYDRO + noahmp%water%state%WaterTableHydro = NoahmpIO%ZWATBLE2D (I,J) + noahmp%water%state%WaterHeadSfc = NoahmpIO%sfcheadrt (I,J) +#endif + + ! water flux variables + noahmp%water%flux%EvapSoilSfcLiqAcc = NoahmpIO%ACC_QSEVAXY (I,J) + noahmp%water%flux%SoilSfcInflowAcc = NoahmpIO%ACC_QINSURXY(I,J) + noahmp%water%flux%SfcWaterTotChgAcc = NoahmpIO%ACC_DWATERXY(I,J) + noahmp%water%flux%PrecipTotAcc = NoahmpIO%ACC_PRCPXY (I,J) + noahmp%water%flux%EvapCanopyNetAcc = NoahmpIO%ACC_ECANXY (I,J) + noahmp%water%flux%TranspirationAcc = NoahmpIO%ACC_ETRANXY (I,J) + noahmp%water%flux%EvapGroundNetAcc = NoahmpIO%ACC_EDIRXY (I,J) + noahmp%water%flux%TranspWatLossSoilAcc(1:NumSoilLayer)= NoahmpIO%ACC_ETRANIXY(I,1:NumSoilLayer,J) + + ! water parameter variables + noahmp%water%param%DrainSoilLayerInd = LISparam%DRAIN_LAYER_OPT + noahmp%water%param%CanopyLiqHoldCap = LISparam%CH2OP + noahmp%water%param%SnowCompactBurdenFac = LISparam%C2_SNOWCOMPACT + noahmp%water%param%SnowCompactAgingFac1 = LISparam%C3_SNOWCOMPACT + noahmp%water%param%SnowCompactAgingFac2 = LISparam%C4_SNOWCOMPACT + noahmp%water%param%SnowCompactAgingFac3 = LISparam%C5_SNOWCOMPACT + noahmp%water%param%SnowCompactAgingMax = LISparam%DM_SNOWCOMPACT + noahmp%water%param%SnowViscosityCoeff = LISparam%ETA0_SNOWCOMPACT + noahmp%water%param%SnowLiqFracMax = LISparam%SNLIQMAXFRAC + noahmp%water%param%SnowLiqHoldCap = LISparam%SSI + noahmp%water%param%SnowLiqReleaseFac = LISparam%SNOW_RET_FAC + noahmp%water%param%IrriFloodRateFac = LISparam%FIRTFAC + noahmp%water%param%IrriMicroRate = LISparam%MICIR_RATE + noahmp%water%param%SoilConductivityRef = LISparam%REFDK + noahmp%water%param%SoilInfilFacRef = LISparam%REFKDT + noahmp%water%param%GroundFrzCoeff = LISparam%FRZK + noahmp%water%param%GridTopoIndex = LISparam%TIMEAN + noahmp%water%param%SoilSfcSatFracMax = LISparam%FSATMX + noahmp%water%param%SpecYieldGw = LISparam%ROUS + noahmp%water%param%MicroPoreContent = LISparam%CMIC + noahmp%water%param%WaterStorageLakeMax = LISparam%WSLMAX + noahmp%water%param%SnoWatEqvMaxGlacier = LISparam%SWEMAXGLA + noahmp%water%param%IrriStopDayBfHarvest = LISparam%IRR_HAR + noahmp%water%param%IrriTriggerLaiMin = LISparam%IRR_LAI + noahmp%water%param%SoilWatDeficitAllow = LISparam%IRR_MAD + noahmp%water%param%IrriFloodLossFrac = LISparam%FILOSS + noahmp%water%param%IrriSprinklerRate = LISparam%SPRIR_RATE + noahmp%water%param%IrriFracThreshold = LISparam%IRR_FRAC + noahmp%water%param%IrriStopPrecipThr = LISparam%IR_RAIN + noahmp%water%param%SnowfallDensityMax = LISparam%SNOWDEN_MAX + noahmp%water%param%SnowMassFullCoverOld = LISparam%SWEMX + noahmp%water%param%SoilMatPotentialWilt = LISparam%PSIWLT + noahmp%water%param%SnowMeltFac = LISparam%MFSNO + noahmp%water%param%SnowCoverFac = LISparam%SCFFAC + noahmp%water%param%InfilFacVic = LISparam%BVIC + noahmp%water%param%TensionWatDistrInfl = LISparam%AXAJ + noahmp%water%param%TensionWatDistrShp = LISparam%BXAJ + noahmp%water%param%FreeWatDistrShp = LISparam%XXAJ + noahmp%water%param%InfilHeteroDynVic = LISparam%BBVIC + noahmp%water%param%InfilCapillaryDynVic = LISparam%GDVIC + noahmp%water%param%InfilFacDynVic = LISparam%BDVIC + noahmp%water%param%TileDrainCoeffSp = LISparam%TD_DC + noahmp%water%param%TileDrainTubeDepth = LISparam%TD_DEPTH + noahmp%water%param%DrainFacSoilWat = LISparam%TDSMC_FAC + noahmp%water%param%TileDrainCoeff = LISparam%TD_DCOEF + noahmp%water%param%DrainDepthToImperv = LISparam%TD_ADEPTH + noahmp%water%param%LateralWatCondFac = LISparam%KLAT_FAC + noahmp%water%param%TileDrainDepth = LISparam%TD_DDRAIN + noahmp%water%param%DrainTubeDist = LISparam%TD_SPAC + noahmp%water%param%DrainTubeRadius = LISparam%TD_RADI + noahmp%water%param%DrainWatDepToImperv = LISparam%TD_D + noahmp%water%param%NumSoilLayerRoot = LISparam%NROOT + noahmp%water%param%SoilDrainSlope = LISparam%SLOPE + + do IndexSoilLayer = 1, size(SoilType) + noahmp%water%param%SoilMoistureSat (IndexSoilLayer) = LISparam%SMCMAX(IndexSoilLayer) + noahmp%water%param%SoilMoistureWilt (IndexSoilLayer) = LISparam%SMCWLT(IndexSoilLayer) + noahmp%water%param%SoilMoistureFieldCap (IndexSoilLayer) = LISparam%SMCREF(IndexSoilLayer) + noahmp%water%param%SoilMoistureDry (IndexSoilLayer) = LISparam%SMCDRY(IndexSoilLayer) + noahmp%water%param%SoilWatDiffusivitySat (IndexSoilLayer) = LISparam%DWSAT(IndexSoilLayer) + noahmp%water%param%SoilWatConductivitySat(IndexSoilLayer) = LISparam%DKSAT(IndexSoilLayer) + noahmp%water%param%SoilExpCoeffB (IndexSoilLayer) = LISparam%BEXP(IndexSoilLayer) + noahmp%water%param%SoilMatPotentialSat (IndexSoilLayer) = LISparam%PSISAT(IndexSoilLayer) + enddo + + ! spatial varying soil texture and properties directly from input + if ( noahmp%config%nmlist%OptSoilProperty == 4 ) then + ! 3D soil properties + noahmp%water%param%SoilExpCoeffB = NoahmpIO%BEXP_3D (I,1:NumSoilLayer,J) ! C-H B exponent + noahmp%water%param%SoilMoistureDry = NoahmpIO%SMCDRY_3D(I,1:NumSoilLayer,J) ! Soil Moisture Limit: Dry + noahmp%water%param%SoilMoistureWilt = NoahmpIO%SMCWLT_3D(I,1:NumSoilLayer,J) ! Soil Moisture Limit: Wilt + noahmp%water%param%SoilMoistureFieldCap = NoahmpIO%SMCREF_3D(I,1:NumSoilLayer,J) ! Soil Moisture Limit: Reference + noahmp%water%param%SoilMoistureSat = NoahmpIO%SMCMAX_3D(I,1:NumSoilLayer,J) ! Soil Moisture Limit: Max + noahmp%water%param%SoilWatConductivitySat = NoahmpIO%DKSAT_3D (I,1:NumSoilLayer,J) ! Saturated Soil Conductivity + noahmp%water%param%SoilWatDiffusivitySat = NoahmpIO%DWSAT_3D (I,1:NumSoilLayer,J) ! Saturated Soil Diffusivity + noahmp%water%param%SoilMatPotentialSat = NoahmpIO%PSISAT_3D(I,1:NumSoilLayer,J) ! Saturated Matric Potential + noahmp%water%param%SoilConductivityRef = NoahmpIO%REFDK_2D (I,J) ! Reference Soil Conductivity + noahmp%water%param%SoilInfilFacRef = NoahmpIO%REFKDT_2D(I,J) ! Soil Infiltration Parameter + ! 2D additional runoff6~8 parameters + noahmp%water%param%InfilFacVic = NoahmpIO%BVIC_2D (I,J) ! VIC model infiltration parameter + noahmp%water%param%TensionWatDistrInfl = NoahmpIO%AXAJ_2D (I,J) ! Xinanjiang: Tension water distribution inflection parameter + noahmp%water%param%TensionWatDistrShp = NoahmpIO%BXAJ_2D (I,J) ! Xinanjiang: Tension water distribution shape parameter + noahmp%water%param%FreeWatDistrShp = NoahmpIO%XXAJ_2D (I,J) ! Xinanjiang: Free water distribution shape parameter + noahmp%water%param%InfilFacDynVic = NoahmpIO%BDVIC_2D(I,J) ! VIC model infiltration parameter + noahmp%water%param%InfilCapillaryDynVic = NoahmpIO%GDVIC_2D(I,J) ! Mean Capillary Drive for infiltration models + noahmp%water%param%InfilHeteroDynVic = NoahmpIO%BBVIC_2D(I,J) ! DVIC heterogeniety parameter for infiltraton + ! 2D irrigation params + noahmp%water%param%IrriFracThreshold = NoahmpIO%IRR_FRAC_2D (I,J) ! irrigation Fraction + noahmp%water%param%IrriStopDayBfHarvest = NoahmpIO%IRR_HAR_2D (I,J) ! number of days before harvest date to stop irrigation + noahmp%water%param%IrriTriggerLaiMin = NoahmpIO%IRR_LAI_2D (I,J) ! Minimum lai to trigger irrigation + noahmp%water%param%SoilWatDeficitAllow = NoahmpIO%IRR_MAD_2D (I,J) ! management allowable deficit (0-1) + noahmp%water%param%IrriFloodLossFrac = NoahmpIO%FILOSS_2D (I,J) ! fraction of flood irrigation loss (0-1) + noahmp%water%param%IrriSprinklerRate = NoahmpIO%SPRIR_RATE_2D(I,J) ! mm/h, sprinkler irrigation rate + noahmp%water%param%IrriMicroRate = NoahmpIO%MICIR_RATE_2D(I,J) ! mm/h, micro irrigation rate + noahmp%water%param%IrriFloodRateFac = NoahmpIO%FIRTFAC_2D (I,J) ! flood application rate factor + noahmp%water%param%IrriStopPrecipThr = NoahmpIO%IR_RAIN_2D (I,J) ! maximum precipitation to stop irrigation trigger + ! 2D tile drainage parameters + noahmp%water%param%LateralWatCondFac = NoahmpIO%KLAT_FAC (I,J) ! factor multiplier to hydraulic conductivity + noahmp%water%param%DrainFacSoilWat = NoahmpIO%TDSMC_FAC(I,J) ! factor multiplier to field capacity + noahmp%water%param%TileDrainCoeffSp = NoahmpIO%TD_DC (I,J) ! drainage coefficient for simple + noahmp%water%param%TileDrainCoeff = NoahmpIO%TD_DCOEF (I,J) ! drainge coefficient for Hooghoudt + noahmp%water%param%TileDrainDepth = NoahmpIO%TD_DDRAIN(I,J) ! depth of drain + noahmp%water%param%DrainTubeRadius = NoahmpIO%TD_RADI (I,J) ! tile tube radius + noahmp%water%param%DrainTubeDist = NoahmpIO%TD_SPAC (I,J) ! tile spacing + endif + + ! derived water parameters + noahmp%water%param%SoilInfilMaxCoeff = noahmp%water%param%SoilInfilFacRef * & + noahmp%water%param%SoilWatConductivitySat(1) / & + noahmp%water%param%SoilConductivityRef + if ( FlagUrban .eqv. .true. ) then + noahmp%water%param%SoilMoistureSat = 0.45 + noahmp%water%param%SoilMoistureFieldCap = 0.42 + noahmp%water%param%SoilMoistureWilt = 0.40 + noahmp%water%param%SoilMoistureDry = 0.40 + endif + + if ( SoilType(1) /= 14 ) then + noahmp%water%param%SoilImpervFracCoeff = noahmp%water%param%GroundFrzCoeff * & + ((noahmp%water%param%SoilMoistureSat(1) / & + noahmp%water%param%SoilMoistureFieldCap(1)) * (0.412/0.468)) + endif + + noahmp%water%state%SnowIceFracPrev = 0.0 + noahmp%water%state%SnowIceFracPrev(NumSnowLayerNeg+1:0) = NoahmpIO%SNICEXY(I,NumSnowLayerNeg+1:0,J) / & + (NoahmpIO%SNICEXY(I,NumSnowLayerNeg+1:0,J) + & + NoahmpIO%SNLIQXY(I,NumSnowLayerNeg+1:0,J)) + + if ( (noahmp%config%nmlist%OptSoilProperty == 3) .and. (.not. noahmp%config%domain%FlagUrban) ) then + if (.not. allocated(SoilSand)) allocate( SoilSand(1:NumSoilLayer) ) + if (.not. allocated(SoilClay)) allocate( SoilClay(1:NumSoilLayer) ) + if (.not. allocated(SoilOrg) ) allocate( SoilOrg (1:NumSoilLayer) ) + SoilSand = 0.01 * NoahmpIO%soilcomp(I,1:NumSoilLayer,J) + SoilClay = 0.01 * NoahmpIO%soilcomp(I,(NumSoilLayer+1):(NumSoilLayer*2),J) + SoilOrg = 0.0 + if (noahmp%config%nmlist%OptPedotransfer == 1) & + call PedoTransferSR2006(NoahmpIO,noahmp,SoilSand,SoilClay,SoilOrg) + deallocate(SoilSand) + deallocate(SoilClay) + deallocate(SoilOrg ) + endif + + end associate + + end subroutine WaterVarInTransfer + +end module WaterVarInTransferMod diff --git a/drivers/lis/WaterVarOutTransferMod.F90 b/drivers/lis/WaterVarOutTransferMod.F90 new file mode 100644 index 00000000..3682e8b5 --- /dev/null +++ b/drivers/lis/WaterVarOutTransferMod.F90 @@ -0,0 +1,155 @@ +module WaterVarOutTransferMod + +!!! Transfer column (1-D) Noah-MP water variables to 2D NoahmpIO for output + +! ------------------------ Code history ----------------------------------- +! Original code: Guo-Yue Niu and Noah-MP team (Niu et al. 2011) +! Refactered code: C. He, P. Valayamkunnath, & refactor team (He et al. 2023) +! ------------------------------------------------------------------------- + + use Machine + use NoahmpIOVarType + use NoahmpVarType + + implicit none + +contains + +!=== Transfer model states to output ===== + + subroutine WaterVarOutTransfer(noahmp, NoahmpIO) + + implicit none + + type(noahmp_type), intent(inout) :: noahmp + type(NoahmpIO_type), intent(inout) :: NoahmpIO + +! ------------------------------------------------------------------------- + associate( & + I => noahmp%config%domain%GridIndexI ,& + J => noahmp%config%domain%GridIndexJ ,& + NumSnowLayerMax => noahmp%config%domain%NumSnowLayerMax ,& + NumSoilLayer => noahmp%config%domain%NumSoilLayer ,& + IndicatorIceSfc => noahmp%config%domain%IndicatorIceSfc & + ) +! ------------------------------------------------------------------------- + + ! special treatment for glacier point output + if ( IndicatorIceSfc == -1 ) then ! land ice point + noahmp%water%state%SnowCoverFrac = 1.0 + noahmp%water%flux%EvapCanopyNet = 0.0 + noahmp%water%flux%Transpiration = 0.0 + noahmp%water%flux%InterceptCanopySnow = 0.0 + noahmp%water%flux%InterceptCanopyRain = 0.0 + noahmp%water%flux%DripCanopySnow = 0.0 + noahmp%water%flux%DripCanopyRain = 0.0 + noahmp%water%flux%ThroughfallSnow = noahmp%water%flux%SnowfallRefHeight + noahmp%water%flux%ThroughfallRain = noahmp%water%flux%RainfallRefHeight + noahmp%water%flux%SublimCanopyIce = 0.0 + noahmp%water%flux%FrostCanopyIce = 0.0 + noahmp%water%flux%FreezeCanopyLiq = 0.0 + noahmp%water%flux%MeltCanopyIce = 0.0 + noahmp%water%flux%EvapCanopyLiq = 0.0 + noahmp%water%flux%DewCanopyLiq = 0.0 + noahmp%water%state%CanopyIce = 0.0 + noahmp%water%state%CanopyLiqWater = 0.0 + noahmp%water%flux%TileDrain = 0.0 + noahmp%water%flux%RunoffSurface = noahmp%water%flux%RunoffSurface * noahmp%config%domain%MainTimeStep + noahmp%water%flux%RunoffSubsurface = noahmp%water%flux%RunoffSubsurface * noahmp%config%domain%MainTimeStep + NoahmpIO%QFX(I,J) = noahmp%water%flux%EvapGroundNet + endif + + if ( IndicatorIceSfc == 0 ) then ! land soil point + NoahmpIO%QFX(I,J) = noahmp%water%flux%EvapCanopyNet + noahmp%water%flux%EvapGroundNet + & + noahmp%water%flux%Transpiration + noahmp%water%flux%EvapIrriSprinkler + endif + + NoahmpIO%SFCRUNOFF (I,J) = NoahmpIO%SFCRUNOFF(I,J) + noahmp%water%flux%RunoffSurface + NoahmpIO%UDRUNOFF (I,J) = NoahmpIO%UDRUNOFF (I,J) + noahmp%water%flux%RunoffSubsurface + NoahmpIO%QTDRAIN (I,J) = NoahmpIO%QTDRAIN (I,J) + noahmp%water%flux%TileDrain + NoahmpIO%SNOWC (I,J) = noahmp%water%state%SnowCoverFrac + NoahmpIO%SNOW (I,J) = noahmp%water%state%SnowWaterEquiv + NoahmpIO%SNOWH (I,J) = noahmp%water%state%SnowDepth + NoahmpIO%CANWAT (I,J) = noahmp%water%state%CanopyLiqWater + noahmp%water%state%CanopyIce + NoahmpIO%ACSNOW (I,J) = NoahmpIO%ACSNOW(I,J) + (NoahmpIO%RAINBL (I,J) * noahmp%water%state%FrozenPrecipFrac) + NoahmpIO%ACSNOM (I,J) = NoahmpIO%ACSNOM(I,J) + (noahmp%water%flux%MeltGroundSnow * NoahmpIO%DTBL) + & + noahmp%water%state%PondSfcThinSnwMelt + noahmp%water%state%PondSfcThinSnwComb + & + noahmp%water%state%PondSfcThinSnwTrans + NoahmpIO%CANLIQXY (I,J) = noahmp%water%state%CanopyLiqWater + NoahmpIO%CANICEXY (I,J) = noahmp%water%state%CanopyIce + NoahmpIO%FWETXY (I,J) = noahmp%water%state%CanopyWetFrac + NoahmpIO%SNEQVOXY (I,J) = noahmp%water%state%SnowWaterEquivPrev + NoahmpIO%QSNOWXY (I,J) = noahmp%water%flux%SnowfallGround + NoahmpIO%QRAINXY (I,J) = noahmp%water%flux%RainfallGround + NoahmpIO%WSLAKEXY (I,J) = noahmp%water%state%WaterStorageLake + NoahmpIO%ZWTXY (I,J) = noahmp%water%state%WaterTableDepth + NoahmpIO%WAXY (I,J) = noahmp%water%state%WaterStorageAquifer + NoahmpIO%WTXY (I,J) = noahmp%water%state%WaterStorageSoilAqf + NoahmpIO%RUNSFXY (I,J) = noahmp%water%flux%RunoffSurface + NoahmpIO%RUNSBXY (I,J) = noahmp%water%flux%RunoffSubsurface + NoahmpIO%ECANXY (I,J) = noahmp%water%flux%EvapCanopyNet + NoahmpIO%EDIRXY (I,J) = noahmp%water%flux%EvapGroundNet + NoahmpIO%ETRANXY (I,J) = noahmp%water%flux%Transpiration + NoahmpIO%QINTSXY (I,J) = noahmp%water%flux%InterceptCanopySnow + NoahmpIO%QINTRXY (I,J) = noahmp%water%flux%InterceptCanopyRain + NoahmpIO%QDRIPSXY (I,J) = noahmp%water%flux%DripCanopySnow + NoahmpIO%QDRIPRXY (I,J) = noahmp%water%flux%DripCanopyRain + NoahmpIO%QTHROSXY (I,J) = noahmp%water%flux%ThroughfallSnow + NoahmpIO%QTHRORXY (I,J) = noahmp%water%flux%ThroughfallRain + NoahmpIO%QSNSUBXY (I,J) = noahmp%water%flux%SublimSnowSfcIce + NoahmpIO%QSNFROXY (I,J) = noahmp%water%flux%FrostSnowSfcIce + NoahmpIO%QSUBCXY (I,J) = noahmp%water%flux%SublimCanopyIce + NoahmpIO%QFROCXY (I,J) = noahmp%water%flux%FrostCanopyIce + NoahmpIO%QEVACXY (I,J) = noahmp%water%flux%EvapCanopyLiq + NoahmpIO%QDEWCXY (I,J) = noahmp%water%flux%DewCanopyLiq + NoahmpIO%QFRZCXY (I,J) = noahmp%water%flux%FreezeCanopyLiq + NoahmpIO%QMELTCXY (I,J) = noahmp%water%flux%MeltCanopyIce + NoahmpIO%QSNBOTXY (I,J) = noahmp%water%flux%SnowBotOutflow + NoahmpIO%QMELTXY (I,J) = noahmp%water%flux%MeltGroundSnow + NoahmpIO%PONDINGXY (I,J) = noahmp%water%state%PondSfcThinSnwTrans + & + noahmp%water%state%PondSfcThinSnwComb + noahmp%water%state%PondSfcThinSnwMelt + NoahmpIO%FPICEXY (I,J) = noahmp%water%state%FrozenPrecipFrac + NoahmpIO%RAINLSM (I,J) = noahmp%water%flux%RainfallRefHeight + NoahmpIO%SNOWLSM (I,J) = noahmp%water%flux%SnowfallRefHeight + NoahmpIO%ACC_QINSURXY(I,J) = noahmp%water%flux%SoilSfcInflowAcc + NoahmpIO%ACC_QSEVAXY (I,J) = noahmp%water%flux%EvapSoilSfcLiqAcc + NoahmpIO%ACC_DWATERXY(I,J) = noahmp%water%flux%SfcWaterTotChgAcc + NoahmpIO%ACC_PRCPXY (I,J) = noahmp%water%flux%PrecipTotAcc + NoahmpIO%ACC_ECANXY (I,J) = noahmp%water%flux%EvapCanopyNetAcc + NoahmpIO%ACC_ETRANXY (I,J) = noahmp%water%flux%TranspirationAcc + NoahmpIO%ACC_EDIRXY (I,J) = noahmp%water%flux%EvapGroundNetAcc + NoahmpIO%RECHXY (I,J) = NoahmpIO%RECHXY(I,J) + (noahmp%water%state%RechargeGwShallowWT*1.0e3) + NoahmpIO%DEEPRECHXY (I,J) = NoahmpIO%DEEPRECHXY(I,J) + noahmp%water%state%RechargeGwDeepWT + NoahmpIO%SMCWTDXY (I,J) = noahmp%water%state%SoilMoistureToWT + NoahmpIO%SMOIS (I,1:NumSoilLayer,J) = noahmp%water%state%SoilMoisture(1:NumSoilLayer) + NoahmpIO%SH2O (I,1:NumSoilLayer,J) = noahmp%water%state%SoilLiqWater(1:NumSoilLayer) + NoahmpIO%ACC_ETRANIXY(I,1:NumSoilLayer,J) = noahmp%water%flux%TranspWatLossSoilAcc(1:NumSoilLayer) + NoahmpIO%SNICEXY (I,-NumSnowLayerMax+1:0,J) = noahmp%water%state%SnowIce(-NumSnowLayerMax+1:0) + NoahmpIO%SNLIQXY (I,-NumSnowLayerMax+1:0,J) = noahmp%water%state%SnowLiqWater(-NumSnowLayerMax+1:0) + NoahmpIO%RELSMC (I,1:NumSoilLayer,J) = (NoahmpIO%SMOIS(I,1:NumSoilLayer,J) - & + noahmp%water%param%SoilMoistureWilt(1:NumSoilLayer)) / & + (noahmp%water%param%SoilMoistureSat(1:NumSoilLayer) - & + noahmp%water%param%SoilMoistureWilt(1:NumSoilLayer)) + ! irrigation + NoahmpIO%IRNUMSI (I,J) = noahmp%water%state%IrrigationCntSprinkler + NoahmpIO%IRNUMMI (I,J) = noahmp%water%state%IrrigationCntMicro + NoahmpIO%IRNUMFI (I,J) = noahmp%water%state%IrrigationCntFlood + NoahmpIO%IRWATSI (I,J) = noahmp%water%state%IrrigationAmtSprinkler + NoahmpIO%IRWATMI (I,J) = noahmp%water%state%IrrigationAmtMicro + NoahmpIO%IRWATFI (I,J) = noahmp%water%state%IrrigationAmtFlood + NoahmpIO%IRSIVOL (I,J) = NoahmpIO%IRSIVOL(I,J)+(noahmp%water%flux%IrrigationRateSprinkler*1000.0) + NoahmpIO%IRMIVOL (I,J) = NoahmpIO%IRMIVOL(I,J)+(noahmp%water%flux%IrrigationRateMicro*1000.0) + NoahmpIO%IRFIVOL (I,J) = NoahmpIO%IRFIVOL(I,J)+(noahmp%water%flux%IrrigationRateFlood*1000.0) + NoahmpIO%IRELOSS (I,J) = NoahmpIO%IRELOSS(I,J)+(noahmp%water%flux%EvapIrriSprinkler*NoahmpIO%DTBL) + +#ifdef WRF_HYDRO + NoahmpIO%infxsrt (I,J) = max(noahmp%water%flux%RunoffSurface, 0.0) ! mm, surface runoff + NoahmpIO%soldrain (I,J) = max(noahmp%water%flux%RunoffSubsurface, 0.0) ! mm, underground runoff + NoahmpIO%qtiledrain(I,J) = max(noahmp%water%flux%TileDrain, 0.0) ! mm, tile drainage +#endif + + end associate + + end subroutine WaterVarOutTransfer + +end module WaterVarOutTransferMod