When interacting with models and model results, some tools are useful for visualising (e.g., xconv, panoply), some tools are useful for downloading files (e.g., ftp_master), and some tools are useful for configuration/ancillary manipulation (e.g., xancil, isla).
A quick rule of thumb:
If you are on the newer Rocky-8 BRIDGE machines, most software is provided via environment modules:
module availmodule load <name>module listFor X11 forwarding from macOS:
ssh -Y user@<bridge-host>ssh -X (less permissive) vs ssh -Y (more permissive), and confirm XQuartz is running.https://ncas-cms.github.io/xconv-doc
Xconv is a point-and-click X-windows application widely used to inspect and quickly plot UM PP fields and netCDF. It’s particularly handy for “sanity checking” fields (are values sensible? missing values? time axis?) and for quick regridding/output conversion to netCDF for downstream analysis.
How to access
xconv if it’s on your PATH.module avail xconv then module load ....which xconv.Basic tips / quick workflow
Common gotchas
cdo/Python instead.Where to get advanced tips
https://ncas-cms.github.io/xancil-doc/singlehtml/index.html
Xancil is an X-windows application for creating UM ancillary files (e.g., land surface / emissions / climatologies) from netCDF inputs. It’s commonly used when you have prepared a netCDF on a UM-compatible grid and need a UM ancil for the model.
How to access
xancil if on PATH.module avail xancil then module load ....which xancil. User version 0.62.Basic tips (what to prepare before opening xancil)
Common gotchas / troubleshooting
ncrename, ncatted) before xancil.cdo operations). If xancil complains, validate the netCDF headers before trying again.Where to get advanced tips
https://www.giss.nasa.gov/tools/panoply/
Panoply is a desktop GUI for exploring and plotting netCDF/HDF/GRIB data. It’s great for quick-look plotting of netCDF outputs (including those produced by um2nc, xconv, or post-processing pipelines) without writing any code.
How to access
Basic tips
Where to get advanced tips
https://code.mpimet.mpg.de/projects/cdo https://code.mpimet.mpg.de/projects/cdo/embedded/index.html
CDO (Climate Data Operators) is a fast command-line toolbox for common climate/data operations on netCDF/GRIB: temporal means, spatial remapping, subsetting, merges, arithmetic, climatologies, etc. It’s ideal for batch processing near the data (BRIDGE/HPC).
How to access
cdo -V to see if it’s available.module avail cdo then module load ....Basic tips / common commands
cdo sinfo file.nc or cdo infon file.nccdo showname file.nccdo timmean in.nc out_timmean.nccdo ymonmean in.nc out_ymonmean.nccdo remapbil,targetgrid.txt in.nc out_remap.ncCommon gotchas
ncdump -h or Python.Where to get advanced tips
cdo -h and man cdoftp_master is a BRIDGE-specific command used to download experiment output from a remote machine (commonly the University HPC) onto BRIDGE storage, and (in typical configurations) convert outputs into netCDF as part of the transfer workflow. It is often used tidy_expt (finalise/copy remaining files and clean up).
How to access
Basic usage patterns
ftp_master -machine bc4 -expt JOBNAMEtidy_expt -machine bc4 -expt JOBNAMEWhere the data ends up / how to find it
umdata dir.umdata tree for the experiment ID.Common gotchas
tidy_expt too early: it can delete/clean remote run directories as part of tidying.Where to get advanced tips
https://github.com/Climateyousheng/utils_cmip7
utils_cmip7 is a Python toolkit for carbon cycle analysis from UM climate model outputs. It handles the full workflow from raw UM output files to validated results against CMIP6 and RECCAP2 observations.
How to install
git clone https://github.com/Climateyousheng/utils_cmip7.git
cd utils_cmip7
pip install -e .
Requirements: Python >= 3.8, numpy, pandas, matplotlib, iris, cartopy, xarray, cf-units, netCDF4 (all installed automatically with pip install -e .).
The toolkit works with two types of input:
Option A: Pre-processed annual mean NetCDF files (recommended, faster)
Located in ~/annual_mean/{expt}/:
{expt}_pa_annual_mean.nc — atmosphere (temperature, precipitation){expt}_pt_annual_mean.nc — TRIFFID (GPP, NPP, soil respiration, carbon stocks, PFTs){expt}_pf_annual_mean.nc — ocean (fgco2)Generate these from raw output using:
./annual_mean_cdo.sh "xqhuj" ~/annual_mean pt pd pf
Option B: Raw monthly UM files
Located in ~/dump2hold/{expt}/datam/, matching pattern {expt}a#pi00000{YYYY}{MM}+.
The toolkit centralises STASH code mappings so you don’t need to remember them:
| Variable | STASH (PP) | STASH (NC) | Description |
|---|---|---|---|
| GPP | m01s03i261 | 3261 | Gross Primary Production |
| NPP | m01s03i262 | 3262 | Net Primary Production |
| Rh | m01s03i293 | 3293 | Soil respiration |
| CV | m01s19i002 | 19002 | Vegetation carbon |
| CS | m01s19i016 | 19016 | Soil carbon |
| fracPFTs | m01s19i013 | 19013 | PFT fractions |
| fgco2 | m02s30i249 | 30249 | Ocean CO2 flux |
| tas | m01s03i236 | 3236 | Surface air temperature |
| pr | m01s05i216 | 5216 | Precipitation |
Unit conversions are applied automatically (e.g. kgC/m2/s to PgC/yr for fluxes, kgC/m2 to PgC for stocks).
Extract annual means from pre-processed NetCDF:
from utils_cmip7 import extract_annual_means
ds = extract_annual_means(expts_list=['xqhuc'])
# Access data
gpp = ds['xqhuc']['global']['GPP']
print(f"GPP: {gpp['data']} {gpp['units']}")
# Extract specific regions
ds = extract_annual_means(['xqhuc'], regions=['global', 'Europe', 'Africa'])
Extract from raw monthly UM files:
from utils_cmip7 import extract_annual_mean_raw
data = extract_annual_mean_raw('xqhuj', start_year=1850, end_year=1900)
extract_preprocessed.py — Extract annual means for all RECCAP2 regions (global + 10 regions) and generate time series plots:
python scripts/extract_preprocessed.py xqhuc
Outputs to validation_outputs/single_val_{expt}/: a CSV of time-mean values plus per-region time series plots for carbon fluxes, stocks, climate variables, and PFT fractions.
extract_raw.py — Extract from raw monthly files:
python scripts/extract_raw.py xqhuj --outdir ./plots
validate_experiment.py — Three-way validation (UM vs CMIP6 vs RECCAP2):
python scripts/validate_experiment.py xqhuc
Outputs to validation_outputs/single_val_{expt}/:
{expt}_metrics.csv — UM results in observational format{expt}_bias_vs_cmip6.csv — bias, bias %, RMSE, within-uncertainty flag{expt}_bias_vs_reccap2.csv — same for RECCAP2comparison_summary.txt — text summary comparing UM performanceplots/ — three-way comparison bar charts, regional bias heatmaps, time seriesutils-cmip7-extract-raw xqhuj
utils-cmip7-extract-preprocessed xqhuc
utils-cmip7-validate-experiment xqhuc
utils-cmip7-validate-ppe
s suffix (e.g. 3261s) — this is normal CDL type notation and does not affect extraction.~/scripts/hadcm3b-ensemble-validator/observations/RECCAP_AfricaSplit_MASK11_Mask_regridded.hadcm3bl_grid.nc. Override with export UTILS_CMIP7_RECCAP_MASK=/path/to/mask.nc.