WRF-Hydro Modeling System

Pre-Processing Tools

WRF-Hydro logo web banner

Pre-Processing Tools

Pre-processing Utility Scripts

Below are utility scripts that are useful in pre-processing data for input into WRF-Hydro.

  • create_wrfinput.R: An R script to create a very basic WRF-Hydro initialization file (wrfinput) from a WRF geogrid file and a set of user-specified conditions. The script produces fields of spatially uniform initial model states of soil moisture, soil temperature, soil liquid water content and skin temperature among a few other variables necessary for model cold-start initialization. The script uses NCO commands to create this file. This file can be used as a 'cold start' for long-term model spin-up or users can overwrite the fields in the file created. Please refer to the script header for specific use information. Sophisticated and WRF-savvy users can bypass this script and use the WRF utility REAL.EXE to create a wrfinput file from model or reanalysis products. Note: This script does not currently work with the Noah LSM. This script works with  WRF-Hydro v3, v5.0.3 and v5.1.1. 
  • create_SoilProperties.R (for use with upcoming v5.1.1 model code): An R script developed for the purpose of creating OPTIONAL spatially distributed soil and vegetation parameter files for Noah-MP and WRF-Hydro Version 5.1.1. These are read from the provided parameter tables (e.g., MPTABLE.TBL, HYDRO.TBL, etc.) and mapped to the appropriate soil or vegetation class map to create the 2D and 3D fields. These default parameter values can now be manipulated in 2 and 3 dimensions (e.g., via model calibration). After creating this file, use the compile option "SPATIAL_SOIL =1" to activate it, and specify the file in the namelist.hrldas. If the spatial soil option is turned off, the code will default to using the traditional TBL files and this file is not required. Please refer to the script header for specific use information. Note: MPTABLE.TBL files from versions of WRF-Hydro 5.0.3 and earlier will likely break the script. Get an updated MPTABLE.TBL file here.  However, the new output files should work with both 5.0.3 and 5.1.1 of the model code.
  • create_soilproperties.r (for use with v5.0.x model code): An R script developed for the purpose of creating OPTIONAL spatially distributed soil and vegetation parameter files for Noah-MP and WRF-Hydro Version 5.0.x These are read from the provided parameter tables (e.g., MPTABLE.TBL, HYDRO.TBL, etc.) and mapped to the appropriate soil or vegetation class map to create the 2D and 3D fields. These default parameter values can now be manipulated in 2 and 3 dimensions (e.g., via model calibration). After creating this file, use the compile option "SPATIAL_SOIL =1" to activate it, and specify the file in the namelist.hrldas. If the spatial soil option is turned off, the code will default to using the traditional TBL files and this file is not required. Please refer to the script header for specific use information.
  • convert_LAKEPARM_to_V5.sh: The v5.0 release version of the WRF-Hydro model code has modifications to several variable names in the LAKEPARM.nc file. This shell script will update these variables from an older (pre v5.0) version of the LAKEPARM.nc file.

Beta Tag
Open Source WRF-Hydro GIS Pre-processing Tools

To help WRF-Hydro users create surface input data for WRF-Hydro we have created a  set of tools as an open source alternative to ArcGIS. While the new utilities contain the similar capabilities and produce similar model input files to the existing tools, the open-source GIS pre-processing tools aim to serve different user communities and may be run in similar software architectures as the WRF-Hydro model itself. The new GIS pre-processing routines use Python version 3 and several key python libraries such as Whitebox Tools, NumPy, netCDF4-python, GDAL, and others. Users may elect to build a suitable software environment using Anaconda or Miniconda, or build their own environment to run these tools inside of.

The motivations for building an open-source GIS Pre-processing funcationality for WRF-Hydro are many:

    1) An open-source alternative was the most requested feature by WRF-Hydro users of the existing GIS Pre-processing tools.
    2) The utility is protable and multi-platform.
    3) The geoprocessing functions are parallelized and efficient.
    4) All underlying libraries are open-source.
    5) All proprietary licensing and application restrictions have been eliminated.
    6) The new utility can be run inside the WRF-Hydro Training Docker container
7) The Whitebox Tools library offers several additional algorithms for terrain pre-processing.
Detailed documentation is forthcoming, but the tools come with basic help functionality, and options may be cross-referenced from the WRF-Hydro ArcGIS Pre-processing tools for additional detail for now. 
Updated WRF-Hydro Training materials provide a "Lesson-LS2-GIS-pre-processing" Jupyter Notebook which is intended to introduce users to the capabilities of the new tools.
  • To request to be a beta tester for this tool please use our contact form
  •  To provide feedback on the beta version please fill out this form

 

Arc-GIS Tools for Preparing WRF-Hydro Routing Grids

To help WRF-Hydro users create surface input data for WRF-Hydro we have created a  set of tools. Presently these tools consist of scripts for use with the ArcGIS Geographical Information System. This is a stand-alone set of scripts which ArcGIS users can install and run locally on their own systems.  ArcGIS is a commercial software product available from ESRI

The purpose of the WRF Hydro GIS Pre-Processing Toolkit is to create the data layers for terrestrial overland flow, subsurface flow and channel routing processes required by WRF Hydro. The outputs from these tools are geospatial and tabular data layers for use with WRF-Hydro model code V5.1.x. This processing workflow for creating WRF-Hydro routing grids is available to users as an ArcGIS Python Toolbox.

  • WRF-Hydro GIS Pre-processing Toolkit v5.1.1 (1.79MB) is compatible for use with ArcGIS v10.3.1 and above and ArcGIS Pro. 
    Updates in this version include the ability to put forecast points on a vector nextwork. The output from this version are backwards compatible with WRF-Hydro model code back to v5.0.

The input files created by this toolkit should not be deemed as definitive and accurate for every application. Preparation of hydrologic network data (such as channel networks and station data) is inherently an iterative process fraught with geospatial data uncertainties. Therefore we encourage users to closely examine the outputs from the tools provided here and make their own necessary adjustments.

The Standalone_TestData.zip file contains prepared data and input to test with the WRF-Hydro GIS Preprocessing Toolkit v5.1.1.

NOTE: There are often bug fixes that are addressed in between public releases.

If you are having difficulty with the public release you might check the current development branch of the WRF-Hydro GIS Pre-processing Toolkit. Also, note that we generally do not provide full support for the tool in between releases. 

ArcGIS vs. QGIS

Development of capabilities related to the WRF-Hydro GIS pre-processing tools has been geared toward using the capabilities of the ArcGIS Python API (arcpy). This has allowed us to build a single, flexible toolset that can be run from a GUI within a desktop GIS environment. Many users have requested an open-source alternative, with QGIS is the obvious choice. However, at this time QGIS has a variety of issues when it comes to displaying and properly georeferincing netCDF data (our primary data format).

Why am I getting an error using the GIS Pre-processing tool?

The WRF-Hydro GIS Preprocessing Tool is compatible with Arc GIS version 10.3.1 and above as well as ArcGIS Pro. Please check the following:

  1. Do you have a valid version of ArcGIS? Illigitimate versions tend to show locks even when everything else is set up correctly
  2. Do you have Spatial Analyst Extension enabled? Enable Spatial Analyst by selecting Customize > Extensions from within ArcCatalog and make sure that the Spatial Analyst is checked on.
  3. Are you writing your files to a geodatabase or network location? This is not allowed by ArcGIS. Specify that your output file goes to a directory on disk which exists (not a geodatabase or network location).
  4. Check your installation: It helps to have 64-bit Background Geoprocessing module installed, and Background Geoprocessing enabled.
  5. Check that your directory names and/or file names do not have spaces or special characters in them.