NEDAS.models.bgrid_solo.util module

Helpers for the DART bgrid_solo restart files and namelist.

The model state lives on two staggered B-grids (see DART’s bgrid_solo model_mod): temperature T and surface pressure ps at the cell centers (nlon x nlat), horizontal wind u,v at the cell’s north-east corners (nlon x nlat-1). NEDAS carries every variable on the temperature grid, so the wind is averaged to it when read, and a change to it is mapped back to the wind grid when written.

NEDAS.models.bgrid_solo.util.grid_coords(nlon: int, nlat: int) → tuple[ndarray, ndarray, ndarray, ndarray][source]

longitudes, latitudes (degrees) of the temperature grid and of the velocity grid

NEDAS.models.bgrid_solo.util.vel_to_temp(f: ndarray) → ndarray[source]

Average a field on the velocity grid (nlat-1, nlon) to the temperature grid (nlat, nlon).

Velocity point (j,i) is the north-east corner of temperature cell (j,i), so the temperature point (j,i) is surrounded by velocity points (j-1..j, i-1..i). The two polar rows only have the two velocity points on their one side.

NEDAS.models.bgrid_solo.util.temp_to_vel(g: ndarray) → ndarray[source]

Average a field on the temperature grid to the velocity grid (each corner has 4 neighbors)

NEDAS.models.bgrid_solo.util.write_restart_file(filename: str, nlon: int, nlat: int, nlev: int, day: float, ps: ndarray, t: ndarray, u: ndarray, v: ndarray) → None[source]

Write a state in the layout of DART’s bgrid_solo perfect_input.nc (also its model template)

NEDAS.models.bgrid_solo.util.input_nml(model, template: str, ic_file: str, ud_file: str, advance_seconds: int = 0, cold_start: bool = False, init_days: int = 0, integrals: bool = True) → str[source]

The input.nml text for nedas_bgrid_advance (or libnedas_bgrid, which only reads the model settings, and takes template ‘null’), with the settings of a BgridSoloModel. With integrals=False the model does not print its daily global integrals.