pycif.plugins.models.lmdz_old — API reference#

Configuration reference: lmdz_old plugin

pycif.plugins.models.lmdz_old.compile.compile(self)[source]#

Compile or copy LMDZ-old executables into the CIF work directory.

Attempts to copy pre-compiled binaries from self.direxec first (skipped if force-recompile is set), then falls back to running make inside the LMDZ source tree.

Parameters:

self – LMDZ-old model plugin instance with workdir and direxec (or dirsrc) set.

pycif.plugins.models.lmdz_old.flushrun.flushrun(self, rundir, mode, transform_id, full_flush=True)[source]#

Cleaning the simulation directories to limit space usage

pycif.plugins.models.lmdz_old.ini_mapper.ini_mapper(model, transform_type, general_mapper={}, backup_comps={}, transforms_order=[], ref_transform='', transform_name='', **kwargs)[source]#

Build the data-flow mapper for the LMDZ-old (legacy structured-grid) model.

Functionally identical to the LMDZ-ACC mapper: declares flux, meteo, initial-condition, end-concentration, and optionally observation inputs, plus concentration and diagnostic outputs. Populates outputs2inputs for adjoint routing.

Parameters:
  • model – LMDZ-old model plugin instance.

  • transform_type (str) – unused; kept for API compatibility.

  • general_mapper (dict) – unused.

  • backup_comps (dict) – unused.

  • transforms_order (list) – unused.

  • ref_transform (str) – unused.

  • transform_name (str) – unused.

  • **kwargs – unused.

Returns:

mapper with inputs, outputs, and outputs2inputs.

Return type:

dict

pycif.plugins.models.lmdz_old.ini_periods.ini_periods(self, **kwargs)[source]#

Compute temporal discretisation for the LMDZ-old model.

Identical in structure to the LMDZ-ACC ini_periods: splits the simulation window into monthly (or self.periods-based) sub-periods and derives time-step arrays from the domain’s dynamical/physical split and the meteorological offset time step.

Sets on self: subsimu_dates, tstep_dates, input_dates, flx_input_dates, tstep_all, iniobs, reset_obs, chain.

Parameters:
  • self – LMDZ-old model plugin instance with datei, datef, periods, domain, and meteo set.

  • **kwargs – unused.

pycif.plugins.models.lmdz_old.perturb_model.append_attribute(plugin: Any, key: str, attr: Any) None[source]#

Set attr as attribute key on plugin and append key to plugin.attributes.

pycif.plugins.models.lmdz_old.perturb_model.remove_attribute(plugin: Any, key: str) None[source]#

Delete attribute key from plugin and remove it from plugin.attributes.

pycif.plugins.models.lmdz_old.perturb_model.perturb_model(self, nsamples, transf_mapper)[source]#

Extend the LMDZ-old chemistry scheme to accommodate ensemble members.

Creates nsamples copies of each active, output, and emitted species using the __sample#NNN naming convention, then removes the original un-suffixed species. Records self.perturbed_species mapping sample names back to originals.

Parameters:
  • self – LMDZ-old model plugin instance.

  • nsamples (int) – number of ensemble members.

  • transf_mapper (dict) – unused; kept for API consistency.

pycif.plugins.models.lmdz_old.run.run(self, runsubdir, mode, workdir, ddi, do_simu=True, approx_transf=False, ref_fwd_dir='', overlap=False, **kwargs)[source]#

Run LMDZ model in forward or adjoint mode

Parameters:
  • runsubdir (str) – working directory for the current run

  • mode (str) – forward or backward

  • workdir (str) – pycif working directory

  • do_simu (bool) – if False, considers that the simulation was already run

pycif.plugins.models.lmdz_old.run.dump2nc(self, runsubdir)[source]#

Dumps simulated concentration field to a netCDF file