Skip to content

DSL - GFDL1M (and some pyMoist shared code) to v11.11.0 - #1590

Open
CharlesKrop wants to merge 368 commits into
GEOS-ESM:developfrom
CharlesKrop:dsl/update/GFDL1M_to_v11.11.0
Open

CharlesKrop wants to merge 368 commits into
GEOS-ESM:developfrom
CharlesKrop:dsl/update/GFDL1M_to_v11.11.0

Conversation

@CharlesKrop

@CharlesKrop CharlesKrop commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary of changes (in no particular order):

  • Updated GFDL1M from GEOS v11.8.1 to GEOS v11.11.0 fortran.
    • Includes new GFDLMPV3 microphysics driver
    • NDSL version is numerically equivalent in to Fortran in stencil-cpu backend at opt level 0. opt level 3 introduces minuscule errors (noise, scientifically irrelevant)
    • orchestrated backends has numerical errors. Will be resolved in another PR
  • Updated significant amount of pyMoist shared code (anything GFDL1M touches, including saturation tables)
  • Reorganized shared code into more physically reasonable locations

Note: UW and GF convection modules (NDSL variant) have not been updated to work with the new shared code; however, this is considered tolerable, as the UW code has been depreciated (Fortran version no longer used), and the 11.8.1 version of GF does not run in v11.11.0, and needs its own update.

GFDL1M module contains nine translate tests to help maintain validity:

  • GFDL1M: whole module test
  • GFDL1M_Macrophysics: phase change and hydrostatic pdf
  • GFDL1M_Microphysics: GFDLMPV3 microphysics driver
    • Various subtests for GFDLMPV3 (each tests the same name class unless otherwise noted):
    • GFDLMPV3_Config: checks configuration and namelist, ensuring defaults (or values overridden by namelist) are consistent
    • GFDLMPV3_MPFull
    • GFDLMPV3_Sedimentation
    • GFDLMPV3_WarmRain
    • GFDLMPV3_IceCloud
    • GFDLMPV3_SubgridProcesses

Katrina Fandrich and others added 30 commits August 18, 2026 11:45
…ostatic mode turns off DO_SEDI_W, but the opposide is no longer necessarily true
…ted fields are present. Macrophysics and Microphysics tests pass at all ranks and savepoints, main GFDL1M fails some ranks/savepoints
…t including the surface layer in a calculation
@CharlesKrop CharlesKrop added the 0 diff The changes in this pull request have verified to be zero-diff with the target branch. label Nov 30, 2026
@CharlesKrop
CharlesKrop marked this pull request as ready for review December 2, 2026 17:00
@CharlesKrop
CharlesKrop requested a review from a team as a code owner December 2, 2026 17:00
@CharlesKrop

CharlesKrop commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor Author

Note to reviewers: a few directories and files were renamed, significantly bloating the total files changed count. Most substantial/scientific changes are confined to ~15 files (either in pyMoist/shared or pyMoist/microphysics/gfdl_1m

@FlorianDeconinck FlorianDeconinck left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Overall good.

Docstrings could use work, make a first pass to at least put down the essential one alongside the big classes. When you don't know, write down a "To Document" notice for further improvement.

Translate test are meh, but that's more on the side of the overall framework not delivering, so a pass on that.

Likewise for the mixed precision of constant, DSL lacking here too

# In testing, this difference resulted in errors no larger than four (4) ULP.
dqsat = dq * DEGSUBS
dqsat = ESFAC * dqsat * p * (dd * dd)
# Match the selected Fortran entry point's evaluation order. A few ULPs

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
# Match the selected Fortran entry point's evaluation order. A few ULPs
# Dev NOTE: Match the selected Fortran entry point's evaluation order. A few ULPs

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Let's try to differentiation implementation/dev notes from algorithmic ones


Args:
mass (FloatField)
u (FloatField)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do we want to be verbose with all of this? I mean mass is mass, but maybe there's always a few different way to keep mass

self._managed_state.register("fill_negative_tendency_cloud_micro.snow", "DQSDT_FILL_CLDMICRO", export_repository)
self._managed_state.register("fill_negative_tendency_cloud_micro.vapor", "DQVDT_FILL_CLDMICRO", export_repository)

# system to alert that radar diag is requested, but not yet implemented. remove when implemented

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Remove or keep?

with TimedCUDAProfiler("GFDL 1M - State copy", {}):
self._managed_state.fortran_to_ndsl()
# KPBL_SC is Fortran-indexed. Convert to Python index while Python numerics run, then restore before state copy-back.
self._managed_state.ndsl_state.boundary_layer_level_for_uw_shallow_conv.field[:] -= 1

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Side note: we should somewhat encode this type of overhead strictly due to the hybrid nature of the interfacing

original_orchestrate = config._orchestrate
config._orchestrate = DaCeOrchestration.Build
set_distributed_caches(config=self.config, force_build=True)
config._set_distributed_caches(force_build=True)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
config._set_distributed_caches(force_build=True)
# Dev NOTE: refactor when NDSL exposes a public API for distribute caching and/or reworks it's build system
config._set_distributed_caches(force_build=True)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Not a fan of "setup", as this could have different aim, e.g. setup the numerics, setup an implementation detail, etc.

t = t - (MAPL_ALHS / MAPL_CP) * subl


# # able of lookup values of radiative effective radius of ice crystals as a function of temperature from

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Clean or keep

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Inline comments should be docstrings for some of them



# surface type constants
SRF_TYPE_OCEAN = Int(0)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Also, we have IntEnum now! (I think)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

(can be done later)

from .microphysics.GFDL_1M.translate_GFDL_1M_RedistributeClouds import TranslateGFDL_1M_RedistributeClouds
from .microphysics.GFDL_1M.translate_GFDL_1M_Setup import TranslateGFDL_1M_Setup
from .translate_aerosol_activation import TranslateAerosolActivation
# from .convection.GF_2020.cumulus_parameterization.air_density.translate_GF2020_CumulusParameterization_HydrostaticAirDensity import (

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Clean or keep

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

Labels

0 diff The changes in this pull request have verified to be zero-diff with the target branch.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants