Skip to content

WRF Chem Upgrade to Manhattan

Tim Hoar edited this page Dec 18, 2019 · 13 revisions

Procedures to Build & Run (NCAR’s Cheyenne)

1. Obtain Required Code and Datasets for Tutorial

Checkout DART/WRF-Chem branch "final_wrfchem_upgrade" from Github repo https://github.com/fossell/DART_development

>> git clone https://github.com/fossell/DART_development/  dart_wrfchem
>> cd dart_wrfchem
>> git checkout -b final_wrfchem_upgrade  origin/final_wrfchem_upgrade
  • Note: $DART_DIR refers to top of DART code tree, e.g. dart_wrfchem/

2. Build the Required Code (build all in same top-level directory location)

Build WRF Chem (v3.9.1)

  • Helpful information links:

  • Unpack WRFV3.9.1

    >>  cd WRFV3
    
    • Unpack WRF-Chem v3.9.1 inside WRFV3 [Creates subdirectory WRFV3/chem]
  • Set the proper environment variables

    >> setenv EM_CORE  1
    >> setenv NMM_CORE 0
    >> setenv WRF_CHEM 1
    >> setenv WRF_KPP 0
    >> setenv YACC “/usr/bin/yacc -d”
    >> setenv FLEX_LIB_DIR /usr/lib64
    
  • Load the proper modules:

    1) ncarenv/1.3   2) intel/18.0.5   3) ncarcompilers/0.5.0
    4) mpt/2.19      5) netcdf/4.6.3   6) xxdiff/4.0.1
    7) mkl/2018.0.5  8) nco/4.7.9      9) ncl/6.6.2
    
  • Configure and Compile

    >> ./configure
         [Option 24 (intel, dmpar, sgi mpt)]
    >> ./compile  em_real  >&  compile.log
         [Look for executables for successful build]
    

Build WRFDA

See WRFDA documentation for assistance

Build WPS

See WRF/WPS documentation for assistance

WPS_GEOG (WPS Static dataset)

  • Link from “wrfhelp” on Cheyenne to location where all of the codes are built.
    >> ln  -s  /glade/u/home/wrfhelp/WPS_GEOG/  GEOG_DATA
    [Tutorial script by default expects directory name 'GEOG_DATA', but can change this in the script if you want.]
    

Build DART/wrf_chem

  • Make sure MKL libraries are loaded [module load mkl]

    • Set up build environment (NCAR Cheyenne example)
    >> cd $DART_DIR/build_templates
    >> cp  mkmf.template.intel.linux  mkmf.template
    
    • Build the code
    >> cd $DART_DIR/models/wrf_chem/work
    >> ./quickbuild.csh  >& build.log &
    
    • Build the observation converters
    >> cd $DART_DIR/observations/obs_converters
    >> ./buildall.csh  >&  build.log &
    
    • Build WRF-Chem utilities
    >> cd  $DART_DIR/models/wrf_chem/run_scripts/
    >> ./buildall.csh  >&  build.log &
    

3. Get Test data from Globus

  • Login to https://www.globusid.org/
  • Search for Endpoint “WRF/CHEM test data files”
  • Download data files (includes test input data for the tutorial, and sample output data for the tutorial to compare results)

4. Run DART/WRF-Chem Tutorial

  • Modify System Job Scripts

    >>  cd  $DART_DIR/models/wrf_chem/hybrid_scripts
    [Edit] da_run_hold*.ksh
    
  • Modify Configuration and Runtime settings in top-level script

    >>  cd  $DART_DIR/models/wrf_chem/run_scripts/RUN_REAL_TIME/FINAL_TEST_SCRIPTS
    
  • Edit real_time_PANDA_RETR_RELEASE_TEST_NCAR_MANHATTAN.ksh

    Important path environment variables to set in run script:

    # CODE VERSIONS (directory name only, not path):
    WPS_VER = Name of build WPS code directory
    WPS_GEOG_VER= Name of GEOG_DATA directory
    WRFDA_VER=Name of build WRFDA code directory
    WRF_VER=Name of build WRF code directory
    WRFCHEM_VER=Name of build WRF-Chem code directory
    DART_VER=Name of build DART code directory
    
    # ROOT DIRECTORIES:
    SCRATCH_DIR = directory for running tutorial
    WORK_DIR = top level directory where all of the source codes reside
    INPUT_DATA_DIR= directory where input data for tutorial was placed and unpacked.
    
    Important settings for initial cycle (2014072418) in script:
    
    INITIAL_DATE=2014072418
    FIRST_FILTER_DATE=2014072500
    FIRST_DART_INFLATE_DATE=2014072500
    FIRST_EMISS_INV_DATE=2014072500
    
    # START CYCLE DATE-TIME:
    CYCLE_STR_DATE=2014072418
    
    # END CYCLE DATE-TIME:
    CYCLE_END_DATE=2014072418
    
  • Run script for initial cycle (2014072418)

    >> cd models/wrf_chem/run_scripts/RUN_REAL/FINAL_TEST_SCRIPTS
    >> ./real_time_PANDA_RETR_RELEASE_TEST_NCAR_MANHATTAN.ksh >& chemtut_initial.out &
    
  • Modify and run the script for the first assimilation time 2014072500 Edit the script for new date and cycle settings:

    # START CYCLE DATE-TIME:
    CYCLE_STR_DATE=2014072500
    
    # END CYCLE DATE-TIME:
    CYCLE_END_DATE=2014072500
    RUN_GEOGRID=false
    [No need to run geogrid more than once during initial cycle]
    
    >> ./real_time_PANDA_RETR_RELEASE_TEST_NCAR_MANHATTAN.ksh >& chemtut_firstassim.out &
    

    [Advanced use: the “SELECT COMPONENT RUN OPTIONS” section of the run script may also be of interest after running the tutorial to turn on/off different obs types. Note that doing so may require edits to other parts of the run script, e.g. namelist sections]

5. Check results

  • Located in $SCRATCH_DIR/real_PANDA_RETR_VARLOC_RELEASE_TEST