How to implement a new model#
In the CIF, a given numerical model has two main components:
- a black-box:
it includes physical, chemical, transport processes, etc.; in most cases it is an executable compiled from Fortran or C sources; it computes outputs (concentration fields, footprints, etc.) from prescribed inputs (fluxes, meteorological fields, boundary conditions, etc.)
- a Python interface to the model:
it produces the model inputs, reads the outputs and runs the executable properly.
The Python interface to a model is implemented as a pyCIF model
class.
Prior to starting to implement your model, please make sure you have the following elements:
a working version of your model (compilable sources), in forward mode, and if applicable in adjoint and tangent-linear modes
a test directory with compatible inputs and outputs for your model
(optional) an observation file you use to compare with your model; it is also possible to generate random observations with pyCIF
In the following, you will learn how to implement a model to pyCIF step-by-step.