diff --git a/src/biogeochem/CNFireBaseMod.F90 b/src/biogeochem/CNFireBaseMod.F90 index 971b2eaba9..cc9d51242b 100644 --- a/src/biogeochem/CNFireBaseMod.F90 +++ b/src/biogeochem/CNFireBaseMod.F90 @@ -74,14 +74,19 @@ module CNFireBaseMod type, abstract, extends(fire_base_type) :: cnfire_base_type private ! !PRIVATE MEMBER DATA: + ! !PUBLIC MEMBER DATA (used by extensions of the base class): + real(r8), public, pointer :: btran2_patch (:) ! patch root zone soil wetness factor (0 to 1) contains ! ! !PUBLIC MEMBER FUNCTIONS: - procedure, public :: FireReadNML ! Read in namelist for CNFire - procedure, public :: CNFireReadParams ! Read in constant parameters from the paramsfile - procedure, public :: CNFireArea ! Calculate fire area - procedure, public :: CNFireFluxes ! Calculate fire fluxes + procedure, public :: FireInit => CNFireInit ! Initialization of Fire + procedure, public :: FireReadNML ! Read in namelist for CNFire + procedure, public :: CNFireRestart ! Restart for CNFire + procedure, public :: CNFireReadParams ! Read in constant parameters from the paramsfile + procedure, public :: CNFireArea ! Calculate fire area + procedure, public :: CNFireFluxes ! Calculate fire fluxes + procedure, public :: CNFire_calc_fire_root_wetness ! Calcualte CN-fire specific root wetness ! end type cnfire_base_type !----------------------------------------------------------------------- @@ -112,6 +117,120 @@ end function need_lightning_and_popdens_interface contains !----------------------------------------------------------------------- + subroutine CNFireInit( this, bounds, NLFilename ) + ! + ! !DESCRIPTION: + ! Initialize CN Fire module + ! !USES: + use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) + use clm_varcon , only : spval + use histFileMod , only : hist_addfld1d + ! + ! !ARGUMENTS: + class(cnfire_base_type) :: this + type(bounds_type), intent(in) :: bounds + character(len=*), intent(in) :: NLFilename + !----------------------------------------------------------------------- + integer :: begp, endp + !------------------------------------------------------------------------ + ! Call the base-class Initialization method + call this%BaseFireInit( bounds, NLFilename ) + + begp = bounds%begp; endp= bounds%endp + + ! Allocate memory + allocate(this%btran2_patch (begp:endp)) ; this%btran2_patch (:) = nan + ! History file + this%btran2_patch(begp:endp) = spval + call hist_addfld1d(fname='BTRAN2', units='unitless', & + avgflag='A', long_name='root zone soil wetness factor', & + ptr_patch=this%btran2_patch, l2g_scale_type='veg') + end subroutine CNFireInit + + !---------------------------------------------------------------------- + subroutine CNFireRestart( this, bounds, ncid, flag ) + use ncdio_pio , only : ncd_double, file_desc_t + use restUtilMod , only : restartvar + implicit none + ! + ! !ARGUMENTS: + class(cnfire_base_type) :: this + type(bounds_type), intent(in) :: bounds + type(file_desc_t), intent(inout) :: ncid + character(len=*) , intent(in) :: flag + + logical :: readvar + + call restartvar(ncid=ncid, flag=flag, varname='btran2', xtype=ncd_double, & + dim1name='pft', & + long_name='', units='', & + interpinic_flag='interp', readvar=readvar, data=this%btran2_patch) + end subroutine CNFireRestart + + !---------------------------------------------------------------------- + subroutine CNFire_calc_fire_root_wetness( this, bounds, nlevgrnd, num_exposedvegp, filter_exposedvegp, & + waterstatebulk_inst, soilstate_inst, soil_water_retention_curve ) + ! + ! Calculate the root wetness term that will be used by the fire model + ! + use pftconMod , only : pftcon + use PatchType , only : patch + use WaterStateBulkType , only : waterstatebulk_type + use SoilStateType , only : soilstate_type + use SoilWaterRetentionCurveMod, only : soil_water_retention_curve_type + class(cnfire_base_type) :: this + type(bounds_type) , intent(in) :: bounds !bounds + integer , intent(in) :: nlevgrnd !number of vertical layers + integer , intent(in) :: num_exposedvegp !number of filters + integer , intent(in) :: filter_exposedvegp(:) !filter array + type(waterstatebulk_type), intent(in) :: waterstatebulk_inst + type(soilstate_type) , intent(in) :: soilstate_inst + class(soil_water_retention_curve_type), intent(in) :: soil_water_retention_curve + ! !LOCAL VARIABLES: + real(r8), parameter :: btran0 = 0.0_r8 ! initial value + real(r8) :: smp_node, s_node !temporary variables + real(r8) :: smp_node_lf !temporary variable + integer :: p, f, j, c, l !indices + !----------------------------------------------------------------------- + + SHR_ASSERT_ALL_FL((ubound(filter_exposedvegp) >= (/num_exposedvegp/)), sourcefile, __LINE__) + + associate( & + smpso => pftcon%smpso , & ! Input: soil water potential at full stomatal opening (mm) + smpsc => pftcon%smpsc , & ! Input: soil water potential at full stomatal closure (mm) + watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation + btran2 => this%btran2_patch , & ! Output: [real(r8) (:) ] integrated soil water stress square + rootfr => soilstate_inst%rootfr_patch , & ! Input: [real(r8) (:,:) ] fraction of roots in each soil layer + h2osoi_vol => waterstatebulk_inst%h2osoi_vol_col & ! Input: [real(r8) (:,:) ] volumetric soil water (0<=h2osoi_vol<=watsat) [m3/m3] (porosity) (constant) + ) + + SHR_ASSERT_ALL_FL((ubound(watsat) == (/bounds%endc,nlevgrnd/)), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(h2osoi_vol) == (/bounds%endc,nlevgrnd/)), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(rootfr) == (/bounds%endp,nlevgrnd/)), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(btran2) == (/bounds%endp/)), sourcefile, __LINE__) + do f = 1, num_exposedvegp + p = filter_exposedvegp(f) + btran2(p) = btran0 + end do + do j = 1,nlevgrnd + do f = 1, num_exposedvegp + p = filter_exposedvegp(f) + c = patch%column(p) + l = patch%landunit(p) + s_node = max(h2osoi_vol(c,j)/watsat(c,j), 0.01_r8) + + call soil_water_retention_curve%soil_suction(c, j, s_node, soilstate_inst, smp_node_lf) + + smp_node_lf = max(smpsc(patch%itype(p)), smp_node_lf) + btran2(p) = btran2(p) +rootfr(p,j)*max(0._r8,min((smp_node_lf - smpsc(patch%itype(p))) / & + (smpso(patch%itype(p)) - smpsc(patch%itype(p))), 1._r8)) + end do + end do + end associate + + end subroutine CNFire_calc_fire_root_wetness + + !---------------------------------------------------------------------- subroutine FireReadNML( this, NLFilename ) ! ! !DESCRIPTION: diff --git a/src/biogeochem/CNFireLi2014Mod.F90 b/src/biogeochem/CNFireLi2014Mod.F90 index 09a6d52373..5c87e75d1c 100644 --- a/src/biogeochem/CNFireLi2014Mod.F90 +++ b/src/biogeochem/CNFireLi2014Mod.F90 @@ -160,7 +160,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ fsr_pft => pftcon%fsr_pft , & ! Input: fd_pft => pftcon%fd_pft , & ! Input: - btran2 => energyflux_inst%btran2_patch , & ! Input: [real(r8) (:) ] root zone soil wetness + btran2 => this%cnfire_base_type%btran2_patch , & ! Input: [real(r8) (:) ] root zone soil wetness fsat => saturated_excess_runoff_inst%fsat_col , & ! Input: [real(r8) (:) ] fractional area with water table at surface wf => waterdiagnosticbulk_inst%wf_col , & ! Input: [real(r8) (:) ] soil water as frac. of whc for top 0.05 m wf2 => waterdiagnosticbulk_inst%wf2_col , & ! Input: [real(r8) (:) ] soil water as frac. of whc for top 0.17 m diff --git a/src/biogeochem/CNFireLi2016Mod.F90 b/src/biogeochem/CNFireLi2016Mod.F90 index 5a36e192b2..a95fd712fd 100644 --- a/src/biogeochem/CNFireLi2016Mod.F90 +++ b/src/biogeochem/CNFireLi2016Mod.F90 @@ -170,7 +170,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ fsr_pft => pftcon%fsr_pft , & ! Input: fd_pft => pftcon%fd_pft , & ! Input: - btran2 => energyflux_inst%btran2_patch , & ! Input: [real(r8) (:) ] root zone soil wetness + btran2 => this%cnfire_base_type%btran2_patch , & ! Input: [real(r8) (:) ] root zone soil wetness fsat => saturated_excess_runoff_inst%fsat_col , & ! Input: [real(r8) (:) ] fractional area with water table at surface wf2 => waterdiagnosticbulk_inst%wf2_col , & ! Input: [real(r8) (:) ] soil water as frac. of whc for top 0.17 m diff --git a/src/biogeochem/CNVegetationFacade.F90 b/src/biogeochem/CNVegetationFacade.F90 index 341c376972..196817b3cc 100644 --- a/src/biogeochem/CNVegetationFacade.F90 +++ b/src/biogeochem/CNVegetationFacade.F90 @@ -506,6 +506,8 @@ subroutine Restart(this, bounds, ncid, flag) end if call this%n_products_inst%restart(bounds, ncid, flag) + call this%cnfire_method%CNFireRestart(bounds, ncid, flag) + end if if (use_cndv) then diff --git a/src/biogeophys/CanopyFluxesMod.F90 b/src/biogeophys/CanopyFluxesMod.F90 index 2e10512683..492108d8b3 100644 --- a/src/biogeophys/CanopyFluxesMod.F90 +++ b/src/biogeophys/CanopyFluxesMod.F90 @@ -190,7 +190,8 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp, waterdiagnosticbulk_inst, wateratm2lndbulk_inst, ch4_inst, ozone_inst, & photosyns_inst, & humanindex_inst, soil_water_retention_curve, & - downreg_patch, leafn_patch, froot_carbon, croot_carbon) + downreg_patch, leafn_patch, froot_carbon, croot_carbon, & + bgc_vegetation_inst) ! ! !DESCRIPTION: ! 1. Calculates the leaf temperature: @@ -233,6 +234,7 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp, swbgt, hmdex, dis_coi, dis_coiS, THIndex, & SwampCoolEff, KtoC, VaporPres use SoilWaterRetentionCurveMod, only : soil_water_retention_curve_type + use CNVegetationFacade , only : cn_vegetation_type ! ! !ARGUMENTS: type(bounds_type) , intent(in) :: bounds @@ -262,6 +264,7 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp, real(r8), intent(in) :: leafn_patch(bounds%begp:) ! leaf N (gN/m2) real(r8), intent(inout) :: froot_carbon(bounds%begp:) ! fine root biomass (gC/m2) real(r8), intent(inout) :: croot_carbon(bounds%begp:) ! live coarse root biomass (gC/m2) + type(cn_vegetation_type) , intent(inout) :: bgc_vegetation_inst ! ! !LOCAL VARIABLES: real(r8), pointer :: bsun(:) ! sunlit canopy transpiration wetness factor (0 to 1) @@ -537,7 +540,6 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp, grnd_ch4_cond => ch4_inst%grnd_ch4_cond_patch , & ! Output: [real(r8) (:) ] tracer conductance for boundary layer [m/s] htvp => energyflux_inst%htvp_col , & ! Input: [real(r8) (:) ] latent heat of evaporation (/sublimation) [J/kg] (constant) - btran2 => energyflux_inst%btran2_patch , & ! Output: [real(r8) (:) ] F. Li and S. Levis btran => energyflux_inst%btran_patch , & ! Output: [real(r8) (:) ] transpiration wetness factor (0 to 1) rresis => energyflux_inst%rresis_patch , & ! Output: [real(r8) (:,:) ] root resistance by layer (0-1) (nlevgrnd) taux => energyflux_inst%taux_patch , & ! Output: [real(r8) (:) ] wind (shear) stress: e-w (kg/m/s**2) @@ -630,7 +632,6 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp, wtaq0(p) = 0._r8 obuold(p) = 0._r8 btran(p) = btran0 - btran2(p) = btran0 end do ! calculate daylength control for Vcmax @@ -706,8 +707,8 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp, temperature_inst=temperature_inst, & waterstatebulk_inst=waterstatebulk_inst, & waterdiagnosticbulk_inst=waterdiagnosticbulk_inst, & - soil_water_retention_curve=soil_water_retention_curve) - + soil_water_retention_curve=soil_water_retention_curve, & + bgc_vegetation_inst=bgc_vegetation_inst) end if diff --git a/src/biogeophys/EnergyFluxType.F90 b/src/biogeophys/EnergyFluxType.F90 index 3f125e9497..9b1a37a235 100644 --- a/src/biogeophys/EnergyFluxType.F90 +++ b/src/biogeophys/EnergyFluxType.F90 @@ -95,7 +95,6 @@ module EnergyFluxType real(r8), pointer :: bsha_patch (:) ! patch shaded canopy transpiration wetness factor (0 to 1) ! Roots - real(r8), pointer :: btran2_patch (:) ! patch root zone soil wetness factor (0 to 1) real(r8), pointer :: rresis_patch (:,:) ! patch root resistance by layer (0-1) (nlevgrnd) ! Latent heat @@ -250,7 +249,6 @@ subroutine InitAllocate(this, bounds) allocate(this%btran_patch (begp:endp)) ; this%btran_patch (:) = nan allocate(this%btran_min_patch (begp:endp)) ; this%btran_min_patch (:) = nan allocate(this%btran_min_inst_patch (begp:endp)) ; this%btran_min_inst_patch (:) = nan - allocate(this%btran2_patch (begp:endp)) ; this%btran2_patch (:) = nan allocate( this%bsun_patch (begp:endp)) ; this%bsun_patch (:) = nan allocate( this%bsha_patch (begp:endp)) ; this%bsha_patch (:) = nan allocate( this%errsoi_patch (begp:endp)) ; this%errsoi_patch (:) = nan @@ -640,11 +638,6 @@ subroutine InitHistory(this, bounds, is_simple_buildtemp) avgflag='A', long_name='daily minimum of transpiration beta factor', & ptr_patch=this%btran_min_patch, l2g_scale_type='veg') - this%btran2_patch(begp:endp) = spval - call hist_addfld1d (fname='BTRAN2', units='unitless', & - avgflag='A', long_name='root zone soil wetness factor', & - ptr_patch=this%btran2_patch, l2g_scale_type='veg') - if (use_cn) then this%rresis_patch(begp:endp,:) = spval call hist_addfld2d (fname='RRESIS', units='proportion', type2d='levgrnd', & @@ -861,11 +854,6 @@ subroutine Restart(this, bounds, ncid, flag, is_simple_buildtemp, is_prog_buildt interpinic_flag='interp', readvar=readvar, data=this%eflx_urban_heat_col) end if - call restartvar(ncid=ncid, flag=flag, varname='btran2', xtype=ncd_double, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%btran2_patch) - call restartvar(ncid=ncid, flag=flag, varname='BTRAN_MIN', xtype=ncd_double, & dim1name='pft', & long_name='daily minimum of transpiration wetness factor', units='', & diff --git a/src/biogeophys/SoilMoistStressMod.F90 b/src/biogeophys/SoilMoistStressMod.F90 index 4f8112b611..62f37635d3 100644 --- a/src/biogeophys/SoilMoistStressMod.F90 +++ b/src/biogeophys/SoilMoistStressMod.F90 @@ -312,7 +312,8 @@ end subroutine normalize_unfrozen_rootfr subroutine calc_root_moist_stress_clm45default(bounds, & nlevgrnd, fn, filterp, rootfr_unf, & temperature_inst, soilstate_inst, energyflux_inst, waterstatebulk_inst, & - waterdiagnosticbulk_inst, soil_water_retention_curve) + waterdiagnosticbulk_inst, soil_water_retention_curve, & + bgc_vegetation_inst ) ! ! DESCRIPTIONS ! compute the root water stress using the default clm45 approach @@ -330,6 +331,8 @@ subroutine calc_root_moist_stress_clm45default(bounds, & use SoilWaterRetentionCurveMod, only : soil_water_retention_curve_type use PatchType , only : patch use clm_varctl , only : iulog, use_hydrstress + use CNVegetationFacade , only : cn_vegetation_type + use clm_varctl , only : use_cn, use_fates ! ! !ARGUMENTS: implicit none @@ -344,11 +347,11 @@ subroutine calc_root_moist_stress_clm45default(bounds, & type(waterstatebulk_type) , intent(inout) :: waterstatebulk_inst type(waterdiagnosticbulk_type) , intent(inout) :: waterdiagnosticbulk_inst class(soil_water_retention_curve_type), intent(in) :: soil_water_retention_curve + type(cn_vegetation_type) , intent(inout) :: bgc_vegetation_inst ! ! !LOCAL VARIABLES: real(r8), parameter :: btran0 = 0.0_r8 ! initial value real(r8) :: smp_node, s_node !temporary variables - real(r8) :: smp_node_lf !temporary variable integer :: p, f, j, c, l !indices !------------------------------------------------------------------------------ @@ -369,13 +372,21 @@ subroutine calc_root_moist_stress_clm45default(bounds, & rootr => soilstate_inst%rootr_patch , & ! Output: [real(r8) (:,:) ] effective fraction of roots in each soil layer (SMS method only) btran => energyflux_inst%btran_patch , & ! Output: [real(r8) (:) ] transpiration wetness factor (0 to 1) (integrated soil water stress) - btran2 => energyflux_inst%btran2_patch , & ! Output: [real(r8) (:) ] integrated soil water stress square rresis => energyflux_inst%rresis_patch , & ! Output: [real(r8) (:,:) ] root soil water stress (resistance) by layer (0-1) (nlevgrnd) h2osoi_vol => waterstatebulk_inst%h2osoi_vol_col , & ! Input: [real(r8) (:,:) ] volumetric soil water (0<=h2osoi_vol<=watsat) [m3/m3] h2osoi_liqvol => waterdiagnosticbulk_inst%h2osoi_liqvol_col & ! Output: [real(r8) (:,:) ] liquid volumetric moisture, will be used for BeTR ) + ! + ! Root zone wetness only used by the CN Li Fire model + ! + if ( use_cn .and. .not. use_fates )then + call bgc_vegetation_inst%cnfire_method%CNFire_calc_fire_root_wetness( bounds, nlevgrnd, & + fn, filterp, waterstatebulk_inst, soilstate_inst, & + soil_water_retention_curve ) + end if + do j = 1,nlevgrnd do f = 1, fn p = filterp(f) @@ -415,13 +426,6 @@ subroutine calc_root_moist_stress_clm45default(bounds, & ! inconsistency for now. btran(p) = btran(p) + max(rootr(p,j),0._r8) end if - s_node = max(h2osoi_vol(c,j)/watsat(c,j), 0.01_r8) - - call soil_water_retention_curve%soil_suction(c, j, s_node, soilstate_inst, smp_node_lf) - - smp_node_lf = max(smpsc(patch%itype(p)), smp_node_lf) - btran2(p) = btran2(p) +rootfr(p,j)*max(0._r8,min((smp_node_lf - smpsc(patch%itype(p))) / & - (smpso(patch%itype(p)) - smpsc(patch%itype(p))), 1._r8)) end do end do @@ -447,7 +451,8 @@ end subroutine calc_root_moist_stress_clm45default !-------------------------------------------------------------------------------- subroutine calc_root_moist_stress(bounds, nlevgrnd, fn, filterp, & active_layer_inst, energyflux_inst, soilstate_inst, temperature_inst, & - waterstatebulk_inst, waterdiagnosticbulk_inst, soil_water_retention_curve) + waterstatebulk_inst, waterdiagnosticbulk_inst, soil_water_retention_curve, & + bgc_vegetation_inst ) ! ! DESCRIPTIONS ! compute the root water stress using different approaches @@ -464,6 +469,7 @@ subroutine calc_root_moist_stress(bounds, nlevgrnd, fn, filterp, & use WaterDiagnosticBulkType , only : waterdiagnosticbulk_type use SoilWaterRetentionCurveMod, only : soil_water_retention_curve_type use abortutils , only : endrun + use CNVegetationFacade , only : cn_vegetation_type ! ! !ARGUMENTS: implicit none @@ -478,6 +484,7 @@ subroutine calc_root_moist_stress(bounds, nlevgrnd, fn, filterp, & type(waterstatebulk_type) , intent(inout) :: waterstatebulk_inst type(waterdiagnosticbulk_type) , intent(inout) :: waterdiagnosticbulk_inst class(soil_water_retention_curve_type), intent(in) :: soil_water_retention_curve + type(cn_vegetation_type) , intent(inout) :: bgc_vegetation_inst ! ! !LOCAL VARIABLES: integer :: p, f, j, c, l ! indices @@ -515,7 +522,8 @@ subroutine calc_root_moist_stress(bounds, nlevgrnd, fn, filterp, & waterstatebulk_inst=waterstatebulk_inst, & waterdiagnosticbulk_inst=waterdiagnosticbulk_inst, & rootfr_unf=rootfr_unf(bounds%begp:bounds%endp,1:nlevgrnd), & - soil_water_retention_curve=soil_water_retention_curve) + soil_water_retention_curve=soil_water_retention_curve, & + bgc_vegetation_inst=bgc_vegetation_inst ) case default call endrun(subname // ':: a root moisture stress function must be specified!') diff --git a/src/main/FireDataBaseType.F90 b/src/main/FireDataBaseType.F90 index be9325d798..5f3edc529b 100644 --- a/src/main/FireDataBaseType.F90 +++ b/src/main/FireDataBaseType.F90 @@ -42,7 +42,8 @@ module FireDataBaseType contains ! ! !PUBLIC MEMBER FUNCTIONS: - procedure, public :: FireInit ! Initialization of Fire + procedure, public :: FireInit => BaseFireInit ! Initialization of Fire + procedure, public :: BaseFireInit ! Initialization of Fire procedure(FireReadNML_interface), public, deferred :: FireReadNML ! Read in namelist for Fire procedure, public :: FireInterp ! Interpolate fire data procedure(need_lightning_and_popdens_interface), public, deferred :: & @@ -92,7 +93,7 @@ subroutine FireReadNML_interface( this, NLFilename ) end subroutine FireReadNML_interface !----------------------------------------------------------------------- - subroutine FireInit( this, bounds, NLFilename ) + subroutine BaseFireInit( this, bounds, NLFilename ) ! ! !DESCRIPTION: ! Initialize CN Fire module @@ -119,7 +120,7 @@ subroutine FireInit( this, bounds, NLFilename ) call this%lnfm_interp(bounds) end if - end subroutine FireInit + end subroutine BaseFireInit !----------------------------------------------------------------------- subroutine FireInterp(this,bounds) diff --git a/src/main/FireMethodType.F90 b/src/main/FireMethodType.F90 index 314ee1ceca..eea2ddce69 100644 --- a/src/main/FireMethodType.F90 +++ b/src/main/FireMethodType.F90 @@ -25,6 +25,9 @@ module FireMethodType ! Read parameters for the fire datasets procedure(CNFireReadParams_interface), public, deferred :: CNFireReadParams + ! Restart + procedure(CNFireRestart_interface), public, deferred :: CNFireRestart + ! Interpolate the fire datasets procedure(FireInterp_interface) , public, deferred :: FireInterp @@ -34,6 +37,9 @@ module FireMethodType ! Figure out the fire fluxes procedure(CNFireFluxes_interface) , public, deferred :: CNFireFluxes + ! Calculate root wetness for the CN Fire + procedure(CNFire_calc_fire_root_wetness_interface) , public, deferred :: CNFire_calc_fire_root_wetness + end type fire_method_type abstract interface @@ -113,6 +119,24 @@ subroutine CNFireReadParams_interface( this, ncid ) end subroutine CNFireReadParams_interface + !----------------------------------------------------------------------- + subroutine CNFireRestart_interface( this, bounds, ncid, flag ) + ! + ! Restart for the CN fire base class + ! !USES: + use ncdio_pio , only : file_desc_t + use decompMod , only : bounds_type + import :: fire_method_type + ! + ! !ARGUMENTS: + class(fire_method_type) :: this + type(bounds_type), intent(in) :: bounds + type(file_desc_t), intent(inout) :: ncid + character(len=*) , intent(in) :: flag + !-------------------------------------------------------------------- + + end subroutine CNFireRestart_interface + !----------------------------------------------------------------------- subroutine CNFireArea_interface (this, bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, & atm2lnd_inst, energyflux_inst, saturated_excess_runoff_inst, & @@ -206,7 +230,28 @@ subroutine CNFireFluxes_interface (this, bounds, num_soilc, filter_soilc, num_so !----------------------------------------------------------------------- end subroutine CNFireFluxes_interface - !----------------------------------------------------------------------- + !----------------------------------------------------------------------- + + !---------------------------------------------------------------------- + subroutine CNFire_calc_fire_root_wetness_interface( this, bounds, nlevgrnd, num_exposedvegp, & + filter_exposedvegp, waterstatebulk_inst, & + soilstate_inst, soil_water_retention_curve ) + ! Calculate root wetness that will be used for the CN fire model + use decompMod , only : bounds_type + use WaterStateBulkType , only : waterstatebulk_type + use SoilStateType , only : soilstate_type + use SoilWaterRetentionCurveMod, only : soil_water_retention_curve_type + import :: fire_method_type + class(fire_method_type) :: this + type(bounds_type) , intent(in) :: bounds !bounds + integer , intent(in) :: nlevgrnd !number of vertical layers + integer , intent(in) :: num_exposedvegp !number of filters + integer , intent(in) :: filter_exposedvegp(:) !filter array + type(waterstatebulk_type), intent(in) :: waterstatebulk_inst + type(soilstate_type) , intent(in) :: soilstate_inst + class(soil_water_retention_curve_type), intent(in) :: soil_water_retention_curve + !----------------------------------------------------------------------- + end subroutine CNFire_calc_fire_root_wetness_interface end interface diff --git a/src/main/clm_driver.F90 b/src/main/clm_driver.F90 index f06c49bc12..51647c105e 100644 --- a/src/main/clm_driver.F90 +++ b/src/main/clm_driver.F90 @@ -679,7 +679,8 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro downreg_patch = downreg_patch(bounds_clump%begp:bounds_clump%endp), & leafn_patch = leafn_patch(bounds_clump%begp:bounds_clump%endp), & froot_carbon = froot_carbon(bounds_clump%begp:bounds_clump%endp), & - croot_carbon = croot_carbon(bounds_clump%begp:bounds_clump%endp)) + croot_carbon = croot_carbon(bounds_clump%begp:bounds_clump%endp), & + bgc_vegetation_inst = bgc_vegetation_inst ) deallocate(downreg_patch, leafn_patch, froot_carbon, croot_carbon) call t_stopf('canflux') diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index 76bcb900ea..580340de01 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -1472,7 +1472,6 @@ subroutine wrap_btran(this,nc,fn,filterc,soilstate_inst, & t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:) ] soil temperature (Kelvin) h2osoi_liqvol => waterdiagnosticbulk_inst%h2osoi_liqvol_col , & ! Input: [real(r8) (:,:) ] liquid volumetric moisture, will be used for BeTR btran => energyflux_inst%btran_patch , & ! Output: [real(r8) (:) ] transpiration wetness factor (0 to 1) - btran2 => energyflux_inst%btran2_patch , & ! Output: [real(r8) (:) ] rresis => energyflux_inst%rresis_patch , & ! Output: [real(r8) (:,:) ] root resistance by layer (0-1) (nlevgrnd) rootr => soilstate_inst%rootr_patch & ! Output: [real(r8) (:,:) ] Fraction of water uptake in each layer ) @@ -1565,8 +1564,8 @@ subroutine wrap_btran(this,nc,fn,filterc,soilstate_inst, & ! Convert output BC's ! For CLM/ALM this wrapper provides return variables that should ! be similar to that of calc_root_moist_stress(). However, - ! CLM/ALM-FATES simulations will no make use of rresis, btran or btran2 - ! outside of FATES. We do not have code in place to calculate btran2 or + ! CLM/ALM-FATES simulations will no make use of rresis or btran + ! outside of FATES. We do not have code in place to calculate or ! rresis right now, so we force to bad. We have btran calculated so we ! pass it in case people want diagnostics. rootr is actually the only ! variable that will be used, as it is needed to help distribute the @@ -1586,7 +1585,6 @@ subroutine wrap_btran(this,nc,fn,filterc,soilstate_inst, & ! it should not thought of as valid output until we decide to. rootr(p,j) = this%fates(nc)%bc_out(s)%rootr_pasl(ifp,j) btran(p) = this%fates(nc)%bc_out(s)%btran_pa(ifp) - btran2(p) = -999.9 ! Not available, force to nonsense end do end do