EXERCISE 2
Exercise 2: Adding the Global emissions data (sea salt, biomass burning) emissions to the HKH domain.
***************************************************************************
mkdir Global_emissions
cd Global_emissions
tar -zxf /home/${USER}/CODE/PREP_CHEM_SOURCES_V1.4
To compile the code move to the main prep_chem_sources directory and then down to the bin/build directory (ie., cd ../../PREP_CHEM_SRC_1.4/bin/build). Edit the include file that is appropriate for your compiler (e.g., include.mk.opt.gfortran). Pay close attention to the lines for the libraries (e.g., the NETCDF, HDF5 library paths) as well as including byte swapping in your compile line. Your include.mk.gfortran 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=/home/badhikary/NETCDF/netcdf.install
NETCDF_LIBS=-I$(NETCDF)/include -L$(NETCDF)/lib -lnetcdf -lnetcdff
HDF5 = /home/badhikary/HDF/hdf.install
HDF5_LIB=-L$(HDF5)/lib -lhdf5hl_fortran -lhdf5_fortran -lhdf5_hl -lhdf5 -L/home/badhikary/zlib/zlib-1.2.8 -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 Nepal tutorial this holds true as the gfortran FORTRAN compiler uses the -fconvert=big-endian compile option. This needs to be added to the FORTRAN compile options in the include.mk.gfortran file at the F_OPTS line as follows:
F_OPTS= -Xpreprocessor -D$(CHEM) -O2 -frecord-marker=4 -fconvert=big-endian
Be sure to use the correct compiler as well in the include.mk.gfortran file
What does this all look like? Compare your include.mk.gfortran file with the following example include.mk.gfortran file produced the Nepal tutorial computer.
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=gfortran 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
grid_type= 'mercator', !
ihour=00,
iday=14,
imon=07,
iyear=2010,
use_retro=1,
use_edgar=2,
use_seac4rs=1,
use_gocart=1,
use_bbem=1,
use_bbem_plumerise=1,
use_gocart_bg=1,
use_volcanoes=0,
...
and the grid information
...
NGRIDS = 1, ! Number of grids to run
NNXP = 41 , ! Number of x gridpointsNNYP = 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 = 25., !
POLELON = 90., !
STDLAT1 = 25., !
STDLAT2 = 25.1, !
CENTLAT = 25.,
CENTLON = 90.,
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: ftp://aftp.fsl.noaa.gov/divisions/taq/global_emissions/global_emissions_v3_24aug2015.tar.gz
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
gocart_bg_spc_nameDMS
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.)
HKH_data-T-2010-07-14-000000-g1-gocartBG.bin ________ 1136624 bytes
HKH_data-T-2010-07-14-000000-g1-bb.bin _______________ 235672 bytes
HKH_data-T-2010-07-14-000000-g1-ab.bin _______________ 181816 bytes
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
ln -sf wrfchemi_d01 wrfchemi_00z_d01
The 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 1 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 8 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 Nepal WRF-Chem tutorial exercise 2.