Skip to content

Enable offline use of Lake GC; add analytical derivative of exchange coeffs for Lake and Landice - #1470

Draft
biljanaorescanin wants to merge 29 commits into
developfrom
feature/borescan_add_lake_gridcomp_to_fixture
Draft

Enable offline use of Lake GC; add analytical derivative of exchange coeffs for Lake and Landice#1470
biljanaorescanin wants to merge 29 commits into
developfrom
feature/borescan_add_lake_gridcomp_to_fixture

Conversation

@biljanaorescanin

@biljanaorescanin biljanaorescanin commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Enables running lake tiles in GEOSldas by adding an "offline mode" into Lake GC.

Additionally, analytical derivatives of the exchange coefficients for Louis are added into Landice GC and Lake GC (equivalent to MOSFC_EXTRA_DERIVS_OFFL_LAND=1 for Catch). For Landice and Lake, these analytical derivatives are used by default (as the only option) when CHOOSEMOSFC=0 (Louis).

Finally, the associated PR GEOS-ESM/GMAO_Shared#454 fixes a bug in the calculation of the analytical derivatives in louissurface():

  • This bug fix is non-zero-diff for Catch when used in GEOSldas with its default config (CHOOSEMOSFC=0, MOSFC_EXTRA_DERIVS_OFFL_LAND=1).
  • This bug fix is non-zero-diff for Landice when used in GEOSldas with its default config (CHOOSEMOSFC=0).

Zero-diff for GCM (except for metadata comparison failure in Lake and Landice restarts owing to minor edits in the LONG_NAME of FR).

Non-zero-diff for GEOSldas:


Related PRs:


Testing:

  • Tested by @biljanaorescanin after initial commit (8ef31ff) for 1day AMIP, REPLAY and IncREPLAY all zero diff. Regression is a pass.

cc: @lcandre2

@biljanaorescanin biljanaorescanin added enhancement New feature or request 0 diff The changes in this pull request have verified to be zero-diff with the target branch. Contingent - DNA These changes are contingent on other PRs (DNA=do not approve) labels Jul 8, 2026
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

This PR is being prevented from merging because you have added one of our blocking labels: Contingent - DNA, Needs Lead Approval, Contingent -- Do Not Approve. You'll need to remove it before this PR can be merged.

@biljanaorescanin
biljanaorescanin force-pushed the feature/borescan_add_lake_gridcomp_to_fixture branch 2 times, most recently from ff405ba to 32398ff Compare July 21, 2026 17:07
@biljanaorescanin

Copy link
Copy Markdown
Contributor Author

With changes as they are now, this PR is zero diff for 1-day AMIP, REPLAY and Inc REPLAY.
It is also zero diff for landice and land tiles only runs (tile_type 20 100 ; GLOBALCS test is what I was running for baseline with all 3 branches/repo's).

@biljanaorescanin

Copy link
Copy Markdown
Contributor Author

Analytical Louis derivatives for Lake and LandIce

The latest commits update the offline Louis paths in both Lake and LandIce (CHOOSEMOSFC = 0) to use the analytical DCHDTVA and DCQDTVA derivatives returned by louissurface.

This treatment is equivalent to Catch L1.

For both components, the implementation applies the same:

  • conversion from the air-minus-surface virtual temperature difference
  • rho * |U| scaling used for the mass exchange coefficients
  • product-rule flux derivatives
  • saturation constraint: qs = qsat(Ts, Ps)

The sensible heat derivative, SHD, is constructed in the same way in Lake and LandIce.
The main difference is how the latent-flux derivative is stored and used.

Lake

Lake stores the latent derivative as a water mass flux derivative:

EVD = dE/dTs

The Lake solver later multiplies EVD by the appropriate latent heat:

  • MAPL_ALHL for open water
  • MAPL_ALHS for lake ice

LandIce

LandIce stores the latent derivative directly as an energy flux derivative:

LHD = MAPL_ALHS * dE/dTs

LHD is passed directly to SOLVEICELAYER

For SNOWRT, it is converted back to a sublimation mass-flux derivative:

DEVAPDT = LHD / MAPL_ALHS

Offline Louis for lake and landice now always uses the analytical derivative treatment.
Offline Louis is expected to be non-zero-diff for landice.

@biljanaorescanin

biljanaorescanin commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

PR testing summary:

Note here after renaming variable in RST file metadata, comparisons in AMIP, REPLAY and IncREPLAY will fail.

With:
Comparing NC4 lake_internal_checkpoint using nccmp...
Failure!
Checking for data differences
Checking for metadata differences
DIFFER : LENGTHS : ATTRIBUTE : long_name : VARIABLE : FR : 21 <> 12 : VALUES : "subtile_area_fraction" : "ice_fraction"

This difference is expected. The previous long_name value, ice_fraction, was incorrect because FR represents the fractional area of each Lake subtile. A Lake tile contains two subtiles: water and ice, so the more accurate metadata description is subtile_area_fraction.

There are no data differences; only the metadata attribute has changed.

@gmao-rreichle

Copy link
Copy Markdown
Contributor

Re. #1470 (comment):
I edited the LONG_NAME of the internal spec 'FR' for further clarification. Now expecting the metadata comparison to fail with the following message:

DIFFER : LENGTHS : ATTRIBUTE : long_name : VARIABLE : FR : 21 <> 12 : VALUES : "subtile_area_fractions_for_ice_and_water" : "ice_fraction"

@gmao-rreichle gmao-rreichle added the Non 0-diff The changes in this pull request are non-zero-diff label Jul 29, 2026
@gmao-rreichle gmao-rreichle changed the title Add offline lake flux path for GEOSldas Enable offline use of Lake GC; add analytical derivative of exchange coeffs for Lake and Landice Jul 29, 2026
…ssurface() in GMAO_Shared repo (GEOS_LakeGridComp.F90, GEOS_LandIceGridComp.F90)
…h that in Catch GC; combined with previous commit (64ed980) and change in louissurface() [GMAO_Shared: d13927d], results should be within roundoff (if not zero-diff) w.r.t. penultimate commit (39027a2)   (GEOS_LandIceGridComp.F90)
…h that in Catch GC; combined with earlier commit (64ed980) and change in louissurface() [GMAO_Shared: d13927d], results should be within roundoff (if not zero-diff) w.r.t. commit ff21468   (GEOS_LakeGridComp.F90)
…ile area fractions (GEOS_LandiceGridComp.F90)
…E flag; edited comments (GEOS_LandIceGridComp.F90)
@gmao-rreichle

Copy link
Copy Markdown
Contributor

Hi @biljanaorescanin and @lcandre2 :

Yesterday and today, I added a bunch of commits to the branch. Here are the key changes:

  • Moved "missing" multiplication of the scaling factor with the Louis derivatives (of the exchange coefficients) into louissurface(). See 64ed980 and Bug fix: multiply derivatives of louissurface() with same factor that is applied to coeffs  GMAO_Shared#454
  • Revised infrastructure for computing extra analytical derivatives of surface turbulence terms to match that of Catch GC. See b347114, 7fa4bff, and a5fc759.
  • Added missing initialization to 0.0 of LAI, ww, and CH before call to louissurface() in Landice and Lake. I expect this to be zero-diff for Landice when using Intel with standard optimization, but when using an aggressive build or other compilers, the results might differ. See b0e542c and 5ada0b1
  • Edited LONG_NAME attributes of FR in Landice and Lake. Restarts will not be zero-diff for the corresponding metadata entries. See 39027a2 and 6658f84.
  • Renamed a couple of z0 parameters for clarity (0486b5f).
  • The remainder of the commits include some cleanup, edits of comments and white-space changes. I recommend hiding white-space changes when viewing diffs.

For Landice and Lake, the sum of the changes above should be no more than "roundoff" different when compared to where @biljanaorescanin left off (59227cf). It may even be zero-diff. Taken together, my intent was to change only the implementation and not introduce any science changes.

For Landice, the addition of the analytical "extra derivatives" is of course non-zero-diff w.r.t. develop.

For Catch, the bug fix in GEOS-ESM/GMAO_Shared#454 introduces non-zero-diff changes.

@biljanaorescanin : When you're back in the office and find some time, please:

  • review my changes and try to verify that I indeed didn't change anything w.r.t. where you left off,
  • provide @lcandre2 with a (nightly) test run that engages the extra analytical derivatives for Landice and that Lauren can compare to the baseline of the nightly test, and
  • take a look at what the bug fix in louissurface() does to the output from Catch.

For the latter two items, we may need to run the LDAS for a longer period, but let's start with the short test runs to see if anything looks terrible right away.

cc: @weiyuan-jiang

@biljanaorescanin

Copy link
Copy Markdown
Contributor Author

I've rerun my 1Y simulation to test, and after a year, lake and landice RST and History (glc and lake collections) are zero diff to what I had.
So no science change was introduced with code cleanup.

For catch it is not zero diff as expected. But differences are far from roundoff.

My guess is we will want to to much longer simulation like 30Y or more to compare and see? Issue in this run is I use same met-forcing as GEOSgcm idea was to be able to compare to what coupled run was doing.

Some more relevant cherrypicked catch RST differences:
46 : 2001-02-28 00:00:00 0 1901320 0 1565690 : F F 16.796 0.063371 : TC
51 : 2001-02-28 00:00:00 0 475330 0 467744 : F F 3.4660 0.012688 : TSURF

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. Contingent - DNA These changes are contingent on other PRs (DNA=do not approve) enhancement New feature or request Non 0-diff The changes in this pull request are non-zero-diff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants