Skip to content

Honor the E3SM coupled model calendar during initialization and date calculations - #12

Closed
proteanplanet wants to merge 28 commits into
developfrom
proteanplanet/all/gregorian
Closed

proteanplanet wants to merge 28 commits into
developfrom
proteanplanet/all/gregorian

Conversation

@proteanplanet

@proteanplanet proteanplanet commented Oct 24, 2026 •

Copy link
Copy Markdown

This PR is to introduce compatibility with the complementary E3SM PR #8968

  • Propagate Gregorian-aware orbital context and scheduled solar timestamps through both drivers and affected components.
  • Derive orbital-year defaults from compset epochs, preserve explicit overrides, and require settings for ambiguous epochs.
  • Preserve the fixed-year day-80.5 equinox reference with Gregorian year lengths.
  • Enable equation-of-time corrections by default without changing model time or seasonal orbital phase.
  • Record and validate the EOT convention in driver restarts.
  • Update Icepack and WW3 revisions for their coupled interfaces.
  • Document configuration, scientific impacts, and intended CMIP compatibility.

In WW3, this adds an optional coupled-calendar argument to initialization, applies the calendar after reading grid configuration and before initialization time arithmetic, maps NO_LEAP to 365_day and GREGORIAN to standard, and uses proleptic Gregorian date conversion for the standard calendar. Focused checks of the full time module passed for 108 date round trips and nine leap-year boundaries using infrastructure stubs. Full coupled-model validation remains pending.

sbrus89 and others added 28 commits June 10, 2021 10:49
 - Check if log file unit is open before opening log.ww3

 - Allow NDSO to be set explicitly
Corrects divide by zero error on pm-cpu intel debug
* origin/e3sm:
  Merge pull request #2 from erinethomas/pm_cpu_debug_fix
  Fix issue undefined variable issue in w3initmd.ftn
  Restrict UOST output to NAPOUT
  Add grid cell area calculation to wmscrpmd.ftn
  Modifications for log file consistency in E3SM
  Fix issue with optional arugment in W3IORS call
  Fix station location bug for RTD unstructured grids
  Add switch_E3SM
  Add unit number input to W3GRID
  Extend length of mesh filename variable
  Fix repeat allocation for unstructred RTD in ww3_ounf.ftn
  Fix RTD switch in w3gridmd.ftn
  Fix RTD bug in w3iopomd.ftn for unstrcutred mesh
  Fix RTD switch bug in ww3_ounf.ftn
This PR updates the WW3 source code to include the CMake build system and CPP directives for switch options.
ADD Z0 and USTAR2 to output for E3SM Coupling
Accept an optional host calendar override immediately after reading the
model grid and before initialization date arithmetic. Map NO_LEAP to
365_day and GREGORIAN to standard, rejecting unknown coupled calendars.

Use proleptic Gregorian conversion for standard dates, including dates
before the historical Gregorian transition.
@erinethomas

Copy link
Copy Markdown

this PR seems to duplicate code mods that have already been merged (has it been rebased recently)? Also does this PR not duplicate some of the work I put into the PR I opened 2 weeks ago to sync the calendars?

@erinethomas erinethomas assigned sbrus89 and unassigned jonbob Oct 26, 2026
@erinethomas

erinethomas commented Oct 26, 2026 •

Copy link
Copy Markdown

also this should not be merged into develop but rather into the e3sm branch - that is probably why there are some many merge conflicts with old code that has already been merged

@erinethomas

Copy link
Copy Markdown

@proteanplanet - the critical part of this PR is the new calculations in model/src/w3timemd.F90
can you

  1. make this PR only include the changes to w3timemd.F90 ? (the 'CALTYPE' variable is a namelist setting we can control from the E3SM scripting to sync the WW3 calendar with that used by E3SMN - no code modifications are needed to WW3)
  2. open this PR into the 'e3sm' branch?

With these two updates, I think this PR will be 100% compatible with my calendar sync efforts, as well as your E3SM efforts to update the Gregorian calendar system.

@erinethomas

Copy link
Copy Markdown

closing this PR to to implement a new PR following the suggestions in the previous comment.

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.

5 participants