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_intervalattracer.file_freq(clamped to the requested bounds), links thedefstoke.ncfile (or thedefstoke_fileoverride) once, then for each period links whichever offluxstoke,fluxstokev,phystokeandphystoke_csrmonthly files exist inref_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_freqand the optionaltracer.defstoke_fileoverride.
- Returns:
(list_files, list_dates), dicts keyed by each month’s start date for which at least one mass-flux file was found.list_filesmaps each key to the (repeated) file name of the first matching file type found that month;list_datesmaps 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.ncfile.For each requested date, locates the corresponding
defstoke.<year>.m<month>.ncfile intracdir(or thedefstoke_fileoverride if set, falling back further to a datelessdefstoke.nc) and, the first time this is called, readsdtvr/istdynfrom it to compute and cacheself.offtstep(the LMDZ physics time step), used elsewhere for mass-flux accumulation bookkeeping.- Parameters:
self – the meteo datastream Plugin (receives the cached
offtstepattribute).name – unused (kept for interface consistency).
varnames – unused (kept for interface consistency).
dates – list of dates for which to locate the
defstokefile.tracdir – directory holding the
defstokefile.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.offtstepis set as a side effect, once.