wrfchem/std wrfchem/std#

Description#

Plugin for the WRF-Chem online chemistry-transport model.

WRF-Chem is the Weather Research and Forecasting (WRF) model coupled with chemistry. It is a fully coupled online air-quality model in which meteorology and chemistry evolve simultaneously within the same time step. WRF-Chem is well-suited for high-resolution regional emission inversion studies at continental to urban scales.

Note

This plugin is at a preliminary stage of integration. Preprocessing of WRF input files (wrfinput_d<nn>, wrfbdy_d01, wrfchemi emission files) must be handled externally before CIF launches the model. The plugin has been developed and tested at DLR (Germany) in the context of regional CO₂ inversion studies.

Official resources#

Key references#

See also WRF-Chem — Weather Research and Forecasting model with Chemistry.

Version history#

  • 2021-10-06 — Moved copying namelist to native2inputs.

  • 2021-09-20 — Removed CTDAS flux_optim (now handled by CIF YAML).

  • 2021-08-17 — Initial version based on LMDZ and TM5 plugins.

YAML arguments#

The following arguments are used to configure the plugin. pyCIF will return an exception at the initialization if mandatory arguments are not specified, or if any argument does not fit accepted values or type:

Mandatory arguments#

source_dir : str, mandatory

Directory like WRF/run/, including output of real.exe, i.e. wrfbdy_d01 and wrfinput_d%02d, both already containing tracer values.

Necessary files are linked/copied (as needed) from source_dir at the start of running CIF. Files that are already present in run_dir are skipped.

namelist.input is copied separately from path specified in argument namelist_input_file. Flux files are handled by the flux plugin.

namelist_input_file : str, mandatory

Path to namelist.input. Namelist settings that are controlled (overwritten) by CIF:

  • run period (start_year, …, end_second)

  • restart flag / interval (restart, restart_interval)

Namelist settings necessary to run with CIF:
  • io_style_emissions = 2 # explicit fluxes per timestep

  • io_form_auxinput5 = 2 # netCDF

  • auxinput5_inname = wrfchemi_d<domain>_<date>

  • write_hist_at_0h_rst = .true.

  • chem_opt = 17

  • emiss_opt = 17

Recommended namelist settings:
  • Consider quilting to speed up i/o of history files

  • I only tested frames_per_auxinput5 = 1. The code is written to handle other cases as well, but this would have to be tested.

  • Use nudging to keep WRF meteorology close to the driving meteorology (e.g. spectral nudging)

Optional arguments#

autoflush : bool, optional, default False

Cleans big temporary files when the simulation is done. Triggers the function flushrun of the model if available

periods : str, optional

Frequency for sub-simulations

mpirun : str, optional, default “”

Command that calls ./wrf.exe. Default is empty string, which is useful e.g. for interactive runs of small testcases. For using slurm inside a cif job, not sure about the format yet. Ultimately want something in the format srun -n 72 -t 10:00:00 - but need to read the resources the cif job has.

Requirements#

The current plugin requires the present plugins to run properly:

Requirement name

Requirement type

Explicit definition

Any valid

Default name

Default version

domain

Domain

False

False

wrfchem

std

chemistry

Chemistry

True

True

None

None

flux

DataStream

True

False

wrfchem

std

latcond

DataStream

True

False

wrfchem

icbc

inicond

DataStream

True

False

wrfchem

icbc

YAML template#

Please find below a template for a YAML configuration:

 1model:
 2  plugin:
 3    name: wrfchem
 4    version: std
 5    type: model
 6
 7  # Mandatory arguments
 8  source_dir: XXXXX  # str
 9  namelist_input_file: XXXXX  # str
10
11  # Optional arguments
12  autoflush: XXXXX  # bool
13  periods: XXXXX  # str
14  mpirun: XXXXX  # str