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 10 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
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 ( use_erosion ) then
Expand Down
5 changes: 4 additions & 1 deletion components/elm/src/biogeophys/BalanceCheckMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,10 @@ 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
!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 ( (errsol(p) /= spval) .and. (abs(errsol(p)) > 5.e-7_r8) ) then
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 this change to try and avoid the water balance error? @rgknox and I recommend that we not change this in e3sm master branch. It should be reverted to the old value.

Copy link
Contributor

Choose a reason for hiding this comment

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

If we bump this value up to suppress warnings, that seems fine for a FATES run. We are very aware that an audit needs to be done to reduce these fine errors in radiation scattering. However, we may want to only apply it to a fates governed patch. This "is_fates" can tell us if we are on a fates patch and if we should apply different logic:
https://github.com/E3SM-Project/E3SM/blob/v2.0.0/components/elm/src/data_types/VegetationType.F90#L70

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 revised the code as suggested. Thank you @rgknox @glemieux .

found = .true.
indexp = p
indext = veg_pp%topounit(indexp)
Expand Down
68 changes: 55 additions & 13 deletions components/elm/src/data_types/ColumnDataType.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2054,6 +2054,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 @@ -5717,6 +5727,34 @@ 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)
! Shijie
Copy link
Contributor

Choose a reason for hiding this comment

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

remove comment

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', &
avgflag='A', long_name='net ecosystem exchange of carbon, includes fire, landuse,'&
//' harvest, and hrv_xsmrpool flux, positive for source', &
ptr_col=this%nee)
! Shijie

end if
! end of use_fates (C12) block

Expand Down Expand Up @@ -6902,9 +6940,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) + &
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

! soil organic matter fire losses (SOMFIRE)
this%somfire(c) = 0._r8
Expand Down Expand Up @@ -7405,18 +7447,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


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
71 changes: 63 additions & 8 deletions components/elm/src/main/elmfates_interfaceMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ module ELMFatesInterfaceMod
use FatesPlantHydraulicsMod, only : InitHydrSites
use FatesPlantHydraulicsMod, only : RestartHydrStates

use dynHarvestMod , only : num_harvest_vars, harvest_varnames
use dynHarvestMod , only : num_harvest_vars, harvest_varnames, wood_harvest_units
use dynHarvestMod , only : harvest_rates ! these are dynamic in space and time
use dynHarvestMod , only : num_harvest_vars, harvest_varnames, wood_harvest_units
Copy link
Contributor

Choose a reason for hiding this comment

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

@sshu88 it looks like there is some duplicate code here as well.

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for checking.


Expand Down Expand Up @@ -211,6 +211,7 @@ module ELMFatesInterfaceMod
procedure, public :: wrap_accumulatefluxes
procedure, public :: prep_canopyfluxes
procedure, public :: wrap_canopy_radiation
procedure, public :: wrap_WoodProducts
procedure, public :: wrap_update_hifrq_hist
procedure, public :: TransferZ0mDisp
procedure, public :: UpdateLitterFluxes
Expand Down Expand Up @@ -271,6 +272,7 @@ subroutine ELMFatesGlobals()
integer :: pass_biogeog
integer :: pass_num_lu_harvest_types
integer :: pass_lu_harvest
integer :: pass_harvest_bypass_criteria
integer :: pass_nocomp
integer :: pass_sp

Expand All @@ -294,11 +296,17 @@ subroutine ELMFatesGlobals()

! We will use this switch temporarily, until we complete
! the ELM-FATES harvest integration
logical, parameter :: do_elm_fates_harvest = .false.

logical, parameter :: do_elm_fates_harvest = .true.
Copy link
Contributor

Choose a reason for hiding this comment

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

similar to my other question, should/could this be a namelist parameter instead of this hard-coded local? Or will this be added in a later phase?

Copy link
Contributor

Choose a reason for hiding this comment

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

nevermind, i see it isn't used. Can we remove this variable and its commented out usage below?

Copy link
Author

Choose a reason for hiding this comment

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

Yes. Remove this namelist option does not affect the ELM-FATES run now.

! Another switch to determine if we want to harvest forest
! by ignoring the harvest criteria
! This is only useful when performing carbon-based harvest
! Need to update as a namelist option in the future
logical, parameter :: allow_harvest_bypass_criteria = .false.

if (use_fates) then

verbose_output = .false.
! Shijie: Turn on verbose_output for test
verbose_output = .false.
call FatesInterfaceInit(iulog, verbose_output)

! Force FATES parameters that are recieve type, to the unset value
Expand All @@ -313,7 +321,7 @@ subroutine ELMFatesGlobals()
call set_fates_ctrlparms('hlm_name',cval='ELM')
call set_fates_ctrlparms('hio_ignore_val',rval=spval)
call set_fates_ctrlparms('soilwater_ipedof',ival=get_ipedof(0))
call set_fates_ctrlparms('max_patch_per_site',ival=(natpft_size-1))
call set_fates_ctrlparms('max_patch_per_site',ival=natpft_size-1)


call set_fates_ctrlparms('parteh_mode',ival=fates_parteh_mode)
Expand Down Expand Up @@ -411,12 +419,19 @@ subroutine ELMFatesGlobals()
pass_logging = 1
pass_num_lu_harvest_types = num_harvest_vars
pass_lu_harvest = 1
if(allow_harvest_bypass_criteria) then
pass_harvest_bypass_criteria = 1
else
pass_harvest_bypass_criteria = 0
end if
else
pass_lu_harvest = 0
pass_num_lu_harvest_types = 0
pass_harvest_bypass_criteria = 0
end if

call set_fates_ctrlparms('use_lu_harvest',ival=pass_lu_harvest)
call set_fates_ctrlparms('use_harvest_bypass_criteria',ival=pass_harvest_bypass_criteria)
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see any setup for this on the fates side pr 888. Is this a future feature? I'm assuming so given that it's hard coded to false just above this.

Copy link
Author

Choose a reason for hiding this comment

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

It's an old flag. I forgot to delete this line in ELM side.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, cool. In that case would you push an update to remove it please?

call set_fates_ctrlparms('num_lu_harvest_cats',ival=pass_num_lu_harvest_types)
call set_fates_ctrlparms('use_logging',ival=pass_logging)

Expand Down Expand Up @@ -692,7 +707,6 @@ subroutine init(this, bounds_proc )

end do


! Initialize site-level static quantities dictated by the HLM
! currently ground layering depth

Expand Down Expand Up @@ -886,6 +900,7 @@ subroutine dynamics_driv(this, bounds_clump, top_as_inst, &
this%fates(nc)%bc_in(s)%hlm_harvest_catnames = harvest_varnames
this%fates(nc)%bc_in(s)%hlm_harvest_units = wood_harvest_units
end if
this%fates(nc)%bc_in(s)%site_area=col_pp%wtgcell(c)*grc_pp%area(g)*1e6_r8
Copy link
Contributor

Choose a reason for hiding this comment

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

need units for 1e6 please. I'm guessing this is m2 per km2?

Copy link
Author

Choose a reason for hiding this comment

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

Right.


end do

Expand Down Expand Up @@ -1108,10 +1123,11 @@ subroutine wrap_update_hlmfates_dyn(this, nc, bounds_clump, &
this%fates(nc)%sites, &
this%fates(nc)%bc_in)

! Canopy diagnostic outputs for HLM
! Canopy diagnostic outputs for HLM, including LUC
call update_hlm_dynamics(this%fates(nc)%nsites, &
this%fates(nc)%sites, &
this%f2hmap(nc)%fcolumn, &
this%fates(nc)%bc_in, &
this%fates(nc)%bc_out )

!---------------------------------------------------------------------------------
Expand Down Expand Up @@ -1180,7 +1196,6 @@ subroutine wrap_update_hlmfates_dyn(this, nc, bounds_clump, &

! initialize SP mode pft order index to 0. Below ground is the 0th patch
veg_pp%sp_pftorder_index(col_pp%pfti(c)) = 0

areacheck = veg_pp%wt_ed(col_pp%pfti(c))

do ifp = 1, this%fates(nc)%sites(s)%youngest_patch%patchno
Expand Down Expand Up @@ -2213,6 +2228,46 @@ end subroutine wrap_accumulatefluxes

! ======================================================================================

subroutine wrap_WoodProducts(this, bounds_clump, fc, filterc)

! !ARGUMENTS:
class(hlm_fates_interface_type), intent(inout) :: this
type(bounds_type) , intent(in) :: bounds_clump
integer , intent(in) :: fc ! size of column filter
integer , intent(in) :: filterc(fc) ! column filter

! Locacs
integer :: s,c,icc
integer :: nc

associate(&
gpp => col_cf%gpp , &
ar => col_cf%ar , &
hrv_deadstemc_to_prod10c => col_cf%hrv_deadstemc_to_prod10c , &
hrv_deadstemc_to_prod100c => col_cf%hrv_deadstemc_to_prod100c)

nc = bounds_clump%clump_index
! Loop over columns
do icc = 1,fc
c = filterc(icc)
s = this%f2hmap(nc)%hsites(c)

! Shijie: Pass harvested wood products to ELM variable
hrv_deadstemc_to_prod10c(c) = this%fates(nc)%bc_out(s)%hrv_deadstemc_to_prod10c
hrv_deadstemc_to_prod100c(c) = this%fates(nc)%bc_out(s)%hrv_deadstemc_to_prod100c

! Pass LUC related C fluxes which are calculated in FATES [gC m-2 s-1]
gpp(c) = this%fates(nc)%bc_out(s)%gpp_site*1e3
Copy link
Contributor

Choose a reason for hiding this comment

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

units for 1e3 please, named constant is good too

Copy link
Author

Choose a reason for hiding this comment

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

g per kg.

ar(c) = this%fates(nc)%bc_out(s)%ar_site*1e3

end do

end associate
return
end subroutine wrap_WoodProducts

! ======================================================================================

subroutine wrap_canopy_radiation(this, bounds_clump, &
num_vegsol, filter_vegsol, coszen, surfalb_inst)

Expand Down