Skip to content

Conversation

@ekluzek
Copy link
Collaborator

@ekluzek ekluzek commented Oct 21, 2025

Description of changes

Bring in the capability to read in Carbon isotopes in streams. There will be other changes to fully flesh this out. And a version that allows it to be turned on instead of the current file method. The final thing will be a tag on master to change the default to only using streams. And then on b4b-dev we can remove the old version.

Specific notes

Contributors other than yourself, if any:

CTSM Issues Fixed (include github issue #):

Design notes in #3546
Fixes #3544
Fixes #3502
Work on #3346

Are answers expected to change (and if so in what way)? No

Any User Interface Changes (namelist or namelist defaults changes)? Yes
New namelist options for stream handling will come in:

  • stream_fldfilename_atm_c14
  • stream_meshfile_atm_c14
  • stream_year_first_atm_c14
  • stream_year_last_atm_c14
  • stream_fldfilename_atm_c13
  • stream_year_first_atm_c13
  • stream_year_last_atm_c13

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

Testing performed, if any: Single case testing so far, will run aux_clm
Currently just running an SMS test: SMS_D_Ld3.f10_f10_mt232.IHistClm60BgcCropCrujra.derecho_intel.clm-clm60cam7LndTuningMode
Will transition to the 3-year test starting in Dec/2013 used previously

@ekluzek ekluzek added this to the cesm3_0_beta08 milestone Oct 21, 2025
@ekluzek ekluzek requested a review from slevis-lmwg October 21, 2025 21:52
@ekluzek ekluzek self-assigned this Oct 21, 2025
@ekluzek ekluzek added the enhancement new capability or improved behavior of existing capability label Oct 21, 2025
@ekluzek ekluzek added priority: high High priority to fix/merge soon, e.g., because it is a problem in important configurations code health improving internal code structure to make easier to maintain (sustainability) bfb bit-for-bit science Enhancement to or bug impacting science usability Improve or clarify user-facing options labels Oct 21, 2025
@github-project-automation github-project-automation bot moved this to Ready to start (or start again) in CTSM: Upcoming tags Oct 21, 2025
…e method a bit, so that varnames and name aren't sent in, also have to make sdat public, so that the dshr_fldbun_getFldPtr method can use it's internal components
…ilename was incorrect as well as a typo for C13 in the Advance and Interp routines
@ekluzek
Copy link
Collaborator Author

ekluzek commented Oct 22, 2025

The read is working now, so it needs more testing to ensure it's correct as well as review and some further updates we'll figure out in the reveiw.

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.

@ekluzek and I discussed aspects of this PR in detail and Erik posted notes that need to be resolved. Meanwhile though I will approve the PR to avoid delaying the merge to b4b-dev later.

@github-project-automation github-project-automation bot moved this from Ready to start (or start again) to In progress - master in CTSM: Upcoming tags Oct 22, 2025
@samsrabin samsrabin moved this from In progress - master to In progress - b4b-dev in CTSM: Upcoming tags Oct 23, 2025
@ekluzek ekluzek moved this from Todo to In Progress in LMWG: Sprint Planning Board Oct 28, 2025
@@ -0,0 +1,178 @@
module CTSMForce2DStreamBaseType

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@slevis-lmwg and I went over the basic name and it makes sense to both of us.

I will need to add comments and descriptions, now that the code is working and we think the names are OK.

type, abstract, public :: ctsm_force_2DStream_base_type
private
type(shr_strdata_type), public :: sdat ! Stream data type
character(len=FL) :: stream_filename ! The stream data filename (also in sdat)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Do I really need these here? Can I use the data in sdat?

real(r8), pointer :: dataptr1d(:)
integer :: rc ! error return code

! Get pointer for stream data that is time and spatially interpolated to model time and grid
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This bit about getting the pointer to data could be put in the base type.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I figured out what to do here in #3566 the data can be directly accessed from here.

@@ -0,0 +1,193 @@
module AtmCarbonIsotopeStreamType
use shr_kind_mod , only : r8 => shr_kind_r8
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Need to add notes and descriptions and general comments, now that the general structure is approved.

real(r8), allocatable, private :: atm_delta_c13(:) ! Delta C13 data
real(r8), parameter :: time_axis_offset = 1850.0_r8 ! Offset in years of time on file

! Private data for the control namelist:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This needs to become an actual namelist and added to namelist defaults all the things.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

At least the filenames need to be done this way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bfb bit-for-bit code health improving internal code structure to make easier to maintain (sustainability) enhancement new capability or improved behavior of existing capability priority: high High priority to fix/merge soon, e.g., because it is a problem in important configurations science Enhancement to or bug impacting science usability Improve or clarify user-facing options

Projects

Status: In progress - b4b-dev
Status: In Progress

Development

Successfully merging this pull request may close these issues.

2 participants