WRF Checklist

Things to remember before you run WRF

  • Relax, running a numerical model is easy. You are way smarter than the model.

  • You sure can do this. So, don't panic, if you can't compile or got error messages.

  • It's fine to mess up with the model. You can always re-download the source codes and recompile it.

  • You will get an A, if you can crash a server by running WRF.

  • Always remember, google is your good friend.

Notes:

If using the following in a command:

> = directs a command/process into a log file (ie: ./geogrid.exe > geogrid.output)

& = hides process in background (ie: ./wrf.exe &)


Setup of WRF and WPS at SJSU MET servers (e.g., rain, snow, hurricane, thunder, frost)

1) Make sure your .bashrc file set up correctly. Mainly the path to NETCDF, MPICH2, gfortran

2) Download .tar files for WRF and WPS

wget -c https://github.com/wrf-model/WRF/archive/v4.1.2.tar.gz

tar -xvzf v4.1.2.tar.gz -C $HOME/WRF

cd $HOME/WRF/WRF-4.1.2

./clean

./configure # 34, 1 for gfortran and distributed memory

./compile em_real

export WRF_DIR=$HOME/WRF/WRF-4.1.2

## WPSV4.1

wget -c https://github.com/wrf-model/WPS/archive/v4.1.tar.gz

tar -xvzf v4.1.tar.gz -C $HOME/WRF

cd $HOME/WRF/WPS-4.1

./configure #3

./compile

Note: you may encounter problems while compiling WPS. oftentimes, it's because the system default setting of the "MPI_LIB". You can find the error message from compile.output file.

The way to solve it:

type

export MPI_LIB=

and recompile WPS (step 4 above)


Run WRF and WPS

1) Adjust namelist.wps

a. Number of domains (single=1, nested=2 or more)

b. Start and end time

c. Size of grid

d. Projection (Mercator, lambert, polar stereographic)

e. Latitude and longitude (references, true)

~Don’t be afraid to play around with different grid sizes and latitudes and longitudes to adjust to your desired domain

2) Use plotgrids.ncl/plotgrids_new.ncl to see and check your domain(s)

a. Command: ncl plotgrids.ncl. (or ncl plotgrids_new.ncl)

Note: make sure your plotgrids.ncl or plotgrids_new.ncl has the correct path to read namelist.wps file

3) Repeat last 2 steps as necessary until you have the desired domain(s)

4) Running geogrid.exe

a. Type “./geogrid.exe >& geogrid.log”

b. Upon successful completion, the following message will appear:

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

! Successful completion of geogrid. !

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

5) Running ungrib.exe

a. Link directory containing gfs data to the

i. Example command:

./link_grib.csh /mmmtmp/mm5rt/data/gfs/gfs_061101_12_./g*

^^^^^^^^^^^^^^^^^^^^^

(the path to the data your downloaded, i.e., GFS or NAM or HRRR)

b. Link the chosen Vtable to WPS directory

i. Example command:

ln -s ungrib/Variable_Tables/Vtable.GFS Vtable

(if using GFS as the forcing data)

ln -s ungrib/Variable_Tables/Vtable.NAM Vtable

(if using NAM as the forcing data)

c. Type “./ungrib.exe >& ungrib.log”

(note: just type ./ungrib.exe , this way you will see the error messages directly if any)

d. Upon completion, the following message will appear:

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

! Successful completion of ungrib. !

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

6) Running metgrid.exe

a. Type “./metgrid.exe >& metgrid.log”

Successful WPS = generates met_em_* files

WRF – Real Case

Explains each namelist.input: https://esrl.noaa.gov/gsd/wrfportal/namelist_input_options.html

1) Go to directory path: ~/WRFV3/test/em_real/

2) Edit and ensure domain and start&end dates from ~/WPS/namelist.wps match ~/em_real/namelist.input

a. For the namelist.input:

i. General rule: dx*6 for timestep

ii. Make sure “num_metgrid_levels” in the namelist.input matches your met_em* files with “ncdump –h met_em* |more”; if more than 1 domain, check a met_em* file for each domain

3) Link met_em files to em_real directory

a. Type: ln –s ~/WPS/met_em* . <--- period is important, denotes where the files are being linked to

4) Type command: ./real.exe >& real.output

a. Look at the real.output or rsl.error files for any errors or the success msg below.

b. Successful execution = SUCCESS EM_REAL INIT in real.output or in a rsl* file

5) Type command: ./wrf.exe (in general); then type “bg” after WRF starts running

Other possible commands using more than one processor include:

a. mpiexec –np # ./wrf.exe< /dev/null & (works well)

b. $nohup mpirun –np # ./wrf.exe > wrf.output & (works sometimes when it logs out; not sure tho)

where # equals number of processors


WRF-Chem

Compile same as WRF-ARW but beforehand:

(https://ruc.noaa.gov/wrf/wrf-chem/wrf_tutorial_exercises_v35/compiling_code.html)

1) Set environmental variable to WRF_CHEM=1

Then..


2) Extra tar file to unzip (WRF_CHEM …tar) in WRFV3 directory; makes a chem directory within WRFV3 directory

3) ./compile emi_conv to make the convert_emissions.exe


WPS difference in WRF-Chem

1) Make a symbolic link for GEOGRID.TBL to GEOGRID.TBL.ARW_CHEM

….

WRF-CHEM

1) Make sure namelist.input is correct

a) order of io_form_auxinput first before auxinput per http://forum.wrfforum.com/viewtopic.php?f=41&t=8828

ie:

io_form_auxinput5 = 2,

io_form_auxinput6 = 2,

io_form_auxinput7 = 2,

io_form_auxinput8 = 2,

io_form_auxinput12 = 2,

io_form_auxinput13 = 0,

auxinput6_inname = 'wrfbiochemi_d01',

auxinput7_inname = 'wrffirechemi_d<domain>',

auxinput8_inname = 'wrfchemi_gocart_bg_d<domain>',

auxinput12_inname = 'wrf_chem_input',

auxinput13_inname = 'wrfchemv_d<domain>’,

First run with chem_opt=0 to obtain wrfinput_d01 file.

2) link prep_chem_sources files (ie xxx.bin) to em_real directory as specified in WRF-Chem Emissions Guide

Naming conventions:

ln -sf <emiss-file-path>/<filename>-T-yyyy-mm-dd-hhmmss-g1-ab.bin emissopt3_d01

ln -sf <emiss-file-path>/<filename>-T-yyyy-mm-dd-hhmmss-g1-bb.bin emissfire_d01

ln -sf <emiss-file-path>/<filename>-T-yyyy-mm-dd-hhmmss-g1-gocartBG.bin wrf_gocart_backg

3) Turn chem_opt back on with appropriate settings (auxinput.. etc)

4) run convert_emiss.exe (need to compile .exe first)

To compile convert_emiss.exe:

a) type “./compile emi_conv” into your WRFV3 directory

b) After the script finishes running, go to the “chem” directory (ie ~name/WRF/WRFV3/chem” to check to see if convert_emiss.exe was created.

c) Files “convert_emiss.f90” and “convert_emiss.o” are also created.

d) success!

5) Check to see if intermediate chem files were created

a) If not, check if io_form_auxinput# is turned on

(ie for Gocart bkg should be “io_form_auxinput8 = 2,”)

b) tutorial #2 namelist for WRF3.5 has io_for_auxinput6-7-8 as 0”, which has not produced the intermediate files so it is likely incorrect

4) Need num_land_cat to match on the namelist.input and intermediate files

5) Make sure to make a symbolic link to rename the global anthropogenic emission file:

Ie: ln -sf wrfchemi_d01 wrfchemi_00z_d01