Table Of Contents

Previous topic

THe wflow_wave Model

Next topic

wflow_adapt Module

This Page

The wflow_floodmap model

Introduction

The wflow_floodmap module can generate flood maps from output of a wflow_sbm|hbv|wave model. Is needs to be run inside an existing case and runid of either of these models.

Warning

The documentation is incomplete

Description of the python module

Definition of the wflow_floodmap model.

Runs flood mapping (very basic) based on an existing wflow_sbm|hbv model run.

The wflow_sbm|hbv model must have saved mapstacks for water level and discharge for each timestep (run*****.*** and lev*****.***). If the name of you Q and/or H maps are different specify these in the [inputmapstacks] section, e.g:

[inputmapstacks]
Q = runDyn
H = levDyn

If a wflow_bankfull.map map is present in the staticmaps directory that map will be used to determine if the river is flooding, otherwise bankfull is determined using: Bankful = RiverWidth/60 (the RiverWidth map is taken from the runid/outsum directory)

Ini file settings:

[model]
# Maximum distance between a cell to be flooded cell and a river cell
# or already flooded cel. Functions as a max flooding velocity
# Never set lower that the length of one cell.
maxflooddist= 0.3

Usage: wflow_floodmap -C case -R Runid -c inifile -h -I

-C: set the name of the case (directory) to run

-I: generate initial conditions from scratch

-R: set the name runId within the current case

-c name of the config file (in the case directory)

-F: if set wflow is expected to be run by FEWS. It will determine
the timesteps from the runinfo.xml file and save the output initial conditions to an alternate location. The runinfo.xml file should be located in the inmaps directory of the case. Also set fewsrun=1 in the .ini file!

-h displays help information

-l: loglevel (most be one of DEBUG, WARNING, ERROR)

$Author: schelle $ $Id: wflow_floodmap.py 916 2014-02-11 14:49:35Z schelle $ $Rev: 916 $

class wflow_floodmap.WflowModel(cloneMap, Dir, RunDir, configfile)

The user defined model class. This is your work!

dynamic()

Required

This is where all the time dependent functions are executed. Time dependent output should also be saved here.

Variables:
  • self.FLOOD – Actual flood level [m]
  • self.FloodExtent – Actual flood extent [-]
initial()

Required

Initial part of the model, executed only once. It reads all static model information (parameters) and sets-up the variables used in modelling.

This function is required. The contents is free. However, in order to easily connect to other models it is advised to adhere to the directory structure used in the other models.

resume()

Required

This function is required. Read initial state maps (they are output of a previous call to suspend()). The implementation showns her is the most basic setup needed.

stateVariables()

Required

Returns a list of state variables that are essential to the model. This list is essential for the resume and suspend functions to work.

This function is specific for each model and must be present. This is where you specify the state variables of you model. If your model is stateless this function must return and empty array (states = [])

Variables:FloodExtent.map – Current FloodExtent
supplyCurrentTime()

Optional

Supplies the current time in seconds after the start of the run This function is optional. If it is not set the framework assumes the model runs with daily timesteps.

Ouput:

  • time in seconds since the start of the model run
suspend()

Suspends the model to disk. All variables needed to restart the model are saved to disk as pcraster maps. Use resume() to re-read them

wflow_floodmap.main(argv=None)

Optional

Perform command line execution of the model. This example uses the getopt module to parse the command line options.

The user can set the caseName, the runDir, the timestep and the configfile.