Professional Documents
Culture Documents
Srend Manual
Install WRF-ARW 3.8
These directions apply to a fairly recent Gnu/Linux distribution. It has worked in all of them tesuser, and these below apply specifically to Centos 7.5 .
The official UCAR directions are much more detailed, and here they are just in case:
http://www2.mmm.ucar.edu/wrf/OnLineTutorial/compilation_tutorial.php
The directions below use key portions of this WRF 3.7 recipe, but they use bash (sh) instead of csh. The directions above include additional tests and further
directions for building WPS and prepping for real cases.
In any case, the steps for incorporating Srend within WRF will be the same, so the directions for building a basic WRF to run stock test cases are sufficient. There
are many documents, tutorials, examples, and pieces of code which can be viewed and downloaded from the WRF Model Users web site. This are stripped-down
essentials-only directions below. Consult the compilation tutorial and WRF site if problems arise. Many people use WRF around the world, so a web search is often
successful in finding solutions to common problems.
You must register for this, and you must navigate to where you can
download WRF. Directions worked for 3.6, 3.7, and 3.3, but 3.8 is available
and so we go with
the most recent.
Download: WRFV3.8.TAR.gz
This is where mpich, netcdf, jasper, libpng, and zlib will go. Yes, these can be installed using a package manager using yum or apt-get, but failure is nearly certain
unless netCDF is compiled with the same compiler version used to build WRF, so build these all in this LIBRARIES directory.
cat ln sort
cd ls tar
cp make touch
cut mkdir tr
expr mv uname
file nm wc
gzip rm m4
a. mpich-3.0.4
b. netcdf-4.1.3
c. Jasper-1.900.1
d. libpng-1.2.50
e. zlib-1.2.7
export CC=gcc
export CXX=g++
exportFC=gfortran
export FCFLAGS=-m64
export F77=gfortran
export FFLAGS=-m64
make
make install
export PATH=$DIR/netcdf/bin:$PATH
export NETCDF=$DIR/netcdf
srend.nongnu.org/manual/WRF/wrf_install.html 1/5
10/11/21 23:50 srend manual: WRF_install
9. Move to the mpich directory: cd /home/user/wrf/LIBRARIES/mpich-3.0.4
make
make install
export PATH=$DIR/mpich/bin:$PATH
export CPPFLAGS=-I$DIR/grib2/include
./configure --prefix=$DIR/grib2
make
make install
make
make install
make
make install
a. Issue this command and answer the questions during the script run:
./configure
b. There are options going through confuration, but select 32 (serial) or 33 (SMP)
from the GNU 32,33,34,35 options.
14. There are many cases to choose from for an ideal run.
em_real (3d real case)
It takes some time to compile, 15-30 minutes! There will be numerous warnings about nonexistent /home/user/wrf/WRFV3/chem, but this is OK as it isn't needed
for this basic setup. If WRF-chem is downloaded and placed in the proper position, the warnings disappear during compilation--which, of course, takes more time
because chem is being built.
16. It is usually best to run test cases from the test directories because there
are additional test-specific files there.
srend.nongnu.org/manual/WRF/wrf_install.html 2/5
10/11/21 23:50 srend manual: WRF_install
-rw-r--r--. 1 user user 2517 Apr 7 2014 input_sounding_preWRFV3.6
*************************************
Parent domain
ids,ide,jds,jde 1 42 1 42
ims,ime,jms,jme -4 47 -4 47
ips,ipe,jps,jpe 1 42 1 42
*************************************
pi is 3.14159274
...
surface pi is 1.00000000
sounding
k height(m) press (Pa) pd(Pa) theta (K) den(kg/m^3) u(m/s) v(m/s) qv(g/g)
...
ptop is 5715.70850
...
surface pi is 1.00000000
sounding
k height(m) press (Pa) pd(Pa) theta (K) den(kg/m^3) u(m/s) v(m/s) qv(g/g)
...
...
--- WARNING: traj_opt is zero, but num_traj is not zero; setting num_traj to zero.
srend.nongnu.org/manual/WRF/wrf_install.html 3/5
10/11/21 23:50 srend manual: WRF_install
--- NOTE: sst_update is 0, setting io_form_auxinput4 = 0 and auxinput4_interval = 0 for all domains
--- NOTE: grid_fdda is 0 for domain 1, setting gfdda interval and ending time to 0 for that domain.
--- NOTE: both grid_sfdda and pxlsm_soil_nudge are 0 for domain 1, setting sgfdda interval and ending time to 0 for that domain.
--- NOTE: obs_nudge_opt is 0 for domain 1, setting obs nudging interval and ending time to 0 for that domain.
--- NOTE: RRTMG radiation is not used, setting: o3input=0 to avoid data pre-processing
*************************************
Parent domain
ids,ide,jds,jde 1 42 1 42
ims,ime,jms,jme -4 47 -4 47
ips,ipe,jps,jpe 1 42 1 42
*************************************
Timing for processing wrfinput file (stream 0) for domain 1: 0.01567 elapsed seconds
WRF TILE 1 IS 1 IE 42 JS 1 JE 42
...
...
18. For a quick look at these netCDF files, install ncview. (This will also install netCDF, but a separate global install
which your WRF install does not use.) Use
yum or apt-get to install ncview.
The 4d vars are most interesting, and there are 3 time steps and 39-40 levels. Here is what the ncview
dialog window looks like.
Here are some 4D variables extracted at various time steps (t0-2) and bottom-top (z 0-39).
srend.nongnu.org/manual/WRF/wrf_install.html 4/5
10/11/21 23:50 srend manual: WRF_install
19. Last but not least, you will need to recompile WRF each time you do a different test problem or switch between serial, SMP, MPI, SMP+MPI, change nesting,
etc. The commands above exporting environment variables
need to be done each time you start a new shell, so collect them all into a file, say wrf.sh with these
contents:
#!/bin/bash
# These are needed for WRF 3.8, perhaps others in the NCAR code family.
export DIR=/home/user/wrf/LIBRARIES
export NETCDF=$DIR/netcdf
export NETCDF_LIB=$DIR/netcdf/lib
export NETCDF_INC=$DIR/netcdf/include
export JASPERLIB=$DIR/grib2/lib
export JASPERINC=$DIR/grib2/include
export LDFLAGS=-L$DIR/grib2/lib
export CPPFLAGS=-I$DIR/grib2/include
export PATH=$DIR/mpich/bin:$DIR/netcdf/bin:$PATH
export FC=gfortran
export CC=gcc
export CXX=g++
export FCFLAGS=-m64
export FFLAGS=-m64
export F77=gfortran
Run this before compiling each time you open a new shell, like this:
cd /home/user/wrf
. wrf.sh
srend.nongnu.org/manual/WRF/wrf_install.html 5/5