Setup of WPS/WRF installation requirements
This document addresses the need for acquiring and installing (typically a one-time-only task) the large geog dataset needed for WPS, followed by a brief discussion of the system environment typically needed to install the WPS/WRF distribution, and the setting of environment variables used by this component.
GEOG_DATA
The WRF simulations are initialised with a lot of static, gridded data - things like topography, land use, leaf area index, etc. This data is available in various resolutions from coarse to fine, and, when fully installed, takes up 30-50+ GBytes of disc space. In order to maintain a versatile WRF modeling environment, it makes sense to make all of this available on the local computing system. It doesn’t make sense to try to store it within this nwp_install component, nor does it make sense to download and install it for each new WRF distribution.
For the most part, this data is identical from one WRF version to another, though sometimes newer versions may use some newly-available datasets. So, it’s generally necessary to install this geog data one time, and then specifying its location when installing a new WRF distribution, for example
$ ./wrfinstall.py --baseinstalldir ~/WRFV4.3-Distribution --geogdatadir /home/ctbtuser/tempgeog
The geog data is available at the WRF site, at https://www2.mmm.ucar.edu/wrf/users/download/get_sources_wps_geog.html. It can be confusing to understand what needs to be downloaded, so the following provides a working example of one-time installation of the datasets needed (so far) for the WRF distributions installed in this component
$ mkdir /dvlscratch/ATM/morton/WRFDistributions/GEOG_DATA
$ cd /dvlscratch/ATM/morton/WRFDistributions
$ wget http://www2.mmm.ucar.edu/wrf/src/wps_files/geog_complete.tar.gz
$ tar xzvf geog_complete.tar.gz --strip-components=1 -C GEOG_DATA
$ du -csk GEOG_DATA
51336536 GEOG_DATA
51336536 total
Once you’re sure that installation was correct (you might wait until you’ve had a successful test of a WRF distribution) it’s safe to remove the downloaded tar file.
The newer WPS/WRF versions needed a couple of extra datasets, installed as follows
$ wget https://www2.mmm.ucar.edu/wrf/src/wps_files/albedo_modis.tar.bz2
$ wget https://www2.mmm.ucar.edu/wrf/src/wps_files/maxsnowalb_modis.tar.bz2
$ cd GEOG_DATA
$ tar xjvf ../albedo_modis.tar.bz2
$ tar xjvf ../maxsnowalb_modis.tar.bz2
Again, the tar files can be removed once you’re sure of successful installation.
And, again, this should be a one-time only installation, at least for current versions of WRF.
System environment
Installation of WPS/WRF requires the presence of suitable executables and libraries. This component has been developed and tested in the RHEL 7 environment of CTBTO’s devlan, as well as a Virtual Box VM set up with CentOS 7 to almost exactly mimic the CTBTO environment. Although this should work well in many other Linux environments, as the libraries are all fairly standard, it hasn’t yet been tested elsewhere. Compilation has been with gfortran v4.8.5 (old, I know, but that’s what is used on these systems!). Since WPS/WRF is used on many other systems, I don’t anticipate problems elsewhere. Within each of the
Within each of the WPS/WRF install directories (for example, install-wrf/wrfv4.3_2022-04-25
) is a shell script for setting the needed environment variables for the WPS/WRF build, setup_install_env.sh. The contents are displayed below and, again, have been suitable in the CTBTO-like environments
#!/bin/bash
# Set of system-specific (mostly) environment variables used by the
# installation routines to compile, setup and test a WRF distribution
################################################################
# These have been tested in the CTBTO-like CentOS 7 VM
# and are the same on devlan
################################################################
export MPIF90=/usr/lib64/openmpi/bin/mpif90
export MPICC=/usr/lib64/openmpi/bin/mpicc
# This is needed for running post-install test cases
export MPIRUN=/usr/lib64/openmpi/bin/mpirun
# Note that the netcdf.mod file in CentOS 7 seems not to be in same place
# as typical netcdf includes
export NETCDF=/usr
export NETCDF_MOD_INC=/usr/lib64/gfortran/modules
export NETCDF_classic=1
export JASPERLIB=/usr/lib64
export JASPERINC=/usr/include
# Needed for some of the WPS utilities (e.g. plotgrids.exe)
export NCARG_ROOT=/usr/lib64/ncarg
So, before running the installation script, the environment can be setup as follows, within the desired distribution directory. Of course, one would want to ensure that the paths are correct for their particular system.
$ . setup_install_env.sh
Summary
Once the geog files and the system environment variables have been set up correctly, it should be possible to run the installation program to build and install the distribution in (for example) ~/WRFV4.3-Distribution
as follows
$ ./wrfinstall.py --baseinstalldir ~/WRFV4.3-Distribution --geogdatadir /home/ctbtuser/tempgeog
More details on the wrfinstall.py program are presented in Technical notes on the WPS/WRF installation program.