EXERCISE 3

Exercise 3: Generating MEGAN biogenics to use along with the other emissions for the HKH domain.

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

  • Be sure your environmental variables are set. The MEGAN utility assume that you have set your NETCDF path as an environment variable.


  • If you have not done so already, make a MEGAN biogenic emissions directory and untar the MEGAN code in your home directory

    mkdir MEGAN

    cd MEGAN

    tar -xf /home/instructor1/CODE/MEGAN_CODE/megan_tutorial.tar.gz

    cd MEGAN/megan_code


  • Compile the MEGAN code using the directions in Appendix C of the User's Guide, or by following the directions in the README file.



    Some compilers have a limit of 132 columns in the free formatted code. If you get an error message indicating an issue at column 132, then the code needs to be edited.

    bio_emiss.f90:1231.132:
    bal, attr_name(:slen), attr_xtype, attr_len, attrs(m)%attr_byte ), message
    __________________________________________________________1
    Error: Syntax error in argument list at (1)

    To fix the problem, reduce the total columns in the code by splitting the code line in two and adding a continuating mark to the end of the first line. In this case, line 1231 of bio_emiss.f90 is too long and needs to be split into two lines. And of course, since the code was modified, you will need to clean and recompile the program.




  • Edit the megan_bio_emiss.inp input file settings for the exercise domain. (This is step 6 in Appendix C of the User's Guide.) It is recommended that one process the data for all 12 months when building the MEGAN input data for any domain. It takes a little longer to run, but it doesn't have to be run again for a new domain, or a new calendar month.

    For the tutorial, you should have something similar to:

    &control

    domains = 1,

    start_lai_mnth = 1,

    end_lai_mnth = 12,

    wrf_dir = '/home/${USER}/WRFV3/test/em_real',

    megan_dir = '/atmosdata/tempgroupdata/inputDATA/megan_data'

    /

    where one needs to use the actual user name in the file in place of ${USER}.


  • Run the megan executable (step 7 in Appendix C). To complete the run you will need about 10 Gb of memory so don't try running the program on a small PC.

    ./megan_bio_emiss < megan_bio_emiss.inp >& run.out



    Examine the run.out log file for any error messages. You should see the following message at the end of a successful run.

    Finished megan2 bio emiss dataset shr200121_30sec.nc

    map_megan2_emissions: Before write_bioemiss

    map_megan2_emissions: After write_bioemiss

    map_megan2_emissions: 3 cached grid(s)

    (No, there is not a nice ending statement at this time.)


  • Verify that the biogenic emissions data exists in the MEGAN directory and that the fields appear correct. Use a netCDF data file viewer to examine your biogenic emissions data. Does it look like it matches your WRF domain? Does it have 12 months of data for leaf area index (MLAI), etc.


  • Copy the wrfbiochemi_d01 data file to your WRFV3/test/em_real directory.


  • Next "cd" to WRFV3/test/em_real and set the correct options for bio_emiss_opt, ne_area and io_form_auxinput6, etc. in the namelist.input file. In addition, turn on the aerosol optical properties to obtain the extinction coefficient in the wrfout file. Remember, the auxiliary input ports are defined 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


  • With the updated namelist.input file you can now run real.exe (step 9 in Appendix C) and wrf.exe. It is recommended that you use the RADM2/MADE-SORGAM chemistry option (chem_opt=2). Be sure to examine the wrfinput data file and verify that the the biogenic emissions (e.g., MLAI) were included. Also, did you need to change the settings for the anthropogenic emissions? What about the chemistry time step? You need to take care with this run and check all of the chemistry settings.




    This concludes WRF-Chem emissions tutorial exercise 3.




    To compare solutions, download desired files from here.


    Return to Nepal WRF-Chem Tutorial Page