WRF-Hydro Logo

Lesson 6 - Lake options for the gridded configuration

Overview

In Lesson 4 we covered some experiments in tinkering with terrain physics. In this lesson, we specifically experiment with lake physics options.

We conduct two experiments in this lesson:

  1. Removing lakes from the simulation
  2. Modifying lake parameters

See here for reference material on lakes and channel routing in WRF-Hydro.

Compiling WRF-Hydro

We do not need to modify the code binary to conduct lake physics experiments, so we will use the compiled code from the template directory.

If you need to recompile the code, refer to the instructions in Lesson 2.

Creating the simulation directory and running a baseline WRF-Hydro simulation

Below are the commands from Lesson 2 to create the simulation directory and run a WRF-Hydro simulation. This simulation will be run exactly as was done in Lesson 2 and will serve as our baseline simulation. We will modify run-time options in subsequent simulations in the lesson and compare the outputs.

Setup for experiments

We will create a new simulation directory for each experiment. First, we will make a new simulation directory as we did with the baseline run above and use this as a template for creating multiple new simulation directories.

Step 1: Create a simulation directory to use as a template

Step 2: View the contents

Review the baseline

First, we will recall the hydrograph from location below the lake, at the outlet of the basin:

Plot the default hydrograph at the stream location downstream of the lake

From this default simulation, we have some work to do for improving the lake's representation. First, let's see what happens when the lake is removed completely.

Experiment 1 - Removing lakes from the simulation

Background

In the gridded channel routing configuration, WRF-Hydro can be run with lakes on or off.

However, it is not as simple as flipping a switch because in the gridded configuration, the lakes are explicitly represented on the fine grid (i.e. in the LAKEGRID variable in the Fulldom_hires.nc file). This is different from how lakes are represented in reach-based routing, where lakes are represented as objects connected by channel reaches, rather than explicitly defined on the grid. Therefore, if a user wants to run the gridded routing configuration without lakes, they should run the GIS pre-processing tools and NOT specify a lake polygon file. This will create a Fulldom_hires.nc file with the LAKEGRID variable = -9999 (fill values).

Thus, we recommend that users setup two different domain directories to run with and without lakes, as is demonstrated in this training.

The only other changes to execute with and without lakes are edits in the hydro.namelist. See below for details.

Objective

Run a simulation for the Gridded configuration without representing lakes and compare the resulting hydrographs at a gage downstream of the lake.

Create experiment simulation directory

Note, we WILL NOT be able to use our run_gridded_template directory for this experiment because we have to use different geospatial data. These data are provided for you in the example_case/Gridded_no_lakes directory.

Review the differences and run the simulation

Step 1: Check that the Fulldom_hires.nc file in the Gridded dir has a lake, i.e. the value of 1 occurs on the grid.

You can use ncdump to check the values of the LAKEGRID variable. On your home machine, using a program like ncview or panoply is an easy way to visually check these values.

Run the same command on the original Fulldom_hires.nc file in the Gridded_no_lakes directory to show there are no lake values (1's)

Step 2: Check that lakes are off in the hydro.namelist file. There are two modifications:

There are two options in the hydro.namelist to turn lakes off.

First is commenting out the route_lake_f option by starting the line with !

! Specify the lake parameter file (e.g.: "LAKEPARM.nc" for netcdf or "LAKEPARM.TBL" for text).
! Note REQUIRED if lakes are on.
!route_lake_f = "./DOMAIN/LAKEPARM.nc"

Second is turning off the lakeout output files.

outlake  = 0                 ! Netcdf grid of lake values (1d)
                             !      0 = no output, 1 = output

Step 3: Run the simulation

Step 3: Check that the simulation finished successfully

Results

We will now look at the differences in streamflow between our baseline run with lakes on and our experiment with lakes off.

We will use Python and the xarray library to load the data and plot hydrographs. For an intro to these tools, please see Lesson 3.

Load the CHANOBS streamflow datasets

We are going to use the CHANOBS files because it will limit the number of grid cells to only those which we have specified have a gage.

Plot the hydrographs at the stream location upstream of the lake to ensure they are identical.

Discussion

The streamflow values at the stream location upstream of the lake were identical between the simulation with lakes represented and the simulation without lakes represented. This is expected.. and if we did not see this result, it would be an indication of an error somewhere in the process.
However, at the stream location downstream of a lake we see that streamflow is considerably higher in the simulation without lakes represented. This reflects the expected behavior of the lake attenuating streamflow at the outlet due to storage.

Plot the hydrographs at the stream location downstream of the lake

NOTE: we changed the feature_id to 2 to select a different stream location in the output files and have changed the USGS gauge ID to reflect the downstream gauge location.

Summary

The 'lakes-off' simulation shows a higher and earlier peak compared with the 'lakes-on' and observed hydrographs. We confirm that this lake serves to attenuate flow during a high event.

Experiment 2 - Modifying lake parameters in LAKEPARM.nc

Background

The orifice and weir lake parameters populated into LAKEPARM.nc by the GIS pre-processing tools are essentially placeholders for the user to replace with their own data. The accuracy of these parameters can have a significant impact on the storage and thus outflow of the lake. We highly recommend replacing the default lake parameters with known values!

Objective

In this exercise, we will update one of these parameters, the weir length - WeirL, with an estimate from observations and explore the impact on the streamflow at the downstream gauge.

First, let's make a new directory to conduct this experiment.

Before modifying anything, let's check the current default value of the WeirL in LAKEPARM.nc

Edit the lake parameter file and run the simulation

Step 1: Edit the LAKEPARM.nc file

NCO (NetCDF Operators, http://nco.sourceforge.net/) is a set of useful utilities to manipulate NetCDF files. We will use the NCO command ncap2 to edit the WeirL variable.

Step 2: Verify that the change was made

We will check the value of the WeirL variable in our new LAKEPARM_WeirL_667.nc file against the original LAKEPARM.nc file.

LAKEPARM_WeirL_667.nc

Step 3: Edit the hydro.namelist to use the new LAKEPARM_WeirL_667.nc

We will change the route_lake_f option in the hydro.namelist to use the edited lakeparm file.

! Specify the lake parameter file (e.g.: "LAKEPARM.nc" for netcdf or "LAKEPARM.TBL" for text).
! Note REQUIRED if lakes are on.
route_lake_f = "./DOMAIN/LAKEPARM_WeirL_667.nc"

Step 3: Run the simulation

Results

We will now look at the differences in streamflow between our baseline run with the original WeirL of 10m and our edited WeirL of 677m.

We will use Python and the xarray library to load the data and plot hydrographs. For an intro to these tools, please see Lesson 3.

Load the CHANOBS streamflow datasets

We are going to use the CHANOBS files because it will limit the number of grid cells to only those which we have specified have a gage.

Plot the hydrographs

Compare the result from experiment 1, where the lake was removed.

Summary

The increase in weir length causes more water to discharge from the lake earlier than the default. The difference in initial condition for the modified WeirL expt is due to not spinning up with this parameter, and the lake initially discharged to meet its equilibrium. When an abrupt parameter change is made without proper spinup, these artifacts are possible.

Load the LAKEOUT files to investigate three lake-related variables: inflow, outflow, and water surface elevation.

On your own experiments:

In the above cells, modify the inflow variable selection in the plotting function above to outflow, then to water_sfc_elev. Feel free to copy and paste the plotting cells so that each of the plots are saved.

Discussion

Streamflow: We can see that extending the weir length via the WeirL parameter has caused the lake to discharge more water out of the weir when the lake level meets (exceeds) the weir elevation. This has resulted in an increase of streamflow downstream of the lake.

Lake outputs: as expected, the inflow into the lake is the same in both simulations (baseline and modified WeirL). However, we find that the discharge is significantly different, due to more discharge out of the weir. From the lake level perspective, the baseline simulation shows that the lake continues to fill, and at a slower pace, with the WeirL=10, while the modified experiment with a much longer WeirL keeps the lake level from reaching near its maximum, even during the high inflow condition.

Next up - Exploring Gridded vs. the NWM configuration

This concludes lesson 6.

In the next lesson, we will explore the differences between the NWM and Gridded configurations.

IT IS BEST TO EITHER SHUTDOWN THIS LESSON OR CLOSE IT BEFORE PROCEEDING TO THE NEXT LESSON TO AVOID POSSIBLY EXCEEDING ALLOCATED MEMORY. Shutdown the lesson be either closing the browser tab for the lesson or selecting Kernel -> Shut Down Kernel in JupyterLab.

© UCAR 2020