Repository navigation
Add FastIsostasy - #183
Add FastIsostasy#183
Conversation
|
Status: Code compiles with Plan instructions
Plan: Couple MALI with FastIsostasy (Fortran)TL;DR: Use the Fortran version of FastIsostasy (palma-ice/FastIsostasy) — not the Julia version — and follow the existing SLM coupling pattern already in Key Discovery: A Fortran version already existsFastIsostasy includes a pure Fortran implementation specifically designed for coupling with ice-sheet models. Its API is: call isos_init(isos, path_par, "isos", nx, ny, dx, dy)
call isos_init_ref(isos, z_bed_ref, H_ice_ref)
call isos_init_state(isos, z_bed, H_ice, time, bsl)
! In time loop:
call isos_update(isos, H_ice, time, bsl)
z_bed = isos%out%z_bedThe docs for it include specific guidance for coupling to an ice-sheet model: https://github.com/palma-ice/FastIsostasy#coupling-fastisostasy-to-your-favorite-ice-sheet-model Why this is tractableMALI already has a complete coupling template in
The FastIsostasy coupling would replicate this pattern almost exactly, substituting FastIsostasy's PhasesPhase 1: Build System
Phase 2: Registry & Config
Phase 3: Core Coupling — most complex, but heavily templated
Phase 4: Grid/Weight Files
Phase 5: Restart
Phase 6: Testing
Relevant Files
Main Challenge: Grid InterpolationMALI uses an unstructured MPAS mesh; FastIsostasy uses a regular Cartesian (stereographic) grid. The SLM coupling already solves this exact problem using pre-computed sparse interpolation weight files (generated by ESMF_RegridWeightGen or TempestRemap). The same tooling applies — you just need to generate weights for the FastIsostasy target grid rather than the SLM's Gauss-Legendre grid. This will be done outside of MALI in a separate preprocessing step and does not need to be implemented here. However, the MALI implementation should assume a similar format for mapping files as for the existing SLM. Build and test loop
I made a cursory review of the implementation. The coupling code looks correct in that it mirrors the coupling code for the SLM heavily, as intended, but I have not done a line by line review. The Makefile/build changes look reasonable, but some cleanup is needed to generalize it to any machine. Note that the FastIsostasy build is really slow for two reasons: 1. it uses config which is generally slow and 2. the FFTW library it depends on is very slow to compile and we may want to support optionally pointing to a pre-build lib of it. Next steps are to build mapping files, set up a FI namelist, and attempt a run. |
|
Update (09/22/2026): This issue has been resolved with commit There seems to be an issue in linking the fastisostasy libraries- I am not able to build MALI with FASTISOSTASY=true without running into errors that are sometimes solved and sometimes not by adding Built attempted on Perlmutter ( Currently, the way I make the build work spuriously is by compiling once with |
|
Results of the testing can be seen here: MPAS-Dev/compass#970 |
a2dadf6 to
5afa428
Compare
|
Test results: Coupled simulation has been tested with realistic climate forcing (ISMIP7 Experiment C007: CESM2-WACCM SSP585) and the weak Earth structure. Below results are based on the 2D MALI outputs.
The spatial pattern of bedrock response is coherent with changes in ice thickness. The restart capability has been tested to the extent possible – by code inspection |
fd33a82 to
1580599
Compare
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Missing submodule gitlinks, an unguarded module import, and invalid-grid handling currently break supported build or initialization paths.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 2
Open (5)
Add pinned gitlinks for FastIsostasy dependencies · New Guard isos_utils import when FastIsostasy is disabled · New Include grid resolution in the main FastIsostasy namelist builder · New Include grid resolution in the alternate namelist builder · New Skip FastIsostasy allocation after non-square grid validation failure · New
What changed in this PR
Adds FastIsostasy as an alternative MALI glacial-isostatic-adjustment model.
Changes:
- Adds FastIsostasy coupling, remapping, and restart handling.
- Integrates FastIsostasy and fesm-utils into the build.
- Adds related namelist configuration.
| File | Description |
|---|---|
.gitmodules |
Declares external dependencies. |
components/mpas-framework/Makefile |
Isolates PIO test libraries. |
components/mpas-albany-landice/src/Registry.xml |
Registers FastIsostasy options. |
components/mpas-albany-landice/src/mode_forward/mpas_li_core.F |
Writes coupled restart state. |
components/mpas-albany-landice/src/mode_forward/mpas_li_bedtopo.F |
Implements coupling and remapping. |
components/mpas-albany-landice/src/Makefile |
Builds external libraries. |
components/mpas-albany-landice/src/build_options.mk |
Adds compile and link options. |
components/mpas-albany-landice/bld/namelist_files/namelist_definition_mali.xml |
Defines namelist entries. |
components/mpas-albany-landice/bld/namelist_files/namelist_defaults_mali.xml |
Adds defaults. |
components/mpas-albany-landice/bld/build-namelist-section |
Assembles section defaults. |
components/mpas-albany-landice/bld/build-namelist |
Assembles MALI defaults. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Without this, a MALI restart with config_uplift_method='fastisostasy' aborted outright. Cold-starting FastIsostasy instead (bypassing that guard) would silently discard its viscous relaxation state and reset the reference load to "now" at every restart, i.e. it would treat the solid Earth as already in equilibrium with the current ice/ocean load. Wires MALI up to FastIsostasy's own restart I/O (isos_restart_write/ read, bsl_restart_write/read) instead: writes a FastIsostasy restart snapshot every time MALI writes its own restart stream, and on restart recomputes the elapsed coupling-step count from simulation time (mirroring find_slm_restart_timestep) to resume FastIsostasy's internal clock at the correct point. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Adds config_fastisostasy_grid_resolution (meters) so the real spacing can be supplied via namelist.landice. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
build_options.mk defined FASTISOSTASY_LINK_LIBS (pointing at FastIsostasy's and fesm-utils' static libraries) but never added it to LIBS, so the final landice_model link would have failed to find FastIsostasy symbols. Wires it in with `override LIBS += $(FASTISOSTASY_LINK_LIBS)`. That addition, however, causes mpas-framework's generic pio_test target to inherit those library paths too. pio_test runs early (as a prerequisite of mpas_main) and links a trivial test program against the full $(LIBS) purely to detect the installed PIO version -- but FastIsostasy's static libraries are only built later, by the fastisostasy_lib target (a prerequisite of core_landice). On a build with FASTISOSTASY=true, this made pio_test's link fail because those .a files don't exist yet, which the target's own error handling then misreports as "PIO environment variable not set" -- masking the real, unrelated cause. Adds PIO_TEST_LIBS, a snapshot of LIBS taken before any core's build_options.mk can append core-specific libraries, and uses it in pio_test instead of the full LIBS. pio_test only needs to check PIO usability, not link against every library the final executable needs, so this doesn't change what it actually tests -- it just stops it from depending on libraries that aren't built yet. The real final executable link is untouched and still uses the full LIBS. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Adds RKC integrator option, includes PR #52 bsl restart fix
* add config_fastisostasy_grid_resolution to e3sm namelist assembly * disable unavailable USE statement when FI is not compiled in Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
78eb7e7 to
31188fb
Compare
TestingCompass full_integration suite on pm:
|
This commit replaces the approach from 9715c1c with a cleaner solution that requires no changes to mpas-framework/Makefile and no machine-specific TOML configuration files. Changes: 1. Remove LIBS pollution in build_options.mk - The override LIBS line was causing LIBS to contain paths to .a files that don't exist yet during the build - These paths were inherited by the FFTW ./configure subprocess, causing C compiler cannot create executables errors 2. Bundle FastIsostasy libraries into libdycore.a (src/Makefile) - Extract objects from libisostasy.a, libfesmutils.a, and libfftw3.a - Add them directly to libdycore.a using ar -ru - Follows the same pattern as Sea Level Model (SLM) - Framework already links -ldycore, so all symbols are found 3. Inherit MPAS compiler settings for FFTW build (src/Makefile) - Pass CC_SERIAL, FC_SERIAL, CFLAGS_OPT, FFLAGS_OPT as environment vars - Generic linux/gfortran config picks these up via autotools defaults - No machine-specific TOML files needed - works on any MPAS machine This approach eliminates the need for: - PIO_TEST_LIBS workaround in mpas-framework/Makefile - Machine-specific fesm-utils/machines/*.toml configuration files - Any modifications to the shared mpas-framework code Commit 9715c1c should be reverted from components/mpas-framework/Makefile. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This reverts the mpas-framework/Makefile changes from commit 9715c1c. The PIO_TEST_LIBS workaround was needed because LIBS contained paths to FastIsostasy .a files that didn't exist yet. Now that FastIsostasy libraries are bundled into libdycore.a instead of being added to LIBS, this workaround is no longer necessary. See commit 1c71965 for the new FastIsostasy linking approach.
TestingCompass full_integration suite on pm with the two new commits modifying the FI build. Built from a fresh clone.
|




This PR adds FastIsostasy as an alternate GIA model to the existing global 1d Sea Level Model. The implementation makes use of a lot of the existing coupling code and builds off of FastIsostasy documentation on coupling here:
https://github.com/palma-ice/FastIsostasy/blob/main/README.md#coupling-fastisostasy-to-your-favorite-ice-sheet-model