Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Page info
infoTypeModified date
prefixLast modified on
typeFlat

Info
iconfalse
titleTable of Contents

Table of Contents
maxLevel4

Easy Heading Macro
navigationExpandOptioncollapse-all-but-headings-1-2

Step 1: Getting meteorological data from IFS or ERA5 reanalysis

Boundary conditions for WRF can be freely downloaded from ftp://ftp.ecmwf.int/pub/wrf. The output comes from ECMWF's operational HRES forecast and only one day's data is available. For more information please have a look at: ECMWF WRF Test Data. For those who have access to ECMWF MARS (access restricted) they can find the recipe how to retrieve the data for the past.

Alternatively, users can download the freely available ERA5 global reanalysis data from the C3S Climate Data Store (CDS) to drive WRF meteorological component. Please read through How to download ERA5. You also need to have a look at the parameter table in ECMWF WRF Test Data for retrieving relevant data.

...

We tested with the CAMS reanalysis data for driving the WRF-Chem model. Please have a look at how to download the CAMS Reanalysis data via the ECMWF Web API so  so that you have a good understanding of the scripts below. Scripts below are using ECMWF's Web API.

Script for retrieving aerosols, parameter names are given in the table bellow:

ParamShort NameLong Name

tTemperature
1.210

aermr01

Sea Salt Aerosol (0.03 - 0.5 um) Mixing Ratio

2.210

aermr02

Sea Salt Aerosol (0.5 - 5 um) Mixing Ratio

3.210

aermr03

Sea Salt Aerosol (5 - 20 um) Mixing Ratio

4.210

aermr04

Dust Aerosol (0.03 - 0.55 um) Mixing Ratio

5.210

aermr05

Dust Aerosol (0.55 - 0.9 um) Mixing Ratio

6.210

aermr06

Dust Aerosol (0.9 - 20 um) Mixing Ratio

7.210

aermr07

Hydrophobic Organic Matter Aerosol Mixing Ratio

8.210

aermr08

Hydrophilic Organic Matter Aerosol Mixing Ratio

9.210

aermr09

Hydrophobic Black Carbon Aerosol Mixing Ratio

10.210

aermr10

Hydrophilic Black Carbon Aerosol Mixing Ratio

11.210

aermr11

Sulphate Aerosol Mixing Ratio


Code Block
languagepy
titleAER
collapsetrue
#!/usr/bin/env python
from ecmwfapi import ECMWFDataServer
   
server = ECMWFDataServer()
   
server.retrieve({
	'dataset'   : "cams_reanalysis
Code Block
languagepy
titleAER
collapsetrue
#!/usr/bin/env python
from ecmwfapi import ECMWFDataServer
   
server = ECMWFDataServer()
   
server.retrieve({
	'dataset'   : "cams_reanalysis",
    'class'     : "mc",
	'type'      : "an",
	'stream'    : "oper",
	'expver'    : "eac4",
    'levtype'   : "ml",
    'repres'	: "gg",
	'levellist'	: "7/to/60",
    'param'     : "T/1.210/2.210/3.210/4.210/5.210/6.210/7.210/8.210/9.210/10.210/11.210",
	'date'      : "20100101/to/20100102",
    'step'      : "0",
    'timeclass'      : "0/to/21/by/3mc",
	'grid'		type'      : "0.75/0.75an",
	'stream'    'target : "oper",
	'expver'    : "AER_20100101_20100102_eac4.grib"
})
Code Block
languagepy
titleGRG
collapsetrue
#!/usr/bin/env python
from ecmwfapi import ECMWFDataServer
   
server = ECMWFDataServer()
   
server.retrieve({
	'dataset'   : "cams_reanalysis,
    'levtype'   : "ml",
    'repres'	: "gg",
	'levellist'	: "7/to/60",
    'classparam'     : "mcT/1.210/2.210/3.210/4.210/5.210/6.210/7.210/8.210/9.210/10.210/11.210",
	'typedate'      : "an20100101/to/20100102",
	'stream'    : "oper",
	'expver'step'      : "eac40",
    'levtypetime'   : "ml",
    'repres'	: "gg0/to/21/by/3",
	'levellistgrid'		: "7/to/600.75/0.75",
     'paramtarget'     : "203.210/123.210/27.217/121.210/13.217/6.217/124.210/122.210",
	'date'      : "20100101/to/20100102",
    'step'      : "0",
    'time'      : "0/to/21/by/3",
	'grid'		: "0.75/0.75",
    'target'    : "GRG_20100101_20100102_eac4.grib"
})
AER_20100101_20100102_eac4.grib"
})


Script for retrieving global reactive gases, parameter names are given in the table bellow:

ParamShort NameLong Name
203.210

O3

ozone

123.210

CO

carbonmonoxide

27.217

NO

nitrogen_monoxide

121.210

NO2

nitrogen_dioxide

13.217

PAN

peroxyacetyl_nitrate

6.217

HNO3

nitric_acid

124.210

CH2O

formaldehyde

122.210

SO2

sulfur_dioxide


Code Block
languagepy
titleGRG
collapsetrue
#!/usr/bin/env python
from ecmwfapi import ECMWFDataServer
   
server = ECMWFDataServer()
   
server.retrieve({
	'dataset'   : "cams_reanalysis",
    'class'     : "mc",
	'type'      : "an",
	'stream'    : "oper",
	'expver'    : "eac4",
    'levtype'   : "ml",
    'repres'	: "gg",
	'levellist'	: "7/to/60",
    'param'     : "203.210/123.210/27.217/121.210/13.217/6.217/124.210/122.210",
	'date'      : "20100101/to/20100102",
    'step'      : "0",
    'time'      : "0/to/21/by/3",
	'grid'		: "0.75/0.75",
    'target'    : "GRG_20100101_20100102_eac4.grib"
})


Script for retrieving volatile organic compounds, parameter names are given in the table bellow:

paramShort NameLong Name
52.217

CH3COCH3

acetone

45.217

C2H6

ethane

9.217

PAR

paraffins

42.217

CH3OH

methanol

47.217

C3H8

propane

46.217

C2H5OH

ethanol

10.217

C2H4

ethene

12.217

ALD2

aldehydes

11.217

OLE

olefins

16.217

C5H8

isoprene

43.217

HCOOH

formic_acid

7.217

CH3OOH

methylperoxide

15.217

ONIT

organic_nitrates


Code Block
languagepy
titleGRG_voc
collapsetrue
#!/usr/bin/env python
from ecmwfapi import ECMWFDataServer
   
server = ECMWFDataServer()
   
server.retrieve({
	'dataset'   : "cams_reanalysis",
    'class'     : "mc",
	'type'      : "an",
	'stream'    : "oper",
	'expver'    : "eac4",
    'levtype'   : "ml",
    'repres'	: "gg",
	'levellist'	: "7/to/60",
    'param'     : "52.217/45.217/9.217/42.217/47.217/46.217/10.217/12.217/11.217/16.217/43.217/7.217/15.217",
	'date'      : "20100101/to/20100102",
    'step'      : "0",
    'time'      : "0/to/21/by/3",
	'grid'		: "0.75/0.75",
    'target'    : "GRG_voc_20100101_20100102_eac4.grib"
})


Script for retrieving h2o2:

Code Block
languagepy
titleGRG_h2o2
collapsetrue
#!/usr/bin/env python
from ecmwfapi import ECMWFDataServer
   
server = ECMWFDataServer()
   
server.retrieve({
	'dataset'   : "cams_reanalysis",
    'class'     : "mc",
	'type'      : "an",
	'stream'    : "oper",
	'expver'    : "eac4",
    'levtype'   : "ml",
    'repres'	: "gg",
	'levellist'	: "7/to/60",
    'param'     : "3.217",
	'date'      : "20100101/to/20100102",
    'step'      : "0",
    'time'      : "0/to/21/by/3",
	'grid'		: "0.75/0.75",
    'target'    : "GRG_h2o2_20100101_20100102_eac4.grib"
})


Script for retrieving surface pressure:

Code Block
languagepy
titlePS
collapsetrue
#!/usr/bin/env python
from ecmwfapi import ECMWFDataServer
   
server = ECMWFDataServer()
   
server.retrieve({
	'dataset'   : "cams_reanalysis",
    'class'     : "mc",
	'type'      : "an",
	'stream'    : "oper",
	'expver'    : "eac4",
    'levtype'   : "ml",
    'repres'	: "gg",
	'levellist'	: "1",
    'param'     : "152",
	'date'      : "20100101/to/20100102",
    'step'      : "0",
    'time'      : "0/to/21/by/3",
	'grid'		: "0.75/0.75",
    'target'    : "PS_20100101_20100102_eac4.grib"
})

...

Before running the script below you will need to have these packages installed:

You also need to download the get_tablecol script and and table_tm5ver15htap.txt file into the same directory where script is to be run. The next step is to run the script below:

...

With a set of additional utilities, it is possible to use the mozbc package provided by the Atmospheric Chemistry Observations and Modelling Lab (ACOM) of NCAR to pre-process CAMS data with some minor modifications to the original code. The set of additional utilities has been developed as part of the AQMEII project and kindly provided by A. Lupascu (IASS-Posdam) and C. Knote (NCAR):  public_box.tar.gz. The package contains:


Directory ./ECMWF2WRFChem/
MACC_BC2MOZART.ncl

ncl script to convert CAMS files containing surface pressure, global reactive gases, and aerosols into a single

file ready to be used by modified MOZBC package.convert.sh
Runs the ncl script. Directory ./mo_mozart_lib.patch

Patch for mo_mozart_lib.f90 program (part of original mozbc package). The file should be copied to mozbc/ and then executed:

$>patch < mo_mozart_lib.patch

saprc99.inp

Namelist. Defines input and output directories and which variables to interpolate to WRF grid. It is possible to use only those variables already defined in wrfinput_d01, which depends on chemical package and options selected in &chem section of WRF's namelist.input. Here, an example for SAPRC99 chemical mechanism coupled with the MOSAIC aerosol chemistry module with 4 size bins.

The users have to provide their own mapping to get the chemical boundary condition for their preferred chemistry option.

mozart.inpA namelist example for mozart package.

Step 4: Running the model

The first step is to run the WRF model but only up to real.exe. Instruction on how run the model are provided in WRF official user guideNote that you should not execute the wrf.exe because we still do not have a chemical BC interpolated to the WRF grid. This will be created using the utility provided by AQMEII and the mozart package. Before running this step you should check and edit paths in convert.sh and MACC_BC2MOZART.ncl if necessary.

No Format
$> cd ECMWF2WRFChem/
$> ./convert.sh

This step converts four NetCDF files (AER_*, GRG_*, GRG_voc_*, and PS_*) into a single AQMEII_*.nc file.

Once it is completed you can run the next step. Unpack, mozbc.tar, go to the mozbc main directory, copy mo_mozart_lib.patch, install, edit path to WRF run directory in the saprc99.inp namelist, and finally run mozbc.

No Format
$> tar -xvf mozbc.tar
$> cd mozbc/
$> cp public_box/mo_mozart_lib.patch .
$> patch < mo_mozart_lib.patch
$> make_mozbc
$> mozbc < saprc99.inp > mozbc.out

...

file ready to be used by modified MOZBC package.

convert.sh
Runs the ncl script. 
Directory ./
mo_mozart_lib.patch

Patch for mo_mozart_lib.f90 program (part of original mozbc package). The file should be copied to mozbc/ and then executed:

$>patch < mo_mozart_lib.patch

saprc99.inp

Namelist. Defines input and output directories and which variables to interpolate to WRF grid. It is possible to use only those variables already defined in wrfinput_d01, which depends on chemical package and options selected in &chem section of WRF's namelist.input. Here, an example for SAPRC99 chemical mechanism coupled with the MOSAIC aerosol chemistry module with 4 size bins.

The users have to provide their own mapping to get the chemical boundary condition for their preferred chemistry option.

mozart.inpA namelist example for mozart package.

Step 4: Running the model


The first step is to run the WRF model but only up to real.exe. Instruction on how run the model are provided in WRF official user guideNote that you should not execute the wrf.exe because we still do not have a chemical BC interpolated to the WRF grid. This will be created using the utility provided by AQMEII and the mozart package. Before running this step you should check and edit paths in convert.sh and MACC_BC2MOZART.ncl if necessary.

No Format
$> cd ECMWF2WRFChem/
$> ./convert.sh

This step converts four NetCDF files (AER_*, GRG_*, GRG_voc_*, and PS_*) into a single AQMEII_*.nc file.

Once it is completed you can run the next step. Unpack, mozbc.tar, go to the mozbc main directory, copy mo_mozart_lib.patch, install, edit path to WRF run directory in the saprc99.inp namelist, and finally run mozbc.

No Format
$> tar -xvf mozbc.tar
$> cd mozbc/
$> cp public_box/mo_mozart_lib.patch .
$> patch < mo_mozart_lib.patch
$> make_mozbc
$> mozbc < saprc99.inp > mozbc.out

This program will read NetCDF files created in the previous step (AQMEII_*.nc), chemical variables from it will be interpolated on WRF grid and added to wrfinput_d01 and wrfbdy_d01 files. Once this step has completed successfully you are ready to execute wrf.exe.


Info
iconfalse

This document has been produced in the context of theCopernicus Atmosphere Monitoring Service (CAMS).

The activities leading to these results have been contracted by the European Centre for Medium-Range Weather Forecasts, operator of CAMS on behalf of the European Union (Delegation Agreement signed on 11/11/2014 and Contribution Agreement signed on 22/07/2021). All information in this document is provided "as is" and no guarantee or warranty is given that the information is fit for any particular purpose.

The users thereof use the information at their sole risk and liability. For the avoidance of all doubt , the European Commission and the European Centre for Medium - Range Weather Forecasts have no liability in respect of this document, which is merely representing the author's view

...

.

Content by Label
showLabelsfalse
max5
spacesCKB
showSpacefalse
sorttitle
typepage
cqllabel in ("cams","era5") and type = "page" and space = "CKB"
labelscams

...