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

Contents

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

Configuration reference: lmdz_massflx_old plugin

pycif.plugins.datastreams.meteos.lmdz_massflx_old.fetch.fetch(ref_dir, ref_file, input_interval, target_dir, tracer=None, **kwargs)[source]#

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

Builds monthly period-start dates covering input_interval at tracer.file_freq (clamped to the requested bounds), links the defstoke.nc file (or the defstoke_file override) once, then for each period links whichever of fluxstoke, fluxstokev, phystoke and phystoke_csr monthly files exist in ref_dir. For the first file type found in each month, computes 3-hourly sub-period date pairs assuming 8 physics steps per day (nday_step = 8).

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

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

  • input_interval – 2-element sequence (datei, datef) giving the requested date range.

  • target_dir – directory where matching files are symlinked.

  • tracer – the meteo datastream Plugin, used for tracer.file_freq and the optional tracer.defstoke_file override.

Returns:

(list_files, list_dates), dicts keyed by each month’s start date for which at least one mass-flux file was found. list_files maps each key to the (repeated) file name of the first matching file type found that month; list_dates maps each key to the list of 3-hourly [start, start + 3h] date pairs spanning that month.

Return type:

tuple

pycif.plugins.datastreams.meteos.lmdz_massflx_old.read.read(self, name, varnames, dates, tracdir, tracfile, interpol_flx=False, tracer=None, model=None, filetypes=['defstoke', 'fluxstoke', 'fluxstokev', 'phystoke'], **kwargs)[source]#

Cache the LMDZ physics time step from the defstoke.nc file.

For each requested date, locates the corresponding defstoke.<year>.m<month>.nc file in tracdir (or the defstoke_file override if set, falling back further to a dateless defstoke.nc) and, the first time this is called, reads dtvr/istdyn from it to compute and cache self.offtstep (the LMDZ physics time step), used elsewhere for mass-flux accumulation bookkeeping.

Parameters:
  • self – the meteo datastream Plugin (receives the cached offtstep attribute).

  • name – unused (kept for interface consistency).

  • varnames – unused (kept for interface consistency).

  • dates – list of dates for which to locate the defstoke file.

  • tracdir – directory holding the defstoke file.

  • tracfile – unused (kept for interface consistency).

  • interpol_flx (bool) – unused (kept for interface consistency).

  • tracer – unused (kept for interface consistency).

  • model – unused (kept for interface consistency).

  • filetypes ([str]) – unused here (kept for interface consistency); only "defstoke" is actually processed by this function.

Returns:

None. self.offtstep is set as a side effect, once.