tracmass.new_grid#
- tracmass.new_grid(fluxes, dtm_start=None, dtm_end=None)[source]#
Build the static grid geometry for a run.
Calls fluxes once (at dtm_start) purely to read the time-invariant geometry —
kmt,dxdy,imt/jmt/km,iperio/jperio— and the GCM output interval (timestep). No flux data is loaded. The returnedGridFieldsis immutable for the lifetime of the run and can be reused across manynew_flux()buffers on the same grid (successive experiments, restart windows).Integration direction is inferred from dtm_start / dtm_end exactly as in
new_flux():dtm_end < dtm_startmarks a backward run (grid.reverse=True).grid.timestepis always positive.- Parameters:
fluxes (
callableorstr) –fluxes(dtm) -> xr.Dataset, or the name of atracmass.gcmsub-module (e.g."glorys"). When the adapter can be identified, the[env.gcm] subsettable from the activetracmass.tomlenvironment is applied first viatracmass.config.apply_gcm_subset().dtm_start (
pd.TimestamporstrorNone, optional) – Any valid time for the adapter; only the geometry is read. DefaultNone— fluxes is called with no arguments at all, so its own default applies (forgcm.glorys/gcm.ecco2this falls through totracmass.seagrid.glorys.open_dataset()/tracmass.seagrid.ecco2.open_dataset()’s owndtmdefault).dtm_end (
pd.TimestamporstrorNone, optional) – When earlier than the resolved dtm_start, marks the grid backward (reverse=True). DefaultNone(forward).
- Returns:
GridFields– Static geometry withtimestep(positive) andreverseset.- Return type:
See also
new_fluxbuild the flux buffer, optionally reusing a grid from here.