Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The iMOD Adapter is a Python script designed to make running iMODFLOW models from Delft-FEWS as easy as possible. This includes not only iMODFLOW, but also the coupled MetaSWAP and WOFOST models, as described below. It builds on the iMOD Python package found at https://gitlab.com/deltares/imod/imod-python and uses the iMOD RUNFILE batch function to create run files from project files.

...

The coupled iMODFLOW-MetaSWAP-WOFOST model benefits from the strengths of each model: iMODFLOW for the groundwater flow, MetaSWAP for the unsaturated zone, and WOFOST for the crop growth aspect. A schema of hte the fluxes between the models is provided in Figure 1.

...

Adapter installation instructions

The adapter iMOD Adapter is a Python package and requires Python 3.6 or higher. A number of packages need to be installed prior to installing the adapter. This can be done by using a file called "environment.yml" such as followsthe one below:

Code Block
titleenvironment.ymlcollapsetrue
name: fews

channels:
  - conda-forge
  - defaults

dependencies:
  - python=3.6
  - numpy
  - xarray
  - numba
  - pandas
  - geopandas
  - dask
  - rasterio
  - git
  - git-lfs
  - jupyterlab
  - spyder
  - jinja2
  - cookiecutter
  - matplotlib
  - pytest
  - cftime
  - netcdf4
  - blackimod

This file can be installed as follows:

...

To test if the installation was successful, try starting the Python interpreter and type "import imodfews".

Notes to users

...

.

...

Input

Project file

An iMOD project file (*.PRJ) that describes the model and provides links to the input files needs to be available to the adapter. This project file needs to cover at least the time period that you intend to run. If you only have a runfile (*.RUN), a corresponding project file can be created in iMOD (refer to the iMOD user manual).

...

Code Block
titlerun_info.xml
<?xml version="1.0" encoding="UTF-8"?>
<Run xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.wldelft.nl/fews/PI" xsi:schemaLocation="http://www.wldelft.nl/fews/PI http://fews.wldelft.nl/schemas/version1.0/pi-schemas/pi_run.xsd" version="1.5">
    <timeZone>0<timeZone>1.0</timeZone>
    <startDateTime date="20162020-0109-2809" time="00:00:00"/>
    <endDateTime date="20162020-0109-3020" time="00:00:00"/>
    <time0 date="20162020-0109-3009" time="00:00:00"/>
    <lastObservationDateTime date="20162020-0109-3020" time="00:00:00"/>
    <workDir>D:<workDir>Modules\Delft-FEWS\FEWS_FARMERS_APP\Modules\fews_aaenmaas<Mipwa-Uitsnede</workDir>
    <inputStateDescriptionFile>D:<inputStateDescriptionFile>Modules\Delft-FEWS\FEWS_FARMERS_APP\Modules\fews_aaenmaasMipwa-Uitsnede\states\config_in\WOFOSTMetaSwap_States_in.xml</inputStateDescriptionFile>
    <inputStateDescriptionFile>D:<inputStateDescriptionFile>Modules\Delft-FEWS\FEWS_FARMERS_APP\Modules\fews_aaenmaasMipwa-Uitsnede\states\config_in\MetaSwapModflow_States_in.xml</inputStateDescriptionFile>
    <inputStateDescriptionFile>D:<inputNetcdfFile>Modules\DelftMipwa-FEWS\FEWS_FARMERS_APP\Modules\fews_aaenmaas\states\config_in\Modflow_States_in.xml</inputStateDescriptionFile>Uitsnede\FromFewsToModel\evaporation.nc</inputNetcdfFile>
    <inputMapStackFile>D:<inputNetcdfFile>Modules\Delft-FEWS\FEWS_FARMERS_APP\Modules\fews_aaenmaas\FromFewsToModel\mapstackEvt.xml</inputMapStackFile>Mipwa-Uitsnede\FromFewsToModel\precipitation.nc</inputNetcdfFile>
    <inputMapStackFile>D:<outputDiagnosticFile>Modules\DelftMipwa-FEWS\FEWS_FARMERS_APP\Modules\fews_aaenmaas\FromFewsToModel\mapstackPrecUitsnede\Logs\dummy_Diagnostics.xml</inputMapStackFile>outputDiagnosticFile>
    <inputMapStackFile>D:<outputStateDescriptionFile>Modules\DelftMipwa-FEWSUitsnede\states\FEWSconfig_FARMERS_APP\Modules\fews_aaenmaas\FromFewsToModel\mapstackHumout\Modflow_States_out.xml</inputMapStackFile>outputStateDescriptionFile>
    <inputMapStackFile>D:<outputStateDescriptionFile>Modules\DelftMipwa-FEWSUitsnede\states\FEWSconfig_FARMERS_APP\Modules\fews_aaenmaas\FromFewsToModel\mapstackTminout\MetaSwap_States_out.xml</inputMapStackFile>outputStateDescriptionFile>
    <inputMapStackFile>D:<outputNetcdfFile>Modules\DelftMipwa-FEWS\FEWS_FARMERS_APP\Modules\fews_aaenmaas\FromFewsToModel\mapstackTavg.xml</inputMapStackFile>Uitsnede\FromModelToFEWS\grid.nc</outputNetcdfFile>
    <inputMapStackFile>D:\Delft-FEWS\FEWS_FARMERS_APP\Modules\fews_aaenmaas\FromFewsToModel\mapstackTmax.xml</inputMapStackFile>
<properties>
      <inputMapStackFile>D:\Delft-FEWS\FEWS_FARMERS_APP\Modules\fews_aaenmaas\FromFewsToModel\mapstackRad.xml</inputMapStackFile>
  <string  <inputMapStackFile>D:\Delft-FEWS\FEWS_FARMERS_APP\Modules\fews_aaenmaas\FromFewsToModel\mapstackWspeed.xml</inputMapStackFile>
    <inputMapStackFile>D:\Delft-FEWS\FEWS_FARMERS_APP\Modules\fews_aaenmaas\FromFewsToModel\mapstackSundur.xml</inputMapStackFile>
    <outputDiagnosticFile>D:\Delft-FEWS\FEWS_FARMERS_APP\Modules\fews_aaenmaas\Logs\dummy_Diagnostics.xml</outputDiagnosticFile>
    <properties>key="imod-executable" value="Modules\Mipwa-Uitsnede/bin/iMOD_V4_4_X64R.exe"/>
        <string key="model-executable" value="Modules\Mipwa-Uitsnede/bin/iMODFLOW_V4_4_METASWAP_SVN1233_X64R.exe"/>
        <string key="imodproject-executablefile" value="D:Modules\Delft-FEWS\FEWS_FARMERS_APP\Modules\fews_aaenmaas/bin/iMOD_V4_2_1_X64R.exeMipwa-Uitsnede/Runfiles/mipwa30_transient.prj"/>
        <string key="modelinput-grid-executablefile" value="D:Modules\Delft-FEWS\FEWS_FARMERS_APP\Modules\fews_aaenmaas/bin/Driver_MetaSWAP_SVN1361_iMOD43_SVN2240.exeMipwa-Uitsnede/FromFewsToModel/precipitation.nc"/>
        <string key="projectinput-scalar-file" value="D:Modules\Delft-FEWS\FEWS_FARMERS_APP\Modules\fews_aaenmaas/Runfiles/AaenMaas.PRJMipwa-Uitsnede/FromFewsToModel/evaporation.nc"/>
        <string key="state-directory" value="D:Modules\Delft-FEWS\FEWS_FARMERS_APP\Modules\fews_aaenmaasMipwa-Uitsnede/states"/>
        <string key="output-directory" value="D:\Delft-FEWS\FEWS_FARMERS_APP\Modules\fews_aaenmaas/outputModules\Mipwa-Uitsnede/output"/>
        <string key="output-grid-file" value="Modules\Mipwa-Uitsnede/FromModelToFews\grid.nc"/>
    </properties>
</Run>

Folder organization

...

  • config_in
  • config_out
  • files_in
  • files_out

Notes to users

  • For all files that are written by this adapter, if the file to be written already exists, it will be overwritten.
  • For cold states, only soil moisture retention curves (pF curves) are supported as input for the init_svat.inp file (MetaSWAP). Full "MeteoInputP" state can be used as a warm state.

Example configuration files

A sample configuration file exporting necessary input data from Delft-FEWS to the model an running the adapter can be found here: Template_ExportToMMW_historicalMIPWA-Uitsnede.xml.