EXERCISE 2

Exercise 2: Adding the Global emissions data (sea salt, biomass burning) emissions to the HKH domain.

***************************************************************************

  1. Be sure your environmental variables are set. You don't have to compile WRFV3, but it is always a good idea to have them set. Also, remember to work in
    your directory /home/${USER} .


  2. If you have not done so already, make a global emissions directory and untar the prep_sources_chem code in your home directory

    mkdir Global_emissions

    cd Global_emissions

    tar -zxf /home/${USER}/CODE/PREP_CHEM_SOURCES_V1.4



  3. If you have not done so already, compile the prep_sources_chem code using the directions in Appendix B of the User's Guide. Be certain to change the compile options to include the path to the netCDF library as well as the compiler used on your system. Hint: at the Nepal tutorial tutorial the netCDF library is set in your path and the gfortran compiler is used.

    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


    and you need to change each one to the correct path for your system. Check each library location (don't just copy the above library paths) as an incorrect path for these libraries will result in a compile error.

    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


    F_COMP=gfortran
    C_COMP=gcc
    LOADER=gfortran
    C_LOADER=gcc

    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. file.


    -L${HDF5}/zlib/lib -lz -lsz

    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


  4. edit the prep_sources_chem.inp input file settings:

    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 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 = 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.


  5. run prep_chem_sources_RADM_WRF_FIM.exe. You should see the following message at the end of a successful run.

    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.)


  6. Verify that the emissions data exists in the prep_chem_sources directory and that their size is (approximately) correct. Depending upon your system and data used the file sizes could vary by a small fraction.

    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


  7. Link these files to the WRFV3/test/em_real directory from the prep_chem_sources/bin run directory.


  8. Next "cd" to WRFV3/test/em_real and set the correct options for emiss_inpt_opt, emiss_opt and chem_optm io_form_auxinput?, etc. in the namelist.input file. As a first step, you might use the simple GOCART aerosol option (chem_opt=300) with dust, sea salt, DMS, and biomass burning. Be sure to consider the update interval of the global emissions as well as their vertical dimensions (kemit=1 as it is only surface data). The run time for convert_emiss don't have to be very long - 12 hours or less - as the global emissions are updated once a month. In this exercise step you could set it to 3 hours. Also, be sure to set your auxiliary input file values accordingly or there will be no data read in or values assigned in the output file. Remember, in column 8 of the registry.chem file the auxiliary input port numbers are set and they have been assigned as:

    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


  9. With the updated namelist.input file you can now run convert_emiss.exe. The output files will be

    wrfchemi_d01 -> Anthropogenic emissions

    wrffirechemi_d01 -> Surface biomass burning fields

    wrfchemi_gocart_bg_d01 -> GOCART background fields



  10. Use a netCDF data file viewer to examine your global emissions data. Does it look like it matches your domain, or a set of diagonal lines?


  11. If the global emissions, biomass burning, etc. files are correct, move or link the fire and GOCART emissions files to the WRF/test/em_real directory. If you need help follow what is shown in the quick start section of the User's guide.


  12. Now link the global anthropogenic emissions back so that it can be used in the simulation. This name is what one would normally use in a run.

    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.


  13. Examine your namelist.input file making sure you have set the correct values for RETRO/EDGAR anthropogenic emissions, the proper vertical dimensions for global emissions (surface data only), auxiliary file update interval, etc. Be sure to turn on biomass burning, sea salt, DMS, etc. as the GOCART aerosol scheme is being used! Also be sure to have the run time of 2 days as you will be making a WRF simulation and not building global emissions from data files that vary daily or monthly.


  14. With the namelist.input file set you can now run your run real.exe to get the GOCART background fields and biomass burning emissions data input the wrfinput file. If you do not do this there will be zero fields entered for biomass burning, etc. when you run wrf.exe

    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?


  15. With the input and boundary conditions files built you can now run wrf.exe. As the biomass burning and GOCART background fields are already in the wrfinput file you need to turn these fields off before running wrf.exe. If you forget you will get a failure reading the input data file message.

    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,...). ***


  16. Once again, when finished you should examine results of your simulation. Verify that sea salt aerosols exist in the run. Are the SO2 and fire emissions correct?

    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.






    To compare solutions, download desired files from here.


    Return to Nepal WRF-Chem Tutorial Page