Monday, April 21, 2008

WRF/CHEM: Frequently Asked Questions

WRF/CHEM: Frequently Asked Questions

Q: Does the chemistry code come with the latest release of the WRF model?

A: No, chemistry is not currently part of the latest release of the WRF model. However, it is in the WRF repository and should be made available some time in the future.


Q: How do I obtain a copy of the WRF chemistry code?

A: The chemistry section of the WRF/Chem model is available from the WRF model code download page.


Q: What are the chemistry namelist.input options?

A: The namelist.input options are:

  • In the physics namelist there is one option:

    cu_rad_feedback = .false. ( No feedback from the parameterized convection to the radition schemes )

    cu_rad_feedback = .true. ( Feedback from the parameterized convection to the radition schemes turned on)

  • And the chemistry namelist there are many options:

    chem_opt = 0 (no chemistry)

    chem_opt = 1 (include chemistry using the RADM2 chemical mechanism - no aerosols)

    chem_opt = 2 (include chemistry using the RADM2 chemical mechanism and MADE/SORGAM aerosols)

    chem_opt = 5 (CBMZ chemical mechanism with Dimethylsulfide, or DMS)

    chem_opt = 6 (CBMZ chemical mechanism without DMS)

    chem_opt = 7 (CBMZ chemical mechanism (chem_opt=6) and MOSAIC using 4 sectional aerosol bins)

    chem_opt = 8 (CBMZ chemical mechanism (chem_opt=6) and MOSAIC using 8 sectional aerosol bins)

    chem_opt = 9 (CBMZ chemical mechanism (chem_opt=6) and MOSAIC using 4 sectional aerosol bins) including some aqueous reactions

    chem_opt = 10 (CBMZ chemical mechanism (chem_opt=6) and MOSAIC using 8 sectional aerosol bins) including some aqueous reactions

    chem_opt = 11 (RADM2 chemical mechanism (chem_opt=6) and MADE/SORGAM aerosols) including some aqueous reactions

    chem_opt = 12 (RACM chemical mechanism (chem_opt=6) and MADE/SORGAM aerosols) including some aqueous reactions

    chem_opt = 13 (Tracer with emissions, currently set-up for SO2 and CO only)

    chem_opt = 101 (RADM2 Chemistry using KPP library)

    chem_opt = 102 (RACM-MIN Chemistry using KPP library)

    chem_opt = 103 (RACM Chemistry using KPP library)

    chem_opt = 104 (RACM Chemistry and PM advection using KPP library)

    chem_opt = 105 (RACM Chemistry and MADE/SORGAM aerosols using KPP library)

    chem_opt = 106 (RADM2 Chemistry and MADE/SORGAM aerosols using KPP library) *** not fully implemented ***

    *** To have radiative feed back with the chemistry/aerosols use chem_opt = 7 or 8 and ra_sw_physics = 2 (Goddard shortwave scheme) ***

    chem_in_opt = 0 (use idealized profile to initialize chemistry )

    chem_in_opt = 1 (use previous simulation data to initialize chemistry - file named chemin_d01_000000)

    io_form_auxinput4 = 2 (biogenic emissions input (wrfbioemi_d01) data format is WRF netCDF. Used if bio_emiss_opt=2)

    io_form_auxinput5 = 2 (anthropogenic emissions input (wrfchemi_00z_d01 and wrfchemi_12z_d01) data format is WRF netCDF)

    auxinput5_interval = 60. (anthropogenic emissions update time interval in minutes)

    chemdt = 1.5 (time step used by chemistry in minutes - suggest that chemdt = dt)

    bioemdt = 30 (update time interval used by biogenic emissions in minutes)

    kemit = 8 (number of vertical levels in the emissions input data file)

    photdt = 30 (updatetime interval used by photolysis routine in minutes)

    phot_opt = 0 (no photolysis)

    phot_opt = 1 (use madronich photolysis)

    phot_opt = 2 (use Fast-J photolysis)

    phot_opt = 3 (use FTUV photolysis)

    emiss_opt = 0 (no anthropogenic emissions)

    emiss_opt = 2 (use radm2 anthropogenic emissions)

    emiss_opt = 3 (use radm2/MADE/SORGAM anthropogenic emissions)

    emiss_opt = 4 (use CBMZ/MOSAIC anthropogenic emissions)

    drydep_opt = 0 (no dry deposition)

    drydep_opt = 1 (include dry deposition)

    bio_emiss_opt = 0 (no biogenic emissions)

    bio_emiss_opt = 1 (calculate biogenic emissions online using the Gunther scheme)

    bio_emiss_opt = 2 (include biogenic emissions in wrfinput data file and modify values online based upon the weather)

    bio_emiss_opt = 3 (include MEGAN biogenic emissions online based upon the weather, landuse data)

    emiss_inpt_opt = 0 (no emissions data read)

    emiss_inpt_opt = 1 (speciation for RADM2/SORGAM)

    emiss_inpt_opt = 101 (calculate biogenic emissions online using the Gunther scheme)

    emiss_inpt_opt = 102 (include biogenic emissions in wrfinput data file and modify values online based upon the weather)

    biomass_burn_opt = 1 (include biomass burning emissions and plume rise calculation (experimental))

    dust_opt = 0 (no GOCART dust emissions) *** inactive ***

    dust_opt = 1 (include GOCART dust emissions - need to provide errosion factor data) *** inactive ***

    seas_opt = 0 (no GOCART sea salt emissions) *** inactive ***

    seas_opt = 1 (include GOCART sea salt emissions) *** inactive ***

    dmsemis_opt = 0 (no GOCART dms emissions from sea surface) *** inactive ***

    dmsemis_opt = 1 (include GOCART dms emissions from sea surface) *** inactive ***

    aer_op_opt = 1 (aerosol optical properties calculated based upon volume approximation)

    aer_op_opt = 2 (aerosol optical properties calculated based upon Maxwell approximation)

    aer_op_opt = 3 (aerosol optical properties calculated based upon exact volume approximation)

    aer_op_opt = 4 (aerosol optical properties calculated based upon exact Maxwell approximation)

    aer_op_opt = 5 (aerosol optical properties calculated based upon exact shell approximation)

    io_style_emissions = 0 (no emissions data read)

    io_style_emissions = 1 (two 12-h emissions data files used)

    io_style_emissions = 2 (Date/time specific emissions data files used)

    frames_per_emissfile = 6 (number of times in each emissions data file, set to 12 for io_style_emissions=1)

    emi_inname = (name of the emissions input file)

      (wrfchemi_12z_d for io_style_emissions = 1)

      (wrfchemi_d_ for io_style_emissions = 2)

    emiss_inpt_opt = 1 (follows RADM2/SORGAM speciation)

    emiss_inpt_opt = 101 (follows CBMZ/MOSAIC speciation)

    emiss_inpt_opt = 102 (follows RAMD2/SORGAM speciation, but similar to 101 with isoprene included)

    gas_bc_opt = |

    gas_ic_opt = |---- 1 (uses default boundary profile )

    aer_bc_opt = | 101 (uses modified default boundary profile - used for Houston)

    aer_ic_opt = |

    gaschem_onoff = 0 ( gas phase chemistry turned off in the simulation )

    gaschem_onoff = 1 ( gas phase chemistry turned on in the simulation )

    aerchem_onoff = 0 ( aerosol chemistry turned off in the simulation )

    aerchem_onoff = 1 ( aerosol chemistry turned on in the simulation )

    wetscav_onoff = 0 ( wet scavaging turned off in the simulation )

    wetscav_onoff = 1 ( wet scavaging turned on in the simulation )

    cldchem_onoff = 0 ( cloud chemistry turned off in the simulation )

    cldchem_onoff = 1 ( cloud chemistry turned on in the simulation )

    vertmix_onoff = 0 ( vertical turbulent mixing turned off in the simulation )

    vertmix_onoff = 1 ( vertical turbulent mixing turned on in the simulation )

    chem_conv_tr = 0 ( subgrid convective transport turned off in the simulation )

    chem_conv_tr = 1 ( subgrid convective transport turned on in the simulation )

    have_bcs_chem = .false. (get lateral boundary data from idealized profile specified in chemistry routines )

    have_bcs_chem = .true. (get lateral boundary data from wrfbdy data file )

    aer_ra_feedback = 0 ( No feedback from the aerosols to the radition schemes )

    aer_ra_feedback = 1 ( Feedback from the aerosols to the radition schemes turned on)


    Q: What data do I need to run a simulation with chemistry included?

    A: You need two 3-D anthropogenic emissions data files. These 3-D data files should contain 12 hours (1 hour update interval) of emissions data (0000 UTC to 1100 UTC and 1200 UTC to 2300 UTC). The data files need to be in the WRF NetCDF format and have the names wrfchemi_00z_d01 and wrfchemi_12z_d01. These data files can be constructed for your domain (United States only) from the emissions data (4-km horizontal spacing) made available from the WRF/Chem download site and the convert_emissions.F routine in the WRF chemistry directory.


    Q: I compile the WRF model, but chemistry does not appear to have been compiled. What do I need to do so that I will get a simulation with chemistry included?

    A: The latest version of the WRF model requires environmental variables to be set.

    To compile the mass dynamic core of the WRF model and include chemistry, one needs to set two environmental variables. These environmental variables are EM_CORE and WRF_CHEM.

    In the bash shell environment use the commands:

  • export EM_CORE=1
  • export WRF_CHEM=1
  • export WRF_KPP=1 (optional)
  • export FLEX_LIB_DIR = /usr/local/lib (optional)

    and in the c-shell environment use the commands:

  • setenv EM_CORE 1
  • setenv WRF_CHEM 1
  • setenv WRF_KPP 1 (optional)
  • setenv FLEX_LIB_DIR = /usr/local/lib (optional)


    Q: How are the gas phase emissions units converted from mole per km^2 per hour to the change in parts per million used by WRF/Chem?

    A: It is assumed that you have examined the anthropogenic emissions web page that discusses how one can build the emissions using the emiss_v01.F program.

    The units of all gas species in the binary files created with emiss_v01.F have units of mole/(km*km)/hr. The units of all aerosol species are microgram/(m*m)/s and they are treated differently than the gas phase emissions - hence the different emissions units. (These are also units of elevated (point) sources for each vertical grid).

    In module_emissions_anthropogrnics.F WRF/Chem code, the subroutine add_anthropogenics has the variable "conv_rho" that is used to convert the emissions units (gas-phase chemistry) to ppm (note that the model works with them as a mixing ratio). Specifically, conv_rho is used in module_emissions_anthropogenics.F to convert the gas-phase emissions from mole/(km*km)/hr into delta-ppmv, where delta-ppmv is the incremental addition to the gas phase species (units of ppmv).

    The calculation of conv_rho needs:

  • rho_phy: the air density in kg/(m3),
  • dtstep: the meteorology big time step in seconds,
  • dz8w: the vertical grid spacing (delta-z) for the lowest layer (or the layer for the emissions) in meters
  • Let E be emission in mole(/km-km)/hr from binary files (this is the output data from the emiss_v01.F program)

    Then

    E*(1.E-3)*(1.E-3)/(dz8w(I,K,J)*3600.) = E2 =emission in mole/(m^3)/sec

    And then let D be the dry air density in mole/(m3), or

    D=rho_phy(i,k,j)/(.02897 kg/mole)

    And the mixing ratio in units of parts per million (ppmv) is equal to 1.E6 * mixing ratio where the mixing ratio units is (mole/mole).

    So that leads to the conv_rho variable which converts the emissions units to parts per million being:

    conv_rho = (1.E6)*dtstep*E2/D = E*dtstep*8.047E-6/(rho_phy(I,k,J)*dz8w(i,k,j))

    So, the chemical emissions that are read into the WRF/Chem model and are multiplied by "conv_rho" to change the units.


    Q: How do I generate the 3-D anthropogenic emissions data files for my model domain?

    A: Anthropogenic emissions data for the 48 contiguous states and parts of Canada and Mexico have been made available for download by the NOAA Earth System Research Laboratory - Chemical Sciences Division. The process to create anthropogenic emissions input data files from this data is as follows:

  • Modify emiss_v01.F to set map and grid parameters for your particular domain.
  • Compile emiss_v01.F and run emiss_v01 using raw emissions data to generate WRF emissions files in binary format (file names are set in emiss_v01.F to be wrfem27k_00to12Z and wrfem27k_12to24Z). These filenames need to match the name of the binary input data file in mediation_integrate.F (in the WRFV3/share directory, but moving to WRFV3/chem/module_input_chem_data.F in a future release).
  • If necessary, change namelist.input file in the WRFV3/test/em_real directory:

    interval_seconds=3600, (hourly update to the emissions data)

    chem_opt=1,

    chem_in_opt=0,

    bio_emiss_opt=1.

  • Run real.exe to create wrfinput data file - need header information for WRF chemical emissions data files.
  • Compile emi_conv (in WRFV3 directory) in single processor mode to build the emissions conversion package.
  • Run convert_emiss.exe for 11 hours starting at 0000 UTC and ending at 1100 UTC and save the netcdf wrfchemi_d01 data file as wrfchemi_00z_d01.
  • Run convert_emiss.exe for 11 hours starting at 1200 UTC and ending at 2300 UTC and save the netcdf wrfchemi_d01 file as wrfchemi_12z_d01.


    Q: What species are included in the chemistry and what are the units for chemical, aerosols and emissions arrays?

    A: The registry.chem file contains the names and dimensions of the chemical species used by the WRF/Chem model.

    The gas phase chemistry variables are in units of parts per million (ppm).

    The aerosol units are in mixing ratio (microgram of aerosol per kg of dry air). The 3-d variable "alt" (inverse density) should be included to the list of output variables in the registry.chem registry file if you desire to convert from mixing ratio to microgram/m3. This is done by dividing the desired aerosol variable or variables by "alt".

    The chemical emissions are in units of mole per square kilometer per hour for the gaseous chemical species and microgram per square meter per second (microgram/(m^2 s)) for the aerosol species.

    The following is important if one wants to use your own biogenic emissions instead of the Gunther scheme. In module_bioemi_beis313.F, after the biogenic emissions are read into the model, a conversion factor which changes emissions from mole/km^2/hr to ppm is calculated. The 4.828E-4/rho_phy term of this factor converts mole/km^2/hr to ppm*m/min (contains conversion factors of molecular weight of air = 0.02897 kg/mol, hours to minutes, and kilometers squared to meters squared). The rest of the factor converts minuntes to seconds, multiplies by the chemistry time step in seconds, and divides by layer thickness in meters. [Thanks goes to Gregory Frost (NOAA-AL, CIRES) for this explanation]


    Q: I do not want to use the Gunther biogenic emissions parameterization. How do generate the 2-D biogenic emissions data file for my model domain?

    A: The process to create biogenic emissions input data files is as follows:

  • Create a wrf input data file without the biogenic emissions included (bio_emiss_opt=1).
  • Create data files for your domain for the biogenic emissions from your data source. *** Please note that no biogenic emissions data is available at this time. *** You must obtain your own biogenic emissions data from another source (e.g., EPA).
  • Change namelist.input file in the WRFV3/test/em_real directory:

    interval_seconds=3600, (hourly update to the emissions data)

    chem_opt=1,

    chem_in_opt=0,

    bio_emiss_opt=2.

  • Modify the med_read_bio_chem_emiss routine in WRFV3/chem/module_input_chem_data.F to read your data set. *** Make sure your units are mole/km^2/hr!***
  • Compile bio_conv (in WRFV3 directory) to build the emissions conversion package.
  • Run convert_emiss.exe for 23 hours starting at 0000 UTC and ending at 2300 UTC and save the netcdf wrfbiochemi_d01 data file.
  • Run real.exe to create wrfinput data file - the biogenic emissions should now be included in the wrfinput data file.


    Q: I want to make a new simulation using chemistry data from an old simulation. What options do I select to get the idealize profile for the first simulation and use the forecasted chemistry for the second simulation?

    A: We assume that the first simulation was run with chem_in_opt = 0 in the namelist.input file so that chemistry fields were initialized using an idealized atmospheric profile.

    Given that the WRF output data files (files named as wrfout_d01_2004-07-22_00:00:00 for example) has chemistry data included, subsequent simulations can be initialized using the forecasted chemistry data.

  • First move the wrfout data files to a new directory so that the data will not be overwritten, or removed.
  • Next, link the desired wrfout data file to a file named wrf_chem_input_d01_date_time in the WRF/test/em_real directory.
  • Then, set chem_in_opt = 1 in the namelist.input file (as well as update the starting and stopping dates and times) and
  • Finally, run real.exe to build a new wrfinput data file containing the updated chemistry data.

    Please note that we have tested simulations starting at either 0000 UTC, or 1200 UTC. Other starting times may or may not be initialized properly.


    Q: Do all of the physics and land-surface parameterizations work with the chemistry modules?

    A: Most of the physics parameterizations should function with the chemistry modules, but not all have been tested. So far, the following parameterizations have been tested by us (Georg Grell and Steven Peckham) when WRF is run with chemistry.

  • Longwave radiation option

      ra_lw_physics = 1, rrtm scheme

  • Shortwave radiation option

      ra_sw_physics = 1, Dudhia scheme

  • microphysics option

      mp_physics = 1, Kessler scheme

      mp_physics = 2, Lin et al. scheme

      mp_physics = 3, WSM 3-class simple ice scheme

      mp_physics = 4, WSM 5-class scheme

      mp_physics = 5, Ferrier (new Eta) scheme

      mp_physics = 6, WSM 6-class graupelscheme

      mp_physics =98, NCEP 3-class simple ice scheme

      mp_physics =99, NCEP 5-class simple ice scheme

  • Surface layer option

      sf_sfclay_physics = 1, Monin-Obukhov scheme

      sf_sfclay_physics = 2, Monin-Obukhov (Eta) scheme

  • Land-surface option

      sf_surface_physics = 2, NOAH land-surface model

      sf_surface_physics = 3, RUC land-surface model

  • Planetary Boundary Layer option

      bl_pbl_physics = 1, YSU boudary layer scheme

      bl_pbl_physics = 2, Mellor-Yamada-Janjic (Eta) TKE scheme

  • Convective paramterization option

      cu_physics = 0, no cumulus

      cu_physics = 1, Kain-Fritsch (new Eta) scheme

      cu_physics = 2, Betts-Miller-Janjic scheme

      cu_physics = 3, Grell-Devenyi ensemble scheme


    Q: Which routines can be used to plot the output from WRF/Chem?

    A: Any plotting routine that can read NetCDF formatted data can be used to plot the data from a WRF/Chem simulation. This includes, but is not limited to, the RIP and Vis5d routines that can be downloaded and used with the WRF model.


    Q: I just tried compiling the WRF/Chem (v3.0) code. I set EM_CORE=1 and WRF_CHEM=1 before ./compile em_real. the compiling stops with error in solve_em. The ./real.exe and ./wrf.exe are not executable files after this compilation process.

    A: On some compilers you might need to reduce the optimization for some routines (like solve_em.F in this case).

    This is done in the configure.wrf file. Look for solve_interface and put in the two similar lines in the configure.wrf file. Then try compiling again.

    # compile these without high optimization to speed compile

    solve_interface.o : solve_interface.F

    solve_em.o : solve_em.F

    shift_domain_em.o : shift_domain_em.F

    module_io_mm5.o : module_io_mm5.F

    module_si_io.o : module_si_io.F

    module_io_wrf.o : module_io_wrf.F

    ...

    ...

    ...

    module_configure.o : module_configure.F

    solve_interface.o \

    solve_em.o \

    shift_domain_em.o \

    module_io_mm5.o module_si_io.o module_io_wrf.o module_domain.o \


    Q: How does one compile the KPP libraries in WRF/Chem version 3.0?

    A: if you want to have the KPP options compiled you should do a "clean -a". Set the path to your flex library directory (directory where libfl.a can be found). For example, most systems have libfl.a located in /usr/lib. To set the flex library path use the command:

    setenv FLEX_LIB_DIR = /usr/local/lib

    Next you set the WRF KPP environmental variable:

    setenv WRF_KPP = 1

    And finally re-configure the WRF model and compile.


    This page developed by Steven Peckham and Georg Grell
    Model questions should be directed to WRF/Chem help.
    Last modified: Tuesday April 8, 2008 09:40 AM

  • 1 comment:

    Mariela said...

    Is it possible to create anthropogenic emissions data for my domain from scratch?