OR/14/007 Tutorials: Difference between revisions

From MediaWiki
Jump to navigation Jump to search
 
Line 79: Line 79:


===Running AquiMod in evaluation mode===
===Running AquiMod in evaluation mode===
Having configured all of the required input files, AquiMod is now ready to run as shown in [[OR/14/007 Getting started#Running Aquimod|Running Aquimod]]. '''Run AquiMod in the command prompt'''. This should return similar messages as the calibration run (Figure 6.8).
Having configured all of the required input files, AquiMod is now ready to run as shown in [[OR/14/007 Getting started#Running AquiMod|Running AquiMod]]. '''Run AquiMod in the command prompt'''. This should return similar messages as the calibration run (Figure 6.8).


Note that the runtime is longer for these evaluation runs, even though far fewer runs have been performed than the 100 000 in the previous tutorial. This is because AquiMod has to write a time-series file for each run. As such, when performing large numbers of evaluation runs and outputting the results, runtime can increase considerably.
Note that the runtime is longer for these evaluation runs, even though far fewer runs have been performed than the 100 000 in the previous tutorial. This is because AquiMod has to write a time-series file for each run. As such, when performing large numbers of evaluation runs and outputting the results, runtime can increase considerably.

Latest revision as of 09:04, 20 October 2021

Mackay, J D, Jackson, C R, and Wang, L. 2014. AquiMod User Manual (v1.0). Nottingham, UK, British geological Survey. (OR/14/007).

This section provides a series of step-by-step tutorials that can be used to familiarise yourself with the AquiMod software. All of the examples shown use the model in the CHexample folder. If you do not have this already, follow the instructions in section 2.

How to perform a calibration run

This tutorial provides instructions to calibrate an AquiMod model for an observation borehole catchment in the United Kingdom. You will configure the Observations.txt and Input.txt files and learn about the calibration input files. You will then run a Monte Carlo calibration procedure and examine the model outputs.

The Chilgrove House observation borehole

The Chilgrove House observation borehole is located in the Cretaceous Chalk aquifer in the south of the United Kingdom (Figure 6.1). It has groundwater level records from 1836 and is one of the longest groundwater level time-series in the world. Situated in the unconfined Seaford Chalk formation, the hydrograph displays a typical sinusoidal response generated by the seasonal recharge signal typical of unconfined aquifers in the UK. More information on the Chilgrove House observation borehole can be found on the British Geological Survey web-site at https://www.bgs.ac.uk/research/groundwater/datainfo/levels/sites/ChilgroveHouse.html. In this tutorial, you will focus on a 45-year time-series of groundwater level data between January 1961 and December 2005 over which reliable rainfall and PET estimates are also available (Figure 6.2).

Figure 6.1    Location of Chilgrove House observation borehole along with geological setting and nearby river network.
Figure 6.2    Observed rainfall, PET (top) and groundwater level data (bottom) for the Chilgrove House observation borehole catchment.

Observations.txt

First you will calibrate the model against the first half of observed groundwater data between January 1961 and June 1983. This half of the data can be found in ObsCalib.txt. Copy and paste this in Observations.txt. Note that there is no significant groundwater abstraction in the catchment, and as such these rates have been set to zero. Also note that the model will run on a monthly time-step.

Input.txt

Next, you will configure the Input.txt file as shown in Figure 6.3. Open this file in a text editor. Going through each option in order:

  • Component IDs — you will use the FAO, Weibull and Q3K3S1 module components so these should all be set to 1.
  • Simulation mode — this should be set to ‘c’ to run in calibration mode.
  • Number of runs — for this tutorial you will run the model 100 000 times in order to find the most efficient parameter sets.
  • Objective function — you will use the NSE as the measure of model fit and so this should be set to 1.
  • Spin-up period — a spin-up period of 6 time-steps (months) is sufficient for this observation borehole catchment.
  • Acceptable model threshold — deciding upon a suitable value for this will depend on the type of application and personal preferences. For this tutorial, an arbitrary value of 0.8 will be used.
  • Maximum number of acceptable models — again, defining this value is likely to depend on the proposed application. For this tutorial, you will only consider the most efficient 1000 models (assuming 1000 exceed the acceptable model threshold).
  • Write model output files — in calibration mode, the output files will contain the parameter sets of the most efficient Monte Carlo simulations. You will need this information later on, so set all of these to ‘Y’.
Figure 6.3    Configured Input.txt file for the Chilgrove House calibration run.

Calibration input files

For this example, the calibration input files have been pre-configured so that a total of 8 of the 16 parameters will be calibrated, while the remainder are fixed. This was determined based on the availability of catchment data.

Open the FAO_calib.txt file located in the Calibration folder. The field capacity, wilting point and baseflow index parameters have been fixed based on known catchment information obtained from a soil database of the United Kingdom (Boorman et al., 1995[1]) while the maximum root depth and depletion factor are to be randomly sampled between specified ranges.

Next, open the Weibull_calib.txt file. The Weibull lambda and n parameters have been determined by analysing the relationship between rainfall and groundwater levels. The lambda parameter controls the location of the peak of the Weibull distribution, or in other words the peak recharge response to rainfall and subsequent soil drainage. As such, a cross-correlation analysis has been performed between monthly rainfall and groundwater levels (Figure 6.4) that shows a peak correlation at a 1 month lag. Accordingly, the lambda range has been set from 1–2.5. The n parameter has been set to 6 as this is the longest lag that shows a significant correlation (also note that this was used to define the spin-up period in Input.txt). The k parameter range has been set to 1–7 which is a typical range for this distribution parameter.

Figure 6.4    Cross-correlations between rainfall and de-seasonalised groundwater levels.

Finally, open Q3K3S1_calib.txt. The aquifer length has been fixed to 3000 m which is the approximate length between the borehole and the nearest river in the catchment where the groundwater discharges. The bottom elevation of the aquifer has been set based on the known geometry of the Chalk aquifer in this catchment. The second layer outlet elevation has also been set. The top layer elevation has been kept as a calibration parameter and is free to fluctuate between ground level elevation and the minimum groundwater level on record (i.e. within the zone of fluctuation). The specific yield and hydraulic conductivity ranges have been set based on known Chalk properties. In this case, the conductivities have been set to decrease with depth as this is a common characteristic of the Chalk aquifer. Due to the fact that some of the conductivity ranges between layers overlap, the alpha parameter has been set to 1 to ensure that the conductivity decreases with depth.

Running AquiMod in calibration mode

Having configured all of the required input files, AquiMod is now ready to run as shown in section 2.2. Run AquiMod in the command prompt. Notice a slight difference in the output messages for this run in comparison to the initial evaluation run conducted in section 2.2 (Figure 6.5). The first message states that the model is running 100 000 times. The second states that it is extracting the best models. Generally this is instantaneous, but when storing large numbers of parameter sets it can become the bottleneck in the overall simulation run-time. Finally it writes the output files to the Output folder and then states the total run-time.

Figure 6.5    Command prompt view when running AquiMod in calibration mode.

Output files

Navigate to the Output folder. AquiMod should have produced a fit_calib.out file as well as a *_calib.out file for each of the three module components. Open the fit_calib.out file to check if any acceptable models have been obtained. The file should be filled with up to 1000 NSE scores. You can use the fit_calib.out file in conjunction with the *_calib.out module component files to assess the sensitivity of the parameters. For example, in Figure 6.6 two dotty plots have been drawn in MATLAB which indicate that the S parameter shows more sensitivity than the K3 parameter.

Figure 6.6    Dotty plots to assess sensitivity of S (%) (left) and K3 (m d-1) (right) parameters from the Q3K3S1 saturated zone component. Plots contain 1000 acceptable models obtained from the calibration run.

If the fit_calib.out file is empty, that means no acceptable models have been obtained. In this case, you may wish to reconsider the criteria for accepting a model, increase the number of runs, adjust the parameter calibration ranges or experiment with different model structures.

How to perform an evaluation run

This tutorial provides guidance on how to use AquiMod in evaluation mode. Here AquiMod does not employ the Monte Carlo parameter sampling. Instead, you are required to specify the parameters. As such, in evaluation mode, AquiMod does not output any information on model parameters, but instead generates the simulated time-series for the defined parameter sets. In this sense it allows you to evaluate specific model structures and parameter sets by visually comparing the observed and simulated time-series.

In this tutorial you will evaluate your newly derived parameter sets from the previous section against all of the available data between January 1961 and December 2005.

Observations.txt

First, you need to specify the observed sequence in the Observations.txt file. This data can be found in ObsEval.txt. Simply copy and paste this into Observations.txt. Note that as before, we are still running the model on a monthly time-step with no abstraction.

Input.txt

Next, you will configure Input.txt. Open Input.txt in a text editor. Going through each option in order:

  • Component IDs this should remain the same as you will use the same module components.
  • Simulation mode — set this to ‘e’ to run AquiMod in evaluation mode.
  • Number of runs — Set this to the number of acceptable parameter sets that were obtained from the previous tutorial.
  • Objective function — this should remain the same.
  • Spin-up period — this should remain the same.
  • Acceptable model threshold — this option is not used in evaluation mode.
  • Maximum number of acceptable models — this option is not used in evaluation mode.
  • Write model output files — in evaluation mode, the output files will contain the time-series simulations for the acceptable models. In this tutorial you will only assess the groundwater level simulations, so set the first two to ‘N’ and the last one to ‘Y’.

Figure 6.7 shows the completed Input.txt file for this exercise.

Figure 6.7    Configured Input.txt file for the Chilgrove House evaluation run.

Evaluation input files

The file structure of the *_eval.txt input files is exactly the same as the output files from the calibration mode. Since you will evaluate the calibrated parameter sets, these files can simply be moved to the Evaluation folder and renamed accordingly. For example Output\Q3K3S1_calib.out should be moved and renamed to Evaluation\Q3K3S1_eval.txt.

Running AquiMod in evaluation mode

Having configured all of the required input files, AquiMod is now ready to run as shown in Running AquiMod. Run AquiMod in the command prompt. This should return similar messages as the calibration run (Figure 6.8).

Note that the runtime is longer for these evaluation runs, even though far fewer runs have been performed than the 100 000 in the previous tutorial. This is because AquiMod has to write a time-series file for each run. As such, when performing large numbers of evaluation runs and outputting the results, runtime can increase considerably.

Figure 6.8    Command prompt view when running AquiMod in evaluation mode.

Output files

After running AquiMod in evaluation mode, it should have produced a fit_eval.out file in the Output folder as well as time-series files for each parameter set for the Q3K3S1 module component. Individual time-series can easily be plotted in applications such as Microsoft Excel. However, plotting the full range of simulations is often faster using a scripting language. Figure 6.9 has been produced using MATLAB and shows the 90% bands of all the simulations in blue (calibration sequence) and red (evaluation sequence) against the observations (black dots).

Figure 6.9    Range of simulations shown in blue (calibration sequence) and red (evaluation sequence) with the mean simulation (solid black) and observations (black dots).

Deactivating modules and using other components

You may select any combination of the available module components when using AquiMod. You may also deactivate modules entirely using the ID ‘0’ in Input.txt if you only wish to consider part of the hydrological system. This may be useful for example if a boundary condition flux is known and therefore does not need to be simulated, or if part of the hydrological system is not deemed to be important for a particular application.

If the soil zone is deactivated, evapotranspiration is assumed to be zero and rainfall passes directly to the unsaturated zone as soil drainage. If the unsaturated zone is deactivated, soil drainage is allowed to pass instantaneously the saturated zone. If both the soil and unsaturated zone are deactivated, the rainfall input essentially becomes a recharge input to the saturated zone. If the saturated zone is deactivated, groundwater recharge discharges instantaneously out of the model domain.

As a final exercise, experiment with deactivating different modules in the AquiMod structure. You should find for the Chilgrove House observation borehole catchment that efficient simulations of groundwater levels can still be reproduced without the inclusion of the unsaturated zone component.

You may also wish to experiment with using other components. This can be done simply by changing the options in Input.txt and the associated input files. For this, it is recommended to use the template files available on the AquiMod website.

Reference

  1. Boorman, D B, Hollis, J M & Lilly, A. 1995. Report No. 126 Hydrology of soil types: a hydrologically-based classification of the soils of the United Kingdom. Wallingford, UK: Institute of Hydrology.