WRF-Hydro Modeling System

Pre-Processing Tools

WRF-Hydro logo web banner

Pre-Processing Tools

Pre-processing Utility Scripts

new bannerBelow 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 both WRF-Hydro V3 and V5.0.x. 
  • 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. 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.
  • create_SoilProperties.R (for use with upcoming v5.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.0. 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.x and earlier will likely break the script. Get an updated MPTABLE.TBL file here.  However, the new output files should work with both versions of the model code.
  • 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.

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.

new banner

  • WRF-Hydro GIS Pre-processing Toolkit v5.1 (1.79MB) for use with ArcGIS v10.3.1-10.7 and ArcGIS Pro 2.3. 
    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.

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 best used with Arc GIS versions 10.3.1-10.7 and ArcGIS Pro 2.3. 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 running ArcGIS in a Virtual Machine? It is known that ArcGIS does not run well in a virtual machine and is not suggested to do so.
  4. 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).
  5. Check your installation: It helps to have 64-bit Background Geoprocessing module installed, and Background Geoprocessing enabled.
  6. Check that your directory names and/or file names do not have spaces or special characters in them.