First forward simulation with the toy Gaussian Model

First forward simulation with the toy Gaussian Model#

Configuration and set-up#

Here we generate pyCIF outputs for a forward run using the Toy Gaussian Model. To do so, follow the steps. Please note here some instructions about how pyCIF deals with paths.

  1. Set up a Yaml configuration:

    • copy the content of the reference Yaml file available here to a directory of your choice

    • the yaml is plug-and-play ready, you only have to modify the following variables in the file:
      • rootdir: path where the CIF sources are

      • outdir: where the outputs will be generated

      pyCIF automatically replaces them anywhere they are used in the yaml; please find details here

  2. Run pyCIF based on your Yaml file:

    python -m pycif path-to-your-yaml


Explore the results in workdir; if you used the default content of the yaml, you should find files in ${outdir}/fwd_long_noMCF/ that is structured as follows:

├── config_fwd_long_noMCF.yml: a copy of the yml used for the run
├── pycif.logtest: the log file
├── VERSION: a log file giving the version (git commit ID) used for the run
├── controlvect/: directory storing data useful for the control vector
    └── correlations/
        └── horcor_hpixels_12x18_cs-999_cl500.bin:
                binary file storing the horizontal correlation matrix used in this case
├── datavect/: all input data
    ├── concs/: directory with concentrations
                (empty as observation file is randomly generated here)
        └── CH4/
    ├── fluxes/
        └── CH4/
            └── dummy_flx.txt: fluxes as generated from the formula in the yml
    └── meteo/
        └── dummy_meteo_%Y%m%d.txt: meteo files randomly generated
├── model/
    ├── H_matrix.pickle: saved H matrix after computation
    └── Pasquill-Gifford.txt:
            reference correspondance file between
            Pasquill-Gifford classes and Gaussian parameters
├── obsoperator/
    └── fwd_0000/: runs are identified by the mode (fwd, tl or adj) and an ID number
        ├── controlvect.pickle: a binary file with the control vector values used for this run
        ├── controlvect/: the same with netCDF user-friendly format
        ├── %Y-%m-%d_%H:%S: sub-directories for every individual model runs (one per day)
            └── Pasquill-Gifford.txt:
                    link to the original Pasquill-Gifford.txt file
                    in the model directory
        ├── obsvect/:
            directory with a structure following available observation
            components and species; Therein, for each component/species
            a with simulated concentrations
        └── chain/: empty in that case; can be used by models that need to chain sub-simulations

└── obsvect/: the final observation vector with perturbed simulations

The example produces five days of simulations using a Gaussian model with arbitrary meteorological conditions, fluxes distributed following the formula \((cos(lat / 500) + sin(lon / 1000)) . ((lat / 1000)^2 + (lon / 1000)^2)\), 5 stations randomly distributed over the domain.

Going further#

You can play with these parameters to see the different possible outputs:

  • nstations in the paragraph datavect/components/concs/parameters/CH4: you can reduce or increase the number of virtual sites

  • flx_formula in the paragraph datavect/components/fluxes/parameters/CH4: you can change the formula used to generate fluxes; accepted arguments to be changed are:

    • variables: zlon or zlat

    • period: a typical horizontal length scale

    • operations: product or sum or square

Many other examples using the Toy Gaussian model and various configurations (inversions, forwards, test of the adjoints, etc.) are available here