polaris.tasks.ocean.horiz_press_grad.init.Init.build_column_state

Init.build_column_state(ds_mesh: Dataset) → Dataset[source]

Build the two-column state on ds_mesh: the p-star vertical coordinate, the tracers, specific volume, pressure, geometric height, and the diagnostic Montgomery potential and HPGA.

run() calls this once the mesh exists. It is separate from run() so that unit tests can build the same state from a minimal two-cell mesh dataset, without mesh generation or file I/O.

Parameters:

ds_mesh (xarray.Dataset) – The horizontal mesh, which must have exactly 2 cells. Only the nCells dimension is required, so a stub dataset is enough for testing.

Returns:

ds (xarray.Dataset) – The two-column state.