pycif.plugins.transforms.complex.diagmet — API reference

pycif.plugins.transforms.complex.diagmet — API reference#

Configuration reference: diagmet plugin

pycif.plugins.transforms.complex.diagmet.adjoint.adjoint(transf, inout_datastore, controlvect, obsvect, mapper, di, df, mode, runsubdir, workdir, onlyinit=False, **kwargs)[source]#

No-op adjoint for diagmet.

Meteorological fields are not control variables; diagmet has no adjoint. This function exists solely to satisfy the transform interface contract.

pycif.plugins.transforms.complex.diagmet.forward.forward(transf, inout_datastore, controlvect, obsvect, mapper, di, df, mode, runsubdir, workdir, onlyinit=False, **kwargs)[source]#

Run the full DIAGMET meteorological processing pipeline.

Executes the following steps in order, each implemented in a dedicated utility module under utils/:

  1. altipres — pressure at level mid-points, altitudes, air density.

  2. defcolumn — interpolation of 3-D fields to the surface level.

  3. uv_rotation — rotation of u/v wind components to the model grid.

  4. mean_z0_shf_extra_urban_temp — urban heat island correction to roughness length and sensible heat flux.

  5. sv_heat_flux — sensible and virtual heat fluxes.

  6. friction_velocity — friction velocity \(u^*\) (Ustar).

  7. boundary_layer_height — PBL height.

  8. checkcfl — CFL condition check and wind-speed limiting.

  9. low_cloud_top — low cloud top pressure.

  10. obukov_length — Obukhov length \(L\).

  11. vertical_turbulent_diffusivity — turbulent diffusion coefficient \(K_{zz}\) at CHIMERE layer tops.

  12. convection — convective mass fluxes.

  13. precipitations — total precipitation (convective + large-scale).

  14. cloud_optical_thickness — cloud optical depth.

A temporary transf.diag_misc dict is created at entry and deleted at exit to allow intermediate fields to be passed between steps.

Parameters:
  • transf (Plugin) – diagmet transform instance.

  • inout_datastore (dict) – mutable datastore; 'inputs' provides the raw ECMWF fields; 'outputs' receives the derived CHIMERE meteorological fields.

  • controlvect – unused.

  • obsvect – unused.

  • mapper (dict) – transform mapper.

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

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

  • mode (str) – 'fwd' (adjoint is a no-op for diagmet).

  • runsubdir (str) – unused.

  • workdir (str) – unused.

  • onlyinit (bool) – unused.

  • **kwargs – forwarded to each utility function.

pycif.plugins.transforms.complex.diagmet.propagate_incompatible.propagate_incompatible_domain(self, trans_mapper, trid_in, mode='backward')[source]#

Assign the correct domain to a diagmet input tracer.

2-D (surface) and 3-D (column) meteorological fields use different domain objects. This function inspects the output domains already present in the mapper, selects the appropriate 2-D or 3-D domain for trid_in, and assigns it.

Parameters:
  • self (Plugin) – diagmet plugin instance (carries meteo_parameters_2d_in listing 2-D field names).

  • trans_mapper (dict) – transform mapper; 'inputs'[trid_in]["domain"] is set in-place.

  • trid_in (tuple) – ('meteo', parameter_name) key of the input tracer whose domain should be resolved.

  • mode (str) – propagation direction (unused; kept for API consistency).

Raises:

Exception – if multiple distinct 3-D or 2-D domains are found in the output mapper (should not occur in a well-formed configuration).