pycif.plugins.datastreams.meteos.lmdz_mass_fluxes — API reference

Contents

pycif.plugins.datastreams.meteos.lmdz_mass_fluxes — API reference#

Configuration reference: lmdz_mass_fluxes plugin

pycif.plugins.datastreams.meteos.lmdz_mass_fluxes.fetch.fetch(ref_dir: str, ref_file: str, input_interval: dict[datetime, list[datetime]], target_dir: str, tracer: object | None = None, **kwargs)[source]#

Locate LMDZ monthly mass-flux files and link them to the working directory.

For each period listed in tracer.model.meteo_input_dates, builds the expected fluxstoke/phystoke_csr file names (plus fluxstokev when tracer.model.grid == "regular") following the <prefix>.<YYYY>.m<MM><suffix>.nc convention, links each into target_dir, and records the sub-date-interval pairs covered by each period.

Parameters:
  • ref_dir – directory holding the LMDZ mass-flux files.

  • ref_file – unused (kept for interface consistency; this plugin derives its own file names from tracer.model).

  • input_interval – unused (kept for interface consistency; dates come from tracer.model.meteo_input_dates).

  • target_dir – directory where matching files are symlinked.

  • tracer – the meteo datastream Plugin, used for tracer.model.grid and tracer.model.meteo_input_dates.

Returns:

(list_files, list_dates), dicts keyed by each period’s start date. list_files maps each key to a placeholder list (one "dummy" entry per sub-period; the actual linked file names are not tracked here). list_dates maps each key to the list of consecutive (start, end) date pairs within the period.

Return type:

tuple

Raises:
  • CifValueError – if tracer is None.

  • CifFileNotFoundError – if an expected mass-flux file is missing from ref_dir.