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

Add two bioenergy crops (switchgrass and Miscanthus) #884

Merged
merged 68 commits into from
May 25, 2020

Conversation

yanyanchengHydro
Copy link
Contributor

@yanyanchengHydro yanyanchengHydro commented Jan 11, 2020

Description of changes

Two bioenergy crops (switchgrass and Miscanthus) are added into the ctsm1.0.dev080 branch. There are 8 source codes are modified:

  1. In pftconMod.F90, add a crop-specific parameter named biofuel_harvfrac for cutting a certain fraction of leaf & stem biomass during the offset period for biofuel. Parameter values (e.g., phenology, photosynthesis capacity) for switchgrass and Miscanthus are added in the parameter file. The parameter file is at: /glade/scratch/ycheng/ctsm_bioenergy_inputdata/clm5_params.c190829_addSW_MXG_biofuel_harvfrac_200329.nc
  2. In CNVegCarbonFluxType.F90, add new fluxes leafc_to_biofuelc/livestemc_to_biofuelc to store the harvested carbon from leaf/stem to biofuel during offset period.
  3. In CNVegNitrogenFluxType.F90, add new output fluxes named leafn_to_biofueln/ livestemn_to_biofueln to store the harvested nitrogen from leaf/stem to biofuel during offset period.
  4. In CNPhenologyMod.F90, during the offset period in the CNOffsetLitterfall subroutine, a certain fraction (determined by the new biofuel_harvfrac parameter) of leaf and stem are harvested and moved to leaf_to_biofuel and livestem_to_biofuel, respectively.
  5. In CNVegStructUpdateMod.F90, add the ivt(p) for switchgrass and Miscanthus in the if statements.
  6. In CNCIsoFluxMod.F90, add calculation for leafc_to_biofuelc & livestemc_to_biofuelc
  7. In CNCStateUpdate1Mod.F90, subtract leafc_to_biofuelc/livestemc_to_biofuelc from leafc/livestemc
  8. In CNNStateUpdate1Mod.F90, subtract leafn_to_biofueln/livestemn_to_biofueln from leafn/livestemn

Specific notes

Contributors other than yourself, if any: Maoyi Huang @huangmy

Testing performed, if any:

  1. Two single point cases (switchgrass and Miscanthus) and validate the single point results against flux tower observations from the Illinois site.
  2. Global simulation at f19_g16 resolution uses the bioenergy expansion (i.e. SSP2-RCP4.5) scenario produced by GCAM. The surface data and landuse.timeseries used are: /glade/scratch/ycheng/ctsm_bioenergy_inputdata/surfdata_1.9x2.5_78pfts_simyr2055_SSP2RCP45_MIROC_c200224.nc and /glade/scratch/ycheng/ctsm_bioenergy_inputdata/landuse.timeseries_1.9x2.5_global_78pfts_CMIP6_simyr2055_2074_SSP2RCP45_MIROC_c200224.nc.
    The simulation results are at: /glade/scratch/ycheng/ctsm_bioenergy_inputdata. There is a README file inside the directory for what the data are.

Reference

Cheng, Y., Huang, M., Chen, M., Guan, K., Bernacchi, C., Peng, B. & Tan, Z. (2019). Parameterizing perennial bioenergy crops in Version 5 of the Community Land Model Based on Site‐Level Observations in the Central Midwestern United States. Journal of Advances in Modeling Earth Systems, 2(2013), 1–24. https://doi.org/10.1029/2019MS001719

@billsacks @dlawrenncar @danicalombardozzi @wwieder @ekluzek @lawrencepj1

NOTE: Be sure to check your Coding style against the standard:
https://github.com/ESCOMP/ctsm/wiki/CTSM-coding-guidelines

@billsacks billsacks added the tag: next this issue should get some attention in the next week or two label Jan 13, 2020
@ekluzek ekluzek added the tag: enh - new science enhancement that brings in new science capabilities label Jan 15, 2020
@billsacks billsacks removed the tag: next this issue should get some attention in the next week or two label Jan 27, 2020
Copy link
Contributor

@wwieder wwieder left a comment

Choose a reason for hiding this comment

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

It's exciting to see this work moving forward.

I only quickly looked at the code and am not an expert on either the crop model or the land use datasets that could drive the model. Comments here are intended to start a conversation to review the science and code from the pull request.

@danicalombardozzi, do you have suggestions for naming the grainc_to_food flux to avoid confusion with the rest of crop harvest.

@lawrencepj1 My understanding is that this would not change historical simulations, as we don't have biofuels on the surface dataset. Are there future scenarios that call for biofuel expansions in SSP/RCP scenarios?

@yanyanchengHydro your single point simulations look promising. Do you have any plans to consider global-scale simulations to get a first look at the potential climate implications of biofuels (and to test the model can run globally)? Alternatively, what happens in future scenarios at the point scale?

src/biogeochem/CNPhenologyMod.F90 Outdated Show resolved Hide resolved
! Y. Cheng, cut 70% AGB for switchgrass and Miscanthus and move to grainc_to_food
if (ivt(p)==nmiscanthus .or. ivt(p)==nirrig_miscanthus .or. ivt(p)==nswitchgrass .or. ivt(p)==nirrig_switchgrass) then
leafc_to_litter(p) = t1 * leafc(p)*0.3 + cpool_to_leafc(p)
grainc_to_food(p) =grainc_to_food(p)+ t1 * leafc(p) * 0.7
Copy link
Contributor

Choose a reason for hiding this comment

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

Calling this grainc_to_food is potentially confusing if it were summed to provide global 'food' estimates. Instead, should there be a new biofuelc flux that's added to the 1 year products pool? @danicalombardozzi do you have ideas here?

Copy link
Member

Choose a reason for hiding this comment

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

Would you also want to make a change where currently the grain pool is being added to grainc_to_food (line 2502), instead putting that in the new biofuel flux?

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 putting a product where leaf biomass is added into the grainc_to_food variable is confusing. It's probably best to keep the grainc_to_food variable similar to data available for evaluation, and UNFAO-STAT does not include biofuels in the global grain yield product. As per @wwieder and @billsacks suggestions, is it possible to change this to a new biofuelc flux, where both the grain pool and 70% of the leaf biomass are put into the biofuel flux? It will also then be easier to keep track of the total biofuel production independently of grain products. The biofuelc flux can follow the same pathway as grainc_to_food, where it ends up in the 1-year product pool.

Copy link
Member

Choose a reason for hiding this comment

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

I also wonder: Would it make sense to introduce another crop-specific parameter for this, specifying the fraction of crop grain that goes to biomass vs. food for each crop? My main thinking is that I'd like to keep logicals on crop type out of the code as much as possible, but I also wonder if this would be a useful flexibility to have. I don't feel strongly about this, but am throwing it out as a suggestion in case others think it could be good to do.

Copy link
Contributor

Choose a reason for hiding this comment

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

So @billsacks you are saying that the fraction of biomass that goes to biofuel would be a parameter that is an array of PFT. And likewise the fraction of biomass that goes to food would be a parameter that is an array of PFT. And then this statement wouldn't need to be encapsulated in an if statement but done for every crop type. That is better. If statements tend to be buggy and cause confusion.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, something like that. We could discuss details of what the parameters should be.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, this is what I was trying to get across in my earlier comment related to residue harvest. It would be great to have crop-specific parameters for this. I think the challenge will be linking the parameters to the appropriate fluxes (e.g., the grainc_to_food vs litter vs cropprod_1yr), which will also likely vary by crop type.

@@ -1436,6 +1436,10 @@ subroutine CropPhenology(num_pcropp, filter_pcropp , &
use pftconMod , only : ntrp_corn, nsugarcane, ntrp_soybean, ncotton, nrice
use pftconMod , only : nirrig_trp_corn, nirrig_sugarcane, nirrig_trp_soybean
use pftconMod , only : nirrig_cotton, nirrig_rice

! Y. Cheng
use pftconMod , only : nmiscanthus, nirrig_miscanthus, nswitchgrass, nirrig_switchgrass
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm assuming the new parameters are included in a parameter file that's not provided with this pull request, but are the parameter values sensible (for as much as we know about C4 grasses in CLM)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, the parameter file I modified is clm5_params.c190829.nc. Can I also add the parameter file in the pull request?

It's exciting to see this work moving forward.

I only quickly looked at the code and am not an expert on either the crop model or the land use datasets that could drive the model. Comments here are intended to start a conversation to review the science and code from the pull request.

@danicalombardozzi, do you have suggestions for naming the grainc_to_food flux to avoid confusion with the rest of crop harvest.

@lawrencepj1 My understanding is that this would not change historical simulations, as we don't have biofuels on the surface dataset. Are there future scenarios that call for biofuel expansions in SSP/RCP scenarios?

@yanyanchengHydro your single point simulations look promising. Do you have any plans to consider global-scale simulations to get a first look at the potential climate implications of biofuels (and to test the model can run globally)? Alternatively, what happens in future scenarios at the point scale?

@wwieder Thank you Will! We have run two future simulations with biofuel expansions (SSP2-RCP4.5 and SSP5-RCP8.5) at 0.125 degree resolution over the CONUS from 2005 to 2100. I plan to present it at the LMWG meeting on March.

Copy link
Contributor

Choose a reason for hiding this comment

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

@yanyanchengHydro. Yes, you can include the paramfile in the Pull Request. It can be pointed to in the bld/namelist_files/namelist_defaults_ctsm.xml file. But, there will likely be permission issues. So do you have access to cheyenne? And could you point us to the file there?

Copy link

Choose a reason for hiding this comment

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

@wwieder @ekluzek We are working on releasing the files through a public facing server at PNNL so that we don't need to worry about transferring the files. In addition to the clm5_params file, we will release the single point surfacedata, landuse, and forcing files so that the experiments are reproducible. However, if it is easier, @yanyanchengHydro can put a copy on cheyenne.

Copy link
Member

Choose a reason for hiding this comment

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

Just to clarify what @ekluzek said in case it wasn't clear: you can change the xml file but please do not add the netcdf file to your branch in git.

@lawrencepj1
Copy link

lawrencepj1 commented Jan 29, 2020 via email

Copy link
Contributor

@danicalombardozzi danicalombardozzi left a comment

Choose a reason for hiding this comment

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

It's very exciting to see all these changes! I include a few additional comments for you to review, including adding the stem carbon to the biofuels pool, adding the biofuels the the one-year product pool, and adding these to the CN balance checks.

In addition, we are now asking that code developers document the new code changes in the CLM Tech Note. We will have a branch on master (hopefully by next week). If you update your branch to master after this change, you should get the Tech Note documentation and can modify it on your branch.

It's possible that we haven't caught everything, so please run a simulation to make sure that there aren't balance check or other issues. You should look at the product pools to make sure that the extra C and N from biofuels are accounted for there.

[Update (2020-03-16)] Yanyan has addressed all of the comments Danica mentioned in this review.

src/biogeochem/CNPhenologyMod.F90 Outdated Show resolved Hide resolved
src/biogeochem/CNPhenologyMod.F90 Outdated Show resolved Hide resolved
src/biogeochem/CNPhenologyMod.F90 Outdated Show resolved Hide resolved
src/biogeochem/CNPhenologyMod.F90 Outdated Show resolved Hide resolved
src/biogeochem/CNCIsoFluxMod.F90 Outdated Show resolved Hide resolved
src/biogeochem/CNCIsoFluxMod.F90 Outdated Show resolved Hide resolved
src/biogeochem/CNCIsoFluxMod.F90 Outdated Show resolved Hide resolved
src/biogeochem/CNVegCarbonFluxType.F90 Outdated Show resolved Hide resolved
yanyanchengHydro and others added 11 commits May 9, 2020 16:55
…gation.rst

Co-authored-by: Danica Lombardozzi <dll@ucar.edu>
…gation.rst

Co-authored-by: Danica Lombardozzi <dll@ucar.edu>
…gation.rst

Co-authored-by: Danica Lombardozzi <dll@ucar.edu>
…gation.rst

Co-authored-by: Danica Lombardozzi <dll@ucar.edu>
…gation.rst

Co-authored-by: Danica Lombardozzi <dll@ucar.edu>
…gation.rst

Co-authored-by: Danica Lombardozzi <dll@ucar.edu>
….rst

Co-authored-by: Danica Lombardozzi <dll@ucar.edu>
Copy link
Contributor

@danicalombardozzi danicalombardozzi left a comment

Choose a reason for hiding this comment

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

Thanks for the recent updates! The changes all look great. I include only two minor suggestions related to wording changes. Sorry I didn't suggest these in the last round. Once these changes are in, I think we can merge the code!

Comment on lines 562 to 564
Leaf C and N pools are routed to the litter and biofuel pools, in contrast to that of unmanaged PFTs and non-biofuel crops, which put leaf C and N into litter pools only.
Root C and N pools are routed to the litter pools in the same manner as natural vegetation.

Copy link
Contributor

Choose a reason for hiding this comment

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

Minor suggestion to reduce confusion:

Suggested change
Leaf C and N pools are routed to the litter and biofuel pools, in contrast to that of unmanaged PFTs and non-biofuel crops, which put leaf C and N into litter pools only.
Root C and N pools are routed to the litter pools in the same manner as natural vegetation.
Biofuel crop leaf C and N pools are routed to the litter and biofuel pools, in contrast to that of unmanaged PFTs and non-biofuel crops, which put leaf C and N into litter pools only.
Root C and N pools are routed to the litter pools in the same manner as natural vegetation.

@@ -758,8 +758,8 @@ The values for both of these fields come from the LUMIP time series for each yea
In addition to the industrial fertilizer, background manure fertilizer is specified
on the parameter file by the field 'manunitro'. For perennial bioenergy crops,
little fertilizer (56kg/ha/yr) is applied to switchgrass, no fertilizer is applied to Miscanthus.
Note this set up is only based on local land management practice at the University of Illinois Energy Farm
located in Central Midwestern United States :ref:`(Cheng et al., 2019)<Chengetal2019>`. For the current CLM5BGCCROP,
Note these rates only based on local land management practice at the University of Illinois Energy Farm
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Note these rates only based on local land management practice at the University of Illinois Energy Farm
Note these rates are only based on local land management practices at the University of Illinois Energy Farm

Copy link
Contributor

@danicalombardozzi danicalombardozzi left a comment

Choose a reason for hiding this comment

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

Thanks for making all the requested changes!

@billsacks
Copy link
Member

Thanks a lot, @yanyanchengHydro and @danicalombardozzi ! I'll do final testing on this in the next week or so, then bring it to master.

@yanyanchengHydro thank you again for all of your work on this!!!

@ekluzek ekluzek added this to the ctsm5.1.0 milestone May 21, 2020
billsacks added a commit that referenced this pull request May 25, 2020
Add two bioenergy crops (switchgrass and miscanthus)

Main change is from Yanyan Cheng: adding parameters and code for two
bioenergy crops, switchgrass and miscanthus. Along with this, there is a
new potential flux from crop leaves and stems to the crop product pool
at harvest, representing biofuel products; a new pft-specific parameter
controls this flux (biofuel_harvfrac). Currently, the out-of-the-box
surface datasets do not specify any area for these crops, but the new
parameter file will allow them to be present if specified on the surface
dataset or landuse_timeseries file. Note that this is only an option for
CLM5.0, NOT for CLM4.5. (See #884 for
details.)

Also, some minor fixes from Bill Sacks:
- Resolves #203 - Fixes creation of harvest-related variables
  on surface datasets created with the all_veg option - smallville,
  PTCLM, etc. (documented in #1019)
- Resolves #930 - Makes gindex_ocn intent(inout) rather than
  intent(out)
- Resolves #1021 - Changes SSP test to only do symlink if
  needed
@billsacks billsacks merged commit 7b53527 into ESCOMP:master May 25, 2020
Upcoming tags automation moved this from In progress - master to Master Tags/Issues Done May 25, 2020
ekluzek added a commit to jtruesdal/ctsm that referenced this pull request May 27, 2020
Add two bioenergy crops (switchgrass and miscanthus)

Main change is from Yanyan Cheng: adding parameters and code for two
bioenergy crops, switchgrass and miscanthus. Along with this, there is a
new potential flux from crop leaves and stems to the crop product pool
at harvest, representing biofuel products; a new pft-specific parameter
controls this flux (biofuel_harvfrac). Currently, the out-of-the-box
surface datasets do not specify any area for these crops, but the new
parameter file will allow them to be present if specified on the surface
dataset or landuse_timeseries file. Note that this is only an option for
CLM5.0, NOT for CLM4.5. (See ESCOMP#884 for
details.)

Also, some minor fixes from Bill Sacks:
- Resolves ESCOMP#203 - Fixes creation of harvest-related variables
  on surface datasets created with the all_veg option - smallville,
  PTCLM, etc. (documented in ESCOMP#1019)
- Resolves ESCOMP#930 - Makes gindex_ocn intent(inout) rather than
  intent(out)
- Resolves ESCOMP#1021 - Changes SSP test to only do symlink if
  needed
ekluzek added a commit to ekluzek/CTSM that referenced this pull request Jun 10, 2020
Add two bioenergy crops (switchgrass and miscanthus)

Main change is from Yanyan Cheng: adding parameters and code for two
bioenergy crops, switchgrass and miscanthus. Along with this, there is a
new potential flux from crop leaves and stems to the crop product pool
at harvest, representing biofuel products; a new pft-specific parameter
controls this flux (biofuel_harvfrac). Currently, the out-of-the-box
surface datasets do not specify any area for these crops, but the new
parameter file will allow them to be present if specified on the surface
dataset or landuse_timeseries file. Note that this is only an option for
CLM5.0, NOT for CLM4.5. (See ESCOMP#884 for
details.)

Also, some minor fixes from Bill Sacks:
- Resolves ESCOMP#203 - Fixes creation of harvest-related variables
  on surface datasets created with the all_veg option - smallville,
  PTCLM, etc. (documented in ESCOMP#1019)
- Resolves ESCOMP#930 - Makes gindex_ocn intent(inout) rather than
  intent(out)
- Resolves ESCOMP#1021 - Changes SSP test to only do symlink if
  needed
ekluzek added a commit to juliusvira/ctsm that referenced this pull request Aug 22, 2022
Add two bioenergy crops (switchgrass and miscanthus)

Main change is from Yanyan Cheng: adding parameters and code for two
bioenergy crops, switchgrass and miscanthus. Along with this, there is a
new potential flux from crop leaves and stems to the crop product pool
at harvest, representing biofuel products; a new pft-specific parameter
controls this flux (biofuel_harvfrac). Currently, the out-of-the-box
surface datasets do not specify any area for these crops, but the new
parameter file will allow them to be present if specified on the surface
dataset or landuse_timeseries file. Note that this is only an option for
CLM5.0, NOT for CLM4.5. (See ESCOMP#884 for
details.)

Also, some minor fixes from Bill Sacks:
- Resolves ESCOMP#203 - Fixes creation of harvest-related variables
  on surface datasets created with the all_veg option - smallville,
  PTCLM, etc. (documented in ESCOMP#1019)
- Resolves ESCOMP#930 - Makes gindex_ocn intent(inout) rather than
  intent(out)
- Resolves ESCOMP#1021 - Changes SSP test to only do symlink if
  needed

 Conflicts:
	Externals.cfg
	bld/namelist_files/namelist_defaults_ctsm.xml
	bld/namelist_files/namelist_definition_ctsm.xml
	bld/unit_testers/build-namelist_test.pl
	src/biogeochem/CNBalanceCheckMod.F90
	src/biogeochem/CNDriverMod.F90
	src/biogeochem/CNVegetationFacade.F90
	src/main/clm_driver.F90
	src/main/clm_initializeMod.F90
	src/main/controlMod.F90
@AnushaNTNU
Copy link

Hi
May I know what is the difference between this page and the page here , https://github.com/IMMM-SFA/CLM5_bioenergy? I have been following that page to add bioenergy crops to the model. I have CLM5 installed as part of NorESM2 which is based on CESM2. I could use the modified fortran files (4 of them) given there and build a case. I could also use the updated paramater file with miscanthus and switchgrass on, but the model is giving me error while running. May I also know whether I should do something more to add bioenergy crops to the CLM5 version I have?

Thanks in Advance

@wwieder
Copy link
Contributor

wwieder commented Mar 6, 2023

Hello, I can't comment on the external github page you pointed to, but we do have bioenergy crops represented in CTSM. I apologies that our documentation for this is not very up to date, but if start with the latest ctsm5.1 development tag on master you should get the code and parameter files you're looking for? See the quick start on the wiki of this website.

Hope that helps, Will

@AnushaNTNU
Copy link

AnushaNTNU commented Mar 9, 2023

Hi
I think the issue is with the landuse input file, my compset uses this file, '/cluster/shared/noresm/inputdata/lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_1.9x2.5_SSP5-3.4_78pfts_CMIP6_simyr1850-2100_c190228.nc' which doesnt have miscanthus or switchgrass as an active crop. And I dont see any landuse file for this compset where these crops are active. Can you please help?

@wwieder
Copy link
Contributor

wwieder commented Mar 9, 2023

I don't think bioenergy crops are on the release (CLM5.0) branch. You need the main CTSM5.1 development branch instead (e.g. git clone --origin escomp https://github.com/ESCOMP/CTSM.git ctsm_MYBRANCH).

I also don't think there is much, or any, miscanthus and switchgrass on the land use time series until you run future scenarios (SSP-RCPs)

@AnushaNTNU
Copy link

Ok Thanks. Can you tell me where can I find the surface data or land use time series with miscanthus and switchgrass active for the SSPs? atleast for single point? Thanks in advance

@wwieder
Copy link
Contributor

wwieder commented Mar 14, 2023

If you create a case with an SSP compset you should get a land use time series with mischanthus and switchgrass active

If you just want a single point case, we'd recommend using the directions posted here. You can also use following flag in subset data --dom_pft 71, which would give you a rainfed miscanthus. I think this would give you a 100% rainfed miscanthus simulation, but you can confirm with the surface dataset created by ./subset_data.

@AnushaNTNU
Copy link

I actually dont want to move to ctsm. I want to stick to CLM5 and icorporate biocrops there by following the suggestions you have given in this page. But I dont see any suitable input files with switchgrass or miscanthus as active, that can be used in CLM5 from here https://svn-ccsm-inputdata.cgd.ucar.edu/trunk/inputdata/lnd/clm2/surfdata_map/.

@wwieder
Copy link
Contributor

wwieder commented Mar 14, 2023

This PR was merged to main after we made the CLM5 release tag, and is part of the CTSM series (see above). I'd encourage you to update to CTSM5.1 to get the information you're looking for, as we don't support backwards compatibility of new developments on old code bases.

It also may be more appropriate to move this discussion to the discussion forum for user support.
https://bb.cgd.ucar.edu/cesm/, where you can reference this thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tag: enh - new science enhancement that brings in new science capabilities
Projects
Upcoming tags
Done (non release/external)
Development

Successfully merging this pull request may close these issues.

None yet

9 participants