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

Merge master 2024 0725 #2662

Merged
merged 246 commits into from
Jul 25, 2024
Merged

Conversation

adrifoster
Copy link
Collaborator

Merging in latest master

ekluzek and others added 30 commits May 27, 2022 09:25
This is a small changeset, which only adds the passing of a text based flag to FATES, that defines which soil decomposition method is active. This setting is needed by FATES, so that it can pass specific boundary conditions to CLM (and potentially ELM in the future). This change was necessitated because MIMICS requires a Nitrogen to lignin-carbon ratio in the litter flux, yet other decomposition schemes do not. Moreover, the generation of this boundary condition is not trivial, so it is worth it to avoid its computation if mimics is not on.  This change should have NO impact on any tests.

slevis resolved conflicts:
cime_config/testdefs/ExpectedTestFails.xml
cime_config/testdefs/testlist_clm.xml
src/biogeochem/CNPhenologyMod.F90
Refactor NutrientCompetition / CNAllocation to provide hooks for AgSys

Major refactor of NutrientCompetition / CNAllocation to provide hooks
for AgSys crop model: separates the NutrientCompetition modules into
pieces based on (1) consolidating duplicate code between the Clm45 and
FlexibleCN versions, and (2) separating pieces that will vs. won't be
used for crop patches when running with the upcoming AgSys crop model.

I have restored the old CNAllocationMod, with some of the
responsibilities that it used to have. (I'm not sure it's appropriate to
have the calculation of gpp and maint resp in CNAllocationMod, but I
left it there because it has always been combined with the allocation
code, including back when we had a separate CNAllocationMod.)

slevis resolved conflicts:
src/biogeochem/CNDriverMod.F90
src/biogeochem/NutrientCompetitionFlexibleCNMod.F90
src/biogeochem/NutrientCompetitionCLM45defaultMod.F90

slevis important note:
To resolve conflicts in the third (ie, last) of the above files, I
checked with Will Wieder, and we agreed to not maintain a clm45
version of matrixcn.
Get FATES and carbon_only test-suite tests to pass with MIMICS active

To pass with MIMICS active, FATES and carbon_only tests need calculations of:
ligninNratioAvg and annsum_npp_col, both currently declared and calculated in CNVegCarbonFluxType.F90.

ligninNratioAvg is a function of leafc_to_litter_patch, frootc_to_litter_patch, soilbiogeochem_cwdc_col, soilbiogeochem_cwdn_col, soilbiogeochem_decomp_cascade_ctransfer_col.

I got both FATES and carbon_only tests to pass by declaring local copies (in MIMICS) of ligninNratioAvg and annsum_npp_col.

slevis resolved conflicts:
src/biogeochem/CNVegCarbonFluxType.F90
src/soilbiogeochem/SoilBiogeochemCarbonFluxType.F90
First pass at getting fates-sp mode to run without soil BGC

Bring in externals updates that include adding AWS as a supported machine.

Add a FatesSP compset and user-mod directory.

Turn soil-BGC off when running FatesSP. Replace PGI tests on izumi with nvhpc tests on cheyenne.
Fix an issue with a particular gnu compiler version in ch4Mod.F90 in DEBUG mode. Add some more
threading tests for Fates. Start adding a prescribed-LAI tests for FatesSp

Add a file to setup a python environment in conda for the python testing. Set line length for black
to same as pylint (100). Add some extra excludes for black to the pylint checking.

Paths for CIME python code was changed, which required changes to some CTSM python code.

slevis resolved conflicts:
cime_config/testdefs/ExpectedTestFails.xml
cime_config/testdefs/testlist_clm.xml
src/biogeochem/CNCStateUpdate1Mod.F90
Update cime to fix DAE issue
modify_neon issue
When FatesSp is on, make soil_decomp None by default

slevis resolved conflicts:
cime_config/testdefs/ExpectedTestFails.xml
This set of changes 1) allows FATES to dictate the number of patches on the naturaly vegetated land unit and 2) is compatible with a version of FATES that updates the parameter file format (changes in parameter naming and parameter set).  Efforts were made to adhere to the system of how patches are looped and loop bounds are defined. There is interaction with the reading of the surface file, which previously dictated all patch counts based on the number of PFTs in the file.  FATES-SP and biogeography preserves the ability to use surface file weighting factors associated with PFTs and CFTs to drive area fractions in FATES.  This change is motivated by FATES-side updates to the parameter file, which includes new settings where the user can control the number of primary "fates_maxpatch_primary" and secondary "fates_maxpatch_secondary" patches. Users should also be aware of a new namelist setting "use_fates_tree_damage" which defaults to false (inoperative).

slevis resolved conflicts:
bld/unit_testers/build-namelist_test.pl
First Commit of CN Matrix Solution:
Start bringing in the use_matrixcn and use_soil_matrixcn control options for the Carbon/Nitrogen BGC model using
the matrix solution methodology developed by Dr. Yiqi Luo and his EcoLab members: Drs. Xingjie Lu,
Yuanyuan Huang and Zhengguang Du, at Northern Arizona University

Work on Anomaly forcing for SSEP scenarios:
Do some work on anomoly forcing for SSP scenarios. Update the script in tools/contrib to work with the latest
data and replicate results of Keith Oleson and Sean Swenson. Add some test cases for it.

Python Environment Management using Conda:
More work on the manage_python_env script to setup the "ctsm_py" conda environment. This now works for UCAR machines
(such as cheyenne and casper) as well as CGD machines (like izumi). This script can also be called for tools, and
the test tools mechanism is now using it rather than ncar_pylib.

./manage_python_env

SCAM Fix:
Add checkimport method for CMEPS so that single-column case can work with SCAM, from Jim Edwards.

Black Formatter for Python Code:
Run "black" python code reformatter on all code under the "python" directory. Add the commits
to .git-blame-ignore-revs so they can be ignored when "git blame" is used, if you add this
to each clone where you want this to apply:

   git config blame.ignoreRevsFile .git-blame-ignore-revs

You can do it for your worktrees, but since the file only applies to CTSM for ctsm5.1.dev100 and
forward, you'll need to do it for each CTSM clone seperately. Also there is now a github action
that checks that python code under the "python" subdirectory is black clean. If it's not the action
will fail and send you an email about it.

Make Map Data Fix:
Simple fix from Sam Rabin.

Fix for DISPLA on History Output:
Fix from Keith Oleson to set history output for DISPLA (displa_patch) to zero when vegetation is buried by snow.

slevis resolved conflicts:
bld/CLMBuildNamelist.pm
bld/namelist_files/namelist_defaults_ctsm.xml
bld/unit_testers/build-namelist_test.pl
cime_config/testdefs/testlist_clm.xml
src/biogeochem/CNAllocationMod.F90
src/biogeochem/CNCStateUpdate1Mod.F90
src/biogeochem/CNDriverMod.F90
src/biogeochem/CNNStateUpdate1Mod.F90
src/biogeochem/CNPhenologyMod.F90
src/biogeochem/CNVegCarbonFluxType.F90
src/biogeochem/NutrientCompetitionCLM45defaultMod.F90
src/biogeochem/NutrientCompetitionFlexibleCNMod.F90
src/soilbiogeochem/SoilBiogeochemCarbonFluxType.F90

slevis had to restore many other files for which git replaced the
matrixcn mods with dev100's matrixcn stubs.

slevis is testing the code with
SMS_Ln9.ne30pg2_ne30pg2_mg17.I2000Clm50BgcCrop.cheyenne_intel.clm-clm50cam6LndTuningMode
and getting a column cbalance error at the moment.
Use conda environment rather than ncar_pylib with the fsurdat_modifier system test

Reason: ncar_pylib is going away soon.

slevis resolved conflicts:
bld/unit_testers/build-namelist_test.pl
cime_config/testdefs/testlist_clm.xml
src/soilbiogeochem/SoilBiogeochemCarbonStateType.F90
 Get gross unrepresented land use transitions working in CLM5.1. This is additional optional
 data added to the landuse.timeseries files for transient simulations. The current landuse.timseries
 files have this data, but it's set to zero. This data will be part of the CTSM5.2 surface dataset
 (that is upcoming) and be on by default for clm5_3 physics.

slevis resolved conflict:
bld/unit_testers/build-namelist_test.pl
FATES API update to facilitate fates refactor

This updates a number of FATES type names and module use statements
which correspond with a refactoring effort that moves FATES
patches and cohorts into their own respective modules.

With the FATES update is a minor science update, so there are
changes to answers for FATES.

This also incorporates a minor update to a more recent version
of the ccs config external.

slevis resolved conflicts:
bld/unit_testers/build-namelist_test.pl
cime_config/buildnml
src/biogeochem/CNVegCarbonFluxType.F90
Migration of FATES to share normal soil BGC call sequence and functionality

This set of changes enables the normal soil biogeochemistry that is used for CN, to be used
for FATES as well. FATES had been using a simplified subset of soil biogeochemistry in its
own module. This change required coordination of litter flux and methane boundary conditions
from FATES to CLM.  CNVEG datastructures were given trivial allocation (of size one on index
zero) to prevent inappropriate use of CNVEG datastructures while FATES is active. Note that
now the carbon balance checking for the soil is now active when FATES is active. Various
accomodations have also been put in place to enable nitrogen cycling between the two models.

slevis resolved conflicts:
bld/unit_testers/build-namelist_test.pl
src/biogeochem/CNCStateUpdate1Mod.F90
src/biogeochem/CNDriverMod.F90
src/biogeochem/CNVegCarbonStateType.F90
src/biogeochem/CNVegNitrogenStateType.F90
src/biogeochem/CNVegetationFacade.F90
src/soilbiogeochem/SoilBiogeochemCarbonFluxType.F90
src/soilbiogeochem/SoilBiogeochemLittVertTranspMod.F90
src/soilbiogeochem/SoilBiogeochemNStateUpdate1Mod.F90
src/soilbiogeochem/SoilBiogeochemNitrogenFluxType.F90
src/soilbiogeochem/SoilBiogeochemNitrogenStateType.F90
because I updated 2 local copies of cn-matrix_v3 at the same time
Used this one for testing:
SMS_D.1x1_brazil.I1850Clm51BgcCrop.cheyenne_gnu.clm-mimics_matrixcn
Various BFB fixes and updates

Purpose/description of changes
------------------------------
the default comes in a later tag (slevis)

Regular and python testing passed.

Does not change answers relative to dev158.

slevis resolved conflicts UNTESTED:
bld/unit_testers/build-namelist_test.pl
cime_config/testdefs/testlist_clm.xml
src/biogeochem/CNPhenologyMod.F90
src/biogeochem/CNVegNitrogenFluxType.F90
src/biogeochem/NutrientCompetitionFlexibleCNMod.F90
AND I will still look for potential additional inconsistencies that I
may need to resolve
because I updated 2 parallel local copies of cn-matrix_v3
slevis-lmwg and others added 27 commits July 15, 2024 14:02
This matches the corresponding fates tag that also impliments
using this file
…tracer_test_v2

Relax tolerance for truncating small snocan values in CanopyFluxes
Relax tolerance for truncating small snocan values in CanopyFluxes

See the PR ESCOMP#2457 for details.
Relax tolerance for truncating small snocan values in CanopyFluxes

See the PR ESCOMP#2457 for details.
FATES land use v2 API update (CTSM-side)
slevis resolved conflicts:
bld/unit_testers/build-namelist_test.pl
use_matrixcn and use_soil_matrixcn are coming in as default .false.
ERS_D.f19_g17.I1850Clm50BgcCrop.izumi_nag.clm-ciso_monthly_matrixcn_spinup
failed during the build because a namelist variable needed renaming
Update submodule tags to pass runoff from CISM to ROF as per issue ESCOMP#2590
Update submodule tags to pass runoff from cism to rof

- Update MOSART, CMEPS, and CISM so CISM runoff goes to ROF rather than CTSM
- Update RTM with fix needed for Paleo LGM work

Contributors:
@mvertens, @jedwards4b, @billsacks, @Katetc, @ekluzek, @slevis-lmwg

 Fixes ESCOMP#2590 Update CMEPS/MOSART/CISM/RTM tags
 Fixes ESCOMP/RTM#50 Likely wrong RTM river flux to MOM6 within cesm2_3_beta17

 Differences in namelist 'mosart_inparm':
  missing variable: 'do_rtmflood'
  missing variable: 'finidat_rtm'
  missing variable: 'frivinp_rtm'
  missing variable: 'rtmhist_fexcl1'
  missing variable: 'rtmhist_fexcl2'
  missing variable: 'rtmhist_fexcl3'
  missing variable: 'rtmhist_fincl1'
  missing variable: 'rtmhist_fincl2'
  missing variable: 'rtmhist_fincl3'
  missing variable: 'rtmhist_mfilt'
  missing variable: 'rtmhist_ndens'
  missing variable: 'rtmhist_nhtfrq'
  found extra variable: 'budget_frq'
  found extra variable: 'fexcl1'
  found extra variable: 'fexcl2'
  found extra variable: 'fexcl3'
  found extra variable: 'fincl1'
  found extra variable: 'fincl2'
  found extra variable: 'fincl3'
  found extra variable: 'finidat'
  found extra variable: 'frivinp'
  found extra variable: 'mfilt'
  found extra variable: 'mosart_euler_calc'
  found extra variable: 'mosart_tracers'
  found extra variable: 'ndens'
  found extra variable: 'nhtfrq'
  found extra variable: 'use_halo_option'

Changes answers
- what code configurations: mosart and rtm
- what platforms/compilers: all
- nature of change: mosart roundoff; rtm larger than roundoff due to bug fix; the latter also affects bgc variables

 We are ignoring strange diffs from baseline in two tests in variable
 FATES_TRANSITION_MATRIX_LULU as explained in issue ESCOMP#2656.
Copy link
Contributor

@slevis-lmwg slevis-lmwg left a comment

Choose a reason for hiding this comment

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

This catches up b4b-dev to master and, therefore, does not need testing.

@adrifoster adrifoster merged commit 51067b0 into ESCOMP:b4b-dev Jul 25, 2024
3 checks passed
@adrifoster adrifoster deleted the merge-master-2024-0725 branch September 24, 2024 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants