pycif.plugins.transforms.system.dump2inputs — API reference

Contents

pycif.plugins.transforms.system.dump2inputs — API reference#

Configuration reference: dump2inputs plugin

pycif.plugins.transforms.system.dump2inputs.adjoint.adjoint(transform, inout_datastore, controlvect, obsvect, mapper, di, df, mode, runsubdir, workdir, onlyinit=False, check_transforms=False, **kwargs)[source]#

Read model adjoint sensitivity files back into CIF arrays.

The adjoint of forward(): calls transform.native2inputs_adj to read the model-native adjoint sensitivity files and convert them to CIF-internal arrays. The results are merged into both 'inputs' and 'outputs' sub-dicts of the datastore.

Parameters:
  • transform (Plugin) – dump2inputs instance (carries native2inputs_adj).

  • inout_datastore (dict) – mutable datastore.

  • controlvect – unused.

  • obsvect – unused.

  • mapper (dict) – transform mapper.

  • di (datetime) – sub-simulation start date.

  • df (datetime) – sub-simulation end date.

  • mode (str) – 'adj'.

  • runsubdir (str) – passed to native2inputs_adj.

  • workdir (str) – unused.

  • onlyinit (bool) – if True, native2inputs_adj is not called.

  • check_transforms (bool) – passed to native2inputs_adj.

  • **kwargs – unused.

pycif.plugins.transforms.system.dump2inputs.forward.forward(transform, inout_datastore, controlvect, obsvect, mapper, di, df, mode, runsubdir, workdir, do_simu=True, onlyinit=False, check_transforms=False, **kwargs)[source]#

Write CIF-internal arrays to model-native input files.

Groups input tracers by reference name (stripping any __sample#N suffix for ensemble tracers), then calls transform.native2inputs for each group to write the data to the format expected by the model executable.

After writing, the 'spec' and 'incr' fields are removed from the datastore to free memory; the written files become the canonical source for subsequent model reads. The output datastore is updated with the data dict returned by native2inputs.

Parameters:
  • transform (Plugin) – dump2inputs instance (carries native2inputs).

  • inout_datastore (dict) – mutable datastore.

  • controlvect – unused.

  • obsvect – unused.

  • mapper (dict) – transform mapper.

  • di (datetime) – sub-simulation start date.

  • df (datetime) – sub-simulation end date.

  • mode (str) – 'fwd' or 'tl'.

  • runsubdir (str) – passed to native2inputs.

  • workdir (str) – unused.

  • do_simu (bool) – passed to native2inputs.

  • onlyinit (bool) – passed to native2inputs.

  • check_transforms (bool) – passed to native2inputs.

  • **kwargs – unused.