Skip to content

Add a script to create Aerosol monthly climatology from CPLHIST daily data to use for CESM3/CMIP7 1850 simulations - #4257

Merged
ekluzek merged 40 commits into
ESCOMP:b4b-devfrom
ekluzek:aero_daily_to_monthly_clim_script
Oct 28, 2026
Merged

ekluzek merged 40 commits into
ESCOMP:b4b-devfrom
ekluzek:aero_daily_to_monthly_clim_script

Conversation

@ekluzek

@ekluzek ekluzek commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Description of changes

Add a script to handle creating aerosol monthly climatology from daily CPLHIST data.

The climatology script will be adapted in the future to work with historical and future scenarios, as well as doing an ensemble average over multiple CESM simulations. For historical, there were 5 year averages done, with a linear interpolation between those for each year. Adding the bit about ensemble average will be straight-forward, but perhaps a running average should be done, rather than fixed five year bins? I looked at the existing code that @olyson and @tilmes had, both of which were NCL, so need to be replaced and neither quite did what was needed. Since, this will be adapted in the future using LDF climatology isn't quite right either.

Specific notes

Contributors other than yourself, if any:

CTSM issues resolved or otherwise addressed, if any:

If answers are expected to change, describe (delete this line otherwise): No

Any user interface changes (namelist or namelist defaults changes)? No

Testing planned or performed, if any:

  • python testing

Requirements before merge:

  • The code in this PR branch builds with no errors.
  • The code in this PR branch runs with no errors. Briefly describe tested configuration(s):
  • This either (a) does not change answers, (b) it only changes answers at roundoff level, or (c) I have performed a scientific evaluation of the answer changes. Which?: a
  • I have reviewed relevant parts of the CLM documentation Tech Note or User's Guide to determine if anything needs to be changed or added. If it does, describe:
  • This PR either (a) does not create a need to update the documentation or (b) includes required documentation updates (see guidelines for contributing documentation). Which?: a

ekluzek and others added 22 commits October 14, 2026 00:08
…get a monthly climatology of daily CPLHIST data for aerosols
…neral changes from looking at our other bash scripts, one of which is handling abort on either killing the batch job, or hitting Ctrl-C when running interactive
…es, and remove the specific one for mksurfdata_esmf
…directory structure and checking, I ran the new script for b.e30_alpha09e_m.B1850C_MTso_Gris_Marbl years 100-130 and the answers were identical to the shell script
…sts, and if monthly files already exist use them rather than overwritting
…carefully examined it's description of what it did and why, as well as the final code changes
…o NOT have the time dimension as that can't be done on the final file, and it's a mistake that CPLHIST files have it to begin with
…r for the last step of adding the 12 climatological months together
@ekluzek ekluzek added this to the cesm3_0_beta12 (compset) milestone Oct 14, 2026
@ekluzek
ekluzek requested a review from slevis-lmwg October 14, 2026 16:32
@ekluzek ekluzek self-assigned this Oct 14, 2026
@ekluzek ekluzek added enhancement new capability or improved behavior of existing capability b4b bit-for-bit labels Oct 14, 2026
@wwieder wwieder moved this from Ready to start (or start again) to In progress - master in CTSM: Upcoming tags Oct 15, 2026
@ekluzek
ekluzek requested a review from olyson October 15, 2026 18:03
ekluzek and others added 4 commits October 15, 2026 12:04

@slevis-lmwg slevis-lmwg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Erik and I discussed this PR last Monday and today.
Erik posted a few comments to address.
Approving.

@ekluzek ekluzek left a comment •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Things I'll do:

  • Seperate into base class and aerosol specific script
  • Add unit tests using Claude to help
  • Remove the batch capability from the aerosol specific one (I left it in for now)

@ekluzek ekluzek moved this from In progress - master to In progress - b4b-dev in CTSM: Upcoming tags Oct 22, 2026
… passes all python tests. It adds about a minute to the sys test time, which seems acceptable, passes black and pylint checks
…er, change some names to be more descriptive, also tweak some error messages, and also disallow year 0, which means the unit test doesn't run
…tiblity stale check and test for it, and run _write_clim with default for with_time_bnds as well as both explicit ways

@slevis-lmwg slevis-lmwg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@ekluzek I had two comments. I'm happy to look this over again and to talk about it more with you.

ekluzek and others added 3 commits October 26, 2026 11:43
…equired an update to the fake files, Claude helped me to get it working
…m with a more generic base class, and the specific application for aerosols on top as a seperate wrapper, this is what it gave me, the tests all work, and black and pylint is clean
@ekluzek
ekluzek merged commit b3b68fa into ESCOMP:b4b-dev Oct 28, 2026
6 checks passed
@ekluzek
ekluzek deleted the aero_daily_to_monthly_clim_script branch October 28, 2026 18:54
@github-project-automation github-project-automation Bot moved this from In Progress to Done in LMWG: Sprint Planning Board Oct 28, 2026
@github-project-automation github-project-automation Bot moved this from In progress - b4b-dev to Done (non release/external) in CTSM: Upcoming tags Oct 28, 2026
@samsrabin samsrabin linked an issue Oct 29, 2026 that may be closed by this pull request
@slevis-lmwg slevis-lmwg mentioned this pull request Oct 29, 2026
12 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

b4b bit-for-bit enhancement new capability or improved behavior of existing capability

Projects

Status: Done (non release/external)
Status: Done

Development

Successfully merging this pull request may close these issues.

Add CF compliance-checker to ctsm_pylib

2 participants