pycif.plugins.datastreams.fields.lmdz_chemfield_ico — API reference

Contents

pycif.plugins.datastreams.fields.lmdz_chemfield_ico — API reference#

Configuration reference: lmdz_chemfield_ico plugin

pycif.plugins.datastreams.fields.lmdz_chemfield_ico.write.write(self, name: str, path: str | PathLike, data: DataArray, **kwargs) None[source]#

Append an LMDz chemical field (icosahedral grid) to a NetCDF file.

Squeezes the lat dimension (unused on the icosahedral grid), renames lon to cell (the DYNAMICO cell index), squeezes lev for single-level (surface-only) fields, builds coordinates via self.domain.get_domain_coords(), and appends the resulting dataset to path.

Parameters:
  • self – This plugin; self.domain supplies the coordinates.

  • name – Name of the variable to write.

  • path – Path to the NetCDF file to append to.

  • data – Data to write, as an xarray.DataArray with lat, lon and lev dimensions.

  • **kwargs – Unused.

Raises:

TypeError – If data is not an xarray.DataArray.