# iMOD User Manual version 5.2 (html)

#### 13.2iMOD-WQ Runfile Description

##### 13.2.1Introduction to iMOD-WQ Runfile Description

The iMOD-WQ executable supports the usage of a runfile. This can be invoked by:
(in a DOS command window, or in a batch file). The runfile is an easy-to-use Windows INI-formatted file with sections for the specific packages. You can add comments to the runfile by using the characters "#", "%" or "!". Each section contains keywords with corresponding properties. The keyword definitions closely follow the MODFLOW documentation, [Harbaugh et al.(2000)], the MT3DMS documentation, [Zheng and Wang(1999)] and the RT3D documentation ([Clement(1997), Clement and Johnson(2003)]). This manual only includes brief descriptions of the various keywords; for full explanations the aforementioned MODFLOW and MT3D documentation is referred to. The order in which the keywords appear within the section, as well as the order in which the sections appear in the runfile, is irrelevant. The valid sections and keys are listed in Section 2.5. A list of all inputs can be generated automatically by the iMOD-WQ executable as a comma separated file (.csv) by specifiying WRITEHELP=TRUE in the [GEN] section. The [GEN] section is the general section where the user must activate the packages (PACKAGES), the model-name, result directory, coordinates of the area of interest, and the starting time. All the other sections correspond directly to the MODFLOW and MT3DMS packages from the corresponding manuals. Note that the input must satisfy the defined format (column 3), e.g. meaning that a user must specify COORD_XLL=0. instead of COORD_XLL=0 in the [GEN] section.

For many keys, iMOD-WQ assumes default settings in case the key is not specified in the runfile. This allows to keep the runfile concise, but places responsibility on the modeller to know the default settings and to consciously accept these when not specifying alternative values in the runfile.

iMOD-WQ can also be used in combination with a .NAM file, just like the original SEAWAT and MT3DMS programs.

##### 13.2.2On the use of macro’s and tokens

###### 13.2.2.1General use of macro’s and tokens

The iMOD-WQ runfile offers the convenient possibility of entering input using macros and tokens. These tokens can be seen as wildcards/jokers, which prevent having to enter many repetitive lines in the runfile. Macro’s can be used for ranges layers (L), rows (R), columns (C), stress periods (P), species (T) and sub-systems (S). A selected range can be specified by a ":". The whole range can be specified by using the tokens: "$", "?" or "&". The format for using selected ranges is ::. Using the stride is optional. For example L1:5 corresponds to layer 1, 2, 3, 4 and 5, and L1:2:5 corresponds to layer 1, 3, and 5. NOTE: the convention in using the stride is that the last number of the series is always smaller than or equal to the specified end number (). It is not allowed to specify the keys for a particular combination of L, R, C, P, T and S, and not do it for the other required keys of a packages. For instance, if the river densities are specified for S=1, L=1 and P=1 (so RIVSSMDENS_S1_P1_L1), also the other keys of the RIV package (STAGE, COND and RBOT) have to be specified for this combination. Or, if for instance COND is specified for all possible combinations, for example via COND_P$_S$_L$, all other keys of the RIV package have to be specified for all combinations as well. Otherwise, the program terminates with an input inconsistency error message. This is to prevent unintended model setups, as otherwise errors are introduced easily.

###### 13.2.2.2Using macro’s in combination with constants

For example, consider a five layer model and consider the key STRT for specifying the starting heads in the [BAS6] section. For specifying the heads for selected layers, one can do:

STRT_L1:3 = 0. # starting heads for layers 1 , 2 , 3

STRT_L4:5 = 1. # starting heads for layers 4 and 5

or for specifying one constant for all layers:

STRT_L? = 1. # starting heads for all layers

Values can also be entered on a single line, for example:

STRT_L? = 0., 0., 0., 1., 1. # starting heads for all layers

Line continuation is enabled by ending the line with a "&" character:

STRT_L? = 0., 0., 0.,&

1. , 1. # starting heads for all layers

It is also possible to specified increment sizes when stepping through the range, e.g.:

PERLEN_P1:4:80 = 365.

PERLEN_P2:4:80 = 365.

PERLEN_P3:4:80 = 365.

PERLEN_P4:4:80 = 366.

sets the stress period lengths of all years to 365., except for every 4th year, which is set to 366. The format is PERLEN_P::.

###### 13.2.2.3Using macro’s in combination with file names

It is also allowed to use macros in file names. For example, instead of entering for each layer separately:

STRT_L1 = INPUT\SHD_L1. IDF # starting heads for layer 1

STRT_L2 = INPUT\SHD_L2. IDF # starting heads for layer 1

STRT_L3 = INPUT\SHD_L3. IDF # starting heads for layer 1

STRT_L4 = INPUT\SHD_L4. IDF # starting heads for layer 1

STRT_L5 = INPUT\SHD_L5. IDF # starting heads for layer 1

it is much faster and more compact to enter:

STRT_L? = INPUT \SHD_L? # starting heads for all layers

Macro’s in filenames can also be used for ranges, using the ":" token, as follows:

STRT_L1:10 = INPUT \SHD_L:. IDF # starting heads for layers 1-10

Macros can also be used for keys with multiple counter, e.g. the river stage which the user has to specify in the RIV section for all stress-periods, selected sub-systems and selected layers. For example:

STAGE_P?_S1_L1 :5 = INPUT\STAGE_P? _S1_L : .idf # river stages

The following general rules apply when using macro’s in combination with file names:

• • the use of tokens in the right hand side (in the file name) should be consistent with their use in the left hand side. If, for example, the "$" token is used for layers in the left hand side, it should also be used as a layer discriminator in the file names on the right hand side. So, for example, for starting concentrations of multiple species, the following is correct: • SCONC_T?_L$ = INPUT\STARTING_CONCENTRATION_SPECIES?_LAYER$.IDF In contrast, the following statements will yield unexpected results. • SCONC_T$_L? = INPUT\STARTING_CONCENTRATION_SPECIES?_LAYER$.IDF SCONC_T?_L? = INPUT\STARTING_CONCENTRATION_SPECIES?_LAYER$.IDF

• • A token at the right hand side (in the file name) should always also be present in the left hand side. So, for example, this is correct:

• BND_L$= INPUT\BND_L$.IDF

but this is not:

• BND_L1:10 = INPUT\BND_L\$.IDF

##### 13.2.3Using arithmetic operations

Numeric input can be entered in combination with one of six different mathematical operators, see Table 13.1

In the runfile, the operator is specified always before the "=" sign, for example:

STRT_L? * 5 . = 1. # starting heads for all layers

is equivalent to:

STRT_L? = 5. # starting heads for all layers

Another example is given by the use of resistance grids and reworking them into vertical conductances by using the power operator:

VCONT_L? ^-1. = INPUT\VERTICAL_RESISTANCE_L?. idf

# vertical conductance for all layers

##### 13.2.4Using factors

It is possible to use factor arrays for specific ranges. This requires the inclusion of a [FAC] section in the runfile, e.g.

[FAC]

F_L? = 1.0 , 2.0 , 3.0 , 4.0 , 5.0

or

[FAC]

F_L? = \ \

1.0

2.0

3.0

4.0

5.0

STRT_L1:3 +F_L1 :3 = 0. # starting heads for layers 1,2,3

STRT_L4:5 +F_L4 :5 = 1. # starting heads for layers 4 and 5

is equivalent to

STRT_L1 = 1.0 # starting head for layers 1

STRT_L2 = 2.0 # starting head for layers 2

STRT_L3 = 3.0 # starting head for layers 3

STRT_L4 = 5.0 # starting head for layers 4

STRT_L5 = 6.0 # starting head for layers 5

##### 13.2.5Input instructions per package

###### 13.2.5.1Introduction to input instructions

In the keyword tables a colour coding is applied, with colours green, orange and red. The meaning of the colours is as follows:
Green: the key is not mandatory, as iMOD-WQ applies default values in case the user does not specify other values in the runfile. For many parameters, however, the default value is a nodata value. For example, if no values for RECH (the recharge flux in $L^3/T$) is given, the nodata value is applied, which amounts to a recharge of zero. The user should always check thoroughly whether the invocation of default values by not specifying keys in the runfile results in the desired settings and parametrization of the model. This can be done, for instance, using the standard MT3DMS/SEAWAT input files written by iMOD-WQ (see key ECHOFILES in the GEN package).
Orange: the key may be mandatory, depending on other choices for model settings. No default values are set in the code but whether the model needs values for these keys depends on other keys. For instance, the primary storage coefficient SF1 is mandatory in case of a transient simulation but does not need to be specified in a steady-state model.
Red: the key always has to be specified. Not specifying these keys always results in the termination of the run.

It is mandatory to obey the key types as specified in the tables in this section. So, integers keys should indeed be specified by integer numbers in the runfile, and the same holds for reals.

###### 13.2.5.2Input instructions for the GEN package

(GEN: general package)

Notes:

• • RUNTYPE determines whether a SEAWAT simulation is performed an standalone MT3DMS simulation. If the latter is the case, fluxes from a separate MODFLOW or iMODFLOW model run are needed, and the [FTL] package should be invoked to provide details on these fluxes.

• • PACKAGES: Runfile-supported packages are:

• – for flow: BAS6, DIS, WEL, DRN, RIV, GHB, CHD, PCG, DE4, BTN, SIP, LPF, BCF6, RCH, EVT, HFB, OC, VDF

• – for transport: BTN, ADV, DSP, SSM, GCG, FTL, RCT, UDR

• – general: FAC

Other packages can be invoked by adding them to the NAM file and calling iMOD-WQ using the NAM file instead of the runfile.

• • COORD_XLL and COORD_YLL are optional, but in case IDF files are part of the models input, these settings determine the clipping of the IDF’s onto the models parametrization. If COORD_XLL and COORD_YLL are not given and the default values do not correspond with the input IDF’s, unexpected behaviour will be the result.

• • COORD_XUR and COORD_YUR are optional, but if in neither the DIS nor the BTN package, NCOL and NROW are given, COORD_XUR and COORD_YUR are mandatory for iMOD-WQ to determine NCOL and NROW (in combination with the cellsize).

• • START_YEAR, START_MONTH, START_DAY, START_HOUR, START_MINUTE and
START_SECOND are optional, but if the model input contains IPF files with associated text files containing time-dependent information (e.g. abstraction rates), these parameters should be chosen such that they correspond to the timing in those associated files.

Example:

###### 13.2.5.3Input instructions for the DIS package

(DIS: Discretization File)

Notes:

• • NLAY, NROW and NCOL can be assigned in the DIS package, in the BTN package, or in both. If they are not assigned in the BTN package, they should be assigned in the DIS package, unless COORD_XUR and COORD_YUR are given in the GEN package. If both COORD_XUR/COORD_YUR and NCOL/NROW are specified, NCOL and NROW will be used in the DIS and BTN package but output IDF’s will have the extent based on COORD_XUR/COORD_YUR.

• • TOP and BOTM are optional for the DIS package, but if they are not specified here then they should be specified in the BTN package (through HTOP and DZ, respectively). If both TOP/BOTM and HTOP/DZ are specified, the DIS package is parameterized with TOP/BOTM and the BTN package with HTOP/DZ. The modeller should in that case make sure that the associated values are identical. It is recommended to define only TOP/BOTM or only HTOP/DZ.

• • NPER should be assigned in the DIS package or in the BTN package. If NPER is assigned in both packages and the values are different, each package will get their own NPER value as assigned in the runfile. If $NPER_{DIS} < NPER_{BTN}$, the number of stress periods performed will be equal to $NPER_{BTN}$. In this case, in the last $NPER_{BTN} - NPER_{DIS}$ the flow field will not be updated anymore. If $NPER_{BTN} < NPER_{DIS}$, the number of stress periods performed will be equal to $NPER_{DIS}$. In this case, in the last $NPER_{DIS} - NPER_{BTN}$ all transport boundary conditions will remain equal to the boundary conditions in stress period $NPER_{BTN}$.

###### 13.2.5.4Input instructions for the BAS6 package

(BAS6: Basic Package)

Example:

###### 13.2.5.5Input instructions for the BCF6 package

(BCF6: Block-Centered Flow)

Example:

###### 13.2.5.6Input instructions for the LPF package

(LPF: Layer-Property Flow)

Caution: VKA is defined differently in iMOD-WQ as compared with the KVA parameter iMODFLOW. In iMODFLOW, KVA, the vertical anisotropy, is multiplied with the horizontal permeability to calculate the vertical conductivities in the permeable part of a modellayer. So in iMODFLOW KVA is a multiplication factor applied to the horizontal anisotropies, whereas in iMOD-WQ it is the ratio of horizontal to vertical conductivities, which amounts to the exact opposite.

Example:

###### 13.2.5.7Input instructions for the CHD package

Notes:

• • It is not obliged to give values for SHEAS and EHEAD. However, if for a certain cell, SHEAD and EHEAD are not given both (with a value other than nodata), no constant head is placed in that cell.

• • In contrast to iMODFLOW, iMOD-WQ follows standard MODFLOW-2000 conventions in the application of the constant head boundaries to the model. This means that any model cell with IBOUND > 0 that has a CHD assigned to it in the input for a certain stress period, will obey this CHD during the simulation. In iMODFLOW, the CHD only comes in effect if IBOUND < 0.

Example:

###### 13.2.5.8Input instructions for the DRN package

(DRN: Drain)

Notes: It is not obliged to give values for ELEVATION and COND. However, if for a certain cell, ELEVATION and COND are not given both (with a value other than nodata), no drain is placed in that cell.

Example:

###### 13.2.5.9Input instructions for the RIV package

(RIV: River)

Notes:

• • The concentration of river water is specified in the MT3DMS SSM package, or alternatively (if RUNTYPE = SEAWAT) through the auxiliary variable RIVSSMDENS. In the latter case the concentrations are specified as densities. The user cannot specify different concentrations/densities for more than one river boundaries in the same model cell. iMOD-WQ does not give an error if this situation occurs and will proceed by assigning the density specified for lowest RIV system number to all RIV boundaries in the cell.

• • If RUNTYPE = SEAWAT and NCOMP = 1, for large models, it is highly recommended to specify the concentrations through the "AUX RIVDENS" option or the "AUX RIVSSMDENS" option, as the SSM package becomes inefficient for large numbers of sinks/sources. The RIVSSMDENS option is the default option. In both cases, the user has to specify densities in the RIV package using the keyword RIVSSMDENS. However, in case the "AUX RIVSSMDENS" option is used, these densities are not used and instead a density calculated from the concentrations given in the SSM package (keyword CRIV) is associated with the GHB boundary cell. So the difference between using the auxiliary variable RIVDENS or RIVSSMDENS is that in the first case the densities as given in the RIV package are used, and in the latter case the densities are inferred from the concentrations given in the SSM package. The RIVSSMDENS option invokes a different and much more efficient implementation of the storage of the density terms in the code from early versions of SEAWAT in which this storage was done in the SSM package. Deviating from this default option is advised against.

• • It is not obliged to give values for STAGE, COND, RBOT and RIVSSMDENS. However, if for a certain cell, STAGE, COND, RBOT and RIVSSMDENS are not all given (with a value other than nodata), no river is placed in that cell.

Example:

###### 13.2.5.10Input instructions for the WEL package

(WEL: Well)

Notes:

• • Wells are specified per model layer using iMOD Point Files (IPF). The general structure of IPF files is described in the iMOD manual. In case the IPF file has three columns in the data table, the first, second and third column are interpreted as X,Y and Q, respectively, in which:

• – X = the x-coordinate of the well

• – Y = the y-coordinate of the well

• – Q = the abstraction/injection rate of the well [$L/T$].

This interpretation of the columns is regardless of the used column names in the IPF file. In case more than three columns are present in the IPF file, the column names in the IPF become important; a column with a name starting with "X" and a column with name starting with "Y" need to be present and they can be positioned at any location in the data table, except in the third column. The third column is always interpreted as the "Q" column, no matter its name.

• • It is possible to let iMOD-WQ divide the well fluxes internally over the model layers based on specified tops and bottoms of the well filters. To do this, the IPF file has to be assigned to layer number 0. Also, the IPF file needs to have two additional columns, named "TOP" and "BOT". They can be placed at any position in the data table, except in the third column. Note: if more than one column in the IPF file has a name that starts with "TOP" or "BOT", the first instance is taken as the column the retrieve the TOP/BOT information from. Also, in case of AUTOLAY = 1, the key WEL can not contain the indicator "_Lx" anymore. The flux assigned to a particular model layer is the total flux multiplied by the contribution (as a fraction) of the part of the model layer overlapping with the filter to the total transmissivity along the filter, based on TOP and BOT of the filter and the top and bottom of the model layer at this particular location.

• • The option to specify the well concentrations through an auxiliary variable
("WELDENSSSM") is not (yet) implemented.

Example:

Example for AUTOLAY = 1:

###### 13.2.5.11Input instructions for the GHB package

Notes:

• • The concentration of general head boundaries is specified in the MT3DMS SSM package, or alternatively (if RUNTYPE = SEAWAT) through the auxiliary variable GHBSSMDENS. In the latter case the concentrations are specified as densities. The user cannot specify different concentrations/densities for more than one GHB boundaries in the same model cell; through the keyword CCOND in the SSM package it is impossible from the input side as CCOND has no key for S (sub-systems). However, GHBSSMDENS could be specified for more than one sub-system, which could potentially result in two ore more densities specified for the same cell. iMOD-WQ does not gives an error if this situation occurs and will handle it in the same manner as Seawat v4 does in this case. Effectively this means that earlier instances in the .ghb file will be overwritten by later instances.

• • If RUNTYPE = SEAWAT and NCOMP = 1, for large models, it is highly recommended to specify the concentrations through the GHBSSMDENS option, as the SSM package becomes inefficient for large numbers of sinks/sources. If CGHB is specified in the SSM package, it overrules GHBSSMDENS.

Example:

###### 13.2.5.12Input instructions for the RCH package

(RCH: Recharge)

Notes: If INRECH and INIRCH are not specified, iMOD-WQ determines appropriate values internally. This is in fact recommended.

Example:

###### 13.2.5.13Input instructions for the EVT package

(EVT: Evapotranspiration)

Notes: If INSURF, INEVTR, INEXPD and/or INIEVT are not specified, iMOD-WQ determines appropriate values internally. This is in fact recommended.

Example:

Example:

###### 13.2.5.15Input instructions for the OC package

(OC: Output Control Option)

Notes: Chapter 13.3 explains in detail the output options of iMOD-WQ

Example:

###### 13.2.5.16Input instructions for the VDF package

(VDF: Variable Density Flow)

Notes: The default value for DENSESLP is derived from the assumption of a seawater total dissolved solids (TDS) concentration of $35 g/L$ and a seawater density of $1025 g/L$. Compared with freshwater having a reference density (DENSEREF) of $1000 g/L$, this yields: DEN SESLP = (1025 − 1000)/(35 − 0.) = 0.7134. If density is defined based on chloride rather than chloride concentrations, and seawater chloride concentration is set at $18 g/L$, DENSESLP becomes: DEN SESLP = (1025 − 1000)/(16.6 − 0.) = 1.3889.

Example:

###### 13.2.5.17Input instructions for the BTN package

(BTN: Basic Transport)

Notes:

• • It is obvious that, in case RUNTYPE = SEAWAT, the BTN package has some redundancy as some input is also specified in the DIS package. This is the case for NLAY, NROW, NCOL, TUNIT (ITMINI in DIS), LUNIT (LENMUNI in DIS), DELR, DELC, PERLEN, NSTP and the tops and bottoms of the model layers as specified by HTOP and DZ (TOP and BOTM in DIS). This redundancy is also there in standard Seawat and this has not been "solved" for iMOD-WQ. Just like in Seawat, it is the user’s responsibility that both in the DIS and BTN package the same/consistent values are specified for these input parameters.

• • NLAY, NROW and NCOL, however, can either be assigned in the DIS package, in the BTN package, or in both. If they are not assigned in the BTN package, they should be assigned in the DIS package, unless COORD_XUR and COORD_YUR are given in the GEN package. If both COORD_XUR/COORD_YUR and NCOL/NROW are specified, NCOL and NROW will be used in the DIS and BTN package but output IDF’s will have the extent based on COORD_XUR/COORD_YUR.

Example:

Example:

###### 13.2.5.19Input instructions for the DSP package

(DSP: Dispersion)

Example:

###### 13.2.5.20Input instructions for the SSM package

(SSM: Source/Sink Mixing)

Example:

Notes:

• • Choosing MXSS larger than necessary blows up memory usage. It is good practice to make a realistic estimation of MXSS and use that number, instead of using a random, very large number.

• • If the model contains recharge fluxes, it is mandatory to specify concentrations for these fluxes (CRCH). The same holds for evapotranspiration fluxes (CEVT). For the other boundary conditions, a concentration of zero is assumed if nothing is specified.

• • If there are multiple systems of a particular boundary condition within one cell, it is not possible to specify different concentrations for them. Only one concentration per species per cell can be specified per boundary condition.

• • CRIV and CGHB overrule densities specified in the RIV and GHB package (through RIVSSMDENS and GHSSMDENS).

• • In case constant concentrations are specified through CTVC, the user has to specify a "homogeneous" input set for all species. If for a certain stress period and layer a constant concentration is specified, also for all other species in the simulation input is expected for these stress periods and layers. This input can be "nodata" (by assigning a constant value of -9999. or an IDF file with only nodata values) but cannot be omitted.

• • CWEL can be assigned through IDF files or IPF files. Only one file type can be used per simulation; IDF and IPF files cannot be mixed. When using IPF files, a separate IPF file should be given for each species (multiple species cannot be handled through multiple columns in the IPF file). Associated text files are supported for assigning time-variant concentrations. Although in the WEL package wells can be assigned to layer number 0 (for automatic distribution of the wells over the model layers based on filter position), this option is not available for CWEL.

Example:

###### 13.2.5.21Input instructions for the RCT package

(RCT: Chemical Reaction)

Notes: IRCTOP < 2 is not allowed in iMOD-WQ. If IRCTOP is set to a value < 2, internally it is reset to 2.

Example:

###### 13.2.5.22Input instructions for the UDR package

(UDR: User Difined Reaction)

Notes:

• • The UDR (User Defined Reaction) package is the implementation of RT3D v2.5 functionality in iMOD-WQ. It supports all nine predefined reaction modules that are part of RT3D v2.5 and can be invoked through the selection of IREACT. For detailed information on the required settings per reaction module, see the RT3D documentation.

• • The user can implement any desired reaction scheme compatible with MT3D/RT3D concepts by coding it into the software. Reaction module number 10 is reserved for these user defined modules, and therefore the module should be invoked through IREACT = 10. User-defined reaction schemes can be designed in the Fortran source file UDR1.for, analogous to the other nine modules.

• • Currently the functionality is limited to maximum 7 constant reaction parameters and 4 spatially variable reaction parameters.

• • IRCTOP < 2 is not allowed in iMOD-WQ. If IRCTOP is set to a value < 2, internally it is reset to 2.

Example:

###### 13.2.5.23Input instructions for the FTL package

Notes:

• • The FTL package is only needed in case RUNTYPE = MT3DMS.

• • iMODFLOW does not produce output per time step, only per stress period.

• • For transient simulations, iMOD-WQ expects fluxes for all stress periods. The transport simulation therefore has to be preceded by a iMODFLOW simulation which produces these fluxes each stress period

• • For FTLSOURCE = 2, the user has to be aware that the MODFLOW version that produced the .ftl file was compiled with a compiler compatible with the one used for iMOD-WQ (Intel Parallel Studio XE Composer Edition for Fortran Windows, 2018), to make sure that iMOD-WQ reads the unformatted .lmf file properly.

• • For FTLSOURCE = 2, the user must make sure that the imod-wq_tmp folder already exists and put the .lmt file in that folder. The name of the .lmt file should be changed into .lmt, with referring to the name for the model that was chosen in the GEN package. For example: my_model.lmt.

• • For FTLSOURCE = 2, all other keywords in the FTL package are not read and therefore do not have to be specified.

• • For FTLSOURCE = 1, in flow simulations using iMODFLOW, or using iMOD-WQ if the VDF package is not used, fluxes are saved for the beginning of the stress period. In iMOD-WQ, with the VDF pacakage included, fluxes are saved at the end of the stress period. When running iMOD-WQ in MT3DMS mode, the code expects flow input for the beginning of the stress periods. This means that if the user want to run iMOD-WQ in MT3MDS using fluxes from a transient flow simulation performed with iMOD-WQ using the VDF package, a preprocessing step is necessary to change the time stamps of the flux IDF’s.

Example: