State fields¶
veris.model.variables.VARIABLES describes the calculation fields created by
veris.execution.initialization.initialize. Every entry has a default,
units, long name, description and dimensions that identify its grid location.
The grid is staggered: some values sit at cell centers and others at cell
faces. State is a frozen dataclass, whose fields cannot be reassigned, and a
JAX PyTree, a collection of arrays that JAX can process together. Update arrays
by creating a new State with dataclasses.replace.
For an interior of nx by ny cells, horizontal arrays have shape
(nx + 4, ny + 4). The interior is field[2:-2, 2:-2]. Axis zero is zonal
(east-west); axis one is meridional (north-south). Dimensions identify Cartesian
grid locations: x_center, y_center, x_face and y_face. Face and
center arrays have equal storage sizes. Both include two halo cells at each
boundary, which hold boundary or neighboring data. When arrays are split
across devices, each partition keeps its own halos; see
Experiment definitions. Boundary conditions are described in Model settings.
State holds the geometry fields and prescribed forcing used by calculations. Output-only diagnostics and configuration do not add arrays to numerical State. Arrays for ice-thickness categories exist only as intermediate values in the thermodynamics calculations, which describe freezing and melting.
NetCDF metadata¶
The metadata can be used directly with h5netcdf:
from veris.model.variables import VARIABLES
metadata = VARIABLES["uIce"]
variable = output.create_variable(
"uIce", metadata.dimensions, dtype=state.uIce.dtype
)
variable.attrs.update(metadata.netcdf_attributes())
variable[:] = state.uIce
Here output is an open h5netcdf.File with the horizontal dimensions
already defined. The example writes the halos along with the interior. When
exporting only the interior, trim the arrays and adjust the dimension lengths
together.
Registry defaults¶
Variable |
Dimensions |
Units |
Default |
Description |
|---|---|---|---|---|
|
x_center, y_center |
m |
|
Mean ice thickness |
|
x_center, y_center |
m |
|
Mean snow thickness |
|
x_center, y_center |
1 |
|
Sea ice cover fraction |
|
x_center, y_center |
K |
|
Ice/ snow surface temperature |
|
x_center, y_center |
kg m-2 |
|
Sea ice mass centered around c point |
|
x_face, y_center |
kg m-2 |
|
Sea ice mass centered around u point |
|
x_center, y_face |
kg m-2 |
|
Sea ice mass centered around v point |
|
x_center, y_center |
N m-1 |
|
Ice strength |
|
x_center, y_center |
m |
|
Prepared minus raw ice thickness from advection cleanup |
|
x_center, y_center |
m |
|
Prepared minus raw snow thickness from advection cleanup |
|
x_face, y_center |
1 |
|
Sea ice cover fraction centered around u point |
|
x_center, y_face |
1 |
|
Sea ice cover fraction centered around v point |
|
x_face, y_center |
m s-1 |
|
Zonal ice velocity |
|
x_center, y_face |
m s-1 |
|
Meridional ice velocity |
|
x_center, y_center |
N m-1 |
|
Stress trace sigma11 + sigma22 |
|
x_center, y_center |
N m-1 |
|
Normal-stress difference sigma11 - sigma22 |
|
x_face, y_face |
N m-1 |
|
Stress tensor component |
|
x_face, y_center |
Pa |
|
Zonal forcing on ice by wind stress |
|
x_center, y_face |
Pa |
|
Meridional forcing on ice by wind stress |
|
x_center, y_center |
m-1 |
|
Reciprocal square root of hIceMean squared plus hIce_reg; refreshed by initialization or growth |
|
x_center, y_center |
kg m-2 |
|
Load of sea ice on ocean surface |
|
x_face, y_center |
m s-1 |
|
Zonal ocean surface velocity |
|
x_center, y_face |
m s-1 |
|
Meridional ocean surface velocity |
|
x_center, y_center |
K |
|
Ocean surface temperature |
|
x_center, y_center |
g kg-1 |
|
Ocean surface salinity |
|
x_center, y_center |
W m-2 |
|
Net heat flux out of the ocean |
|
x_center, y_center |
m |
|
Sea floor depth (<0) |
|
x_center, y_center |
m |
|
Sea surface height anomaly |
|
x_center, y_center |
W m-2 |
|
Surface shortwave heatflux (+ = upwards) |
|
x_center, y_center |
m s-1 |
|
Zonal wind velocity |
|
x_center, y_center |
m s-1 |
|
Meridional wind velocity |
|
x_center, y_center |
m s-1 |
|
Total wind speed |
|
x_center, y_center |
Pa |
|
Surface pressure |
|
x_center, y_center |
W m-2 |
|
Downward shortwave radiation |
|
x_center, y_center |
W m-2 |
|
Downward longwave radiation |
|
x_center, y_center |
K |
|
Atmospheric temperature |
|
x_center, y_center |
kg kg-1 |
|
Atmospheric specific humidity |
|
x_center, y_center |
m s-1 |
|
Precipitation rate (freshwater flux) |
|
x_center, y_center |
m s-1 |
|
Snowfall rate |
|
x_center, y_center |
m s-1 |
|
Evaporation rate over open ocean (freshwater flux, <0 increases salinity) |
|
x_center, y_center |
m s-1 |
|
Runoff into ocean |
|
x_center, y_center |
1 |
|
Mask at c-points, used for open boundaries |
|
x_face, y_center |
1 |
|
Mask at u-points, used for open boundaries |
|
x_center, y_face |
1 |
|
Mask at v-points, used for open boundaries |
|
x_center, y_center |
1 |
|
Mask at c-points |
|
x_face, y_center |
1 |
|
Mask at u-points |
|
x_center, y_face |
1 |
|
Mask at v-points |
|
x_center, y_center |
m-1 |
|
Zonal metric curvature at cell centers |
|
x_center, y_center |
m-1 |
|
Meridional metric curvature at cell centers |
|
x_face, y_face |
m-1 |
|
Zonal metric curvature at cell corners |
|
x_face, y_face |
m-1 |
|
Meridional metric curvature at cell corners |
|
x_face, y_center |
1 |
|
U-component of form factor |
|
x_center, y_face |
1 |
|
V-component of form factor |
|
x_center, y_center |
s-1 |
|
Coriolis parameter |
|
x_center, y_face |
m |
|
Zonal spacing of cell faces along southern cell wall |
|
x_face, y_center |
m |
|
Meridional spacing of cell faces along western cell wall |
|
x_center, y_center |
m |
|
Zonal spacing of u-points through cell center |
|
x_face, y_face |
m |
|
Meridional spacing of u-points through south-west corner of the cel |
|
x_face, y_face |
m |
|
Zonal spacing of v-points through south-west corner of the cell |
|
x_center, y_center |
m |
|
Meridional spacing of v-points through cell center |
|
x_face, y_center |
m-1 |
|
Reciprocal of dxC |
|
x_center, y_face |
m-1 |
|
Reciprocal of dyC |
|
x_center, y_center |
m-1 |
|
Reciprocal of dxU |
|
x_face, y_face |
m-1 |
|
Reciprocal of dyU |
|
x_face, y_face |
m-1 |
|
Reciprocal of dxV |
|
x_center, y_center |
m-1 |
|
Reciprocal of dyV |
|
x_face, y_face |
m2 |
|
Grid cell area centered around z-point |
|
x_center, y_center |
m-2 |
|
Reciprocal of rA |
|
x_face, y_center |
m-2 |
|
Reciprocal of rAu |
|
x_center, y_face |
m-2 |
|
Reciprocal of rAv |
Coupling diagnostics¶
advance returns these fields in a separate frozen dataclass. These
diagnostics describe the exchange with an ocean model and do not add arrays to
the calculation State. When ice salinity is nonzero, the two terms in the
legacy combined salt forcing use different freshwater normalizations (scaling
factors). Its units are recorded as unknown to avoid misleading units. The
move to this metadata keeps the existing equation.
Variable |
Dimensions |
Units |
Default |
Description |
|---|---|---|---|---|
|
x_center, y_center |
W m-2 |
|
Grid-cell mean shortwave heat flux transmitted through sea ice |
|
x_face, y_center |
N m-2 |
|
Zonal ice-ocean stress from the momentum step at zonal velocity faces |
|
x_center, y_face |
N m-2 |
|
Meridional ice-ocean stress from the momentum step at meridional velocity faces |
|
x_center, y_center |
kg m-2 s-1 |
|
Total ocean mass loss, including ice/snow and external freshwater exchange |
|
x_center, y_center |
g kg-1 m s-1 |
|
Local-salinity virtual forcing: (EmPmR*ocSalt + 1000*ocean_salt_mass_flux)/rhoFresh |
|
x_center, y_center |
1 |
|
Zero for valid physics; one for invalid physical parameters; two for invalid saline-ice formation |
|
x_center, y_center |
kg m-2 s-1 |
|
Downward total bulk mass input, including retained ice salt mass |
|
x_center, y_center |
kg m-2 s-1 |
|
Downward salt mass input for fixed bulk ice salinity in g/kg |
|
x_center, y_center |
kg m-2 s-1 |
|
Downward atmospheric/land mass from rain, snow, evaporation, sublimation and runoff |
|
x_center, y_center |
W m-2 |
|
Downward zero-layer enthalpy input from surface thermal fluxes and boundary mass events |