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/:altipres — pressure at level mid-points, altitudes, air density.
defcolumn — interpolation of 3-D fields to the surface level.
uv_rotation — rotation of u/v wind components to the model grid.
mean_z0_shf_extra_urban_temp — urban heat island correction to roughness length and sensible heat flux.
sv_heat_flux — sensible and virtual heat fluxes.
friction_velocity — friction velocity \(u^*\) (Ustar).
boundary_layer_height — PBL height.
checkcfl — CFL condition check and wind-speed limiting.
low_cloud_top — low cloud top pressure.
obukov_length — Obukhov length \(L\).
vertical_turbulent_diffusivity — turbulent diffusion coefficient \(K_{zz}\) at CHIMERE layer tops.
convection — convective mass fluxes.
precipitations — total precipitation (convective + large-scale).
cloud_optical_thickness — cloud optical depth.
A temporary
transf.diag_miscdict 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_inlisting 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).