Scripts for computing sea-level contributions (SLC) and other scalar variables from ISMIP7 ice sheet model output for the Antarctic Ice Sheet (AIS) and Greenland Ice Sheet (GrIS). All scripts expect ISMIP7-compliant model output on the diagnostic ISMIP grid following ISMIP7 conventions for file names and units.
Three parallel implementations are provided: Python (primary), NCO/bash (GrIS only), and MATLAB.
conda create -n nc
conda activate nc
conda install -c conda-forge cdo=2.4.4 nco netCDF4 scipyIn addition to model output, the scripts require masks and area factors available on the ISMIP Globus server under Output-Processing. Model-specific density parameters (rhoi, rhow, rhof) are read from a params.nc file in the model directory.
By default, Data/ and Models/ are expected at the repository root. Any location on the file system can be used instead via the --datapath and --modelpath command-line options.
ismip7-scalar-processing/ # repository root
├── slc/ # shared SLC computation package
├── python/scalars.py # AIS + GrIS (--region flag)
├── matlab/scalars.m # AIS + GrIS (region variable)
├── nco/scalars_GrIS.sh # GrIS NCO/bash implementation
├── Data/ # default location for masks and area factors
│ ├── AIS/
│ ├── GrIS/
│ ├── MINI0/
│ └── MINI1/
├── Models/ # default location for model output
│ ├── AIS/{lab}/{model}/{exp}_{res}/
│ ├── GrIS/{lab}/{model}/{exp}_{res}/
│ └── MINI/ISMIP7/{MINI0,MINI1}/{exp}/
└── manual-tests/
├── compare_outputs.py # Python vs MATLAB comparison (--region filter)
├── test_histout.py # integration test for --histout
├── test_refyear.py # integration test for --refyear
└── MINI/ # lightweight MINI test suite
├── scalars_MINI.py
├── run_MINI.py
├── output/
└── setup/ # experiment generation and remapping tools
├── derive_exp0.py
├── check_masks.py
├── ground.sh
├── interpolate.sh
├── remapCDO.sh
├── gdf_ISMIP7_MINI0.txt
└── gdf_ISMIP7_MINI1.txt
All scripts accept CLI arguments; the default settings match the NORCE/CISM08-MAR312-p50 (GrIS) and VUW/PISM1 (AIS) reference configurations.
cd python
conda run -n nc python3 scalars.py --region AIS
conda run -n nc python3 scalars.py --region GrIS
conda run -n nc python3 scalars.py --region AIS --lab ISMIP7 --model TEST --exp exp0 --hist historicalKey arguments: --region {AIS,GrIS} (required), --lab, --model, --exp, --hist, --refyear, --histout, --res, --datapath, --modelpath, --outpath.
Output is written to ./output/ relative to the script directory.
cd matlab
matlab -nodisplay -nosplash -r "region='AIS'; run('scalars.m'); exit"
matlab -nodisplay -nosplash -r "region='GrIS'; run('scalars.m'); exit"Set workspace variables before run() to override any default (lab, model, exp, hist, refyear, res, datapath, modelpath, outpath).
First create the model-specific parameter file, then run the main script:
cd nco
bash set_params.sh
bash scalars_GrIS.shThe MINI suite provides lightweight test cases on a coarse 11×11 grid (600 km pixels) for rapid validation.
cd manual-tests/MINI
# Run a single case
conda run -n nc python3 scalars_MINI.py --model MINI1 --exp exp0
# Run all combinations (MINI0/MINI1 × exp0/expg) and print summary
conda run -n nc python3 run_MINI.pyExperiment generation and grid remapping tools live in manual-tests/MINI/setup/.
Two grid variants are available:
| Grid | Size | Origin (xfirst, yfirst) | Notes |
|---|---|---|---|
| MINI1 | 11×11 | −3,040,000 m | primary test grid |
| MINI0 | 12×12 | −3,340,000 m | half-cell-offset variant for CDO remapping tests |
MINI differs from the full AIS/GrIS scripts in three ways: the first time step serves as the SLC baseline (no separate historical reference), standard densities are used directly (no params.nc), and area weighting uses dx² directly.
The slc/ package implements three sea-level contribution methods:
| Method | Description |
|---|---|
slc_vaf |
Volume Above Flotation — ISMIP6 method, freshwater conversion |
slc_G2020 |
Goelzer et al. 2020 (TC) — adds potential ocean volume and density corrections |
slc_A2020 |
Adhikari et al. 2020 (TC) — absolute reference frame with grounding-line migration |
Three volume diagnostics are also computed (total, grounded, floating ice volume change).
Ocean area normalization uses oarea = 3.625 × 10¹⁴ m² (Gregory et al. 2019).
After running both Python and MATLAB versions, compare outputs:
cd manual-tests
conda run -n nc python3 compare_outputs.py --region AIS
conda run -n nc python3 compare_outputs.py --region GrISExpected tolerance: < 1 × 10⁻¹⁰ m.
Integration tests for --histout and --refyear (require --datapath and --modelpath):
cd manual-tests
conda run -n nc python3 test_histout.py --datapath <path> --modelpath <path>
conda run -n nc python3 test_refyear.py --datapath <path> --modelpath <path>