Exercise 1: Using the Global emissions data (sea salt, biomass burning) emissions for your domain.
Purpose: To familiarize the user with the available global emissions data set. This data set uses a program called "prep_chem_sources" to read the emissions data and map it to the user specified simulation domain. The program is capable of mapping anthropogenic emissions, sea salt as well as biomass burning (wild fire) and volcanic ash emissions to the user domain.
The use of the prep_chem_sources program is complex and requires the user to be familiar with the simulation domain mapping information, the location of various data sets and where they are obtained as well as located on their particular system. Also, the user needs to be very familiar with the WRF-Chem registry (WRFV3/Registry/registry.chem) as the conversion process for this data that relies on the correct specification of chemistry namelist options. See the WRF-Chem Quick_start guide, the User's guide as well as the WRF-Chem FAQ web page (http://ruc.noaa.gov/wrf/wrf-chem/user-support.htm) for additional information.
This exercise demonstrates the methodology for making a WRF-Chem emissions input files. the process shown here is:
tar -zxf /kumquat/wrfhelp/SOURCE_CODE/WRF-CHEM/prep_chem_sources_v1.4.tar.gz
To compile the code cd to the main prep_chem_sources directory and then down to the bin/build directory (ie., cd ../../PREP_CHEM_SRC_1.3/bin/build). Edit the include file that is appropriate for your compiler (e.g., include.mk.opt.pgi, or include.mk.pgi for those using PGF90, include.mk.opt.intel for those using ifort). Pay close attention to the lines for the libraries (e.g., the NETCDF, HDF5 library paths) as well as if byte swapping is needed. Your include.mk.opt file should have lines that look something like:
NCARG_DIR=$(NCARG_ROOT) .... Remember that WRF uses NCARG_ROOT as the path to your NCAR graphics libraries...
NETCDF_LIBS=-I$(NETCDF)/include -L$(NETCDF)/lib -lnetcdf
HDF_LIBS=-L/usr/local/hdf5-1.8.11-pgi/lib -lhdf5hl_fortran -lhdf5_fortran -lhdf5_hl -lhdf5 -L$(SZIP)/lib -lz
Regarding compile options such as byte swapping, look at the FORTAN compile lines from your WRFV3 compile log. Most often the basic compile options used for WRF will be needed for prep_chem_sources as well. For the NCAR tutorial this holds true as the PGI FORTRAN compiler uses the -byteswapio compile option. This needs to be added to the FORTRAN compile options in the include.mk.opt.pgi file at the F_OPTS line as follows:
F_OPTS= $(NETCDF_LIBS) $(HDF_LIBS) -Mpreprocess -D$(CHEM) -O3 -byteswapio
And finally, be sure to use as new of a compiler version as possible. There has been issues building the code when using old compilers. For example, at NCAR you have a choice between PGF90 version 10 or version 13. The version 10 compiler(/usr/local/pgi_10/bin/pgf90) will not be able to generate an executable, but the version 13 compiler (/usr/local/pgi-13.6/bin/pgf90) does work.
Even with the correct default compiler version, you might need to state which compiler version needs to be used when building the code by editing the compiler lines from
to like the following:
What does this all look like? Compare your include.mk.opt.pgi file with the following example include.mk.opt.pgi file produced for the NCAR tutorial computers.
Some computers have an additional compression library that needs to be added to the HDF5 library path. If you are getting an error message suggesting the sz compression library is not linked, make sure you have loaded the zlib module (only some systems require loading modules) and added libsz to your HDF_LIBS line in the include.mk.
Once the settings for the compiler and library paths are correct you can compile the code with the command (assumes PGF90 compiler)
make OPT=opt.pgi CHEM=RADM_WRF_FIM
prep_chem_sources exectutable one directory up. You can verify by listing the executable ../prep_chem_sources_RADM_WRF_FIM.exe
If during the compile you get a message like:
ifort -c -I/usr/local/netcdf/include -L/usr/local/netcdf/lib -lnetcdf -L/usr/local/hdf5/lib -lmfhdf -ldf -L/usr/loal/jpeg-6b -ljpeg -L/usr/local/zlib-1.2.7 -lz -lsz -fpp -DRADM_WRF_FIM -convert big_endian -O2 -I../../aux_src/utils/include gocart_background.f90gocart_background.f90(132): error #7013: This module file was not generated by any release of this compiler. [NETCDF]
gocart_background.f90(213): error #6404: This name does not have a type, and must have an explicit type. [NF90_OPEN]
call check( nf90_open(TRIM(filename(ispc)), NF90_NOWRITE, ncid) )
You have a bad compile due to the netCDF library path being incorrect. Verify that the netCDF libraries and include file paths are correct for your compiler and that the hdf5 library was built with the netCDF library build disabled. Similar error messages can occur as well when there are problems with the other libraries so verify all settings in the include.mk.
If you have a bad compile and need to clean the code and try again, just type:
make OPT=opt.pgi clean
If you get an error message suggesting that there are missing netCDF library routines then you might be missing the netcdff.a library extension. Not all systems have a netcdff.a library extension, but it should be included if it exists. To include the netcdff.a library you should add it to the NETCDF_LIBS listing for your compiler.
NETCDF_LIBS=-I$(NETCDF)/include -L$(NETCDF)/lib -lnetcdf -lnetcdff
Again, verify that the netCDF libraries and include file paths are correct for your compiler, clean and recompile the code.
Confusing? There is a README file in the PREP_CHEM_SOURCES main directory that explains the whole process in more detail.
grid_type= 'lambert', !
and the grid information
NGRIDS = 1, ! Number of grids to runNNXP = 41 , ! Number of x gridpoints
NNYP = 41 ! Number of y gridpoints
NXTNEST = 0, ! Grid number which is the next coarser grid
DELTAX = 100000.,
DELTAY = 100000., ! X and Y grid spacing
! Nest ratios between this grid and the next coarser grid.
NSTRATX = 1,2,3,4, ! x-direction
NSTRATY = 1,2,3,4 ! y-direction
! For polar, polelat and polelon are the geographical coordinates of the point
! of tangency between the projection plane and the Earth surface.
! It will be coincide with the center of grid (nnxp/2,nnyp/2) if they are
! equal to centlat and centlon.
! For lambert, then polelat and polelon specify the grid center lat/lon
POLELAT = 35., !
POLELON = 25., !
STDLAT1 = 30., !
STDLAT2 = 40., !
CENTLAT = 35.,
CENTLON = 25.,
For the tutorial, the input RETRO, EDGAR, surface and WF-ABBA data are located inside
the Global_emissions directory. For a place to start, look under:
Note: You will need to set all of the data file paths for each of the options. There will be more than just the three paths that needs to be set. Also, you might want to examine the emissions and surface data to confirm the paths you are setting. Review the quick_start and User's guide for additional information.
DMS for month= 7
writing spc=EROD 41 41 3
writing spc=H2O2 41 41 55
writing spc=OH 41 41 55
writing spc=NO3 41 41 55
(No, there is not a nice ending statement at this time.)
WRF-TUTORIAL-T-2010-07-14-000000-g1-gocartBG.bin ________ 1136624 bytes
WRF-TUTORIAL-T-2010-07-14-000000-g1-bb.bin _______________ 235672 bytes
WRF-TUTORIAL-T-2010-07-14-000000-g1-ab.bin _______________ 181816 bytes
cp -R /kumquat/wrfhelp/PRE_COMPILED/WRF-CHEM/WRFV3 WRFV3
This WRF-Chem code is compiled for the organized tutorial sessions. If you are not attending an organized tutorial you need to obtain and compile the WRF-Chem code yourself. If compiling WRF-Chem is unfamiliar, A short tutorial on compiling the code is available.
auxinput_5 -> Anthropogenic emissions
auxinput_6 -> Biogenic emissions (BEIS, MEGAN)
auxinput_7 -> Surface biomass burning fields
auxinput_8 -> GOCART background fields
auxinput_12 -> Chemistry initial fields
auxinput_13 -> Volcanic ash emissions
auxinput_14 -> Aircraft emissions
auxinput_15 -> Green House Gas emissions
wrfchemi_d01 -> Anthropogenic emissions
wrffirechemi_d01 -> Surface biomass burning fields
wrfchemi_gocart_bg_d01 -> GOCART background fields
Did you get a run time error when running convert_emiss.exe? Perhaps something like:
If so, then you might:
* have a bad link,
* a zero-size file, or
* a missing the GOCART backgroud file.
Or you might have incorrectly set the byteswap compile option(s) for prep_chem_sources. First make sure the file link is correct. Then verify that you used the same compile options for prep_chem_sources as was used with WRF.
ln -sf wrfchemi_d01 wrfchemi_00z_d01The name wrfchemi_00z_d01 is normally used in a WRF run when emiss_inpt_opt=1 so it should become familiar. But note: IF you are using hourly emissions data - not daily global surface data from RETRO/EDGAR - there will be two wrfchemi files. The first, wrfchemi_00z_d01 containing data from 00 to 11 UTC and wrfchemi_12z_d01 containing data from 12 to 23 UTC. The 24 hours of emissions data will be cycled each day.
mpirun -np 4 real.exe
Examine the wrfinput data file. Do you see the GOCART background fields in the wrfinput_d01 file? Biomass burning emissions (e.g., ebu_in_co) in the surface fields as well?
mpirun -np 4 wrf.exe
It will probably take approximately 5 minutes to finish the simulation on your computer.
*** An important item to remember is that the GOCART background fields are reset for each chemistry time step. A small chemistry time step will result in an inacurate background state as it takes about 1 hour for the background fields to recover. Be sure to use a reasonable chemical time step like chem_dt = 60 when running the simple GOCART option (chem_opt=300). IF (and that is a big IF) you did not use a large time step for the simple GOCART simulation, rerun with chem_dt = 60 (minutes). But what about chem_opt=301 and 302 (GOCART + RADM2 or RACM gas chemistry)? Those options have the oxidizing chemistry updating with chemdt so the GOCART background fields are not being used for the gas-phase chemistry calculation. For those options use a reasonable chemistry timestep (chemdt = n * time_step; n=0,1,2,3,...). ***
Can you see the fire emissions in the PM, or CO fields above the surface? Does the sea salt match the fine coarse particulate matter fields (PM10)?
This concludes WRF-Chem emissions tutorial exercise 1.
Return to WRF-Chem Emissions Tutorial Page