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. Follow the steps below. Please refer to this page for instructions on how pyCIF handles paths.
Set up a YAML configuration:
copy the reference YAML file available here to a directory of your choice
- the YAML is ready to use; you only need to modify the following variables:
rootdir: path to the CIF sourcesoutdir: path where the outputs will be generated
pyCIF automatically substitutes these variables wherever they appear in the YAML; see here for details
Run pyCIF based on your Yaml file:
python -m pycif path-to-your-yaml
Outputs#
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:
${outdir}/fwd_long_noMCF/
├── 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 monitor.nc 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 according to the formula \((cos(lat / 500) + sin(lon / 1000)) \cdot ((lat / 1000)^2 + (lon / 1000)^2)\), and 5 stations randomly distributed over the domain.
Going further#
You can play with these parameters to see the different possible outputs:
nstationsin the paragraphdatavect/components/concs/parameters/CH4: you can reduce or increase the number of virtual sites
flx_formulain the paragraphdatavect/components/fluxes/parameters/CH4: you can change the formula used to generate fluxes; accepted arguments to be changed are:
variables:
zlonorzlatperiod: a typical horizontal length scale
operations:
productorsumorsquare
Many other examples using the Toy Gaussian model with various configurations (inversions, forward runs, adjoint tests, etc.) are available here.