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.direxecfirst (skipped ifforce-recompileis set), then falls back to runningmakeinside the LMDZ source tree.- Parameters:
self – LMDZ-old model plugin instance with
workdiranddirexec(ordirsrc) 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
outputs2inputsfor 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, andoutputs2inputs.- 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 (orself.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, andmeteoset.**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
nsamplescopies of each active, output, and emitted species using the__sample#NNNnaming convention, then removes the original un-suffixed species. Recordsself.perturbed_speciesmapping 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