# iMOD User Manual version 5.2 (html)

#### 8.11POSTPROCESSING-FUNCTIONS

##### 8.11.1GXG-Function

The GXG function calculates the maximum and minimum groundwaterhead during the hydrological year (from 1${}^{st}$ April) based on the mean of the three highest, c.q. lowest observed groundwaterheads. The GXG is an indicator used in the Netherlands to indicate the seasonal variation of the groundwaterhead.

Example 1

FUNCTION=GXG
ILAYER=1
NDIR=1
SYEAR=1991
EYEAR=2000

This illustrates a simple example of a GxG computation over the years 1991 (actually starts at 14${}^{th}$ of April 1991) until 2000 (actually 28${}^{th}$ of March 2000), for all the HEAD* files that are within the folder D:\MODEL. Since the keyword SURFACEIDF is absent, the GxG will be expressed according to 0.0 instead of a true surface level, moreover, ILAY is absent too, but ILAY=1 will be used as default.

Example 2

FUNCTION=GXG
ILAYER=1,2
SURFACEIDF=D:\DATA\AHN.IDF
IYEAR=1994,1995,2000,2001
IPERIOD=000000001111111100000000
ISEL=3
IDFNAME=D:\DATA\ZONE.IDF
NDIR=1

This example computes the GxG for the years 1994, 1995, 2000 and 2001 only. This means two hydrological years, namely 14-4-1994-upto 28-3-1995 and 14-4-2000 upto 28-3-2001. In this period the summer months May, June, July, August are included as expressed by the IPERIOD keyword.

##### 8.11.2WBALANCE-Function

The WBALANCE function calculates the water balance based on the model output for the steady state condition or for a specific period and area. The result is a CSV file (Step 1).
Alternatively, this function can create images, IDF files and/or CVS files from aggregation on existing CSV files (Step 2).

Example 1

FUNCTION=WBALANCE
NBAL=3
BAL1=BDGFRF
BAL2=BDGFFF
BAL3=BDGFLF
ILAYER=3
NDIR=1
ISEL=2
GENFILE=D:\MODEL\zone.gen
SOURCEDIR1=D:\MODEL
OUTPUTNAME1=D:\MODEL\WBAL.TXT

The above mentioned simple example will give a waterbalance for the BDGFRF, BDGFFF and BDGFLF, respectively, for modellayer 3.
The result is written in D:\MODEL\WBAL.TXT.

Example 2

FUNCTION=WBALANCE
NBAL=2
BAL1=BDGRIV
BAL1ISYS=1,2
BAL2=BDGDRN
ILAYER=1,2
SDATE=19900101
EDATE=20001231
IYEAR=1990,1995,1997,2000
NPERIOD=1
PERIOD1=0104-3107
ISEL=2
GENFNAME=D:\DATA\ZONES.GEN
NDIR=2
SOURCEDIR1=D:\MODEL
SOURCEDIR2=D:\SCENARIO
OUTPUTNAME1=D:\OUTPUT\WBAL_MODEL.CSV
OUTPUTNAME2=D:\OUTPUT\WBAL_SCENARIO.CSV

The example above will compute a waterbalance for two modellayers (1,2) for the budgetfiles BDGRIV*SYS1 and BDGRIV*SYS2 and BDGDRN in the period from 1${}^{th}$ of April until the 31${}^{th}$ of July for the years 1990,1995,1997,2000. The waterbalance will be summed for the zones that are described by the polygon(s) inside the file ZONES.GEN. Finally, the computation will be executed twice, for those results in D:\MODEL and those in D:\SCENARIO. Results are stored in the folder D:\OUTPUT.

##### 8.11.3MSPNETRCH-Function

The MSPNETRCH function calculates the net Recharch from the MetaSWAP compartment to the watertable of Modflow for a specific period and area. The result is a series of IDF files. The following functions is used to calculate the net recharch.

$$NetRCH = \Delta lvgmodf * sc1 - qmodf,$$

whereby lvgwmodf is the head calculated by Modflow and sc1 a long term calculated mean of the Storage Coefficient. Qmodf is the sum of all MODFLOW stresses on groundwater.
For time step t the $\Delta$ lvgwmodf is defined as lvgmodf (t) - lvgmodf (t-1).

Note: It is obligatory to provide MSPNETRCH the necessary files for lvgwmodf and qmodf on a daily basis.
Note: To get model results for lvgwmodf and qmodf switch on these keywords in the model input file sel_key_svat_per.inp.

Example *.INI file content

FUNCTION=MSPNETRCH
SOURCEDIR=C:\IMOD_USER\MODELS\ISLAND
OUTPUTDIR=C:\IMOD_USER\MODELS\ISLAND\METASWAP\MSPNETRCH

The above given example will calculate the net Recharge IDFs for the whole model period. The IDF-files will be written as C:\IMOD_USER \MODELS \ISLAND \METASWAP \MSPNETRCH \MSPNETRCH_yyyymmdd.IDF.
The MSPNETRCH is calculated using the $\Delta$ lvgwmodf between 2 time steps (t and t-1). As a result the number of MSPNETRCH file is the number of provided time steps minus 1.

##### 8.11.4MF6TOIDF-Function

Use this iMODFLOW post-processing function to convert standard MODFLOW6 output to IDF files.

Example 1

FUNCTION=MF6TOIDF
SDATE=20121231
GRB=.\GWF_1 \MODELINPUT \{MODELNAME}.DIS6.GRB
BDG=.\GWF_1 \MODELOUTPUT \BUDGET \BUDGET.CBC
SAVESHD=-1
SAVEFLX=-1
SAVERIV=1
SAVEWEL=8,12

The above mentioned examples creates IDF files for all HEADS in the HED-file as well as all budget files for all items in the CBC-file. Multiple folders can be created for BDGRIV, BDGDRN, BDGFLF etc. if these are present in the CBC-file.

Example 2

FUNCTION=MF6TOIDF
IDF=.\GWF_1 \MODELINPUT \DIS \BND_L1.IDF

This example creates HEAD*.IDF files from the selected HED-file and using the IDF files from that submodel.

##### 8.11.5IDFTIMESERIE-Function

Use this function to generate timeseries out of IDF-files that have the notation {item}_yyyymmdd_l{ilay}.idf. These are IDF-files that yield from a normal iMODFLOW simulation.

NOTE: if IPF1 is an IPF with time series (e.g. in associated TXT files) than be aware: if the new IPF2 is in the same folder, than the original associated TXT files will be overwritten.

Example 1

FUNCTION=IDFTIMESERIE
IPF1=D:\DATA\MEASUREMENTS_LOC.IPF
ILAY=1
SDATE=19500101000000
EDATE=20120101123005

The example above will yield time series from the results in D:\RESULT\HEAD\HEAD_*_L1.IDF for the period between the 1${}^{\rm st}$ of January 1950 and the 1${}^{\rm st}$ of January 2012 at 12 hours, 30 minutes and 5 seconds.

Example 2

FUNCTION=IDFTIMESERIE
IPF1=D:\DATA\MEASUREMENTS_LOC.IPF
ILAY=1
SDATE=19500101000000
EDATE=20120101000000
LABELCOL=3

The example above differs for LABELCOL only. The 3${}^{\rm rd}$ column of IPF1 will be used to generate the name of the text file that stores the time series, most logically this is the ID name of the monitoring location.

##### 8.11.6IPFRESIDUAL-Function

Use this function to calculate residuals based on IPF files containing statistics.

Example

FUNCTION=IPFRESIDUAL
NIPF=2
POINTERIDF=D:\MODEL\POINTER.IDF
W_TYPE2=1
NZONE=2
IZONE1=5
IZONE2=6
OUTNAME=D:\RESULTS\STATISTICS.TXT

The example above will give a file containing all the residual values per given IPF-file based on the predefined conditions.

##### 8.11.7PLOTRESIDUAL-Function

Use this function to make a scatter plot or histogram plot of the observations and calculated heads and residuals (calculated-observed) from the iPEST-output data file(s).

Example

FUNCTION=PLOTRESIDUAL
INPUTFILE=D:\LOG_PEST_RESIDUAL_10V2.6.66.TXT
IPLOT=1
BMPNAME=d:\SCATTERPLOT.BMP
ITRANSIENT=1
ILAYER=16
IIPF=1
IWEIGHT=1

This example makes a scatter plot with the name SCATTERPLOT.BMP of the transient data available in the LOG_PEST_RESIDUAL_10V2.6.66.TXT file for a selection of layer 16 and the first IPF-file. The plotted values are multiplied with the given weight factor.

##### 8.11.8PWTCOUNT-Function

Use this iMODFLOW post-processing function to count the number of moments where a PWT situation occurs.

Example 1

FUNCTION=PWTCOUNT
SDLIDF=C:\RESULTS2\PWT\SDL_LAYER.IDF
ILAYIDF=C:\RESULTS2\PWT\PWT_LAYER.IDF
SDATE=19980201
EDATE=20111231
SOURCEDIR=C:\RESULTS\PWT\PWT*.IDF
OUTPUTIDF=D:\RESULTS\PWT_COUNT.IDF

The above mentioned examples creates the IDF file PWT_COUNT.IDF based on a timeseries of PWT result files in directory C:\DATA\