Skip to content

Conversation

@ekluzek
Copy link
Collaborator

@ekluzek ekluzek commented Aug 30, 2025

Description of changes

Start bringing in updates for the CMIP7 Carbon isoptope data.

Specific notes

Contributors other than yourself, if any: @slevis-lmwg

CTSM Issues Fixed (include github issue #):
Work on #3346
Fixes #3528

Are answers expected to change (and if so in what way)? When it's turned on

Any User Interface Changes (namelist or namelist defaults changes)? Default for C13/C14 data will be updated

Does this create a need to change or add documentation? Did you do so? No No

Testing performed, if any: None yet

Definition of Done:

  • Change units of time expected on file from years to days
  • Handle the opposite direction that the latitude sectors are for CMIP6 and CMIP7
  • Do enough testing of a hardcoded version to CMIP7 that science experiements can run
  • Make a branch tag of it for those purposes
  • Fix the latitude problem Preliminary CMIP7 C14 Carbon isotope dataset is upside down! #3528

@ekluzek ekluzek self-assigned this Aug 30, 2025
@ekluzek ekluzek added the science Enhancement to or bug impacting science label Aug 30, 2025
@ekluzek
Copy link
Collaborator Author

ekluzek commented Sep 1, 2025

Note, NEON/PLUMBER2 cases use a SSP scenario, which means they will point to CMIP6 isotope data. We'll have to do some reworking for them to point to the CMIP7 datasets.

@ekluzek
Copy link
Collaborator Author

ekluzek commented Sep 2, 2025

Not fully tested, but seems to have the minimum required to get this to work now.

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.

Thank you @ekluzek

  1. I see your point, we may not need to preprocess the c13 and c14 files, which is good I think. But we may want to add a comment stating that the new code is not backwards compatible with CMIP6.
  2. I looked at your code changes. In this review I expressed a couple of concerns based on my inspection of the files. Let me know if you want to follow up.

@ekluzek
Copy link
Collaborator Author

ekluzek commented Sep 16, 2025

I realized there's another part where it's hardcoded to the old dataset. Here in PhotosynthesisMod

               ! determine latitute sector for radiocarbon bomb spike inputs
               if ( grc%latdeg(g) .ge. 30._r8 ) then
                  sector_c14 = 1
               else if ( grc%latdeg(g) .ge. -30._r8 ) then            
                  sector_c14 = 2
               else
                  sector_c14 = 3
               endif

So that needs to be handled.

@ekluzek
Copy link
Collaborator Author

ekluzek commented Sep 16, 2025

The history variables for this are default off, but are: RC14_CANAIR, RC13_CANAIR

@ekluzek
Copy link
Collaborator Author

ekluzek commented Sep 16, 2025

OK, and it looks like RC14_CANAIR needs to be added as a history output variable.

@ekluzek
Copy link
Collaborator Author

ekluzek commented Sep 18, 2025

Here's a conversion to Delta using ncap2, I'm trying out:

 ncap2 -s 'c14ratio = 1.e-12' -s 'PDB = 0.0112372' -s 'preind_atm_del13c = -6.' \
-s 'preind_atm_ratio = PDB + (preind_atm_del13c * PDB)/1000.0' -s 'c13ratio = preind_atm_ratio/(1.0+preind_atm_ratio)' \
-s 'Deltac13 = (RC13_CANAIR/PDB - 1.0)/1.0e-3' -s 'Deltac14 = (RC14_CANAIR/c14ratio - 1.0)/1.0e-3'  infile.nc outfile.nc

@ekluzek
Copy link
Collaborator Author

ekluzek commented Sep 18, 2025

Results are looking good so far. But, I'm running a test for a few years to make sure time is correct.

@ekluzek
Copy link
Collaborator Author

ekluzek commented Sep 22, 2025

Ok. It looks like there's something wrong with the time interpolation. So I'm looking into this more.

@ekluzek
Copy link
Collaborator Author

ekluzek commented Sep 23, 2025

I added some logging for time, and saw there were problems with both c13 and c14 time. So I've modified it so that the time is in units of CE year, and can then be directly compared to dateyear for the current time. This should resolve the issues with time. Running a test for this now.

@wwieder
Copy link
Contributor

wwieder commented Sep 23, 2025

Thanks for working on this and providing updates, Erik.

…and compare to dateyear in the logging and correct it so that it's picking the right time for both c13 and c14, the time interpolation isn't working quite right as it's almost a step function, but it is getting the right times from the data files
@ekluzek
Copy link
Collaborator Author

ekluzek commented Sep 23, 2025

Tag to make:
branch_tags/CMIP7_ciso.n01.alpha-ctsm5.4.CMIP7.11.ctsm5.3.075

@wwieder
Copy link
Contributor

wwieder commented Sep 23, 2025

I'm spinning this up in an ne30 bgc-crop test. If we're OK with how these results look, I suggest we don't worry about maintaining the flexibility of using CMIP6 vs. CMIP7 datasets for carbon isotopes.

Other input data are easier to maintain with streams files (e.g., #3471 to switch between CMIP6 and CMIP7 data), but given the brittle nature of how we handle C isotopes I suggest we only support CMIP7 13C and 14C datasets moving forward. It's not not worth the overhead costs of maintaining code to ingest both files at this point. Happy to have further discussion on this if it's helpful.

@ekluzek ekluzek changed the title [WIP] Update Carbon isotope data to CMIP7 Update Carbon isotope data to CMIP7 Oct 7, 2025
@ekluzek ekluzek linked an issue Oct 7, 2025 that may be closed by this pull request
17 tasks
@github-project-automation github-project-automation bot moved this to Ready to start (or start again) in CTSM: Upcoming tags Oct 7, 2025
@ekluzek ekluzek moved this from Ready to start (or start again) to In progress - release/externals / MOSART / RTM / mizu etc. tags in CTSM: Upcoming tags Oct 7, 2025
@ekluzek ekluzek moved this from Todo to In Progress in LMWG: Sprint Planning Board Oct 7, 2025
@ekluzek ekluzek marked this pull request as ready for review October 10, 2025 17:49
@ekluzek
Copy link
Collaborator Author

ekluzek commented Oct 10, 2025

@slevis-lmwg and I went over this, and I'll bring this into the ctsm5.4 alpha branch largely as is at this point, even though it has problems. It's already been used to run simulations so we want to preserve that version. And the work to do this with streams should be an independent PR.

@ekluzek ekluzek linked an issue Oct 10, 2025 that may be closed by this pull request
@ekluzek ekluzek requested a review from slevis-lmwg October 10, 2025 21:48
@ekluzek ekluzek moved this from Status not assigned to In progress in CTSM: realease-ctsm5.4 minor version update (CMIP7 datasets) Oct 10, 2025
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.

Ok, not spending too much time here, since the code has been tested, and we are aware of problems if I am not mistaken.

I am approving with Erik's idea in mind that we keep a record of this code because it was used in specific simulations. However, I want to also introduce another idea: What if we revert entirely back to the cmip6 code here? Doing so allows backwards compatibility with the cmip6 isotope data, now that we are proceeding with streams for cmip7.

@github-project-automation github-project-automation bot moved this from In progress - release/externals / MOSART / RTM / mizu etc. tags to In progress - master in CTSM: Upcoming tags Oct 10, 2025
@ekluzek ekluzek moved this from In progress - master to In progress - release/externals / MOSART / RTM / mizu etc. tags in CTSM: Upcoming tags Oct 13, 2025
@ekluzek
Copy link
Collaborator Author

ekluzek commented Oct 13, 2025

A new problem I realized was that we have CMIP6 SSP datasets, which don't work in this setup. The way forward we decided on is to turn Carbon isotopes off for SSP scenarios even for clm6_0. And we might as well turn carbon isotopes off for some compsets such as single point cases.

I'm going to make a tag of this branch, and then close without merging once we have the streams way forward up and working.

@ekluzek
Copy link
Collaborator Author

ekluzek commented Oct 13, 2025

I tagged the fixed version as branch_tags/CMIP7_ciso.n02.alpha-ctsm5.4.CMIP7.11.ctsm5.3.075, so the fix is preserved in a tag in case we need it. This will also allow us to compare the new answer with streams to this version to validate the streams method.

@ekluzek ekluzek marked this pull request as draft October 13, 2025 18:11
@ekluzek ekluzek moved this from In Progress to Done in LMWG: Sprint Planning Board Oct 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

science Enhancement to or bug impacting science

Projects

Status: In progress - release/externals / MOSART / RTM / mizu etc. tags
Status: Done

Development

Successfully merging this pull request may close these issues.

C Isotope data for CMIP7 for clm6_0 physics Preliminary CMIP7 C14 Carbon isotope dataset is upside down!

3 participants