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

Update temperature cost function for symbiotic Nfix in FUN #2869

Merged
merged 12 commits into from
Dec 16, 2024

Conversation

wwieder
Copy link
Contributor

@wwieder wwieder commented Nov 7, 2024

Description of changes

Updates temperature cost function of Nfix using lab measurements from Bytnerowicz et al. (2022), see Supplementary Table 3.

Specific notes

Replaces the Houlton temperature cost function that's currently used in CNFUN.

  • requires updated parameter file with min, optimum, and max temperatures for tropical and extra-tropical PFTs. /glade/work/wwieder/modified_inputs/ctsm60_params_nfix.c241101.nc

Updated temperature function (below in blue) compared to the default temperature function from Houlton et al (orange) to calculate C costs of N fix in FUN (second figure).

image
image

Contributors other than yourself, if any:
Tom Bytnerowicz, @tbytnero, [email protected]

CTSM Issues Fixed (include github issue #):
None

Are answers expected to change (and if so in what way)?
Reduces temperate N fix and vegetation C pools. Also modifies temporal changes over historical and SSP scenarios.

Diagnostics from CRU-JRA forced runs at f19 posted here

Issue on LMWG-dev linked here
Discussion on Nfix started on LMWG-dev

Any User Interface Changes (namelist or namelist defaults changes)?
TODO add namelist option for Bytnerowicz vs. Houlton Nfix cost function

Does this create a need to change or add documentation? Did you do so?
Needs to be added to documentation, not currently done

Testing performed, if any:
Ran scientific tests in point simulations (CLM5.1 code base) and global 2 degree spinup, historical and SSP2-4.5 case.

@wwieder wwieder added enhancement new capability or improved behavior of existing capability science Enhancement to or bug impacting science labels Nov 7, 2024
@linniahawkins
Copy link

Given that the new temperature cost function will be included in the ctsm6 release, we will need to re-run the One-at-a-time parameter ensemble. To do so, we will need a tag that is greater than ctsm5.3.010 with this new cost function added.

We will also need a parameter file that is compatible with ctsm5.3.010 (ctsm60_params.c241017.nc) and adds the three new parameters from this function.

I'll also need a restart from the 2-degree spinup Will already ran.

@wwieder
Copy link
Contributor Author

wwieder commented Nov 15, 2024

@linniahawkins and @ekluzek I've:

  • Removed unnecessary usermods from this PR
  • Updated to the latest dev tag, 012.
  • Added new parameters for Tom's nfix function to the default parameter file ctsm60_params.c241017.nc. This can be used / seen here paramfile = '/glade/work/wwieder/modified_inputs/ctsm60_params.c241114.nc'
  • Created, built, & ran a case to test that things still work /glade/work/wwieder/ctsm5.3.0/ctsm5.3.012_f19_nfix_test
  • Initial condition files for f19 are here
finidat = '/glade/derecho/scratch/wwieder/archive/ctsm530_f19_nfix_pSASU/rest/0161-01-01-00000/ctsm530_f19_nfix_pSASU.clm2.r.0161-01-01-00000.nc'

Next steps would be to:

  1. Erik creates a branch tag for Linnia
  • Will / @olyson checks 1850 survivability in the default f19_PPE case and the f19_nfix cases
  1. Will / Erik adds a namelist option for the nfix_temperature_method = 1 (Houlton function from CLM5)
  2. Bring PR onto b4b-dev
  3. Answer changing tag to master, setting nfix_temperature_method =2 (Tom's function)

Let me know what you think of this plan and what I've missed.

@wwieder
Copy link
Contributor Author

wwieder commented Nov 15, 2024

Doesn't seem like the NFIX changes make a big impact on arctic survival. Dead grids (max ELAI < 0.1) for PPE and NFix cases are on the left and center. max LAIs from the PPE where Nfix case is dead are on the right.

image

@ekluzek ekluzek added this to the cesm3_0_beta06 milestone Nov 19, 2024
@ekluzek ekluzek self-assigned this Nov 19, 2024
…nd update ctsm60 file so that it is based on the previous one with the nfix fields just added to the end
@ekluzek
Copy link
Collaborator

ekluzek commented Nov 20, 2024

Testing on Derecho and Izumi are as expected other than the following which fail, because they need update parameter files

ERS_Ld3.f10_f10_mg37.I2000Clm60Bgc.derecho_intel.clm-ciso_cwd_hr (RUN)
ERS_Ld3.f10_f10_mg37.I2000Clm60Bgc.derecho_intel.clm-ciso_cwd_hr--clm-matrixcnOn (RUN)
SMS_Lm1.f10_f10_mg37.I1850Clm60Bgc.derecho_intel.clm-clm60_monthly_matrixcn_soilCN30 (RUN)

@ekluzek
Copy link
Collaborator

ekluzek commented Nov 20, 2024

Branch tag made: branch_tags/BNF_v2.n01_ctsm5.3.012

src/biogeochem/CNFUNMod.F90 Outdated Show resolved Hide resolved
@wwieder
Copy link
Contributor Author

wwieder commented Dec 5, 2024

@slevis-lmwg can you help add a namelist flag that controls the Houlton or Bytnerowicz function? Initially it should default to Houlton and be merged on b4b-dev.

@slevis-lmwg slevis-lmwg self-assigned this Dec 5, 2024
@slevis-lmwg
Copy link
Contributor

slevis-lmwg commented Dec 6, 2024

I have checked out this branch to work on the namelist flag:
git describe returns branch_tags/BNF_v2.n01_ctsm5.3.012

Current plan:
Use other "method" flags as template(s), e.g.
soil_decomp_method, snow_thermal_cond_method, z0param_method, snow_cover_fraction_method, and others...
UPDATE: I mostly used snow_thermal_cond_method as a template.

@slevis-lmwg slevis-lmwg changed the base branch from master to b4b-dev December 6, 2024 17:44
@slevis-lmwg
Copy link
Contributor

Testing code mods with
./create_test ERP_D_P64x2_Ld3.f10_f10_mg37.I2000Clm50BgcCru.derecho_intel.clm-flexCN_FUN -c /glade/campaign/cgd/tss/ctsm_baselines/ctsm5.3.013
PASS Houlton as the default: b4b identical to 013
EXPECTED FAIL Misspell Bitnerovich in user_nl_clm: graceful fail
PASS Bytnerowicz in user_nl_clm: expected fail with diff from baseline and (expected?) fail COMPARE_base_rest

@slevis-lmwg
Copy link
Contributor

@wwieder my code mods are pushed and ready for your review.

I could not assign you the review because you own the PR :-)

Copy link
Contributor Author

@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.

Thanks for adding in the namelist controls, @slevis-lmwg. I'm assuming it will be straightforward for CLM5 physics to default to Houlton and CLM6 physics to default to Tom's function once we have it turned on?

@slevis-lmwg
Copy link
Contributor

Thanks for adding in the namelist controls, @slevis-lmwg. I'm assuming it will be straightforward for CLM5 physics to default to Houlton and CLM6 physics to default to Tom's function once we have it turned on?

Currently it always defaults to Houlton but, yes, later we can change namelist_defaults_ctsm.xml to

<nfix_method>Houlton</nfix_method>
<nfix_method phys="clm6_0">Bytnerowicz</nfix_method>

@slevis-lmwg
Copy link
Contributor

slevis-lmwg commented Dec 9, 2024

Bytnerowicz in user_nl_clm: expected fail with diff from baseline and (expected?) fail COMPARE_base_rest

I want to follow up regarding the COMPARE_base_rest failure above by

  1. rerunning the 'Bytnerowicz' test to generate new baseline
    ./create_test ERP_D_P64x2_Ld3.f10_f10_mg37.I2000Clm50BgcCru.derecho_intel.clm-flexCN_FUN -c /glade/campaign/cgd/tss/ctsm_baselines/ctsm5.3.013 -g /glade/campaign/cgd/tss/ctsm_baselines/ctsm5.3.013_BNF_v2

  2. rerunning again to compare to the new baseline: do I get the same failure?
    ./create_test ERP_D_P64x2_Ld3.f10_f10_mg37.I2000Clm50BgcCru.derecho_intel.clm-flexCN_FUN -c /glade/campaign/cgd/tss/ctsm_baselines/ctsm5.3.013_BNF_v2

@slevis-lmwg
Copy link
Contributor

@wwieder I still get the COMPARE_base_rest failure in my follow-up test above. The Bytnerowicz method may need a new variable sent to restart to give b4b restarts. We can discuss and/or I could try to resolve this before we discuss.

@slevis-lmwg
Copy link
Contributor

@wwieder I may have been quick to conclude that there was a problem. I now see that my "case2run" in the test used "Houlton" even though the base case used "Bytnerowicz" so I need to revisit my testing approach.

@slevis-lmwg
Copy link
Contributor

Ok, I just had to temporarily hardwire Bytnerowicz as the default and the COMPARE_base_rest test passed, so we're good.

@slevis-lmwg slevis-lmwg marked this pull request as ready for review December 10, 2024 01:50
@slevis-lmwg slevis-lmwg merged commit 2db5c6a into ESCOMP:b4b-dev Dec 16, 2024
2 checks passed
@slevis-lmwg slevis-lmwg deleted the BNF_v2 branch December 16, 2024 19:02
@slevis-lmwg
Copy link
Contributor

This comment suggests that I will likely need to open an issue/PR to debug some aspect of the code that was introduced here.

@ekluzek ekluzek removed their assignment Jan 7, 2025
slevis-lmwg added a commit to slevis-lmwg/ctsm that referenced this pull request Jan 9, 2025
Merge tmp-241219 branch to master

Includes three tmp-241219 tags:

tmp-241219.n01.ctsm5.3.016 Merge b4b-dev:
nfix_method options Houlton (default), Bytnerowicz (option)
tmp-241219.n02.ctsm5.3.016 FATES hydro test update
tmp-241219.n03.ctsm5.3.016 Bug fix for izumi nag tests to pass (b4b unless using Bytnerowicz)

Fixes ESCOMP#2924 Fix problem with izumi nag tests
Fixes ESCOMP#2878 Remove fates_allom_smode shell_command update in FatesColdHydro testmod
Fixes ESCOMP#2869 Update temperature cost function for symbiotic nfix in FUN

Changes answers as documented in the ChangeLog.

slevis resolved conflicts:
doc/ChangeLog
doc/ChangeSum
ekluzek added a commit to ekluzek/CTSM that referenced this pull request Jan 13, 2025
Merge tmp-241219 branch to master

Includes three tmp-241219 tags:

tmp-241219.n01.ctsm5.3.016 Merge b4b-dev:
nfix_method options Houlton (default), Bytnerowicz (option)
tmp-241219.n02.ctsm5.3.016 FATES hydro test update
tmp-241219.n03.ctsm5.3.016 Bug fix for izumi nag tests to pass (b4b unless using Bytnerowicz)

Fixes ESCOMP#2924 Fix problem with izumi nag tests
Fixes ESCOMP#2878 Remove fates_allom_smode shell_command update in FatesColdHydro testmod
Fixes ESCOMP#2869 Update temperature cost function for symbiotic nfix in FUN

Changes answers as documented in the ChangeLog.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement new capability or improved behavior of existing capability science Enhancement to or bug impacting science
Projects
Status: Done (non release/external)
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants