Skip to content

Rename libglimmer, libglimmer-solve and two basal modules; merge the isostasy modules - #112

Open
whlipscomb wants to merge 8 commits into
lipscomb/config_reorg_r4from
lipscomb/rename_dirs_modules
Open

whlipscomb wants to merge 8 commits into
lipscomb/config_reorg_r4from
lipscomb/rename_dirs_modules

Conversation

@whlipscomb

@whlipscomb whlipscomb commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Branch: lipscomb/rename_dirs_modules (7 commits, 5702131..a4bebfe, plus the merge commit 593b92d)
Base: lipscomb/config_reorg_r4 (#111). Stacked; the base will be changed to main after the config reorganization PRs are merged.
CISM-wrapper: companion PR ESCOMP/CISM-wrapper#167 (1 commit: the unit-test Filepath). The wrapper's build (buildlib) needs no change.

Update (December 2026): one merge commit at the end of this branch (593b92d) brings in the lateral melt fixes from the review of #99, which are now at the end of the #99 branch (they were first made in #114, which no longer changes anything). It changes nothing else in this PR.

Summary

Code reorganization with no answer changes:

  1. Directories: libglimmer → cism_shared and libglimmer-solve → glimmer_solve. The files and modules keep their names (glimmer_*), so no use statement changes.
  2. Modules named after their config sections and types: glissade_basal_traction → glissade_basal_physics ([basal_physics], glissade_basal_physics_type) and glissade_basal_water → glissade_basal_hydro ([basal_hydro], glissade_basal_hydro_type).
  3. One isostasy module: glissade_isostasy_elastic and glissade_isostasy_kelvin, used only by glissade_isostasy, are merged into it as private procedures, in keeping with one module per physics category (as for calving, basal physics and basal hydrology). The unused single-precision Kelvin functions are removed.
  4. Halfar test scripts read rhoi from the config file.

Module names were checked against all other names in the code: no procedure, type or variable has the name of a new module, and the new names keep the glissade_ prefix, so they stay unique in CESM.

Changes

libglimmer → cism_shared (5702131). The directory holds the code shared by Glide, Glissade, GLAD and Glint. Paths are updated in CMakeLists.txt (the source glob and the I/O template and version files), the three utils/build scripts, the Halfar scripts and a comment in glide.F90.

libglimmer-solve → glimmer_solve (98e7bca). Paths are updated in CMakeLists.txt and the README, and a comment in glissade_types.F90.

Halfar rhoi (61bb5cc). runHalfar.py and halfar_results.py got the ice density by grepping glimmer_physcon.F90 for real(dp),parameter :: rhoi =. rhoi has been a variable since 2015 (66b123a), so the grep found nothing and the scripts always used 910 with a warning. A new function get_rhoi reads rhoi from [constants] (Glissade) or [parameters] (Glide), else uses CISM's default of 910.

glissade_basal_traction → glissade_basal_physics (9085c61) and glissade_basal_water → glissade_basal_hydro (d21a83f), with glissade_basal_water_init → glissade_basal_hydro_init. The other procedure names are unchanged.

Isostasy (bf07092, a4bebfe). glissade_isostasy keeps its public interface (glissade_isostasy_init, glissade_isostasy_solve, verbose_isostasy); glissade.F90 is unchanged. The elastic-lithosphere and Kelvin-function procedures are moved to the end of the module unchanged (checked with a script), except:

  • glissade_init_elastic and glissade_calc_elastic, now private, are elastic_init and elastic_calc;
  • the Kelvin parameter gamma (Euler's constant) is euler_gamma, so it no longer hides the intrinsic GAMMA;
  • the single-precision versions s_ber ... s_dkei, which nothing used, are removed, and the double-precision functions take the generic names (ber, bei, ..., dkei) directly.

git diff --color-moved (or git log -p --color-moved) shows the moved code.

Testing

  • Every commit builds with intel; the isostasy commits also build with gnu. Builds were from empty build directories, so CMake picked up the new paths.
  • Standalone suite after each commit: 63/63 output files BFB with the baseline; the logs are identical to those of the R4 tip (52f030b), apart from time stamps.
  • Dome with isostasy (relaxing asthenosphere; local and elastic lithosphere), after bf07092 and a4bebfe: BFB with 52f030b (23 variables; topography changes by up to 18 m (local) and 0.25 m (elastic) over the run).
  • GrIS/AIS/Alps restart tests at the tip (13 output files): BFB with the R1 originals. The AIS run has an elastic lithosphere and a relaxing asthenosphere with laterally varying relaxation time.
  • Halfar: runHalfar.py -s with both configs writes input files identical to those of the baseline, and reports rhoi = 910 from the default.
  • CESM aux_glc subset of 5 tests (--compare alpha11e_stage1; CISM a4bebfe, wrapper with the companion PR): all PASS (namelist comparison excepted, as for R4). This also tests the build with the renamed directories.
  • After the merge of the Lateral melt updates #99 fixes (593b92d): builds with intel; standalone test suite: output and log files identical to those of the branch tip before the merge (a4bebfe).

Commits

5702131a Rename the libglimmer directory to cism_shared
98e7bca8 Rename the libglimmer-solve directory to glimmer_solve
61bb5ccc Halfar test: read rhoi from the config file
9085c61e Rename glissade_basal_traction to glissade_basal_physics
d21a83fa Rename glissade_basal_water to glissade_basal_hydro
bf07092a Merge the elastic-lithosphere and Kelvin-function modules into glissade_isostasy
a4bebfeb Remove the unused single-precision Kelvin functions
593b92d8 Merge lipscomb/config_reorg_r4 (#111) into #112: lateral melt fixes from the review of #99

🤖 Generated with Claude Code

whlipscomb and others added 7 commits November 20, 2026 16:32
The directory holds the code shared by Glide, Glissade, GLAD and Glint;
the new name says so. The files and modules in it keep their glimmer_*
names, so no use statement changes.

Paths are updated in CMakeLists.txt (the source glob and the I/O
template and version files), the three utils/build scripts and the
Halfar test scripts, which read rhoi from glimmer_physcon.F90. The
warning in the Halfar scripts also had a wrong path (../../../); it now
names the same file as the grep.

No answer changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The directory holds the SLAP sparse solvers and their interface
(glimmer_sparse*); the new name drops the "lib" prefix, as cism_shared
does, and uses an underscore like the other source directories.

Paths are updated in CMakeLists.txt and the README, and a comment in
glissade_types.F90.

No answer changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
runHalfar.py and halfar_results.py got the ice density by grepping
glimmer_physcon.F90 for "real(dp),parameter :: rhoi =". rhoi has been a
variable (settable in the config) for a long time, so the grep found
nothing and the scripts always fell back to 910 with a warning; a config
that set rhoi would have been compared with the wrong analytic solution.

A new function get_rhoi in runHalfar.py, also used by halfar_results.py,
reads rhoi from [constants] (Glissade) or [parameters] (Glide) and
otherwise uses CISM's default of 910.

No answer changes (the Halfar configs do not set rhoi).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The module now has the name of the config section ([basal_physics]) and
of the derived type (glissade_basal_physics_type) whose settings it
uses. It computes beta for the sliding laws and the effective pressure.
The procedure names are unchanged.

No answer changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The module now has the name of the config section ([basal_hydro]) and of
the derived type (glissade_basal_hydro_type) whose settings it uses; its
init routine is renamed glissade_basal_hydro_init to match. The other
procedure names are unchanged.

No answer changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…de_isostasy

glissade_isostasy_elastic and glissade_isostasy_kelvin were used only by
glissade_isostasy. Their code is now at the end of glissade_isostasy as
private procedures, in keeping with one module per physics category.
glissade_isostasy_init and glissade_isostasy_solve (and verbose_isostasy)
remain the only public names.

The procedures are moved unchanged, except:
- glissade_init_elastic and glissade_calc_elastic, now private, are
  renamed elastic_init and elastic_calc;
- the Kelvin parameter gamma (Euler's constant) is renamed euler_gamma,
  so that it no longer hides the Fortran intrinsic GAMMA in the module;
- the use statements between the three modules are removed; the module
  variables (verbose_elastic, euler_gamma, j_max, tolerance) and the
  Kelvin generic interfaces move to the top of the module.

No answer changes (dome with local and elastic lithosphere, relaxing
asthenosphere: BFB with the previous executable).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Kelvin functions (ber, bei, ker, kei and their derivatives) had
single-precision versions s_* behind generic interfaces; nothing used
them. They are removed, and the double-precision functions d_* take the
generic names, so the calls in the elastic-lithosphere code are
unchanged. The local variables p_d_* are renamed p_* to match.

No answer changes (dome with local and elastic lithosphere, relaxing
asthenosphere: BFB with the previous executable).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rom the review of #99

The fixes for the issues found in Kate's review of #99, first made in #114,
were added at the end of the #99 branch (lipscomb/lateral_melt). This merge
carries them forward to this branch; it brings in no other changes.

Answers change only for lateral melt (lateral_melt_method = ismip), as in #114.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
whlipscomb added a commit that referenced this pull request Dec 2, 2026
…es from the review of #99

The fixes for the issues found in Kate's review of #99, first made in #114,
were added at the end of the #99 branch (lipscomb/lateral_melt). This merge
carries them forward to this branch; it brings in no other changes.

Answers change only for lateral melt (lateral_melt_method = ismip), as in #114.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants