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.

...

Code Block
titleenvironment.yml
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:

...

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_aaenmaas\Mipwa-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_aaenmaasMipwa-Uitsnede\FromFewsToModel\mapstackEvtprecipitation.xml<nc</inputMapStackFile>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

...

  • For all files that are written by this adapter, if the file to be written already exists, it will be overwritten.
  • This adapter only handles For cold states, only soil moisture retention curves (pF curves) are supported as input for the init_svat.inp file (MetaSWAP), not . Full "MeteoInputP" as inputstate 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.