-
Notifications
You must be signed in to change notification settings - Fork 368
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
Changes from 20 commits
975c41a
e60d108
be484a5
17bb955
f50460d
b00fb40
3da7482
f69a848
12be3a6
b322f08
362fecf
9b49c52
f165e40
60ee280
16d43dc
afe87df
08dc6ad
f9a40a5
e96fc25
164e333
0ccaedf
13d0f5a
ed780f8
d215068
7480098
3730a54
cbc03fb
45d053d
1beed82
2e05202
1b3257f
4d13737
076299a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In my opinion it would be better to set There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 ? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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) | ||
|
There was a problem hiding this comment.
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
andprod100c
for when fates was running?There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.There was a problem hiding this comment.
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.