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

v1 Land Use Change #1040

Merged
merged 132 commits into from
Dec 19, 2023
Merged

v1 Land Use Change #1040

merged 132 commits into from
Dec 19, 2023

Conversation

ckoven
Copy link
Contributor

@ckoven ckoven commented Jun 8, 2023

This PR is a first version of including land use change other than forest harvest into FATES.

Description:

The patch-level land use labels are extended from their prior values of only primary or secondary lands to also include pasture, rangeland, and crops. Land use change in FATES is treated as a disturbance rate (in area/time units) from existing patches with a given land use label to new patches with the new land use label. The code thus now has four distinct types of disturbances: treefall, fire, logging, and land-use change, any or all of which may occur on a given patch on a given day. The structure of the overall disturbance routines had to be somewhat changed to accommodate this new logic.

The code uses as its driving data the LUH2 state and transition data available at https://luh.umd.edu. The code in #1032 regrids this data into a new FATES land use driving dataset; i.e. it is decoupled from the existing code used to drive land use change in big-leaf CLM and ELM; this is because the logic is totally different, instead of translating land use to land cover offline, the land use data is directly ingested during runtime. The five FATES land use categories are aggregated during runtime from a greater number of LUH2 land use types (which include forest/nonforest, and multiple crops). The LUH2 state data is used to initialize the patch structure at the year of model initialization. The LUH2 transition matrix is used to drive land-use-change disturbance rates in FATES. During land use change disturbance, vegetation is either cleared or not cleared on the newly-disturbed patch based on the specific transition, following rules described in Ma et al (2020) https://doi.org/10.5194/gmd-13-3203-2020.

There are corresponding ELM- and CLM-side changes required to read and pass the LUH2 data to FATES, as well as a few other small things. This code is currently working with ELM, where a PR will be coming shortly.

This code only really handles the basic infrastructure of land use change, subsequent developments that have not yet been written are still needed to handle lots of other things:

  1. extending land use change to nocomp logic (where both land use and land cover need to be jointly specified).
  2. treatment of a simplified crop PFT on croplands.
  3. grazing and/or fire management on pasture, rangeland, and croplands.
  4. other management approaches that govern land cover as a function of land use when not using nocomp configurations.
  5. consolidating the drivers of logging from their current location in the surface dataset into the FATES-LUH2 dataset (where both area-based and mass-based driving data currently now also exists)

Two new output history dimensions are created: (1) a land-use "lu" dimension, and (2) a land-use x land-use "lulu" dimension. The former can be used for looking at any quantity across all land use types (area, biomass, etc); the latter can be used to look at, e.g., a disturbance rate matrix from a given land-use type to a given land-use type. Either as part of this PR (not yet done) or in a subsequent one, all of the existing history variables that are specific to secondary lands should be moved to the new lu dimension (see also #964, which also proposes a land use x PFT dimension, which would be useful).

fixes #450.
fixes ESCOMP/CTSM#1077.

Collaborators:

I worked extensively with @glemieux in writing and testing this. Discussions with many people, including @rosiealice @jkshuman @adrifoster @lawrencepj1 @rgknox @jenniferholm @aldivi @sshu88 @JessicaNeedham @dlawrenncar @mpaiao @ekluzek @billsacks

Expectation of Answer Changes:

If land use is enabled, answers will be very different. If not enabled, roundoff-level changes would seem likely due to the reorganization of the loop structure in the disturbance code.

Checklist:

  • My change requires a change to the documentation.
  • I have updated the in-code documentation .AND. (the technical note .OR. the wiki) accordingly.
  • I have read the CONTRIBUTING document.
  • FATES PASS/FAIL regression tests were run
  • If answers were expected to change, evaluation was performed and provided

Test Results:

Currently not tested.

CTSM (or) E3SM (specify which) test hash-tag:

CTSM (or) E3SM (specify which) baseline hash-tag:

FATES baseline hash-tag:

Test Output:

ckoven and others added 30 commits March 10, 2023 13:22
LUH2 transition and state information isn't dependent on the
land use harvest capability.
Explicit-shape arrays need the parameter designation for named constants
I messed up the replacement string and dropped a character
@rgknox rgknox self-requested a review October 10, 2023 17:16
@ckoven ckoven mentioned this pull request Nov 10, 2023
4 tasks
@glemieux
Copy link
Contributor

glemieux commented Dec 4, 2023

I've implemented a landuse testmod and I'm seeing a failure in the CNBalanceCheckMod.F90 during the first hist_htapes_wrapup call:

2928  clm: leaving fates model           1          11
2929  --WARNING-- skipping CN balance check for first timesteps after startup or data
2930   assimilation
2931  --WARNING-- skipping CN balance check for first timesteps after startup or data
2932   assimilation
2933  --WARNING-- skipping CN balance check for first timesteps after startup or data
2934   assimilation
2935  cbalance warning at c =           4  5.266753678508790E-007
2936    911.953104391837
2937  cbalance warning at c =           5  2.277429033081813E-006
2938    911.974234598625
2939  cbalance warning at c =           6  1.683174109460076E-006
2940    911.967568518515
2941  cbalance warning at c =           7  1.537941879714219E-006
2942    911.957395544391
2943  column cbalance error    =   1.537941879714219E-006           7
2944  is fates column?         =  T
2945  Latdeg,Londeg=   30.0000000000000        260.000000000000
2946  begcb                    =    911.965299656670
2947  endcb                    =    911.957395544391
2948  delta store              =  -7.904112279447872E-003
2949  --- Inputs ---
2950  fates litter_flux        =   0.000000000000000E+000
2951  fates wood product flux  =   0.000000000000000E+000
2952  --- Outputs ---
2953  hr                       =   7.904112279464640E-003
2954  -1*som_c_leached         =  -3.964367563847151E-014
2955 iam = 0: local  column   index = 7
2956 iam = 0: global column   index = 5224
2957 iam = 0: global landunit index = 1953
2958 iam = 0: global gridcell index = 865
2959 iam = 0: gridcell longitude    =  260.0000000
2960 iam = 0: gridcell latitude     =   30.0000000
2961 iam = 0: column   type         = 1
2962 iam = 0: landunit type         = 1
2963  ENDRUN:
2964  ERROR: ERROR in CNBalanceCheckMod.F90 at line 391

Note that this test is starting up from a cold start in year 2000.

UPDATE: I can't seem to manually replicate the value of the error using the diagnostic outputs below. Calculating the cbalance error manually is far below the error threshold of 1.e-7_r8. I'm rerunning and dumping out the actual begcb during the warnings leading up to the error reporting.

@glemieux
Copy link
Contributor

Reviewing the carbon balance check for elm and clm, I found some inconsistency between the two HLMs. Discussing this with @rgknox, I've removed the wood products fluxes from the carbon balance check for both host land models in the respective HLM-side PRs. This results in the ctsm-fates landuse testmod passing. I've got a longer-term case running to check beyond the typical regression test length, which is usually no more than a year or so.

@glemieux
Copy link
Contributor

glemieux commented Dec 13, 2023

Regression testing the fates suite on cheyenne is partially B4B with the following exceptions:

    FAIL ERS_Lm13.f10_f10_mg37.I2000Clm50Fates.cheyenne_gnu.clm-FatesCold BASELINE fates-sci.1.69.0_api.31.0.0-ctsm5.1.dev155: DIFF
    FAIL SMS_Lm13.1x1_brazil.I2000Clm50FatesCruRsGs.cheyenne_gnu.clm-FatesCold BASELINE fates-sci.1.69.0_api.31.0.0-ctsm5.1.dev155: DIFF
    FAIL ERS_D_Ld30.f45_f45_mg37.I2000Clm50FatesCruRsGs.cheyenne_intel.clm-FatesColdLandUse BASELINE fates-sci.1.69.0_api.31.0.0-ctsm5.1.dev155: DIFF
    FAIL ERS_Ld30.f45_f45_mg37.I2000Clm50FatesCruRsGs.cheyenne_intel.clm-FatesColdNoComp BASELINE fates-sci.1.69.0_api.31.0.0-ctsm5.1.dev155: DIFF
    FAIL ERS_Ld30.f45_f45_mg37.I2000Clm50FatesCruRsGs.cheyenne_intel.clm-FatesColdNoCompFixedBioGeo BASELINE fates-sci.1.69.0_api.31.0.0-ctsm5.1.dev155: DIFF
    FAIL ERS_Ld60.f45_f45_mg37.I2000Clm50FatesCruRsGs.cheyenne_intel.clm-FatesColdLogging BASELINE fates-sci.1.69.0_api.31.0.0-ctsm5.1.dev155: DIFF
    FAIL ERS_Lm12.1x1_brazil.I2000Clm50FatesCruRsGs.cheyenne_intel.clm-FatesFireLightningPopDens BASELINE fates-sci.1.69.0_api.31.0.0-ctsm5.1.dev155: DIFF
    FAIL ERS_Lm13.f45_f45_mg37.I2000Clm50Fates.cheyenne_intel.clm-FatesColdNoComp BASELINE fates-sci.1.69.0_api.31.0.0-ctsm5.1.dev155: DIFF
    FAIL ERS_P144x1_Lm25.f10_f10_mg37.I2000Clm51Fates.cheyenne_intel.clm-FatesColdNoComp BASELINE fates-sci.1.69.0_api.31.0.0-ctsm5.1.dev155: DIFF
    FAIL SMS_Lm13.1x1_brazil.I2000Clm50FatesCruRsGs.cheyenne_intel.clm-FatesCold BASELINE fates-sci.1.69.0_api.31.0.0-ctsm5.1.dev155: DIFF
    FAIL SMS_Lm6.f45_f45_mg37.I2000Clm50FatesCruRsGs.cheyenne_intel.clm-Fates BASELINE fates-sci.1.69.0_api.31.0.0-ctsm5.1.dev155: DIFF

These appear to be associated with testmods that activate disturbances and/or are long enough to elicit changes due to fire disturbance. The differences are very small at round-off level. This makes sense given that this PR changes the disturbance code as noted in the PR description.

I'm still waiting on one test that is stuck in the queue, but that's a SatPhen testmod that should be B4B, given the above.

UPDATE: the last satphen test came through the queue with only FIELDLIST diffs as expected.

findloc is not available for the current supported compiler
versions (e.g. < nag 7.0)
The sum of the maxpatches is used to set the natpft value
in the HLMs.  Some of the companion default surface datasets
(e.g. NEON) currently assume 16 pfts for fates and as such,
having the default paramfile with more pfts would require
rebuilding many other surface datasets.
I also reordered the datestamp for the filename to YYMMDD
@glemieux
Copy link
Contributor

glemieux commented Dec 18, 2023

Regression testing the fates suite on izumi has completed. All expected tests pass with only FIELDLIST differences as expected due to the history output changes. One minor note is that I had to submit the new FatesColdLUH2 testmod twice to get the test to complete without an MPI timeout failure (similar to the one seen in ESCOMP/CTSM#1317). Note if this comes up in future nag tests, I seemed to have luck with reducing the testmod to an Ld15 test; that managed to go through fine on the first submission.

Retesting on derecho is underway.

@glemieux
Copy link
Contributor

Testing on derecho is complete and results are similar to the previous results on cheyenne with small initial DIFFs showing up for the longer testmods:

pr2079-fates-2_gnu: 9 tests
    FAIL ERS_Lm13.f10_f10_mg37.I2000Clm50Fates.derecho_gnu.clm-FatesCold BASELINE fates-sci.1.69.0_api.31.0.0-ctsm5.1.dev159: DIFF
    FAIL SMS_Lm13.1x1_brazil.I2000Clm50FatesCruRsGs.derecho_gnu.clm-FatesCold BASELINE fates-sci.1.69.0_api.31.0.0-ctsm5.1.dev159: DIFF

 
pr2079-fates-2_int: 34 tests
    FAIL ERS_Ld30.f45_f45_mg37.I2000Clm50FatesCruRsGs.derecho_intel.clm-FatesColdNoCompFixedBioGeo BASELINE fates-sci.1.69.0_api.31.0.0-ctsm5.1.dev159: DIFF
    FAIL ERS_Ld30.f45_f45_mg37.I2000Clm50FatesCruRsGs.derecho_intel.clm-FatesColdNoComp BASELINE fates-sci.1.69.0_api.31.0.0-ctsm5.1.dev159: DIFF
    FAIL ERS_Ld60.f45_f45_mg37.I2000Clm50FatesCruRsGs.derecho_intel.clm-FatesColdLogging BASELINE fates-sci.1.69.0_api.31.0.0-ctsm5.1.dev159: DIFF
    FAIL ERS_Lm12.1x1_brazil.I2000Clm50FatesCruRsGs.derecho_intel.clm-FatesFireLightningPopDens BASELINE fates-sci.1.69.0_api.31.0.0-ctsm5.1.dev159: DIFF
    FAIL ERS_Lm13.f45_f45_mg37.I2000Clm50Fates.derecho_intel.clm-FatesColdNoComp BASELINE fates-sci.1.69.0_api.31.0.0-ctsm5.1.dev159: DIFF
    FAIL ERS_P128x1_Lm25.f10_f10_mg37.I2000Clm51Fates.derecho_intel.clm-FatesColdNoComp BASELINE fates-sci.1.69.0_api.31.0.0-ctsm5.1.dev159: DIFF
    FAIL SMS_Lm13.1x1_brazil.I2000Clm50FatesCruRsGs.derecho_intel.clm-FatesCold BASELINE fates-sci.1.69.0_api.31.0.0-ctsm5.1.dev159: DIFF
    FAIL SMS_Lm6.f45_f45_mg37.I2000Clm50FatesCruRsGs.derecho_intel.clm-Fates BASELINE fates-sci.1.69.0_api.31.0.0-ctsm5.1.dev159: DIFF

All other diffs are expected FIELDLIST differences and otherwise b4b.

Derecho location: /glade/u/home/glemieux/scratch/ctsm-tests/tests_pr2079-fates-2

@glemieux glemieux merged commit 81be091 into NGEET:main Dec 19, 2023
1 check passed
peterdschwartz added a commit to E3SM-Project/E3SM that referenced this pull request Mar 5, 2024
…5760)

This pull request adds a new module, the structure of which is adopted from the dyn_subgrid code,
to enable e3sm to ingest minimally processed luh2 data to be passed to FATES.
A new namelist variable is introduced use_fates_luh, to engage the module functionality, which is off by default.
The luh2 dataset to be ingested is a minimally processed concatenation of the luh2 state, transition and management datasets.

These changes also include a minor bug fix discovered in the process of developing the code,
in which if the number of FATES patches being defined by the user in the fates parameter file
is greater than the max_patch_per_col elm variable, would result in a BalanceCheck error.

To be coordinated with NGEET/fates#1040

[nonBFB] for FATES
peterdschwartz added a commit to E3SM-Project/E3SM that referenced this pull request Mar 6, 2024
This pull request adds a new module, the structure of which is adopted from the dyn_subgrid code,
to enable e3sm to ingest minimally processed luh2 data to be passed to FATES.
A new namelist variable is introduced use_fates_luh, to engage the module functionality,
which is off by default. The luh2 dataset to be ingested is a minimally processed concatenation
of the luh2 state, transition and management datasets.

These changes also include a minor bug fix discovered in the process of developing the code,
in which if the number of FATES patches being defined by the user in the fates parameter file is greater than the max_patch_per_col elm variable, would result in a BalanceCheck error.

To be coordinated with NGEET/fates#1040

[nonBFB] for FATES
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Read in full LUH2 dataset for use by FATES Towards FATES w/ land use
7 participants