Customized PEST Setups

PEST is a model-independent parameter estimator and is easy to integrate with most numerical models. The transparent design of its file setup allows the user a lot of flexibility for customizing and implementation of desired functionality.

One of the challenges during FePEST development was to make sure that PEST setup also maintains its flexibility and that it could be used inde­pendently of FePEST. FePEST provides a convenient user interface to set up the PEST files, but at the same time, the user is free to continue working with PEST in the traditional way (i.e. by directly editing its configuration files and running its tools from the command line).

This release of FePEST implements those PEST features that are commonly used for model calibration. As it was discussed before, PEST has a lot more to offer.

Experienced users of PEST could potentially benefit from features like Pareto methods or Null-Space Monte-Carlo analysis, or editing certain PEST varia­bles or options that are not accessible through the FePEST GUI. Implementa­tion of own pre- or post-processing code (including third-party software and IFM plug-ins) into the PEST iteration loop might also be desired.

To benefit from both, FePEST and traditional PEST, it is ideal to configure the PEST setup in FePEST and generate the respective files that can be edited (if desired). Finally PEST can be started (in some cases, this can be done again from within FePEST).

Creating the PEST Setup

The PEST setup files are created when the PEST run is commenced. To edit the files, press the run button, but disable the options for running PEST (and recalculating the Jacobian, if applicable) before pressing the OK button.

RunDialogCreateOnly.png 

Settings in the Run dialog to create the PEST files.

The Checks option will also initiate the creation of the files if these are not present when it is executed.

Convenience Tools

To make the manual editing of the file setup easier, and to allow quick access to the relevant files and locations, the following features appear in the Esti­mation menu of FePEST after the PEST files have been generated.

  • Checks
    Runs the PEST error check tools PESTCHEK (checks the control file), INSCHECK (checks the instructions file) and TEMPCHEK (checks the template file). Errors and warnings - if raised - will be shown in the dialog.

  • Open work folder in explorer
    Use this option to open the work folder, to operate with files or to open them for editing.

  • Open work folder in console window
    Use this option to open a new command line window, from where PEST (and other) commands can run.

  • Open control file
    Directly opens the PEST control (*.pst) file in the standard editor.

  • Show command
    Shows a command line string with that the PEST run can be initiated. Use this command if you want to run PEST outside the FePEST GUI.

File Structure

Basic file structure as it is created by FePEST for the simplest case is shown below. Additional files may be present depending on the selected methods.

  • PEST script (run_pest.bat)
    This script file is executed when the PEST run is started by the user within FePEST. Besides other commands, the PEST executable is called. The content of this script will vary depending on the settings done in FePEST (e.g., SVDAPREP will be run from this script if SVD-Assist is active).
    Change this script to implement additional commands to the overall PEST process.

  • Model script (run_model.bat)
    This script is executed by PEST directly to commence a model call (It is cited as the model command in the PEST control file). The actual FEFLOW execution is cited in here.
    Add commands to this file that should be executed with every model run.

  • FePEST input file (<case>.fpi)
    PEST writes parameter values to the FePEST input fie (as advised in the respective template file), from where they are read by FePEST. The for­mat is kept very simple, thus that user-specific scripts or plug-ins can access it.

  • FePEST output file (<case>.fpo)
    FePEST writes observation values to the FePEST output file, from where they are read by PEST (as advised in the respective instructions file). Once again, a very simple format is used thus that user-defined scripts or plug-ins can access this file.

  • PEST control file (<case>.pst)
    This is the primary PEST control file which defines the configuration of PEST. Edit this file to make changes that are not supported by FePEST.

  • SVDA files (super.pst and others)
    If SVD-Assist is used, a second pest setup will appear in the directory after SVDAPREP has been executed by the PEST script.

  • Supportive files
    Other files may appear depending on settings. E.g., several PLPROC files will be generated if the pilot-point method is applied, and a covari­ance matrix will be created by PPCOV if pilot-points are regularized.
    The FePEST help contains a detailed description of these and other files.

FileStructure.png 

Running Customized PEST Setups

A customized setup of files can be run in two ways: Either from within or out­side of FePEST:

Run from within FePEST

This option is more convenient and should be preferred if applicable. Click on “Run” again, but deactivate the Create Files option this time (otherwise, the files would be overwritten).

RunDialogRunOnly.png 

Settings in the Run dialog to run PEST without recreating the file setup.

FePEST will commence the PEST run by running the PEST script (run_pest.bat under windows), including all user modifications.

Note that because FePEST parses the primary output of PEST during run-time, FePEST visual feedback might fail partially or completely if the PEST output changes significantly due to the user modifications.

PEST script from command line

The FePEST is part of a superordinate batch run, the PEST script (or its con­tents) can be incorporated into another script.

Even though visual feedback cannot be provided any more, FePEST (called in its simulation mode) still ensures that parameters and observations are correctly transferred between FEFLOW and PEST.

Integrating IFM Plug-ins and Third-Party Code

When creating a new observation definition or parameter definition, FePEST offers the type "IFM implemented" to add a specified number of additional parameters to the PEST file setup. These can be directly modified by an IFM plug-In or a third-party code (e.g., a script or another program).

IFM plug-ins

An IFM plug-in must be attached to the FEFLOW model and registered in FEFLOW before the PEST run is started. If paralellization involves remote servers, the plug-in must be installed on all remote machine as well (these will not be transferred automatically).

It opens the *.fpi file during run-time of the model to read parameters, and opens the *.fpo file to save observations.

Scripts and third-party software

Any program used for additional postprocessing can access the *.fpi  (to read parameters) and *.fpo file (to save observations) accordingly. To include them in the optimization, they have to be started appropriately from one of the batch files (either the model batch file or the pest run batch file).

For user-defined parameters, consider creating a new parameter group with appropriate settings for the derivative calculation.

Table of Contents

Index

Glossary

-Search-

Back