Source code for pycif.plugins.transforms.complex.diagmet.utils.precipitations
[docs]
def precipitations(transf, inout_datastore, ddi, mapper):
"""Compute total precipitation as the sum of convective and large-scale components.
Outputs ``('meteo', 'topc')`` = convective precipitation (``copc``)
+ large-scale precipitation (``lspc``).
See :doc:`/documentation/doc-models/chimere/diagmet` (section 13) for the
full derivation.
Args:
transf (Plugin): diagmet transform instance.
inout_datastore (dict): mutable datastore.
ddi (datetime): current sub-simulation date.
mapper (dict): transform mapper (unused).
"""
copc = inout_datastore["inputs"][("meteo", "copc")][ddi]["spec"]
lspc = inout_datastore["inputs"][("meteo", "lspc")][ddi]["spec"]
inout_datastore["outputs"][("meteo", "topc")][ddi]["spec"] = \
copc + lspc