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

C-based harvest in ELM-FATES #5106

Closed
wants to merge 33 commits into from
Closed
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
975c41a
Add LUC fluxes in ELM-FATES interface.
sshu3 Feb 22, 2022
e60d108
Removed pprodharv10 from bc_in.
sshu3 Mar 11, 2022
be484a5
Merge branch 'master' into fatesluc
sshu3 Mar 20, 2022
17bb955
Change the maximum numbers of patches to 20.
sshu3 Apr 12, 2022
f50460d
Revise back to 14 patches version from 'flex_numpatch'.
sshu3 Jun 16, 2022
b00fb40
Revised ELM C fluxes diagnostic outputs.
sshu3 Aug 2, 2022
3da7482
Removed unnecessary changes.
sshu3 Aug 29, 2022
f69a848
Revert changes in config_pesall.xml and .gitignore
sshu3 Sep 12, 2022
12be3a6
Revert changes in testmod files.
sshu3 Sep 12, 2022
b322f08
Added a missing blank line in testmod file.
sshu3 Sep 12, 2022
362fecf
Revised the solar radiation imbalance threshold for FATES.
sshu3 Oct 10, 2022
9b49c52
Remove the confusing IF-ELSE logic.
sshu3 Oct 10, 2022
f165e40
Update interface code to allow FATES API 25
rgknox Dec 12, 2022
60ee280
Update FATES submodule pointer to sci.1.61.0_api.25.0.0
rgknox Dec 12, 2022
16d43dc
Merge pull request #2 from rgknox/fatesluc_cbasedhrv_v2_api25
sshu88 Dec 19, 2022
afe87df
merging changes for fates api24 into c-based lu branch
rgknox Dec 19, 2022
08dc6ad
Updating FATES pointer to api25
rgknox Dec 19, 2022
f9a40a5
Merge resolution between fates api 24 and 25 parameter defaults
rgknox Dec 19, 2022
e96fc25
Merge pull request #3 from rgknox/fatesluc_cbasedhrv_v2
sshu88 Dec 19, 2022
164e333
Minor revisions based on reviewers' comments.
sshu3 Dec 20, 2022
0ccaedf
Code clean-up.
sshu3 Dec 20, 2022
13d0f5a
fates-nutrient coupling api changes
rgknox Jan 6, 2023
ed780f8
small update to a comment
rgknox Jan 6, 2023
d215068
Merge pull request #4 from rgknox/fatesluc_cbasedhrv_v2_allocationfixes
sshu88 Jan 6, 2023
7480098
Update elmfates_interfaceMod.F90
sshu88 Jan 18, 2023
3730a54
Update elmfates_interfaceMod.F90
sshu88 Jan 18, 2023
cbc03fb
Update ColumnDataType.F90
sshu88 Jan 27, 2023
45d053d
Removed a deprecated mapping between fates and elm soil layers that h…
rgknox Jan 31, 2023
1beed82
Updated pftvarcon to read in phosphorus parameters when fates is on
rgknox Jan 31, 2023
2e05202
Added a div0 protection to phosphorus cycling
rgknox Jan 31, 2023
1b3257f
Merge pull request #5 from rgknox/fatesluc_cbasedhrv_v2
sshu88 Jan 31, 2023
4d13737
update fates submodule pointer to carbon harvest compatible tag
glemieux Jan 31, 2023
076299a
Merge pull request #6 from glemieux/fatesluc_cbasedhrv_v2-fatestag
sshu88 Jan 31, 2023
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
2 changes: 1 addition & 1 deletion components/elm/bld/namelist_files/namelist_defaults.xml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case).
<!-- ================================================================== -->
<!-- FATES default parameter file -->
<!-- ================================================================== -->
<fates_paramfile >lnd/clm2/paramdata/fates_params_api.24.0.0_12pft_c220719.nc</fates_paramfile>
<fates_paramfile >lnd/clm2/paramdata/fates_params_api.25.0.0_12pft_c221212.nc</fates_paramfile>

<!-- soil order related parameters (relative to {csmdata}) -->
<fsoilordercon >lnd/clm2/paramdata/CNP_parameters_c131108.nc</fsoilordercon>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ hist_fincl1 = 'FATES_NCOHORTS', 'FATES_TRIMMING', 'FATES_AREA_PLANTS',
'FATES_FUEL_AMOUNT', 'FATES_LITTER_IN', 'FATES_LITTER_OUT',
'FATES_SEED_BANK', 'FATES_SEEDS_IN', 'FATES_STOREC', 'FATES_VEGC',
'FATES_SAPWOODC', 'FATES_LEAFC', 'FATES_FROOTC', 'FATES_REPROC',
'FATES_CEFFLUX', 'FATES_STRUCTC', 'FATES_NONSTRUCTC', 'FATES_VEGC_ABOVEGROUND',
'FATES_STRUCTC', 'FATES_NONSTRUCTC', 'FATES_VEGC_ABOVEGROUND',
'FATES_CANOPY_VEGC', 'FATES_USTORY_VEGC', 'FATES_PRIMARY_PATCHFUSION_ERR',
'FATES_DISTURBANCE_RATE_P2P', 'FATES_DISTURBANCE_RATE_P2S',
'FATES_DISTURBANCE_RATE_S2S', 'FATES_DISTURBANCE_RATE_FIRE',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ hist_fincl1 = 'FATES_NCOHORTS', 'FATES_TRIMMING', 'FATES_AREA_PLANTS',
'FATES_FUEL_AMOUNT', 'FATES_LITTER_IN', 'FATES_LITTER_OUT',
'FATES_SEED_BANK', 'FATES_SEEDS_IN', 'FATES_STOREC', 'FATES_VEGC',
'FATES_SAPWOODC', 'FATES_LEAFC', 'FATES_FROOTC', 'FATES_REPROC',
'FATES_CEFFLUX', 'FATES_STRUCTC', 'FATES_NONSTRUCTC', 'FATES_VEGC_ABOVEGROUND',
'FATES_STRUCTC', 'FATES_NONSTRUCTC', 'FATES_VEGC_ABOVEGROUND',
'FATES_CANOPY_VEGC', 'FATES_USTORY_VEGC', 'FATES_PRIMARY_PATCHFUSION_ERR',
'FATES_DISTURBANCE_RATE_P2P', 'FATES_DISTURBANCE_RATE_P2S',
'FATES_DISTURBANCE_RATE_S2S', 'FATES_DISTURBANCE_RATE_FIRE',
Expand All @@ -33,7 +33,16 @@ hist_fincl1 = 'FATES_NCOHORTS', 'FATES_TRIMMING', 'FATES_AREA_PLANTS',
'FATES_CBALANCE_ERROR', 'FATES_ERROR_EL', 'FATES_LEAF_ALLOC',
'FATES_SEED_ALLOC', 'FATES_STEM_ALLOC', 'FATES_FROOT_ALLOC',
'FATES_CROOT_ALLOC', 'FATES_STORE_ALLOC','FATES_LITTER_IN_EL','FATES_LITTER_OUT_EL',
'FATES_LEAFN','FATES_LEAFP','FATES_FROOTN','FATES_FROOTP','FATES_NH4UPTAKE',
'FATES_NO3UPTAKE','FATES_NEFFLUX','FATES_PUPTAKE','FATES_PEFFLUX',
'NET_NMIN','NET_PMIN','LITR1P_vr','LITR1C_vr','LITR1N_vr','SOLUTIONP',
'SMIN_NO3','SMIN_NH4','TOTSOMN','TOTSOMP'
'SMIN_NO3','SMIN_NH4','TOTSOMN','TOTSOMP',
'FATES_L2FR','FATES_L2FR_CANOPY_REC_PF','FATES_L2FR_USTORY_REC_PF',
'FATES_NH4UPTAKE_SZPF','FATES_NO3UPTAKE_SZPF','FATES_NEFFLUX_SZPF' ,
'FATES_NDEMAND_SZPF','FATES_NFIX_SYM_SZPF','FATES_NH4UPTAKE','FATES_NO3UPTAKE',
'FATES_NEFFLUX','FATES_NDEMAND','FATES_NFIX_SYM','FATES_STOREN','FATES_STOREN_TF',
'FATES_VEGN','FATES_SAPWOODN','FATES_LEAFN','FATES_FROOTN','FATES_REPRON','FATES_VEGN_SZPF',
'FATES_LEAFN_SZPF','FATES_FROOTN_SZPF','FATES_SAPWOODN_SZPF','FATES_STOREN_SZPF','FATES_STOREN_TF_CANOPY_SZPF',
'FATES_STOREN_TF_USTORY_SZPF','FATES_REPRON_SZPF','FATES_STOREP','FATES_STOREP_TF','FATES_VEGP','FATES_SAPWOODP',
'FATES_LEAFP','FATES_FROOTP','FATES_REPROP','FATES_PUPTAKE','FATES_PEFFLUX','FATES_PDEMAND',
'FATES_VEGP_SZPF','FATES_LEAFP_SZPF','FATES_FROOTP_SZPF','FATES_SAPWOODP_SZPF','FATES_STOREP_SZPF',
'FATES_STOREP_TF_CANOPY_SZPF','FATES_STOREP_TF_USTORY_SZPF','FATES_REPROP_SZPF','FATES_PUPTAKE_SZPF',
'FATES_PEFFLUX_SZPF','FATES_PDEMAND_SZPF'
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ hist_fincl1 = 'FATES_NCOHORTS', 'FATES_TRIMMING', 'FATES_AREA_PLANTS',
'FATES_FUEL_AMOUNT', 'FATES_LITTER_IN', 'FATES_LITTER_OUT',
'FATES_SEED_BANK', 'FATES_SEEDS_IN', 'FATES_STOREC', 'FATES_VEGC',
'FATES_SAPWOODC', 'FATES_LEAFC', 'FATES_FROOTC', 'FATES_REPROC',
'FATES_CEFFLUX', 'FATES_STRUCTC', 'FATES_NONSTRUCTC', 'FATES_VEGC_ABOVEGROUND',
'FATES_STRUCTC', 'FATES_NONSTRUCTC', 'FATES_VEGC_ABOVEGROUND',
'FATES_CANOPY_VEGC', 'FATES_USTORY_VEGC', 'FATES_PRIMARY_PATCHFUSION_ERR',
'FATES_DISTURBANCE_RATE_P2P', 'FATES_DISTURBANCE_RATE_P2S',
'FATES_DISTURBANCE_RATE_S2S', 'FATES_DISTURBANCE_RATE_FIRE',
Expand All @@ -33,7 +33,16 @@ hist_fincl1 = 'FATES_NCOHORTS', 'FATES_TRIMMING', 'FATES_AREA_PLANTS',
'FATES_CBALANCE_ERROR', 'FATES_ERROR_EL', 'FATES_LEAF_ALLOC',
'FATES_SEED_ALLOC', 'FATES_STEM_ALLOC', 'FATES_FROOT_ALLOC',
'FATES_CROOT_ALLOC', 'FATES_STORE_ALLOC','FATES_LITTER_IN_EL','FATES_LITTER_OUT_EL',
'FATES_LEAFN','FATES_LEAFP','FATES_FROOTN','FATES_FROOTP','FATES_NH4UPTAKE',
'FATES_NO3UPTAKE','FATES_NEFFLUX','FATES_PUPTAKE','FATES_PEFFLUX',
'NET_NMIN','NET_PMIN','LITR1P_vr','LITR1C_vr','LITR1N_vr','SOLUTIONP',
'SMIN_NO3','SMIN_NH4','TOTSOMN','TOTSOMP'
'SMIN_NO3','SMIN_NH4','TOTSOMN','TOTSOMP',
'FATES_L2FR','FATES_L2FR_CANOPY_REC_PF','FATES_L2FR_USTORY_REC_PF',
'FATES_NH4UPTAKE_SZPF','FATES_NO3UPTAKE_SZPF','FATES_NEFFLUX_SZPF' ,
'FATES_NDEMAND_SZPF','FATES_NFIX_SYM_SZPF','FATES_NH4UPTAKE','FATES_NO3UPTAKE',
'FATES_NEFFLUX','FATES_NDEMAND','FATES_NFIX_SYM','FATES_STOREN','FATES_STOREN_TF',
'FATES_VEGN','FATES_SAPWOODN','FATES_LEAFN','FATES_FROOTN','FATES_REPRON','FATES_VEGN_SZPF',
'FATES_LEAFN_SZPF','FATES_FROOTN_SZPF','FATES_SAPWOODN_SZPF','FATES_STOREN_SZPF','FATES_STOREN_TF_CANOPY_SZPF',
'FATES_STOREN_TF_USTORY_SZPF','FATES_REPRON_SZPF','FATES_STOREP','FATES_STOREP_TF','FATES_VEGP','FATES_SAPWOODP',
'FATES_LEAFP','FATES_FROOTP','FATES_REPROP','FATES_PUPTAKE','FATES_PEFFLUX','FATES_PDEMAND',
'FATES_VEGP_SZPF','FATES_LEAFP_SZPF','FATES_FROOTP_SZPF','FATES_SAPWOODP_SZPF','FATES_STOREP_SZPF',
'FATES_STOREP_TF_CANOPY_SZPF','FATES_STOREP_TF_USTORY_SZPF','FATES_REPROP_SZPF','FATES_PUPTAKE_SZPF',
'FATES_PEFFLUX_SZPF','FATES_PDEMAND_SZPF'
7 changes: 7 additions & 0 deletions components/elm/src/biogeochem/EcosystemDynMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -805,6 +805,13 @@ subroutine EcosystemDynNoLeaching2(bounds, &

call t_stop_lnd(event)

else
call alm_fates%wrap_WoodProducts(bounds, num_soilc, filter_soilc)

call WoodProducts(num_soilc, filter_soilc )

call CropHarvestPools(num_soilc, filter_soilc, dt)

end if

if ( ero_ccycle ) then
Expand Down
10 changes: 9 additions & 1 deletion components/elm/src/biogeophys/BalanceCheckMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ subroutine ColWaterBalanceCheck( bounds, num_do_smb_c, filter_do_smb_c, &
integer :: indexp,indexc,indexl,indext,indexg ! index of first found in search loop
real(r8) :: forc_rain_col(bounds%begc:bounds%endc) ! column level rain rate [mm/s]
real(r8) :: forc_snow_col(bounds%begc:bounds%endc) ! column level snow rate [mm/s]
real(r8) :: sol_err_th ! solar radiation imbalance threshold
!-----------------------------------------------------------------------

associate( &
Expand Down Expand Up @@ -616,7 +617,14 @@ subroutine ColWaterBalanceCheck( bounds, num_do_smb_c, filter_do_smb_c, &
found = .false.
do p = bounds%begp, bounds%endp
if (veg_pp%active(p)) then
if ( (errsol(p) /= spval) .and. (abs(errsol(p)) > 1.e-7_r8) ) then
! solar radiation balance error is high when running FATES
! adjust the threshold to 5.e-7
if (veg_pp%is_fates(p)) then
sol_err_th = 5.e-7_r8
else
sol_err_th = 1.e-7_r8
end if
if ( (errsol(p) /= spval) .and. (abs(errsol(p)) > sol_err_th) ) then
found = .true.
indexp = p
indext = veg_pp%topounit(indexp)
Expand Down
67 changes: 54 additions & 13 deletions components/elm/src/data_types/ColumnDataType.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2090,6 +2090,16 @@ subroutine col_cs_init(this, begc, endc, carbon_type, ratio, c12_carbonstate_var
avgflag='A', long_name='total column carbon, incl veg and cpool but excl product pools', &
ptr_col=this%totcolc)

this%prod10c(begc:endc) = spval
call hist_addfld1d (fname='PROD10C', units='gC/m^2', &
avgflag='A', long_name='10-yr wood product C', &
ptr_col=this%prod10c, default='inactive')

this%prod100c(begc:endc) = spval
call hist_addfld1d (fname='PROD100C', units='gC/m^2', &
avgflag='A', long_name='100-yr wood product C', &
ptr_col=this%prod100c, default='inactive')

Comment on lines +2093 to +2102
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sshu88 was this a temporary change to make sure that you could read the prod10c and prod100c for when fates was running?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are two outputs I added to the history output file for checking the change of product pool size. So it is a temporary change. But the product pool size shall be a basic output in land surface model when considering anthropogenic disturbances.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To clarify, does this need to be available when fates is running? The current issue is that the same call is made just below behind a .not. use_fates check, which means this will get called twice and cause a build failure for non-fates runs. If it's not necessary for fates right now, would you mind removing these lines? Otherwise, the part that is behind the .not. use_fates check could be removed.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have removed the part below .not. use_fates check.

if(.not.use_fates)then

this%seedc(begc:endc) = spval
Expand Down Expand Up @@ -5763,6 +5773,33 @@ subroutine col_cf_init(this, begc, endc, carbon_type)
call hist_addfld1d (fname='HR', units='gC/m^2/s', &
avgflag='A', long_name='total heterotrophic respiration', &
ptr_col=this%hr)

this%hrv_deadstemc_to_prod10c(begc:endc) = spval
call hist_addfld1d (fname='HRV_DEADSTEMC_TO_PROD10C', units='gC/m^2/s', &
avgflag='A', long_name='flux into 10-yr wood product C', &
ptr_col=this%hrv_deadstemc_to_prod10c, default='inactive')

this%hrv_deadstemc_to_prod100c(begc:endc) = spval
call hist_addfld1d (fname='HRV_DEADSTEMC_TO_PROD100C', units='gC/m^2/s', &
avgflag='A', long_name='flux into 100-yr wood product C', &
ptr_col=this%hrv_deadstemc_to_prod100c, default='inactive')

this%nep(begc:endc) = spval
call hist_addfld1d (fname='NEP', units='gC/m^2/s', &
avgflag='A', long_name='net ecosystem production, excludes fire, landuse, and harvest flux, positive for sink', &
ptr_col=this%nep)

this%nbp(begc:endc) = spval
call hist_addfld1d (fname='NBP', units='gC/m^2/s', &
avgflag='A', long_name='net biome production, includes fire, landuse, and harvest flux, positive for sink', &
ptr_col=this%nbp)

this%nee(begc:endc) = spval
call hist_addfld1d (fname='NEE', units='gC/m^2/s', &
rgknox marked this conversation as resolved.
Show resolved Hide resolved
avgflag='A', long_name='net ecosystem exchange of carbon, includes fire, landuse,'&
//' harvest, and hrv_xsmrpool flux, positive for source', &
ptr_col=this%nee)

end if
! end of use_fates (C12) block

Expand Down Expand Up @@ -6948,9 +6985,13 @@ subroutine col_cf_summary(this, bounds, num_soilc, filter_soilc, isotope)

! total product loss
this%product_closs(c) = &
this%prod10c_loss(c) + &
this%prod10c_loss(c) + &
bishtgautam marked this conversation as resolved.
Show resolved Hide resolved
this%prod100c_loss(c) + &
this%prod1c_loss(c)
! if (masterproc) then
! write(iulog,*) "this%prod10c_loss?", this%prod10c_loss(c), "this%prod100c_loss?", &
! this%prod100c_loss(c), "this%prod1c_loss?", this%prod1c_loss(c)
! endif
bishtgautam marked this conversation as resolved.
Show resolved Hide resolved

! soil organic matter fire losses (SOMFIRE)
this%somfire(c) = 0._r8
Expand Down Expand Up @@ -7451,18 +7492,18 @@ subroutine col_cf_zero_forfates_veg(this, bounds, num_soilc, filter_soilc)

if(.not.use_fates) return

do fc = 1,num_soilc
c = filter_soilc(fc)
this%gpp(c) = 0._r8
this%ar(c) = 0._r8
this%npp(c) = 0._r8
this%vegfire(c) = 0._r8
this%wood_harvestc(c) = 0._r8
this%fire_closs_p2c(c) = 0._r8
!this%litfall(c) = 0._r8 (overwritten)
this%hrv_xsmrpool_to_atm(c) = 0._r8

end do
do fc = 1,num_soilc
c = filter_soilc(fc)
this%gpp(c) = 0._r8
this%ar(c) = 0._r8
this%npp(c) = 0._r8
this%vegfire(c) = 0._r8
this%wood_harvestc(c) = 0._r8
this%fire_closs_p2c(c) = 0._r8
!this%litfall(c) = 0._r8 (overwritten)
this%hrv_xsmrpool_to_atm(c) = 0._r8

end do
bishtgautam marked this conversation as resolved.
Show resolved Hide resolved


end subroutine col_cf_zero_forfates_veg
Expand Down
30 changes: 16 additions & 14 deletions components/elm/src/dyn_subgrid/dynHarvestMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ module dynHarvestMod
use ColumnDataType , only : col_cf, col_nf, col_pf
use VegetationType , only : veg_pp
use VegetationDataType , only : veg_cs, veg_cf, veg_ns, veg_nf
use topounit_varcon , only : max_topounits
use VegetationDataType , only : veg_ps, veg_pf
use topounit_varcon , only : max_topounits
use VegetationDataType , only : veg_ps, veg_pf
use elm_varctl , only : use_cn, use_fates, iulog
use FatesConstantsMod , only : hlm_harvest_area_fraction
Expand Down Expand Up @@ -66,22 +65,23 @@ module dynHarvestMod
! for FATES: capacity for passing harvest data in units of carbon harvested per year (per grid cell) has been added
! but these data are not yet included in the input file
! the code here can be changed to wood_harvest_units = harvest_carbon to pass carbon data to FATES if:
! the carbon data are in the same input variables as listed below
! and the carbon units in the input file match that expected by FATES
! the carbon data are in the same input variables as listed below
! and the carbon units in the input file match that expected by FATES

integer, public, parameter :: num_harvest_vars = 5
character(len=64), public, parameter :: harvest_varnames(num_harvest_vars) = &
[character(len=64) :: 'HARVEST_VH1', 'HARVEST_VH2', 'HARVEST_SH1', 'HARVEST_SH2', 'HARVEST_SH3']
[character(len=64) :: 'HARVEST_VH1', 'HARVEST_VH2', 'HARVEST_SH1', 'HARVEST_SH2', 'HARVEST_SH3']

type(dyn_var_time_uninterp_type) :: harvest_vars(num_harvest_vars) ! value of each harvest variable

! the units flag must match the units of harvest_varnames
! set this here because dynHarvest_init is called after alm_fates%init
! this flag is accessed only if namelist do_harvest is TRUE
integer, public :: wood_harvest_units = hlm_harvest_area_fraction

type(dyn_var_time_uninterp_type) :: harvest_vars(num_harvest_vars) ! value of each harvest variable

real(r8) , allocatable, public :: harvest_rates(:,:) ! category harvest rates (d1) in each gridcell (d2)
integer, public, parameter :: wood_harvest_units = 2 ! 1 = area fraction, 2 = carbon
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sshu88, is the long-term plan to have wood_harvest_units read in or defined in the file? or set in a namelist?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my opinion it would be better to set wood_harvest_units as a namelist option. However, this option may require the change of another set of harvest rate data in different unit.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that a namelist option would be best in the long-term, particularly if the input file eventually contains both carbon and area prescriptions.

real(r8), allocatable, public :: harvest_rates(:,:) ! harvest rates
logical, private :: do_harvest ! whether we're in a period when we should do harvest

logical, private :: do_harvest ! whether we're in a period when we should do harvest
!---------------------------------------------------------------------------

contains
Expand All @@ -92,8 +92,9 @@ subroutine dynHarvest_init(bounds, harvest_filename)
! !DESCRIPTION:
! Initialize data structures for harvest information.
! This should be called once, during model initialization.
!
use elm_varctl , only : use_cn

! !USES:
use elm_varctl , only : use_cn, use_fates
use dynVarTimeUninterpMod , only : dyn_var_time_uninterp_type
use dynTimeInfoMod , only : YEAR_POSITION_START_OF_TIMESTEP
use dynTimeInfoMod , only : YEAR_POSITION_END_OF_TIMESTEP
Expand Down Expand Up @@ -156,7 +157,7 @@ subroutine dynHarvest_interp_harvest_types(bounds)
!
! !USES:
use dynTimeInfoMod , only : time_info_type
use elm_varctl , only : use_cn, use_fates
use elm_varctl , only : use_cn, use_fates
!
! !ARGUMENTS:
type(bounds_type), intent(in) :: bounds ! proc-level bounds
Expand All @@ -181,7 +182,8 @@ subroutine dynHarvest_interp_harvest_types(bounds)
! means that harvest rates will be maintained at the rate given in the last
! year of the file for all years past the end of this specified time series.
do_harvest = .true.
allocate(this_data(bounds%begg:bounds%endg))
! Right now we don't account for the topounit in plant harvest
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will harvest work with a configuration with more than 1 topo unit per cell? If it doesn't, we should have a graceful fail if that combination is specified. Probably in contolmod ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True. The dataset we are using now does not account for another topographic dimension.

allocate(this_data(bounds%begg:bounds%endg))
do varnum = 1, num_harvest_vars
call harvest_vars(varnum)%get_current_data(this_data)
harvest_rates(varnum,bounds%begg:bounds%endg) = this_data(bounds%begg:bounds%endg)
Expand Down
2 changes: 1 addition & 1 deletion components/elm/src/external_models/fates
Submodule fates updated 51 files
+23 −0 .github/workflows/add-to-gh_projects.yml
+5 −12 README.md
+229 −0 biogeochem/DamageMainMod.F90
+262 −333 biogeochem/EDCanopyStructureMod.F90
+439 −166 biogeochem/EDCohortDynamicsMod.F90
+2 −2 biogeochem/EDLoggingMortalityMod.F90
+117 −73 biogeochem/EDMortalityFunctionsMod.F90
+768 −782 biogeochem/EDPatchDynamicsMod.F90
+518 −181 biogeochem/EDPhysiologyMod.F90
+147 −87 biogeochem/FatesAllometryMod.F90
+206 −622 biogeochem/FatesSoilBGCFluxMod.F90
+2 −0 biogeophys/EDAccumulateFluxesMod.F90
+60 −49 biogeophys/FatesPlantHydraulicsMod.F90
+173 −41 biogeophys/FatesPlantRespPhotosynthMod.F90
+9 −9 fire/SFMainMod.F90
+8 −6 functional_unit_testing/parteh/f90src/FatesCohortWrapMod.F90
+0 −11 main/ChecksBalancesMod.F90
+96 −43 main/EDInitMod.F90
+254 −155 main/EDMainMod.F90
+74 −27 main/EDPftvarcon.F90
+130 −64 main/EDTypesMod.F90
+7 −11 main/FatesConstantsMod.F90
+1,259 −423 main/FatesHistoryInterfaceMod.F90
+21 −1 main/FatesHistoryVariableType.F90
+15 −2 main/FatesIODimensionsMod.F90
+2 −1 main/FatesIOVariableKindMod.F90
+66 −48 main/FatesInterfaceMod.F90
+15 −9 main/FatesInterfaceTypesMod.F90
+21 −30 main/FatesInventoryInitMod.F90
+108 −6 main/FatesParameterDerivedMod.F90
+433 −221 main/FatesRestartInterfaceMod.F90
+21 −7 main/FatesRunningMeanMod.F90
+74 −2 main/FatesSizeAgeTypeIndicesMod.F90
+1,538 −0 parameter_files/archive/api24.1.0_101722_fates_params_default.cdl
+51 −0 parameter_files/archive/api24.1.0_101722_patch_params.xml
+1,537 −0 parameter_files/archive/api24.2.0_112822_fates_params_default.cdl
+0 −0 parameter_files/archive/apichange_23to24.xml
+72 −0 parameter_files/archive/apichange_24.2to25.xml
+41 −38 parameter_files/fates_params_default.cdl
+31 −21 parameter_files/patch_default_bciopt224.xml
+2 −2 parameter_files/patch_default_e3smtest.xml
+1,070 −960 parteh/PRTAllometricCNPMod.F90
+492 −472 parteh/PRTAllometricCarbonMod.F90
+122 −149 parteh/PRTGenericMod.F90
+88 −19 parteh/PRTLossFluxesMod.F90
+21 −15 parteh/PRTParametersMod.F90
+70 −25 parteh/PRTParamsFATESMod.F90
+113 −24 tools/BatchPatchParams.py
+9 −5 tools/FatesPFTIndexSwapper.py
+7 −24 tools/UpdateParamAPI.py
+3 −1 tools/modify_fates_paramfile.py
Loading