Skip to content

Add lake- and landice-specific exports to support budget closure - #1553

Draft
gmao-qliu wants to merge 35 commits into
developfrom
feature/qliu/add_lake_export_variables
Draft

gmao-qliu wants to merge 35 commits into
developfrom
feature/qliu/add_lake_export_variables

Conversation

@gmao-qliu

@gmao-qliu gmao-qliu commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Adds exports needed to close the water and energy budgets for Lake, Landice, and ISSM.

Lake:

  • Water balance: 0 = PRLAKE - EVAP - WNETFLUXLAKE

  • Energy balance: DHLAKE = LWND + SWND - SH - LH - MAPL_ALHF * (1. - FRLAKEICE) * PRECSNOLAKE

    • Lake has no water storage.
    • PRLAKE, PRECSNOLAKE: total precipitation and snowfall over lake tiles; snowfall needed to calculate extra fusion-heat term in energy balance.
    • DHLAKE: rate of change of total lake heat content, similar to DHLAND (or ECHANGE) in Catchment GC.
    • FRLAKEICE: ice fraction(FR(:, ICE)), needed to evaluate the fusion heat sink.
    • WNETFLUXLAKE: net water flux into lake (=precip-minus-evap). Same as "runoff" from Lake GC, but in Surface this diagnostic is averaged only over lake tiles

Landice:

  • Water balance:

    • Snowpack:
      DSNOMASGLC =  ASNOWGLC x PRECTOTGLC - EVAPSNOWGLC – SMELT – WESNEXT – WESNDENS

    • Glacier (incl. snowpack):
      0 [or DSNOWMASGLC???] = ICESMBGLC – WESNEXT – WESNDENS (needs add'l closure term b/c glacier volume assumed constant?) (probably wrong)

      better guess:
      DSNOWMASGLC = ICESMBGLC + SPEVAPBAREICE + SPRUNOFFBAREICE [ best guess right now, spurious (SP) terms to balance evap from bare ice and runoff from bare ice]

      where
      ICESMBGLC = PRECTOTGLC - EVAPGLC - RUNOFFGLC

      • WESNEXT: total snow mass residual due to densification
      • WESNDENS: snow layer mass change due to densification [not currently in "glc"!?!?!]
      • [if we have DSNOWMASGLC in glacier balance, do we drop WESNEXT and WESNDENS from glacier balance??]
      • SMELT: snow melt [at least nc4 var name should be changed to SMELTGLC; check if eponymous var in Land/Catch]
  • Energy balance:

    • Glacier (incl. snowpack):
      ECHANGEGLC = LWNDGLC +SWNDGLC - SHGLC - LHGLC
      +(-?) MAPL_ALHFRUNOFFGLC (probably not needed here, already included in Landice GC physics)
      +(-?) MAPL_ALHF
      (PRECTOTGLC-PRECSNOGLC) (probably not needed here, already included in Landice GC physics)
      + HCORRFROMSTIEGLITZ (need to export from LandiceGC)
    • Surface layer:
      ECHANGEGLCSRF =  LWNDGLC +SWNDGLC + SHGLC + LHGLC + GHTFLUXGLC

    EGLC = htsn + FR(:,ICE)*TICE(1,ICE)*CP + FR(:,SNOW)*TICE(1,SNOW)*CP
    EGLCSRF = htsn_top_layer + FR(:,ICE)*TICE(1,ICE)*CP

    GHTFLUXGLC may need different SHORT/LONG NAME attributes

ISSM:

  • Water balance: ICEDTHICK + ICEDIVQ = ICEEQUIVSMB
  • Energy balance: n/a
    • ISSM only solves for mass changes.
    • Assumes no melting at the base of the ice sheet (left for future development).
    • ICEDTHICK: rate of change of ice thickness
    • ICEDIVQ: ice flux divergence
    • ICEEQUIVSMB: surface-mass balance forcing term (from landice; averaged between ISSM time steps and divided by ice density)

Testing:

  • TBD


Initially tested with a 1-year GEOSldas offline simulation, and the annual energy and budgets based on lat/lon output are close to zero.

Balance computed from hourly averages:
TS_lake_EW_balance


Balance computed from daily averages (approximates fusion-heat term, where average of product is different from product of averages ):
Map_lake_202101-202112
TS_lake_EW_balance

@gmao-qliu gmao-qliu added the 0 diff The changes in this pull request have verified to be zero-diff with the target branch. label Oct 23, 2026
@gmao-rreichle gmao-rreichle added the enhancement New feature or request label Oct 23, 2026
@gmao-rreichle gmao-rreichle changed the title Add RAINF, SNOWF, DHLAKE, and FRLAKEICE exports to Lake GC for budget closure Add lake-specific exports to support Lake budget closure Oct 23, 2026
@gmao-rreichle

Copy link
Copy Markdown
Contributor

Thanks, @gmao-qliu, for putting this together! I made a few changes, consisting primarily of slightly changing/renaming the budget terms. I also added the exports into Surface, so they become available for GCM runs.
PRLAKE and SNOLAKE are meant to mirror PRLAND and SNOLAND from Catch.
Rather than use RUNOFF for the lake water budget, I added the same diagnostic with a different name that is (i) less confusing and (ii) does not interfere with the "runoff" diagnostic in Surface GC (which is averaged across land, landice, and lake).
Please take a look and let me know if you find anything wrong with my commits.

@gmao-qliu

gmao-qliu commented Oct 23, 2026 via email

Copy link
Copy Markdown
Contributor Author

@gmao-rreichle gmao-rreichle 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.

see comment below

@gmao-rreichle

Copy link
Copy Markdown
Contributor

Rolf, I see you renamed runoff, precip and sno as WNETFLUXLAKE, PRLAKE and SNOLAKE. Other export variables don't have 'LAKE' in the name. I'd like to confirm that you prefer to keep 'LAKE' there?

Including "LAKE" in the name is intentional. Without giving the export a lake-specific name, Surface will average over the same-name quantities from tile of other surface types (i.e., land and landice). E.g., to get just land precipitation from Catch, we have an export called "PRLAND".

@gmao-rreichle

Copy link
Copy Markdown
Contributor

@gmao-qliu : One more thing:

In the intro comment, I changed the fusion heat term in the balance equation to the following:

MAPL_ALHF * FRLAKEICE * SNOWF

Before it was

MAPL_ALHF * (1 - FRLAKEICE) * SNOWF

which seemed wrong. Was this a typo in the original comment, or am I missing something?

@gmao-qliu

Copy link
Copy Markdown
Contributor Author

@gmao-qliu : One more thing:

In the intro comment, I changed the fusion heat term in the balance equation to the following:

MAPL_ALHF * FRLAKEICE * SNOWF

Before it was

MAPL_ALHF * (1 - FRLAKEICE) * SNOWF

which seemed wrong. Was this a typo in the original comment, or am I missing something?

The original should be correct because the snow fusion heat term applies only to the water subtile (1-FRLAKEICE).

@gmao-rreichle

Copy link
Copy Markdown
Contributor

The original should be correct because the snow fusion heat term applies only to the water subtile (1-FRLAKEICE).

Thanks, I see now. This is for snow falling on the unfrozen lake portion! I restored the original equation in the comment.

@gmao-rreichle gmao-rreichle changed the title Add lake-specific exports to support Lake budget closure Add lake- and landice-specific exports to support budget closure Nov 5, 2026
gmao-rreichle and others added 4 commits November 7, 2026 10:46
* add issm mass budget terms

* fix pointer assoc checks

* remove commented out line

* update description comment

---------

Co-authored-by: agstub <aaron.g.stubblefield@dartmouth.edu>

@gmao-rreichle gmao-rreichle 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.

@agstub : Thanks for adding the ISSM balance variables. Can you please write down the balances explicitly somewhere, perhaps in the ISSM GridComp file somewhere, using the variable names of the exports (or internals)

! Exports: ICESURF, ICETHICK, ICEVEL (defined on landice tiles) [via private internal state]
! Internals: ICESURF, ICETHICK, IMLS, OMLS, ISSM_NSTEPS (defined on mesh) [true internal state]
! Imports: ICESMB (defined on landice tiles) [via private internal state]
! Exports: ICESURF, ICETHICK, ICEVX, ICEVY, DHDT, DIVQ, ICESMB_ISSM (defined on mesh) [true export state]

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.

This is probably more a question for the SI team (@weiyuan-jiang)... Why do we have these 7 "exports" here, which seem to duplicate the eponymous "internals"? I thought "internals" can also function as "exports" in MAPL. If that's the case, the code could be much simplified, and we wouldn't need separate variables for _EX and _IN. Although I'm not sure what happens in Lines ~826-862, where some (but not all!) exports are keyed to "HALO" variables (but with the HALO points not owned by the processor excluded).
Put differently, I don't understand why we would need an export for, say, ICESURF when ICESURF is also an internal.

@agstub agstub Nov 20, 2026 •

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.

"I thought "internals" can also function as "exports" in MAPL."

I did not realize that. Yes that would simplify everything and there is not a need for the separate variables if that's the case. I will test tomorrow. Looking at other grid comps, I'm wondering if we need to add ADD2EXPORT = .true. in the MAPL_AddInternalSpec calls.

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.

Ok, thanks. I don't know about ADD2EXPORT=.true.. Maybe wait until we get input from @weiyuan-jiang next week. This cleanup, if it makes sense, isn't urgent and could be done in a follow-up PR.

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.

Use this as an example

so you don't need to specify the export

@gmao-rreichle gmao-rreichle 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.

@lcandre2 , @agstub : I pushed a few commits on this PR and its GEOSldas GC companion (GEOS-ESM/GEOSldas_GridComp#236), in an attempt to unify the variable names across the GridComp and fix what I think might be errors. Please review the commits and the comments below, thanks

if(associated(DHGLC)) then
DHGLC = 0.0
do L=1,NUM_SNOW_LAYERS
DHGLC = DHGLC - HTSN(:,L)

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.

Why add the minus sign when summing up HTSN? By GEOS convention, heat content is zero at 0 deg C. Catch adds HTSN to calculate total energy

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Agree and will change.

DHGLC = DHGLC - HTSN(:,L)
enddo
do L=1,NUM_ICE_LAYERS
DHGLC = DHGLC - FR(:,ICE)*MAPL_CAPICE*RHOICE*DZMAXI(L)*(TICE(:,ICE,L)-MAPL_TICE)

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.

Not sure I understand this correctly, but it looks like only the energy of the "bare" (not snow-covered) ice sheet layers is computed. Is there no exchange of energy between the bottom snow layer and the top layer of the ice sheet? I expected another term here that adds in the heat content of ice layers under the snowpack.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

So, the way I read/wrote this and the above do loop is that first it loops through and sums (well accidentally subtracts) the heat content in the snow layers -- HTSN) then proceeds to move to the ice layers and sums (accidentally subtracts) the heat content in the ice layers (messy equation). But, this is where my fortran is not great. So, I am most definitely open to improvements/other suggestions. Also, because HTSN is coming from snowrt, I think that it has already been weighted by snow fraction, but need to confirm.

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.

There's nothing wrong with the Fortran per se. I think it's just not adding up all of the energy in the system. Here's what I would expect (incl. the change in sign):

DHGLC = 0.0
do L=1,NUM_SNOW_LAYERS
    DHGLC = DHGLC + HTSN(:,L)                                                           ! heat content of snowpack
enddo
do L=1,NUM_ICE_LAYERS
    DHGLC = DHGLC + FR(:,ICE) *MAPL_CAPICE*RHOICE*DZMAXI(L)*(TICE(:,ICE, L)-MAPL_TICE)  ! heat content of ice under bare conditions
    DHGLC = DHGLC + FR(:,SNOW)*MAPL_CAPICE*RHOICE*DZMAXI(L)*(TICE(:,SNOW,L)-MAPL_TICE)  ! heat content of ice under snowpack
enddo

In a nutshell, I think we're missing the heat content of the ice under the snowpack, which is in the added line. My understanding is that TICE(:,ICE) is the ice temp in the bare ice fraction and TICE(:,SNOW) is the ice temperature under the snowpack. Maybe I'm getting this all wrong?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Ah....I see what you mean. I actually don't know and the only way I can think to find out is to run a couple short experiments, so I will.

call MAPL_AddExportSpec(GC, &
LONG_NAME = 'snowfall_on_glaciated_surface' ,&
UNITS = 'kg m-2 s-1' ,&
SHORT_NAME = 'SNOGLC' ,&

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.

This isn't relevant for M21C-Land, but Landice doesn't seem to have the new precipitation types (such as icefall) that Bill put into the model and will presumably want to turn on soon. We tweaked Catch to accept "ICE" (icefall) and add it to "SNO" (snowfall) for a total solid precipitation variable (SLDTOT). The outputs from Catch still say "SNO" is snowfall, but it would include icefall if ICE is non-zero in future version.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Ah good catch, I'll start an issue for this -- should lake also be included?

@gmao-rreichle gmao-rreichle 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.

see below for a couple of quick answers

agstub and others added 3 commits November 23, 2026 10:25
Update LONG_NAME for ice sheet velocity components, specifying local Cartesian coordinate system
* icesmb to iceequivsmb name changes

* change DHDT and DIVQ names to be more specific

* change glc suffix to ice prefix

---------

Co-authored-by: agstub <aaron.g.stubblefield@dartmouth.edu>
specify "equivalent" surface mass balance
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. enhancement New feature or request

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

5 participants