Skip to content

Add a circular ice sheet test for the coupled MALI-Sea level model#748

Open
hollyhan wants to merge 30 commits intoMPAS-Dev:mainfrom
hollyhan:hollyhan/compass/landice/slm_circ_icesheet
Open

Add a circular ice sheet test for the coupled MALI-Sea level model#748
hollyhan wants to merge 30 commits intoMPAS-Dev:mainfrom
hollyhan:hollyhan/compass/landice/slm_circ_icesheet

Conversation

@hollyhan
Copy link
Contributor

@hollyhan hollyhan commented Dec 21, 2023

Checklist

  • User's Guide has been updated
  • Developer's Guide has been updated
  • API documentation in the Developer's Guide (api.rst) has any new or modified class, method and/or functions listed
  • Documentation has been built locally and changes look as expected
  • The E3SM-Project submodule has been updated with relevant E3SM changes
  • The MALI-Dev submodule has been updated with relevant MALI changes
  • Document (in a comment titled Testing in this PR) any testing that was used to verify the changes
  • New tests have been added to a test suite

@hollyhan hollyhan added land ice in progress This PR is not ready for review or merging labels Dec 21, 2023
Copy link
Member

@matthewhoffman matthewhoffman left a comment

Choose a reason for hiding this comment

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

@hollyhan and @xylar , I did a quick pass through this PR and don't see any concerns with the overall structure. @hollyhan , this is great work, and I am very happy we have this idealized setup fully automated within compass! Once this is complete, I will think about how to add a version of this to our full_integration suite to be sure we are testing SLM with every PR.

I added a number of comments as I went - I'm sure you are aware of many of these clean up items, but I figured I might as well flag them as I went. There are a few slightly more significant items I mention - feel free if you want to discuss any of them. And like we talked about, for anything that seems beyond what you actually care about, let me know and I am happy to contribute. Xylar and I can do a more thorough review once the docs are ready and any other details are finalized.


# other constants used in the fuction
# pi = 3.1415926535898 # pi value used in the SLM
rhoi = 910.0 # ice density
Copy link
Member

Choose a reason for hiding this comment

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

May want to get this from namelist or cfg to be safe. Could be added later

smbfile.close()


def _build_mapping_files(config, logger, res, nglv, mali_mesh_file):
Copy link
Member

Choose a reason for hiding this comment

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

Is this identical (or very similar) to the version in the ISMIP6-2300 SLM test case PR (#749)? If so, we should move this to a compass landice framework module and call it from both places. That does not need to need to be in the scope of your revisions - I can do that in a follow up PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good - I'll leave this comment unresolved so you can follow up with it.

# adjust the lat-lon values
args = ['set_lat_lon_fields_in_planar_grid.py',
'--file', mali_mesh_file,
'--proj', 'ais-bedmap2-sphere']
Copy link
Member

Choose a reason for hiding this comment

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

Flagging again that we need to add this in an MPAS-Tools PR. (Already mentioned in #749)

@xylar
Copy link
Collaborator

xylar commented Jul 7, 2024

@hollyhan and @matthewhoffman, I just wanted to check in on this one. What's the status?

@hollyhan hollyhan force-pushed the hollyhan/compass/landice/slm_circ_icesheet branch from 77d6c8a to 27ad364 Compare August 31, 2024 22:25
matthewhoffman and others added 23 commits March 14, 2026 11:47
This is largely copied from the dome smoke test and has stretches of
code from the test left in place as an example.
MPE: mean percentage error
SLC: sea-level change

Also enable the SLM output class to take in an assigned number of time
indices of outputs to be analyzied
@matthewhoffman matthewhoffman force-pushed the hollyhan/compass/landice/slm_circ_icesheet branch from 27ad364 to e4e98c9 Compare March 14, 2026 18:47
@matthewhoffman
Copy link
Member

Rebased and force-pushed to refresh this PR.

@matthewhoffman
Copy link
Member

Review Findings from local Copilot review

I used copilot locally to review this branch after I rebased it. I am recording the results here for me to address in subsequent commits and get this test case running again!


  1. High: the new SLM test case is not portable because its required input directories are hard-coded to one user’s filesystem in compass/landice/tests/slm/namelist.sealevel.template.

Nothing in the branch makes those paths configurable, so anyone outside that exact environment will fail as soon as run_model writes and uses this namelist.

  1. High: the exposed coupling option is not actually wired into the runtime setup.

The config advertises [slm] coupling = ... in compass/landice/tests/slm/circ_icesheet/circ_icesheet.cfg, but only the visualization code reads it. The actual run files force coupling on via compass/landice/tests/slm/namelist.sealevel.template and compass/landice/tests/slm/circ_icesheet/namelist.landice. If a user sets coupling = False, they will still run a coupled case but post-process it as uncoupled.

  1. High: the time-series comparison between MALI and SLM is internally inconsistent and will mis-sample the data.

The runtime namelist hard-codes config_slm_coupling_interval = 5 in compass/landice/tests/slm/circ_icesheet/namelist.landice, while the public config defaults time_stride = 1 in compass/landice/tests/slm/circ_icesheet/circ_icesheet.cfg. Then the analysis ignores the actual file length and overwrites its own index selection with nt = np.arange(0, 50, time_stride) in compass/landice/tests/slm/circ_icesheet/visualize.py. That means the plotted self.yrs and the loaded SLM series can diverge in length or correspond to different physical times, so the reported error metrics are unreliable even when the run itself succeeds.

  1. Medium: the non-coupled analysis path is broken.

In compass/landice/tests/slm/circ_icesheet/visualize.py, nyrs is used before it is ever assigned, so coupling = False raises immediately. The same function also reads Aocn_const and AocnBeta_const from config, then overwrites them with hard-coded values, so the advertised config knobs would not take effect even after fixing the crash.

  1. Medium: multi-case plotting will fail once the branch exercises the heatmap path.

compass/landice/tests/slm/circ_icesheet/visualize.py calls plt.figure(..., facecolot='w'); facecolot is not a valid Matplotlib keyword, so this raises a TypeError when plot_heatmap() runs.

  1. Medium: output_analysis closes the xarray dataset inside the timestep loop in compass/landice/tests/slm/circ_icesheet/visualize.py.

Because bed, cellMask, and thickness are still being lazily indexed on subsequent iterations, closing the dataset there is at best fragile and at worst breaks all but the first timestep depending on backend behavior. The close should happen after the loop.

Assumptions

  • I reviewed the branch-only commit range reconstructed from the worktree reflog: rebased commits on top of origin/main at 70a4a41f, ending at e4e98c98.
  • I ignored the submodule pointer changes in E3SM-Project and MALI-Dev as requested.

* Fix heatmap facecolor keyword typo
* Close visualization dataset after timestep loop
* Set SLM data path to NERSC location
* test case name
* cleanup in setup_mesh & run_model
* set MALI/SLM coupling interval to 1 year

Case sets up and runs without error after this change,
but I have not checked correctness yet.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in progress This PR is not ready for review or merging land ice

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants