Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calculate btran2 inside fire - and call the new routine from within the fire code #1155

Merged
merged 22 commits into from
Oct 6, 2020
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
e345c39
Call routine to calc fire's btran2 from CNFireArea
billsacks Sep 18, 2020
c7723f9
Remove some very expensive tests
billsacks Sep 18, 2020
48bd465
Add comments
billsacks Sep 18, 2020
4e9308f
Restore some high-res tests, but put expensive tests in ctsm_sci
billsacks Sep 18, 2020
e252e94
Merge tag 'ctsm5.1.dev001' into btran2incnfire_movecall
billsacks Sep 30, 2020
5cd478e
Apply changes to CNFireLi2021 like those applied to other fire versions
billsacks Sep 30, 2020
bfed614
Minor cleanup
billsacks Sep 30, 2020
8d1fc69
Merge branch 'master' into btran2incnfire_movecall
billsacks Sep 30, 2020
b496b65
Change some stray SHR_ASSERT calls to SHR_ASSERT_FL
billsacks Sep 30, 2020
0a97062
run_sys_tests: use abspath of --testfile argument
billsacks Sep 30, 2020
acb90bf
Merge branch 'master' into btran2incnfire_movecall
billsacks Oct 2, 2020
f7a98bf
Merge branch 'fix_clm51_fire_btran' into btran2incnfire_movecall
billsacks Oct 2, 2020
ec8d075
Calculate fire btran2 using updated h2osoi_vol
billsacks Sep 30, 2020
b1cf8b9
Reinitialize fire btran2 to spval for all patches in each time step
billsacks Oct 2, 2020
4291f06
Limit fire btran2 to be <= 1
billsacks Oct 2, 2020
c6675b3
In CNFireLi2021: Allow btran2 to exceed 1 by somewhat more
billsacks Oct 4, 2020
04c968c
In CNFireLi2021: Remove check on btran2 significantly greater than 1
billsacks Oct 4, 2020
ad4f17c
Fire btran2 cleanup that should be bit-for-bit
billsacks Oct 4, 2020
cb6e7ce
Move calc_fire_root_wetness for CNFireLi2021 into the base type
billsacks Oct 5, 2020
460efa4
Set btran2 to 0 over non-exposed-veg points
billsacks Oct 5, 2020
a7efe34
Change fire looping structure to be more standard
billsacks Oct 5, 2020
7a365a7
Merge branch 'master' into btran2incnfire_movecall
billsacks Oct 6, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions cime_config/testdefs/testlist_clm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@
<option name="wallclock">00:20:00</option>
</options>
</test>
<test name="ERI_D_Ld9" grid="C96_t061" compset="I2000Clm50SpRsGs" testmods="clm/default">
<test name="SMS_Ln9" grid="C96_t061" compset="I2000Clm50SpRsGs" testmods="clm/default">
<machines>
<machine name="cheyenne" compiler="intel" category="aux_clm"/>
<machine name="cheyenne" compiler="intel" category="ctsm_sci"/>
</machines>
<options>
<option name="wallclock">00:60:00</option>
<option name="comment">Ran a basic test for fv3 C96 standard resolution</option>
<option name="comment">We have one C96 test in aux_clm; this is another that uses a different compset. No need to run this additional C96 test with every tag, but include it in the less frequent ctsm_sci testing.</option>
</options>
</test>
<test name="ERI_D_Ld9" grid="ne30_g17" compset="I2000Clm50BgcCruGs" testmods="clm/vrtlay">
Expand Down Expand Up @@ -301,13 +301,13 @@
<option name="wallclock">00:60:00</option>
</options>
</test>
<test name="ERP_D_Ld5" grid="C96_C96_mg17" compset="IHistClm50BgcCrop" testmods="clm/allActive">
<test name="SMS_Ln9" grid="C96_C96_mg17" compset="IHistClm50BgcCrop" testmods="clm/default">
<machines>
<machine name="cheyenne" compiler="intel" category="aux_clm"/>
</machines>
<options>
<option name="wallclock">00:20:00</option>
<option name="comment">Use a transient compset so we allocate and run all PFTs (non-transient cases only allocate memory for non-zero-weight PFTs)</option>
<option name="comment">Want one C96 test in the aux_clm test suite; just a short smoke test to make sure it can get off the ground</option>
</options>
</test>
<test name="SMS_Ld5" grid="f09_g17" compset="IHistClm50BgcCrop" testmods="clm/default">
Expand Down Expand Up @@ -1019,13 +1019,13 @@
<option name="comment" >Test transient PFTs (via HIST) in conjunction with changing glacier area. This test also covers the reset_dynbal_baselines option. CISM is not answer preserving across processor changes, but short test length should be OK.</option>
</options>
</test>
<test name="ERS_D_Ld10" grid="C96_C96_mg17" compset="IHistClm50Sp" testmods="clm/decStart">
<test name="SMS_Ln9" grid="C96_C96_mg17" compset="IHistClm50Sp" testmods="clm/decStart">
<machines>
<machine name="cheyenne" compiler="intel" category="aux_clm"/>
<machine name="cheyenne" compiler="intel" category="ctsm_sci"/>
</machines>
<options>
<option name="wallclock">00:20:00</option>
<option name="comment" >test transient PFTs (via HIST) with a December start, reading 78-pft data and running with 16 pfts</option>
<option name="comment">We have one C96 test in aux_clm; this is another that uses a different compset. No need to run this additional C96 test with every tag, but include it in the less frequent ctsm_sci testing. decStart doesn't accomplish a lot in this very short test, but we're using it anyway to be consistent with other Hist tests.</option>
</options>
</test>
<test name="ERS_D_Ld10" grid="f10_f10_musgs" compset="IHistClm50Sp" testmods="clm/collapse_pfts_78_to_16_decStart_f10">
Expand Down Expand Up @@ -1371,39 +1371,39 @@
</test>
<test name="ERS_Ln9" grid="ne0ARCTICne30x4_ne0ARCTICne30x4_mt12" compset="IHistClm50SpGs" testmods="clm/clm50cam6LndTuningMode_1979Start">
<machines>
<machine name="cheyenne" compiler="intel" category="aux_clm"/>
<machine name="cheyenne" compiler="intel" category="ctsm_sci"/>
</machines>
<options>
<option name="wallclock">00:20:00</option>
<option name="comment" >Run ARCTIC for transient case starting in 1979 as for AMIP CAM cases, be sure to run with stub GLC
for ERS test as otherwise it won't work for a sub-day test"</option>
for ERS test as otherwise it won't work for a sub-day test (no need to run this high core count test with every tag, but include it in the less frequent ctsm_sci testing)"</option>
</options>
</test>
<test name="SMS_Ln9" grid="ne0ARCTICGRISne30x8_ne0ARCTICGRISne30x8_mt12" compset="IHistClm50Sp" testmods="clm/clm50cam6LndTuningMode_1979Start">
<machines>
<machine name="cheyenne" compiler="intel" category="aux_clm"/>
<machine name="cheyenne" compiler="intel" category="ctsm_sci"/>
</machines>
<options>
<option name="wallclock">01:20:00</option>
<option name="comment" >Run ARCTICGRIS for transient case starting in 1979 as for AMIP CAM cases"</option>
<option name="wallclock">00:20:00</option>
<option name="comment" >Run ARCTICGRIS for transient case starting in 1979 as for AMIP CAM cases (no need to run this high core count test with every tag, but include it in the less frequent ctsm_sci testing)"</option>
</options>
</test>
<test name="SMS_Ln9" grid="ne0ARCTICGRISne30x8_ne0ARCTICGRISne30x8_mt12" compset="ISSP585Clm50BgcCrop" testmods="clm/clm50cam6LndTuningMode">
<machines>
<machine name="cheyenne" compiler="intel" category="aux_clm"/>
<machine name="cheyenne" compiler="intel" category="ctsm_sci"/>
</machines>
<options>
<option name="wallclock">00:40:00</option>
<option name="comment" >Run ARCTICGRIS for future transient case"</option>
<option name="comment" >Run ARCTICGRIS for future transient case (do not run this expensive test with every tag, but include it in the less frequent ctsm_sci testing)"</option>
</options>
</test>
<test name="SMS_Ln9" grid="ne0CONUSne30x8_ne0CONUSne30x8_mt12" compset="IHistClm50Sp" testmods="clm/clm50cam6LndTuningMode_2013Start">
<machines>
<machine name="cheyenne" compiler="intel" category="aux_clm"/>
<machine name="cheyenne" compiler="intel" category="ctsm_sci"/>
</machines>
<options>
<option name="wallclock">00:20:00</option>
<option name="comment" >Run CONUS for transient case starting in 2013 as for CAM case"</option>
<option name="comment" >Run CONUS for transient case starting in 2013 as for CAM case (no need to run this high core count test with every tag, but include it in the less frequent ctsm_sci testing)"</option>
</options>
</test>
<test name="SMS_Ld5" grid="f09_g17" compset="IHistClm50Sp" testmods="clm/default">
Expand Down
12 changes: 10 additions & 2 deletions src/biogeochem/CNDriverMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ module CNDriverMod
use EnergyFluxType , only : energyflux_type
use SaturatedExcessRunoffMod , only : saturated_excess_runoff_type
use ActiveLayerMod , only : active_layer_type
use SoilWaterRetentionCurveMod , only : soil_water_retention_curve_type
!
! !PUBLIC TYPES:
implicit none
Expand Down Expand Up @@ -80,7 +81,8 @@ end subroutine CNDriverInit

!-----------------------------------------------------------------------
subroutine CNDriverNoLeaching(bounds, &
num_soilc, filter_soilc, num_soilp, filter_soilp, num_pcropp, filter_pcropp, doalb, &
num_soilc, filter_soilc, num_soilp, filter_soilp, num_pcropp, filter_pcropp, &
num_exposedvegp, filter_exposedvegp, doalb, &
cnveg_state_inst, &
cnveg_carbonflux_inst, cnveg_carbonstate_inst, &
c13_cnveg_carbonflux_inst, c13_cnveg_carbonstate_inst, &
Expand All @@ -94,7 +96,8 @@ subroutine CNDriverNoLeaching(bounds,
soilbiogeochem_nitrogenflux_inst, soilbiogeochem_nitrogenstate_inst, &
active_layer_inst, &
atm2lnd_inst, waterstatebulk_inst, waterdiagnosticbulk_inst, waterfluxbulk_inst, &
wateratm2lndbulk_inst, canopystate_inst, soilstate_inst, temperature_inst, crop_inst, ch4_inst, &
wateratm2lndbulk_inst, canopystate_inst, soilstate_inst, temperature_inst, &
soil_water_retention_curve, crop_inst, ch4_inst, &
dgvs_inst, photosyns_inst, saturated_excess_runoff_inst, energyflux_inst, &
nutrient_competition_method, cnfire_method, dribble_crophrv_xsmrpool_2atm)
!
Expand Down Expand Up @@ -146,6 +149,8 @@ subroutine CNDriverNoLeaching(bounds,
integer , intent(in) :: filter_soilp(:) ! filter for soil patches
integer , intent(in) :: num_pcropp ! number of prog. crop patches in filter
integer , intent(in) :: filter_pcropp(:) ! filter for prognostic crop patches
integer , intent(in) :: num_exposedvegp ! number of points in filter_exposedvegp
integer , intent(in) :: filter_exposedvegp(:) ! patch filter for non-snow-covered veg
logical , intent(in) :: doalb ! true = surface albedo calculation time step
type(cnveg_state_type) , intent(inout) :: cnveg_state_inst
type(cnveg_carbonflux_type) , intent(inout) :: cnveg_carbonflux_inst
Expand Down Expand Up @@ -178,6 +183,7 @@ subroutine CNDriverNoLeaching(bounds,
type(canopystate_type) , intent(inout) :: canopystate_inst
type(soilstate_type) , intent(inout) :: soilstate_inst
type(temperature_type) , intent(inout) :: temperature_inst
class(soil_water_retention_curve_type) , intent(in) :: soil_water_retention_curve
type(crop_type) , intent(inout) :: crop_inst
type(ch4_type) , intent(in) :: ch4_inst
type(dgvs_type) , intent(inout) :: dgvs_inst
Expand Down Expand Up @@ -747,7 +753,9 @@ subroutine CNDriverNoLeaching(bounds,

call t_startf('CNFire')
call cnfire_method%CNFireArea(bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, &
num_exposedvegp, filter_exposedvegp, &
atm2lnd_inst, energyflux_inst, saturated_excess_runoff_inst, waterdiagnosticbulk_inst, wateratm2lndbulk_inst, &
waterstatebulk_inst, soilstate_inst, soil_water_retention_curve, &
cnveg_state_inst, cnveg_carbonstate_inst, &
totlitc_col=soilbiogeochem_carbonstate_inst%totlitc_col(begc:endc), &
decomp_cpools_vr_col=soilbiogeochem_carbonstate_inst%decomp_cpools_vr_col(begc:endc,1:nlevdecomp_full,1:ndecomp_pools), &
Expand Down
42 changes: 4 additions & 38 deletions src/biogeochem/CNFireBaseMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ module CNFireBaseMod
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
! !PRIVATE MEMBER FUNCTIONS:
Expand Down Expand Up @@ -197,19 +196,19 @@ subroutine CNFireRestart( this, bounds, ncid, flag )
end subroutine CNFireRestart

!----------------------------------------------------------------------
subroutine CNFire_calc_fire_root_wetness( this, bounds, nlevgrnd, num_exposedvegp, filter_exposedvegp, &
subroutine CNFire_calc_fire_root_wetness( this, bounds, 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 clm_varpar , only : nlevgrnd
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
Expand All @@ -230,7 +229,8 @@ subroutine CNFire_calc_fire_root_wetness( this, bounds, nlevgrnd, num_exposedveg
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)
! FIXME(wjs, 2020-09-18) change this to use h2osoi_vol_col instead of the prehydrology version
h2osoi_vol => waterstatebulk_inst%h2osoi_vol_prehydrology_col & ! Input: [real(r8) (:,:) ] volumetric soil water (0<=h2osoi_vol<=watsat) [m3/m3] (porosity) (constant)
)

do f = 1, num_exposedvegp
Expand Down Expand Up @@ -363,40 +363,6 @@ subroutine FireReadNML( this, NLFilename )

end subroutine FireReadNML

!-----------------------------------------------------------------------
subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, &
atm2lnd_inst, energyflux_inst, saturated_excess_runoff_inst, &
waterdiagnosticbulk_inst, wateratm2lndbulk_inst, &
cnveg_state_inst, cnveg_carbonstate_inst, totlitc_col, decomp_cpools_vr_col, t_soi17cm_col)
!
! !DESCRIPTION:
! Computes column-level burned area
!
! !USES:
!
! !ARGUMENTS:
class(cnfire_base_type) :: this
type(bounds_type) , intent(in) :: bounds
integer , intent(in) :: num_soilc ! number of soil columns in filter
integer , intent(in) :: filter_soilc(:) ! filter for soil columns
integer , intent(in) :: num_soilp ! number of soil patches in filter
integer , intent(in) :: filter_soilp(:) ! filter for soil patches
type(atm2lnd_type) , intent(in) :: atm2lnd_inst
type(energyflux_type) , intent(in) :: energyflux_inst
type(saturated_excess_runoff_type) , intent(in) :: saturated_excess_runoff_inst
type(waterdiagnosticbulk_type) , intent(in) :: waterdiagnosticbulk_inst
type(wateratm2lndbulk_type) , intent(in) :: wateratm2lndbulk_inst
type(cnveg_state_type) , intent(inout) :: cnveg_state_inst
type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst
real(r8) , intent(in) :: totlitc_col(bounds%begc:)
real(r8) , intent(in) :: decomp_cpools_vr_col(bounds%begc:,1:,1:)
real(r8) , intent(in) :: t_soi17cm_col(bounds%begc:)
!

call endrun( 'cnfire_base::CNFireArea: this method MUST be implemented!' )

end subroutine CNFireArea

!-----------------------------------------------------------------------
subroutine CNFireFluxes (this, bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, &
dgvs_inst, cnveg_state_inst, &
Expand Down
25 changes: 20 additions & 5 deletions src/biogeochem/CNFireLi2014Mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,11 @@ module CNFireLi2014Mod
use SoilBiogeochemDecompCascadeConType , only : decomp_cascade_con
use EnergyFluxType , only : energyflux_type
use SaturatedExcessRunoffMod , only : saturated_excess_runoff_type
use WaterDiagnosticBulkType , only : waterdiagnosticbulk_type
use Wateratm2lndBulkType , only : wateratm2lndbulk_type
use WaterDiagnosticBulkType , only : waterdiagnosticbulk_type
use Wateratm2lndBulkType , only : wateratm2lndbulk_type
use WaterStateBulkType , only : waterstatebulk_type
use SoilStateType , only : soilstate_type
use SoilWaterRetentionCurveMod , only : soil_water_retention_curve_type
use GridcellType , only : grc
use ColumnType , only : col
use PatchType , only : patch
Expand Down Expand Up @@ -79,8 +82,10 @@ end function need_lightning_and_popdens

!-----------------------------------------------------------------------
subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, &
num_exposedvegp, filter_exposedvegp, &
atm2lnd_inst, energyflux_inst, saturated_excess_runoff_inst, waterdiagnosticbulk_inst, &
wateratm2lndbulk_inst, cnveg_state_inst, cnveg_carbonstate_inst, totlitc_col, decomp_cpools_vr_col, t_soi17cm_col)
wateratm2lndbulk_inst, waterstatebulk_inst, soilstate_inst, soil_water_retention_curve, &
cnveg_state_inst, cnveg_carbonstate_inst, totlitc_col, decomp_cpools_vr_col, t_soi17cm_col)
!
! !DESCRIPTION:
! Computes column-level burned area
Expand All @@ -100,11 +105,16 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_
integer , intent(in) :: filter_soilc(:) ! filter for soil columns
integer , intent(in) :: num_soilp ! number of soil patches in filter
integer , intent(in) :: filter_soilp(:) ! filter for soil patches
integer , intent(in) :: num_exposedvegp ! number of points in filter_exposedvegp
integer , intent(in) :: filter_exposedvegp(:) ! patch filter for non-snow-covered veg
type(atm2lnd_type) , intent(in) :: atm2lnd_inst
type(energyflux_type) , intent(in) :: energyflux_inst
type(saturated_excess_runoff_type) , intent(in) :: saturated_excess_runoff_inst
type(waterdiagnosticbulk_type) , intent(in) :: waterdiagnosticbulk_inst
type(wateratm2lndbulk_type) , intent(in) :: wateratm2lndbulk_inst
type(waterdiagnosticbulk_type) , intent(in) :: waterdiagnosticbulk_inst
type(wateratm2lndbulk_type) , intent(in) :: wateratm2lndbulk_inst
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
type(cnveg_state_type) , intent(inout) :: cnveg_state_inst
type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst
real(r8) , intent(in) :: totlitc_col(bounds%begc:)
Expand Down Expand Up @@ -322,6 +332,11 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_
dtrotr_col(c)=0._r8
end if
end do

! This subroutine calculates btran2
call this%CNFire_calc_fire_root_wetness(bounds, num_exposedvegp, filter_exposedvegp, &
waterstatebulk_inst, soilstate_inst, soil_water_retention_curve)

do pi = 1,max_patch_per_col
do fc = 1,num_soilc
c = filter_soilc(fc)
Expand Down
Loading