Friday, August 14, 2015

Workflow for building a model of a real domain

by Laura Condon
Keywords: Domain setup, watershed model, getting started

Manual Location
Defining the Problem – Chapter 3.1
TFG example (Little Washita) – Chapter 3.6.2
TFG formulation – Chapter 5.3
ParFlow Solid Files (.pfsol) – Chapter 6.5

Basic Workflow for Setting up a Real Domain

This section is copied from the ParFlow manual section 3.1. This workflow is for setting up a real domain for ParFlow CLM from a DEM using the terrain following grid with an indicator file to define the subsurface. Refer to this blog post for a discussion of the differences between terrain following grid and orthogonal grids. If you are setting up an orthogonal grid this general workflow is still applicable but steps 4-6 will be slightly modified. 

The general approach is as follows:

1. Gather input datasets to define the domain. First decide the resolution that you would like to simulate at. Then gather the following datasets at the appropriate resolution for yourdomain:(a) Elevation (DEM)(b) Soil data for the near surface layers (c) Geologic maps for the deeper subsurface (d) Land Cover

2. Create consistent gridded layers that are all clipped to your domain and have the same number of grid cells

3. Convert gridded files to .pfb (see manual section 6.2). One way to accomplish this is by reformatting the gridded outputs to the correct ParFlow .sa order (§ 6.7) and to convert the .sa file to .pfb using the conversion tools (see manual section 4.3 Example 1)

4. Calculate slopes in the x and y directions from the elevation dataset. This can be done with the built in tools as shown in the manual section 4.3, example 5. In most cases some additional processing of the DEM will be required to ensure that the drainage patterns are correct. To check this you can run a “parking lot test” by setting the permeability of surface to almost zero and adding a flux to the top surface. If the results from this test don’t look right (i.e. your runoff patterns don’t match what you expect) you will need to go back and modify your DEM. The built in ParFlow tools pitfill and flatfill can be used to address some issues. These tools are also shown in the manual section 4.3 Example 5. For a more thorough workflow refer to this blog post on DEM processing.

5. Create an indicator file for the subsurface. The indicator file is a 3D .pfb file with the same dimensions as your domain that has an integer for every cell designating which unit it belongs to. The units you define will correspond to the soil types and geologic units from your input datasets. This blog post contains more information on indicator files and the Little Washita annotated input script in the manual (section 3.6.2) uses an indicator file to define the subsurface. 

6. Determine the hydrologic properties for each of the subsurface units defined in the indicator file. You will need: Permeability, specific storage, porosity and vanGenuchten parameters.

7. At this point you are ready to run a ParFlow model without CLM and if you don’t need to include the land surface model in your simulations you can ignore the following steps. Either way, at this point it is advisable to run a “spinup” simulation to initialize the water table. There are several ways to approach this. One way is to start with the water table at a constant depth and run for a long time with a constant recharge forcing until the water table reaches a steady state. There are some additional key for spinup runs that are provided in the manual section 6.1.34. This blog post has some addition tips on spinning up a model. 

8. Convert land cover classifications to the IGBP1 land cover classes that are used in CLM.

9. Create a CLM vegm file that designates the land cover fractions for every cell (Refer to the clm input directory in the Washita Example for an sample of what a vegm file should look like).

10. Create a CLM driver file to set the parameters for the CLM model (Refer to the clm input directory in the Washita Example for a sample of a CLM driver file).

11. Assemble meteorological forcing data for your domain. CLM requires the following variables (also described on p. 136 of the manual):
  • DLWR: Long wave radiation [W/m2]
  • DSWR: Visible or short-wave radiation [W/m2].
  • APCP: Precipitation [mm/s]
  • Temp: Air Temperature [K]
  • UGRD: East-west wind speed [m/s]
  • SPFH: Specific humidity [kg/kg]
  • Press: Atmospheric pressure [pa]
  • VGRD: South-to-North wind speed [m/s]
If you choose to do spatially heterogeneous forcings you will need to generate separate files for each variable. The files should be formatted in the standard ParFlow format with the third (i.e. z dimension) as time. If you are doing hourly simulations it is standard practice to put 24 hours in one file, but you can change this as needed. For an example of hetergeneous forcing files refer to the NLDAS directory in the Washita Example. Alternatively, if you would like to force the model with spatially homogenous forcings, then a single file can be provided where each variable is a column and rows designate time steps.

12. Run your simulation! Section 3.6.2 of the manual has an annotated input script for the Little Washita example which is a good place to start when setting up your run script. 

If your model doesn't run the first time don't worry there are some troubleshooting blog posts here and here and you can also check the archives of the ParFlow users mailing list here