Skip to content

Latest commit

 

History

History
182 lines (123 loc) · 8.01 KB

installation.rst

File metadata and controls

182 lines (123 loc) · 8.01 KB

Installation

Please see https://www.openwfm.org/wiki/Setting_up_current_WRFx_system for up to date detailed instructions.

WPS/WRF-SFIRE

Please follow the instructions on OpenWFM to run WPS/WRF with real data. Ensure that you have working WPS/WRF installation is available and compatible with the MPI on your cluster. Note that wrfxpy will not modify the WPS/WRF installation, instead for each job, it will clone their directories into its workspace.

Attention

Past this point, you should be able to run a fire simulation yourself, that is have a working WPS/WRF-SFIRE installation including WPS-GEOG and fuels/topography downloaded. You should be able to submit a parallel job into your cluster/supercomputer to run wrf.exe

Python and packages

Download and install the Python 3 Anaconda Python distribution for your platform. URL and filenames change, so be sure to use the current ones. We recommend an installation into the users home directory.

wget https://repo.continuum.io/archive/Anaconda3-2019.10-Linux-x86_64.sh
chmod +x Anaconda3-2019.10-Linux-x86_64.sh
./Anaconda3-2019.10-Linux-x86_64.sh

We recomend the creation of an environtment. Install pre-requisites:

conda update -n base -c defaults conda
conda create -n wrfx python=3 gdal netcdf4 pyproj paramiko dill h5py psutil proj4 pytz scipy matplotlib=3.2.2 flask
conda activate wrfx
conda install -c conda-forge simplekml pygrib f90nml pyhdf xmltodict basemap rasterio
pip install MesoPy python-cmr

Note that conda and pip are package managers available in the Anaconda Python distribution.

If you run into difficulties, please see if https://www.openwfm.org/wiki/Setting_up_current_WRFx_system#Install_necessary_packages has any further details.

wrfxpy

Next, clone the wrfxpy code:

git clone https://github.com/openwfm/wrfxpy.git

configuration

And finally, a etc/conf.json file must be created with the keys discussed below. A template file etc/conf.json.initial is provided as a starting point.

Configure the system directories, WPS/WRF-SFIRE locations and workspace locations by editing the following keys:

"workspace_path": "wksp"
"wps_install_path": "path/to/WPS"
"wrf_install_path": "path/to/WRF"
"sys_install_path": "/path/to/wrfxpy"
"wps_geog_path" : "/path/to/wps-geogrid"

Optionally, the wrfxpy installation can be connected to a visualization server wrfxweb. The following keys are all optional (and only used if the postprocessed results of simulations are uploaded).

"shuttle_ssh_key": "path/to/your/priv_ssh_key/to/remote/host",
"shuttle_remote_user" : "remote_username",
"shuttle_remote_host" : "remote_hostname",
"shuttle_remote_root" : "remote directory for output storage"

This concludes the etc/conf.json file.

Next we need to edit etc/clusters.json file adding a new section for the cluster wrfxpy will be run on, since wrfxpy needs to know how jobs are submitted there. Create an entry for your cluster, here we use speedy as an example, but you should just use the name of your cluster:

{
  "speedy" : {
    "qsub_cmd" : "qsub",
    "qsub_script" : "etc/qsub/speedy.sub"
  }
}

And then the file etc/qsub/speedy.sub should contain a submission script template, that makes use of the following variables supplied by wrfxpy based on job configuration:

  • %(nodes)d the number of nodes requested
  • %(ppn)d the number of processors per node requested
  • %(wall_time_hrs)d the number of hours requested
  • %(exec_path)d the path to the wrf.exe that should be executed
  • %(cwd)d the job working directory
  • %(task_id)d a task id that can be used to identify the job
  • %(np)d the total number of processes requested, equals nodes x ppn

Note that not all keys need to be used, as shown in the speedy example:

#$ -S /bin/bash
#$ -N %(task_id)s
#$ -wd %(cwd)s
#$ -l h_rt=%(wall_time_hrs)d:00:00
#$ -pe mpich %(np)d
mpirun_rsh -np %(np)d -hostfile $TMPDIR/machines %(exec_path)d

The script template should be derived from a working submission script.

You can start by copying an existing etc/qsub/cluster_name.sub under the name of your cluster, and modifyig it.

Note: wrfxpy has already configuration for colibri, gross, kingspeak, and cheyenne clusters which can be used as an example (see colibri.sub, gross.sub, kingspeak.sub and cheyenne.sub in etc/qsub/).

tokens

When running wrfxpy, sometimes the data needs to be accessed and downloaded using a specific token created for the user. For instance, in the case of running the Fuel Moisture Model, one needs a token from a valid MesoWest user to download data automatically. Also, when downloading satellite data, one needs a token from an Earthdata user. All of these can be specified with the creation of the file etc/tokens.json from the template etc/tokens.json.initial containing:

{
  "mesowest" : "token-from-mesowest",
  "appkey" : "token-from-earthdata"
}

So, if any of the previous capabilities are required, create a token from the specific page, do

cp etc/tokens.json.initial etc/tokens.json

and include your previously created token.

For running fuel moisture model, a new MesoWest user can be created in MesoWest New User. Then, the token can be acquiered and replaced in the etc/tokens.json file.

For acquiring satellite data, a new Earthdata user can be created in Earthdata New User. Then, the token can be acquiered and replaced in the etc/tokens.json file. There are some data centers that need to be accessed using the $HOME/.netrc file. Therefore, creating the $HOME/.netrc file is recommended as follows

machine urs.earthdata.nasa.gov
login your_earthdata_id
password your_earthdata_password

Attention

You are now ready for your first fire simulation, continue with quickstart.

Custom installation

If Anaconda python is not practical, a different python distribution can be used. Below is a list of packages the system requires:

  • Python 3.5+
  • Basemap to render the rasters
  • simplekml to build KMZ files
  • psutil to retrieve processes and system information
  • dill to serialize python objects
  • xmltodict to parse XML files
  • f90nml to manipulate Fortran namelists
  • pyproj to place domains dynamically in LCC projection
  • proj4 to create and manipulate projections
  • paramiko to communicate over SSH with remote hosts
  • netCDF4 to manipulate WPS and WRF files
  • pygrib to read and manipulate GRIB files
  • MesoPy to retrieve fuel moisture observations from Mesowest
  • python-cmr to search satellite data in the CMR search engine
  • pyhdf to read and manipulate HDF files
  • h5py to read and manipulate HDF5 files
  • scikit-learn to run machine learning

wrfxpy is installed by cloning a GitHub repository

git clone https://github.com/openwfm/wrfxpy.git

Configure wrfxpy by editing etc/conf.json as above and then continue with quickstart.