In the following, <CONFIGNAME>, <EXPT_ID>, and <IEXPT> are placeholders for user-defined
values, see the table in the directory structure section for a
description and examples of each.
Set up the work directory
Copy the model configuration template and create a symlink to the utility scripts:
CONFIGNAME=<CONFIGNAME> # e.g. TP2a0.10
cd $WORK
cp -r $HOME/NERSC-HYCOM-CICE/${CONFIGNAME} .
cd $WORK/${CONFIGNAME}
ln -sf $HOME/NERSC-HYCOM-CICE/bin .
Note
The bin symlink is required because scripts in bin/ call each other using relative
../bin/ paths, assuming they are run from an experiment subdirectory. Without the
symlink, those internal calls would fail.
expt_preprocess.sh looks up nest/, relax/, and force/ relative to the <CONFIGNAME>/
directory — redirect them with symlinks onto the scratch filesystem. Set WDIR to the scratch
path for your machine:
WDIR — scratch path by machine
WDIR=$USERWORK/${CONFIGNAME}
WDIR=/cluster/work/projects/nn2993k/$USER/${CONFIGNAME}
Then create the directories and symlinks:
mkdir -p $WDIR $WDIR/nest
cd $WORK/${CONFIGNAME}
mv relax $WDIR/relax
mv force $WDIR/force
mkdir -p $WDIR/force/synoptic
ln -sf $WDIR/nest nest
ln -sf $WDIR/relax relax
ln -sf $WDIR/force force
Important
nest/, relax/, and force/ hold input data that is expensive to regenerate. Because the
scratch filesystem is purged after 21 days, stage this data back from NIRD (or re-create it)
before restarting a run if these directories have aged out.
Configure REGION.src
Copy the template into the configuration directory:
CONFIGNAME=<CONFIGNAME> # e.g. TP2a0.10
cd $WORK/${CONFIGNAME}
cp $HOME/NERSC-HYCOM-CICE/input/REGION.src .
Open REGION.src and update the following lines to match your setup:
export R=<CONFIGNAME>
...
export NHCROOT=${HOME}/NERSC-HYCOM-CICE
Create the experiment directory
Use expt_new.sh to create a new experiment from the template experiment 01.0:
CONFIGNAME=<CONFIGNAME> # e.g. TP2a0.10
EXPT_ID=<EXPT_ID> # e.g. 01.0
cd $WORK/${CONFIGNAME}
bin/expt_new.sh 01.0 ${EXPT_ID}
This creates expt_<EXPT_ID>/ with default configuration files that you will
adjust in the following steps.
Note
When you must create a new experiment — small parameter tweaks (e.g. viscosity) can be made in an existing experiment. But the following changes require a new experiment directory to avoid inconsistencies between the restart files, topography, and relaxation fields:
Topography version change — the bottom pressure field (
pbot) stored in restart files is tied to the topography; mismatched versions will cause inconsistencies.Vertical grid change — any of the vertical discretisation parameters in
blkdat.input(kdm,nhybrd,nsigma,dp00*,ds00*, sigma layer densities) must be consistent with the relaxation and climatology files.HYCOM version change — new model versions often introduce changes to
blkdat.input; a fresh experiment directory lets you update the configuration without overwriting a working one.
What does expt_new.sh do?
Validates the environment — the script must be run from either an experiment directory (containing
EXPT.src) or the configuration root (containingREGION.src). It also checks thattopo/regional.grid.bexists, which means the grid must already be in place.Copies the template experiment — all files from
expt_<old>/are copied to the new directory withrsync, skipping thedata/,log/, andSCRATCH/subdirectories (those are created fresh and empty). This includes configuration files such asblkdat.input,EXPT.src, and the job submission scriptsrjob.sh.Updates
EXPT.src— theX=andE=lines are rewritten to reflect the new experiment ID (e.g.X="02.6"andE="026").Updates
blkdat.input— theiexpt,idm, andjdmfields are updated automatically:iexptis set from the new experiment number, andidm/jdmare read directly fromtopo/regional.grid.b, so they always match the actual grid.Renames PBS job scripts — any
pbsjob*.shfiles have their-Njob-name line updated to<CONFIGNAME>_X<EXPT_ID>for easier identification in the job queue.
Copy hycom_opt into the experiment directory:
CONFIGNAME=<CONFIGNAME> # e.g. TP2a0.10
EXPT_ID=<EXPT_ID> # e.g. 01.0
cd $WORK/${CONFIGNAME}/expt_${EXPT_ID}
cp $HOME/NERSC-HYCOM-CICE/TP5a0.06/expt_01.0/hycom_opt .
hycom_opt is a Fortran namelist read by the model at runtime. Open it and update the
values for your experiment. For TP2, the file should look like this:
&hycom_nml
write_arche = .false.
sss_underice= .false.
highfq_river= .false.
sssrmx_scalar=.5
/
Option |
Description |
|---|---|
|
Write ESMF archive files at each coupling step. Useful for debugging the ESMF coupling interface; leave |
|
Apply SSS relaxation under sea ice. When |
|
Use time-varying (high-frequency) river forcing instead of the climatological river forcing. Requires |
|
Maximum SSS anomaly (psu) at which relaxation is still applied. Relaxation is suppressed where the model–climatology difference exceeds this value. |
Configure blkdat.input
blkdat.input controls core model parameters. The easiest starting point is to copy it
from an existing experiment for your configuration. For TP2, reference files are available
at:
With nesting boundary:
/nird/datalake/NS9481K/shuang/TP2_setup/exp02.6_seaclim_ref/blkdat.inputWith climatology boundary:
/nird/datalake/NS9481K/shuang/TP2_setup/exp02.6_seaclim_ref/blkdat.input_clim
Copy it into place:
CONFIGNAME=<CONFIGNAME> # e.g. TP2a0.10
EXPT_ID=<EXPT_ID> # e.g. 01.0
cd $WORK/${CONFIGNAME}/expt_${EXPT_ID}
cp <path/to/reference/blkdat.input> .
Each field occupies its own line; change the leading numeric value only. At minimum, update these fields for each new experiment:
Field |
Description |
Notes |
|---|---|---|
|
Experiment number ×10 |
e.g. |
|
Number of BGC tracers |
|
Full blkdat.input parameter reference (with example values)
Grid and configuration
Field |
TP2 value |
Description |
|---|---|---|
|
|
HYCOM version number ×10 |
|
|
Experiment number ×10 |
|
|
Longitudinal array size |
|
|
Latitudinal array size |
|
|
Grid point for detailed diagnostics (-1=none) |
|
|
Grid point for detailed diagnostics (-1=none) |
|
|
Number of layers |
|
|
Number of layers in the hybrid generator (0=all isopycnal) |
|
|
Number of terrain-following sigma levels at the surface |
Vertical grid spacing
Field |
TP2 value |
Description |
|---|---|---|
|
|
Deep z-level minimum thickness (m) |
|
|
Deep z-level maximum thickness (m) |
|
|
Deep z-level stretching factor (1.0=constant) |
|
|
Shallow z-level minimum thickness (m) |
|
|
Shallow z-level maximum thickness (m) |
|
|
Shallow z-level stretching factor (1.0=constant) |
|
|
Deep isopycnal spacing minimum thickness (m) |
|
|
Shallowest depth for isopycnal layers (m; <0=from file) |
|
|
Minimum 1+eta, must be >0 |
Layer densities
One isopycnal target density (sigma) per layer — nhybrd values in total. Each layer
tracks water of that target density when the water column is sufficiently stratified. The
choice of target densities determines the vertical coordinate structure and is
configuration-specific; take these values from a reference file for your configuration.
In the TP2 configuration, the first 10 entries are assigned unrealistically light densities (sigma 0.1–1.0). Real ocean water never reaches those densities, so these layers remain near the surface and act as quasi-fixed surface layers. Layers 11–50 carry realistic isopycnal target densities ranging from 24.05 to 28.12 (sigma units).
Hybrid generator
Field |
TP2 value |
Description |
|---|---|---|
|
|
Robert-Asselin flag (0=F, 1=T) |
|
|
Inverse relaxation coefficient (time steps) |
|
|
Use PCM if layer is within this value of target density |
|
|
Ratio of layer thicknesses to select the thinner |
|
|
Thick-thin-thick ratio to expand the thin layer |
|
|
Remapper flag (0=PCM, 1=PLM, 2=PPM) |
|
|
Generator flag (0=T&S, 1=th&S, 2=th&T) |
Initialization
Field |
TP2 value |
Description |
|---|---|---|
|
|
Initial salinity (psu); only used when |
|
|
Locally-referenced potential density for stability (0=F, 1=T) |
|
|
Thermobaric reference state (-1=input, 0=none, 1–3=constant) |
|
|
Reference pressure flag (0=Sigma-0, 2=Sigma-2) |
|
|
Reference density (sigma units) |
|
|
Spatially varying isopycnal target densities (0=F, 1=T) |
|
|
Initial state flag (0=level, 1=zonal, 2=climatology) |
|
|
Initial Jerlov water type (1–5; 0=use KPAR) |
Time stepping
Field |
TP2 value |
Description |
|---|---|---|
|
|
Days-in-year flag (0=360, 1=366, 2=366J1, 3=actual) |
|
|
Baroclinic time step (s); must divide 86400 |
|
|
Barotropic time step (s); must divide baclin/2 |
|
|
Robert-Asselin time filter weight |
|
|
Barotropic time smoothing weight |
|
|
Leapfrog barotropic time step (0=F, 1=T) |
|
|
Barotropic mass conservation (0=F, 1=T) |
Advection and dynamics
Field |
TP2 value |
Description |
|---|---|---|
|
|
Thermal advection flag (0=T&S, 1=th&S, 2=th&T) |
|
|
Scalar advection type (0=PCM, 1=MPDATA, 2=FCT2, 4=FCT4) |
|
|
Momentum advection type (2=2nd order, 4=4th order) |
|
|
Boundary condition (+1=free-slip, -1=non-slip) |
|
|
Deformation-dependent Laplacian viscosity factor |
|
|
Deformation-dependent biharmonic viscosity factor |
|
|
Speed-dependent biharmonic viscosity factor |
Diffusion
Field |
TP2 value |
Description |
|---|---|---|
|
|
Laplacian momentum diffusion velocity (m/s) |
|
|
Biharmonic momentum diffusion velocity (m/s; <0=from file) |
|
|
Laplacian thickness diffusion velocity (m/s) |
|
|
Biharmonic thickness diffusion velocity (m/s; <0=from file) |
|
|
Laplacian temperature/salinity diffusion velocity (m/s) |
|
|
Temperature diffusion conservation (0=density, 1=temperature) |
|
|
Momentum diffusion velocity at MICOM mixed layer base (m/s) |
Bottom friction
Field |
TP2 value |
Description |
|---|---|---|
|
|
RMS flow speed for linear bottom friction (m/s) |
|
|
Quadratic bottom friction coefficient |
|
|
Limiter for explicit friction (1.0=none, 0.0=implicit) |
|
|
Bottom boundary layer thickness (m) |
Mixed layer and interface
Field |
TP2 value |
Description |
|---|---|---|
|
|
Minimum density jump across interfaces (kg/m³) |
|
|
Equivalent temperature jump across mixed layer (°C) |
|
|
SSS relaxation e-folding time |
|
|
Reference mixed-layer thickness for SSS relaxation (m) |
|
|
Reference mixed-layer thickness for SST relaxation (m) |
|
|
Nominal thickness of river inflow (m) |
|
|
Thickness for near-surface currents in ice-ocean stress (m) |
|
|
Maximum thickness of near-surface freezing zone (m) |
KPP mixed layer
Field |
TP2 value |
Description |
|---|---|---|
|
|
Mixed layer scheme (0=none, 1=KPP, 2–3=KT, 4=PWP, 5=MY, 6=GISS) |
|
|
Penetrating solar radiation (0=F, 1=T) |
|
|
Minimum mixed-layer thickness (m) |
|
|
Diapycnal mixing flag (0=none, 1=KPP, 2=explicit) |
|
|
Time steps between diapycnal mixing calculations |
|
|
Diapycnal diffusivity × buoyancy frequency (m²/s²) |
|
|
KPP: maximum gradient Richardson number (shear instability) |
|
|
KPP: critical bulk Richardson number |
|
|
KPP: minimum surface boundary layer thickness (m) |
|
|
KPP: maximum surface boundary layer thickness (m) |
|
|
KPP/KT: Ekman depth scale factor |
|
|
KPP: Monin-Obukhov depth scale factor |
|
|
KPP: activate bottom boundary layer (0=F, 1=T) |
|
|
KPP: activate shear instability mixing (0=F, 1=T) |
|
|
KPP: activate double diffusion mixing (0=F, 1=T) |
|
|
KPP: activate nonlocal boundary layer mixing (0=F, 1=T) |
|
|
Activate bottom-enhanced internal wave mixing (0=F, 1=T) |
|
|
Output viscosity/diffusivity coefficients in archive (0=F, 1=T) |
|
|
KPP: max viscosity due to shear instability (m²/s) |
|
|
KPP: max diffusivity due to shear instability (m²/s) |
|
|
KPP: background/internal wave viscosity (m²/s) |
|
|
KPP: background/internal wave diffusivity (m²/s) |
|
|
KPP: salt fingering diffusivity factor (m²/s) |
|
|
KPP: boundary layer interpolation flag (0=const., 1=linear, 2=quad.) |
|
|
KPP: iterations for semi-implicit solution (2 recommended) |
|
|
KPP: activate Langmuir turbulence factor (0=F, 1=T) |
Sea ice
Field |
TP2 value |
Description |
|---|---|---|
|
|
Sea ice model (0=none, 1=energy loan, 2=coupled/ESMF) |
|
|
Ice melting point at S=0 psu (°C) |
|
|
Gradient of ice melting point (°C/psu) |
|
|
E-folding time back to freezing point (days; <0=time steps) |
|
|
Temperature gradient inside ice (°C/m); 0=use surface temp |
|
|
Minimum ice thickness (m) |
|
|
Maximum ice thickness (m) |
|
|
Ice shelf flag (0=none, 1=ice shelf over ocean) |
Tracers
Field |
Example |
Description |
|---|---|---|
|
|
Number of tracers (0=none; negative=initialize) |
|
|
Tracer flags (one digit per tracer, most significant replicated) |
|
|
Number of diagnostic tracers |
|
|
Time steps between anti-drift offset calculations |
|
|
Temperature anti-drift offset (°C/century) |
|
|
Salinity anti-drift offset (psu/century) |
Forcing
Field |
Example |
Description |
|---|---|---|
|
|
Climatology frequency (6=bimonthly, 12=monthly) |
|
|
Wind stress input (0=none, 1=u/v-grid, 2–3=p-grid, 4–5=10m wind) |
|
|
Scale factor for ocean current in relative wind (0=absolute wind) |
|
|
ustar forcing flag (1–2=wind speed, 3=input, 4=stress) |
|
|
Thermal forcing flag (0=none, 3=net flux, 1–2/4–6=SST-based) |
|
|
E-P forcing flag (0=none, 3=net E-P, 1–2/4–6=SST-based) |
|
|
E-P balance target (mm/week into ocean) |
|
|
E-P balance flag (0=none, 1=offset, 2=scale) |
|
|
Diurnal shortwave flag (0=none, 1=daily-to-diurnal correction) |
|
|
Ocean albedo flag (0=none, 1=constant, 2=L&Y) |
|
|
SSS relaxation flag (0=none, 1=climatology) |
|
|
SSS relaxation balance flag (0=none, 1=offset, 2=scale) |
|
|
Longwave flag (0=none, 1=climatology, 2=atmosphere) |
|
|
SST relaxation flag (0=none, 1=clim, 2=atmos, 3=observed) |
|
|
Ice mask flag (0=none, 1=clim, 2=atmos, 3=obs/coupled) |
|
|
MSL pressure offset: input field + prsbas (Pa) |
|
|
MSL pressure forcing flag (0=F, 1=T) |
|
|
Net stress offset flag (0=F, 1=T) |
|
|
Net flux offset flag (0=F, 1=T) |
|
|
Smooth surface fluxes (0=F, 1=T) |
Lateral boundary and nesting
Field |
Example |
Description |
|---|---|---|
|
|
Lateral barotropic boundary flag (0=none, 1=port, 2=input) |
|
|
Barotropic nesting archives have sshflg=2 |
|
|
Activate lateral boundary nudging (0=F, 1=T) |
|
|
Activate lateral boundary tracer nudging (0=F, 1=T) |
|
|
Rivers as precipitation (0=F, 1=T) |
|
|
Treat E-P as mass exchange (0=F, 1=T) |
Incremental update
Field |
TP2 value |
Description |
|---|---|---|
|
|
Incremental update flag (0=no, 1=yes, 2=full-velocity) |
|
|
Number of time steps for full update (1=direct insertion) |
|
|
Number of days of incremental updating input |
Stochastic forcing
Field |
TP2 value |
Description |
|---|---|---|
|
|
Stochastic anomaly forcing (0=no, 1=TS, 2=TSV) |
|
|
Stochastic T anomaly e-folding depth (m) |
|
|
Stochastic S anomaly e-folding depth (m) |
|
|
Stochastic V anomaly e-folding depth (m) |
Tides
Field |
TP2 value |
Description |
|---|---|---|
|
|
Tidal forcing flag (0=none, 1=open boundary, 2=boundary+body) |
|
|
Tide field input flag (0=no, 1=yes, 2=SAL) |
|
|
Tidal constituents: one digit per (Q1 K2 P1 N2 O1 K1 S2 M2) |
|
|
Scalar self-attraction and loading factor (<0=from file) |
|
|
Tidal drag flag (0=no, 1=scalar, 2=tensor) |
|
|
Bottom boundary layer thickness for tidal drag (m) |
|
|
Scale factor for tidal drag (0=no tidal drag) |
|
|
Generic time (0=F, 1=T) |
|
|
Tidal ramp time (days) |
|
|
Origin for tidal ramp time (model day) |
Synthetic floats
Field |
TP2 value |
Description |
|---|---|---|
|
|
Synthetic float flag (0=no, 1=yes) |
|
|
Advect every nfladv baroclinic time steps (even, ≥4) |
|
|
Output (0=every nfladv steps; >0=number of days) |
|
|
Horizontal interpolation (0=2nd order+n.n., 1=n.n. only) |
|
|
Add horizontal turbulent advection velocity (0=no, 1=yes) |
|
|
Sample water properties at float (0=no, 1=yes) |
|
|
Horizontal turbulent velocity variance scale (m²/s²) |
|
|
Inverse decorrelation time scale (1/day) |
Output frequencies
Field |
Example |
Description |
|---|---|---|
|
|
SSH output flag (0=SSH, 1=SSH+steric SSH) |
|
|
Days between surface diagnostics |
|
|
Days between full diagnostics |
|
|
Days between profile diagnostics |
|
|
Days between tile diagnostics |
|
|
Days between time-averaged diagnostics |
|
|
Days between restart output |
|
|
Days between barotropic nesting archive input |
|
|
Days between 3-D nesting archive input |
|
|
Days (or time steps) between sea ice coupling |
Output file names
Field |
Example |
Description |
|---|---|---|
|
|
Restart input filename (dot and date appended; empty=old HYCOM name) |
|
|
Restart output filename (dot and date appended; empty=old HYCOM name) |
|
|
Surface archive filename |
|
|
Full archive filename |
|
|
Mean archive filename |
Configure EXPT.src
EXPT.src sets experiment-level parameters sourced at runtime and during compilation.
Open $WORK/<CONFIGNAME>/expt_<EXPT_ID>/EXPT.src and update:
Line to find |
Value to set |
Notes |
|---|---|---|
|
|
Experiment identifier (dot notation) |
|
|
Experiment identifier (no dot) |
|
|
Topography version |
|
|
HYCOM version, determines which source directory is used when compiling |
|
e.g. |
Number of ocean MPI tiles |
|
e.g. |
Maximum ice blocks per MPI process |
|
|
BGC coupling on/off |
Note
For TP2, the available topography versions are: 01 (initial interpolation), 02 (adds
Ob river channel), 03 (identical to 02), 04 (blends 02/03 with NEMO topography
at the nesting boundary). Higher numbers are newer refinements, not changes in resolution.
Use 04 for current experiments.
Note
NMPI is determined by the tiling step in
Preparing External Files (which requires
hycom_ALL to be compiled first). For TP2 on Betzy,
with topography version 04 and Icore=29, Jcore=26, the result is 504, so you can
set that now. For other configurations, leave it as a placeholder and fill it in after
running create_ref_case.sh. Compilation of HYCOM-CICE does not use NMPI.
Note
If the model reports that ice blocks exceed the maximum, increase MXBLCKS to the value
recommended in the error message.
Other variables in EXPT.src
Variable |
Description |
|---|---|
|
Equation of state version; must be consistent with |
|
Number of layers — auto-derived from |
|
Experiment directory path — set automatically from the script location |
|
Permanent data directory ( |
|
Scratch directory ( |
Both machines — redirect SCRATCH and data onto the scratch filesystem
Keep the experiment tree (configuration and build/) on the non-purged $WORK
(/cluster/projects/nn2993k/$USER), and put the two large directories — scratch and output —
on the fast, purged scratch filesystem. Override the auto-set S= and D= lines in EXPT.src.
The scratch path differs by machine:
export S=$USERWORK/<CONFIGNAME>/expt_<EXPT_ID>/SCRATCH
export D=$USERWORK/<CONFIGNAME>/expt_<EXPT_ID>/data
export S=/cluster/work/projects/nn2993k/$USER/<CONFIGNAME>/expt_<EXPT_ID>/SCRATCH
export D=/cluster/work/projects/nn2993k/$USER/<CONFIGNAME>/expt_<EXPT_ID>/data
This is safe: expt_preprocess.sh only creates (mkdir -p) and enters (cd) $S and $D —
it never deletes them — and the overrides propagate automatically when expt_new.sh copies
EXPT.src to a new experiment. P= and build/ stay on $WORK, so the configuration and
compiled executable survive the purge.
Note
expt_preprocess.sh also accesses relax/ via ${D}/../../relax/ (two levels up from $D).
When D= is overridden to a path on the scratch filesystem, ${D}/../../ resolves to the
scratch <CONFIGNAME>/ subtree — so relax/ must be on scratch as well, which is exactly what
the symlinks described above (Set up the work directory) provide.
Important
data/ is now on the purged filesystem, so archive completed output to NIRD on a rolling
basis (e.g. per model year as it finishes) from a service node — the scratch filesystem is
purged by file age, so early output can age out while a long run is still going.