pycif.plugins.domains.dalecbethy — API reference

pycif.plugins.domains.dalecbethy — API reference#

Configuration reference: dalecbethy plugin

pycif.plugins.domains.dalecbethy.create_domain.create_domain(*args, **kwargs)[source]#

D&B’s sample-point domain cannot be generated by pyCIF.

Unlike CHIMERE’s HCOORD/VCOORD grid, D&B’s domain (its ng grid-cells/sites and their PFT-derived nsp sample points) is not a regular grid pyCIF could build from a handful of geometry parameters: it is entirely defined by D&B’s own static forcing NetCDF file (input/staticforcing.nc), produced externally, upstream of any pyCIF run (see model_sources/dalecbethy/src/ncread_forcing.f90:: ncread_static_forcing). Use read_grid() instead.

Raises:

CifValueError – always.

pycif.plugins.domains.dalecbethy.read_domain.read_grid(domain, **kwargs)[source]#

Read D&B’s sample-point domain from its static forcing NetCDF file.

Grid-cells are collapsed into a 1D list of nsp “sample points”, skipping grid-cells where condition_simulate == 0.

Sets on domain: unstructured_domain, nlon (=``nsp``), nlat (=1), zlon, zlat (shape (1, nsp)), plus a single-level vertical coordinate. Also sets ng (the full, unfiltered size of the static forcing file’s flat grid-cell dimension) and active, the indices (into that ng dimension) of the retained sample points, in the same order as zlon/zlat; other D&B NetCDF files indexed along the same ng dimension (e.g. D&B’s own dynforcing.nc, see pycif.plugins.datastreams.fluxes.dalecbethy) must be subset/scattered with these to line up with this domain.

Parameters:
  • domain – dalecbethy domain plugin instance with dir/file set.

  • **kwargs – unused.

Raises:
  • CifKeyError – if a mandatory dimension/variable is missing.

  • CifValueError – if no active sample point is found.