Gv8 Tutorial Manual-5
Gv8 Tutorial Manual-5
So now you have 10 different model calibrations for this example. What do we do with this stuff? That is
a good question. The final parameters for each realization can be found in the files called t2.bpa.# where #
is the realization number. The Pest summary output file for each realization can be found in the files called
t2_svd.rec.# where # is the realization number.
Post-processing of the realizations will be an ongoing development exercise in Groundwater Vistas. For
now, there are a couple of things you can do. First, select Model|Pest|Null Space Monte
Carlo|Summarize Parameters. Groundwater Vistas reads the file record.dat shown above along with the
parameter files and summarizes the results for you. Two text files will be displayed. The first is called
NullSpaceSummary.txt as shown below.
This file just summarizes the number of realizations, the number that met the phi threshold, and then the
phi (sum of squared residuals) for each realization.
The second file is called NullSpaceParameters.txt and shows the mean, log mean, standard deviation,
minimum value, and maximum value for each parameter. You can see from the example below that the
range in parameter values can be quite extreme and yet each realization is well calibrated.
.
Note that this file also has the realization coded in the description of the matrix but also the time step
number is the realization number. This allows you to import the results of a *.gst file to contour like it was
a head file. We don’t do this for the head file shown above because this information is processed in a
different way.
We can now use some of the stochastic post-processing built into Groundwater Vistas to look at the 10
realizations we just combined into the one head file called t2_nsmc.hds.
Before we begin processing the stochastic output, we need to import results into Vistas. This sets up
memory for the following procedures. Select Plot|Import Results and click ok.
First, select Plot|Stochastic|Import Target Data. Browse to find the file t2_nsmc.hds and click OK. It
should report 10 realizations were imported.
Click on the Scatter Plot for All Realizations button and the following graph should appear. This is just a
visual summary of the text file you created earlier.
To see how heads vary at calibration targets, use Plot|Stochastic|Graph|Target CDF and just choose the
first target on the list.
It is usually best to color flood these values instead of contours. Choose Plot|What to Dislay. Turn off
display of dry cells and turn off contours. Turn on the color flood of “head”.
To change the scale on the color flood, use Plot|Color Flood|Color Flood options. Change to log color
flood and also change the minimum and maximum values, as shown below:
Now you can quickly scan through each realization using the Plot|Next Time Step and Plot|Previous Time
step to see how variable the Kx values are. This illustrates the extreme nature of model nonuniqueness in
groundwater models. This is a synthetic model and should match exactly to the original distribution.
Perhaps if we had sampled a head target in all model grid cells the variability would be much less.
However, the sparcity of head data in real models makes this example more realistic.
Introduction
This tutorial illustrates use of the PESTPP-IES iterative ensemble smoother to generate a suite of parameter
fields which calibrate a model. It is designed to complement Groundwater Vistas (GV) tutorials entitled
“3D Pilot Point Example with SVD” and “PEST and Null Space Monte Carlo” presented in the last two
chapters. This tutorial was developed by John Doherty (author of PEST) and has been adapted to show the
new Pestpp-IES options in Groundwater Vistas version 8.
Use of PESTPP-IES for generation of a suite of calibration-constrained random parameter fields has some
advantages and some disadvantages compared with calibration followed by use of the null space Monte
Carlo methodology. Advantages are:
• History-matching and uncertainty analysis are implemented through the same parameter
adjustment process using an algorithm that combines gradient-based inversion with the use of random
parameter fields.
• The number of model runs required to generate a suite of calibration-constrained random
parameter fields may be smaller than that required by PEST to obtain a single calibrated parameter field.
Use of an iterative ensemble smoother can be extremely computationally efficient, especially where the
dimensionality of the calibration null space is high.
• The number of model runs required to achieve a good fit between model outputs and a calibration
dataset does not rise with the number of adjustable parameters. Hence spatial parameterization can take
place on a cell-by-cell basis, this resulting in millions of adjustable parameters. These parameters can
describe any aspect of a system that is unknown, including historical pumping rates at individual wells for
which assumptions of incorrect values can promulgate erroneous, compensatory estimates of calibrated
parameter values.
• Since PESTPP-IES does not rely on strict local gradient information, it has a high tolerance for
nonlinearities in relationships between model parameters and model outputs. These can arise from the
intrinsic nature of these relationships, or they can be a numerical artefact arising from model solution
convergence difficulties.
Disadvantages include the following:
• Use of random parameter fields can sometimes raise the ire of a numerically unstable model which
is pre-disposed to numerical grumpiness.
• Fits between model outputs and a calibration dataset may not be as good as those achieved using a
traditional Jacobian matrix as a basis for parameter adjustment when using the same number of parameters.
However this is of little consequence if measurements comprising a calibration dataset are noisy, or if
model structural defects make a significant contribution to model-to-measurement misfit.
• Sometimes pursuit of a “minimum error variance” parameter field that constitutes the “calibrated
model” allows a modeller to gain important insights into the integrity of a calibration dataset, and/or of the
model itself. These insights may not be as obvious when the outcome of the history matching process is an
ensemble of random parameter fields.
• Because the PESTPP-IES history-matching process does not yield a sensitivity matrix, linear
parameter and predictive uncertainty analysis, and ancillary data worth analysis, cannot be undertaken as an
adjunct to parameter estimation. (Note, however, that the whole purpose of PESTPP-IES is to produce an
ensemble of “calibrated” parameter sets, this being a measure of parameter uncertainty which is not subject
to a linearity assumption.)
• Optimal performance of ensemble methods sometimes requires the use of so-called “localization”
methods. PESTPP-IES implements several forms localization. These require that a user indicate in advance
of the history-matching process observations which are unlikely to be sensitive to certain parameters.
Ensemble Smoothers
At the commencement of its execution, PESTPP-IES reads or generates an ensemble of random parameter
fields; each of these fields is a sample (i.e. a realization) of the prior parameter probability distribution.
Then, through a succession of iterations, it modifies these realizations until they become samples of the
posterior parameter probability distribution (i.e. the post-calibration parameter probability distribution). A
posterior parameter probability distribution expresses residual parameter uncertainty arising from:
- limited information contained within the calibration dataset, and
- measurement noise associated with this dataset (some of which is, of course, so-called “structural
noise” arising from inadequacies of the model as a simulator of real-world behaviour).
PESTPP-IES can generate the initial parameter ensemble itself based on a multi-Gaussian distribution
centred on parameter values provided in a PEST control file. If this option is taken, then it is incumbent on
the user to ensure that initial parameter values comprise “expected parameter values” (in the statistical
sense) from the standpoint of the prior parameter probability distribution. That is, they should be “best”
parameter values based on all information that exists prior to the history-matching process. If parameters
are correlated, users should also supply a parameter covariance matrix (through an uncertainty file or a
matrix file) for PESTPP-IES to use for generation of the initial parameter ensemble. As has already been
discussed, the covariance matrix for subsets of spatially varying parameters can be calculated from a
variogram.
In addition to an initial parameter ensemble, PESTPP-IES also requires an observation ensemble. The
observation ensemble is centred on observation values supplied in a PEST control file. Each observation
realization in the observation ensemble is the original observation vector from the PEST control file plus a
realization of measurement noise. Generally, the measurement noise associated with each observation is
assumed to be statistically independent of that associated with all other observations. If PESTPP-IES
generates the observation ensemble itself (which is its default behaviour), it assumes that the standard
deviation of measurement noise associated with each observation is equal to the inverse of the weight
associated with that observation. It is thus incumbent on a PESTPP-IES user to ensure that weights
supplied in a PEST control file are “correct” if he/she asks PESTPP-IES to generate the observation
ensemble itself. (Note, however, that exactness is not essential here.)
Let Φi denote the initial objective function (i.e. the objective function based on initial parameter values
supplied in a PEST control file). Suppose that you think that an objective function of Φf is achievable
through the history-matching process. Then a “correct” set of weights can be calculated by multiplying all
existing weights by the factor f, calculated as:
f= √(Φ_f/Φ_i) (3.1)
(The WTFACTOR utility supplied with the PEST suite can help here.) After multiplication of weights by
this factor, the achievable objective function should be roughly equal to the number of non-zero-weighted
observations featured in the PEST control file.
Unfortunately, more issues than measurement noise must be taken into account when assigning weights to
observations. It is often advantageous to design a weighting scheme that approximately equalizes the initial
contribution to the objective function made by each observation group. By rendering each observation
group as visible in the initial objective function as any other observation group, assurance is gained that the
information which it contains is not lost to the history-matching process. However weights calculated in
this way may not be in accordance with those calculated on the basis of measurement noise. Hence there
may be occasions where it is better to use an objective-function-balancing set of weights in a PEST control
file, while using a different set of weights to calculate the observation noise ensemble used by PESTPP-
IES. This will be demonstrated herein.
Control Variables
PESTPP-IES is a member of the PEST++ suite of programs. These programs are completely
interchangeable with those of the PEST suite. Programs of the PEST++ suite read a PEST control file just
like PEST does. Furthermore, they communicate with a numerical model using template and instruction
files, just like PEST does. Some of the control variables used by members of the PEST++ suite are the
same as those used by PEST. These are read from a PEST control file. However optional control variables
which are specific to PEST++ programs must be inserted into a PEST control file in such a way that they
are recognizable by members of the PEST++ suite. It is not essential that all control variables that pertain to
a specific PEST++ program be represented in a PEST control file that is used by that program; PEST++
programs provide default values for all missing variables. On the other hand, if a PEST control file which
contains PEST++ control variables is provided to PEST, PEST simply ignores these variables.
A PEST++ control variable can be placed anywhere within a PEST control file. It is recognized as such
because the line on which it is placed must begin with the characters “++”. This must be followed by the
name of the variable, and then by one or more values surrounded by brackets; multiple values supplied for
the same variable must be comma-delimited.
Running PESTPP-IES
PESTPP-IES can undertake model runs in serial or in parallel.
Suppose that a PEST control file is named case.pst. To undertake model runs in serial based on this file,
PESTPP-IES should be run using the command:
pestpp-ies case.pst
PESTPP-IES (and any other member of the PEST++ suite) undertakes model runs in parallel if its
execution is initiated in a similar manner to that of BEOPEST. First, all files required by PESTPP-IES, as
well as those required by the model that it runs, should be copied to all folders in which workers will be
operating. Execution of the PESTPP-IES manager is then initiated using the command:
pestpp-ies case /h :port
where port is a suitable port number (for example 4004). Note the space between “h” and “:”. Meanwhile,
execution of workers is initiated using the command:
pestpp-ies case /h ip_address:port
where ip_address is the IP address or hostname of the computer on which the manager is running and port
is the port used by the manager.
This same initiation protocol applies to other members of the PEST++ suite, including PESTPP-INV
(which carries out regularized inversion) and PESTPP-SWP (which undertakes model runs based on
different, user-specified parameter sets). PESTPP-SWP is used in the present workshop.
Turn off the use of regularization as well on this default tab. Use of regularization is not appropriate when
using PESTPP-IES (although it will ignore the regularization informatin).
Set up for PESTPP-IES is virtually identical to that of PEST. There are a few new options, though. Select
Model|Pest|PESTPP-IES|Options. Use 80 realizations and turn ON the option to adjust observation
weights. Enter a weight scaling factor of 2 for heads. These new weights are intended to express the fact
that “noise” associated with head measurements that comprise the calibration dataset has a standard
deviation of 0.5.
The most important line in the above display is the second last (starting with “actual”). This reports
objective functions based on differences between model outputs calculated using each parameter realization
and observations recorded in the PEST control file. As was stated above, if actual measurement noise is in
accordance with the weighting scheme used in the PEST control file, the values of these objective functions
If you would like to see the results of all realizations, select Model|PEST|PestPP-IES|Combine files. This
does the same thing as the combine results command for Null Space Monte Carlo and you can then do the
same sort of post-processing as outlined in the Null Space Monte Carlo tutorial.
On the other hand, if you just want to see the results of the base calibration to process like a normal pest
run, use Model|PEST|PestPP-IES|Run Base Realization. You first enter the Pestpp-IES output which is
t2.7.par.jcb for the 7th iteration and then specify a root name of t2.
Now import the results and your screen should look like the one below. If you review the calibration
statistics, you will see that this run is even better than the original Pest run for pilot points in 3D from a
previous tutorial.
Mesh Concepts
Unstructured grids are those that are not necessarily arranged on row and column basis. These grids can
contain cells of just about any shape, such as triangles, octagons, quadrilaterals, etc. The trick is to tell the
model how the cells are linked together and the geometric information about the connections between cells.
Groundwater Vistas supports the use of MODFLOW-USG (and MODFLOW 6) through the use of square
and rectangular elements, but ones that do not necessarily line up in a row/column pattern. This means that
you can quickly use existing MODFLOW models and enhance them with new grid schemes.
First, you can use MODFLOW-USG with your normal MODFLOW row, column, and layer grids. Instead
of having a row, column numbering scheme, though, each cell has a node number. The following figure
shows how Groundwater Vistas numbers nodes in a normal MODFLOW grid.
One added benefit of this type of grid scheme is that you can pinch out nodes that are very thin. In a
normal MODFLOW grid, you cannot pinch out a layer. But using MODFLOW-USG, it is relatively
simple. We will cover this in a later exercise.
Nested grids are actually separate objects in Groundwater Vistas so they can be turned on and off. This
means that you can have a regional model with a relatively uniform grid and quickly add a nest to it to
make a more detailed prediction. When that prediction is no longer needed, the nest can be temporarily
deactivated. The main limitation with nests is that they cannot overlap each other. Each nest, though,
contains its own properties and boundary conditions which are initially inherited from the parent grid. The
properties and boundary conditions can be refined, however, once the nest has been created.
Nested grids can have the same layering scheme as the parent model or sublayering can be used. In a
sublayered nest, the nest can be confined to a subset of parent layers and/or the parent layers can be
subdivided. The figure below shows a cross section through a nested grid that has 5 layers in the parent
grid and 5 layers in the nest. However the nest layers start in parent layer 2 and end in parent layer 4, with
parent layer 3 split into 3 sublayers.
A much more general gridding scheme is called quadtree refinement. This is similar to finite-element
modeling but the mesh is a lot easier to generate and maintain. In smoothed quadtree refinement, each
parent cell can be refined into subcells using a power of 2. This means that subgrids of 2x2, 4x4, 8x8,
16x16, and 32x32 subcells can be created. Unlike the nested grid, these refinements happen on a cell-by-
cell basis. Within Groundwater Vistas, the refinements are smoothed such that each cell connects to no
more than 2 other cells on each face of the cell. An example of a smoothed quadtree mesh is shown below.
In the following tutorials we will start with examples that do not need AlgoMesh and then follow those
with some AlgoMesh tutorials.
MODFLOW-USG Versions
There are two versions of MODFLOW-USG. The public version is from the USGS
(http://water.usgs.gov/ogw/mfusg/) and the Transport Version (used to be called advanced or beta version)
is available through Groundwater Vistas. The USGS and transport versions support the following
MODFLOW packages:
BASIC
Block-Centered Flow (BCF) with upstream weighting capability of MODFLOW-NWT
Layer-Property Flow (LPF) with upstream weighting capability of MODFLOW-NWT
Horizontal Flow Barrier (HFB)
Time-Variant Constant Head (CHD)
Recharge (RCH)
Evapotranspiration (EVT)
Groundwater Vistas supports all of these packages. You will note that there is a new solver, called SMS,
which must be used for every model. This is essentially the same solver used in MODFLOW-NWT. Two
other new packages are Connected Linear Network (CLN) and Ghost Node Correction (GNC). The CLN
package is roughly equivalent to the multi-node well (MNW) packages or MODFLOW-Surfact's Fracture
Well packages. The GNC Package is generally needed when two nodes do not line up perpendicular to the
cell face separating them. Nested grids and quadtree grids may need ghost node corrections. Groundwater
Vistas automatically configures ghost nodes, though, so you only need to decide whether to use them or
not. The MODFLOW-USG manual contains a good discussion on ghost nodes.
The transport version of MODFLOW-USG contains the following additional packages and options not
supported by the USGS version:
Adaptive Time Stepping (ATS)
Transient IBOUND (TIB)
Ponding Depth and Time-series Options added to the Recharge Package
Time-Series option added to the ET package
Richards Equation formulation (unsaturated zone flow) added to BCF and LPF
Dual-Porosity Flow (DPF)
Specified Gradient Boundary Condition (SGB)
Block-Centered Transport (BCT)
Prescribed Concentration Boundary (PCB)
Dual Porosity Transport (DPT)
Density Driven Flow (DDF)
Time-Variant Materials (TVM)
Sink Return Flow (QRT)
Adaptive Time Stepping is similar to the MODFLOW-Surfact ATO Package but also allows you to change
some solver parameters by stress period. These packages are described in detail in the Groundwater Vistas
8 Users Guide.
To run MODFLOW-USG on any existing model, simply select Model|MODFLOW|Packages and change
the version of MODFLOW-USG Transport. As long as the "automatically reset package units" flag is ON,
Groundwater Vistas will change the solver to SMS, set the flow package to LPF, and change the
MODFLOW program file to MFUSGsWin32.dll.
The contoured heads should look like the original modflow run, as shown below.
Now create datasets and run MODFLOW-USG on this model. After running the model in MODFLOW-
USG, the results should look like the figure below.
Change the number of divisions for both rows and columns from 2 to 3 as shown above. Keep the other
information at the default values. If you did want to either restrict the nest to a subset of layers or split the
original layers into sublayers you would make those changes here. When you click ok, GV will ask if you
want to copy the parent boundary conditions to the nest. Normally it is a good idea to do this. You can
always modify them later. However, if you know that you will be importing new information from
shapefiles or other sources, then answering no is fine too. In this example, answer YES to copy the parent
Use File|Save As to create a new GWV file for this nested grid. You should generally use ghost nodes
with nested and quadtree grids in MODFLOW-USG. Ghost nodes are necessary to make the solution more
accurate. The MODFLOW-USG manual describes ghost nodes and their significance. In Groundwater
Vistas, ghost nodes are added laterally around nested grids. If the nested grid is not contained in all layers,
ghost nodes are also placed above and/or below the nest. The figure shown below illustrates the position of
ghost nodes (shown in green) around part of a nested grid.
Now run the model as before and bring in the results. The contours may be a bit coarse as the default
setting is to contour the entire model. Select Plot|Contour|Window and drag a window around the area of
the nest to make them smoother. The results should look similar to the ones below.
Even if you don't know how to read this format, you can see that the pumping rate of -10,000 is not in this
file. The CLN file defines the location of the feature within the parent model and defines the physical
characteristics of the well. However, the rate is actually stored in the MODFLOW Well Package. Open
that file in a text editor and you will see the following:
Quadtree Refinement
Quadtree refinement is also available in Groundwater Vistas as an alternative to the nested grids. The
following tutorial example will illustrate how to design a simple quadtree mesh. As with nested grids, it
makes sense to start with a relatively uniform parent model grid. This is not really necessary but we
believe it will make the resulting meshes more visually appealing. There will be no restrictions on this,
however, within Groundwater Vistas.
Using quadtree refinement in a model grid is three-step process. In the first stage, each cell in the model is
assigned an integer code from 1 to 7. A value of 1 means that the cell will not be divided. A value of 2
indicates the cell will be split into 2 rows by 2 columns, 3 means a 4 x 4 split, 4 means 8 x 8, 5 is 16 x 16, 6
is 32 x 32, and 7 is 64 x 64. These will be color coded in Vistas. In the example below, the white cells are
not divided, blue will be divided 2 x 2, and green will be divided 4 x 4.
Two types of quadtree refinement can be performed in Groundwater Vistas. In the most simplistic case, the
same level of refinement is used in each model layer. In Groundwater Vistas 7, this was the only type of
quadtree refinement allowed. In version 8, you also have the choice of have different levels of quadtree
refinement in each layer. To use the same quadtree refinement in each layer, you only have to define the
level of refinement in layer 1. For the 3D case, you define the levels in each layer. Use of sublayers is
NOT supported in either quadtree grid type.
Finally, after the quadtree refinements have been made new boundary conditions and updated properties
can be applied to the refined mesh. The best approach will be to have boundary conditions like rivers be
defined in one or more shapefiles so they can be easily imported and assigned to the new grid.
Start this example by opening the file called Bedrock_Example_USG.gwv located in the gwv8\tutorial
directory. The model is a uniform grid model already set up for use with MODFLOW-USG. We are going
to add quadtree refinement around the streams and the large river in this model. This is an ideal use of
quadtree refinement where the grid is refined along linear features that do not lend themselves to use of a
nested grid.
The light blue cells are in the large river and will be refined to quadtree level 2 (2 x 2 refinement in each
parent cell) and the green cells in the streams will use quadtree refinement level 3 (4 x 4) refinement.
Select Grid|Quadtree Refinement|Start Quadtree Mesh. Groundwater Vistas will then ask if you want to
vary quadtree refinement by layer. Answer NO to this prompt.
Then select the next command called Grid|Quadtree Refinement|HSU zone to Quadtree level. Now the
model should look like the following:
So far, Groundwater Vistas can draw the quadtree mesh but it has not computed node numbers and nodal
geometry yet. If you are satisfied with the quadtree mesh, select Grid|Quadtree Refinement|Allocate
Quadtree Mesh. When GV8 asks you if you want to copy boundary conditions to the new grid, answer
NO. We will import the river cells again from the shapefiles to take advantage of the new grid resolution.
Note that we turned OFF the checkbox near the bottom called “Import into Parent Grid”. We only want to
replace river boundary conditions in the quadtree cells.
Save your work and then run the model. The results should look like the following:
Select Grid|Quadtree Refinement|Start Quadtree Mesh. This time answer YES when prompted to vary
quadtree refinement by layer. Select Grid|Quadtree Refinement|HSU Zone to Quadtree Level. So far, the
grid looks just like the last section. Now use Grid|Quadtree Refinement|Smooth Quadtree Mesh.
Layer 1 should look just like layer 1 before. But go down to layer 2 and you will see that there are
refinements in this layer that are not the same as in layer 1.
Note that we turned OFF the checkbox near the bottom called “Import into Parent Grid”. We only want to
replace river boundary conditions in the quadtree cells.
The main workflow difference between a normal quadtree mesh ans an octree mesh is that defining the
level of refinement for quadtree is done ONLY in layer 1. For Octree, the level of refinement is defined in
all layers. Also, smoothing is done between layers in octree. GV will start with the highest level of
refinement and smooth the refinement out both laterally and vertically from those highest levels. It then
proceeds to the next lowest level of refinement and so on.
For each polyline, start where the 3 intersect and digitize in the order shown above. Each polyline should
have about 7 line segments.
Note that when digitizing these CLN polylines, you should NOT change the Global Starting Node Number.
Groundwater Vistas computes with from all other CLN polylines and is the correct one to use in all cases.
The elevations entered for the beginning and end of the polyline determines which layer the polyline will
be in. In the case of a stream these elevations should be slightly below land surface and represent the
bottom elevation of the stream channel. The starting and ending heads set the initial conditions of the CLN
nodes. GV will linearly interpolate to the intervening CLN nodes on the line. You can see and edit that
data by clicking the Node Properties button. Remember that each line segment along the polyline is one
CLN node. The head computed for this node is at the center of the line segment so it is block-centered just
like MODFLOW.
Now, click the Groundwater Connection tab and change the skin factor (hydraulic conductivity in this case)
to 100.
Click OK when you are done. Now digitize the second polyline, starting from the beginning of polyline 1
and moving upstream. Try to digitize about 7 segments. There will be no boundary conditions on this
polyline but change hydraulic conductivity to 0.002, starting elevation to 147, ending elevation to 200,
starting head is 152, and ending head is 205. Click the Groundwater Connection tab and change the skin
factor to 100.
Another key thing to do before clicking OK, is to define how the second polyline connects to the first one.
This has to be done manually when hand digitizing. Click the Connections tab and enter 1 for the node that
connects to the starting node of this polyline. This says that the beginning of polyline 2 connects to the
beginning of polyline 1, which is node 1.