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

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

Configuration reference: tm5_ic plugin

pycif.plugins.datastreams.fields.tm5_ic.fetch.fetch(ref_dir, ref_file, input_interval, target_dir, tracer=None, component=None)[source]#

Fetch the single TM5 initial-condition file for the start date.

Parameters:
  • ref_dir – directory where the original file is found.

  • ref_file – (template) name of the original file.

  • input_interval – list of two dates; only the start date is used.

  • target_dir – directory where the link to the original file is created.

  • tracer – unused, accepted for interface compatibility.

  • component – unused, accepted for interface compatibility.

Returns:

single-entry dict mapping the start date to a

one-element list with the file path.

list_dates: single-entry dict mapping the start date to

[[start date, start date]].

Return type:

list_files

pycif.plugins.datastreams.fields.tm5_ic.read.read(self, name, tracdir, tracfile, varnames, dates, interpol_flx=False, comp_type=None, model=None, tracer=None, **kwargs)[source]#

Get the TM5 initial condition and load it into a pyCIF variable.

Reads q{restart_id:02d} (using tracer.restart_id if set, otherwise the restart_id of the species in the chemical scheme) from the single file matching the earliest requested date.

Parameters:
  • self – the IC Plugin

  • name – the name of the component

  • tracdir – restart file directory and file format

  • tracfile – restart file directory and file format

  • varnames – unused, accepted for interface compatibility

  • dates – list of dates to extract; only the earliest date is used

  • interpol_flx (bool) – unused, accepted for interface compatibility

  • comp_type – unused, accepted for interface compatibility

  • model – the model Plugin, used to resolve the species’ restart_id via model.chemistry.acspecies when tracer.restart_id is not set

  • tracer – may carry an explicit restart_id, taking precedence over the chemical scheme’s

Returns:

xarray.DataArray with dims (time, lev, lat, lon).

pycif.plugins.datastreams.fields.tm5_ic.write.write(self, name, ic_file, flx, mode='a', **kwargs)[source]#

Not implemented: writing TM5 initial-condition files is unsupported.

Raises:

CifError – always.