GRASS logo

NAME

m.swim.substats.py - Soil and Water Integrated Model (SWIM) preprocessor: subbasin statistics

KEYWORDS

SYNOPSIS

m.swim.substats.py
m.swim.substats.py --help
m.swim.substats.py [-kv] projectname=name projectpath=path subbasins=name [elev0=raster or value] [sdtsav=raster or value] [sl=raster or value] [stp=raster or value] [salb=raster or value] [sno=raster or value] [ovn=raster or value] [rt=raster or value] [css=raster or value] [ecp=raster or value] [suborder=order] [mainstreams=name] [elevation=name] [drainage=name] [accumulation=name] [chl=raster or value] [chs=raster or value] [chw=raster or value] [chd=raster or value] [chk=raster or value] [chn=raster or value] [chxk=raster or value] [chc=raster or value] [rteorder=order] [gwht=raster or value] [gwq=raster or value] [abf=raster or value] [syld=raster or value] [delay=raster or value] [revapc=raster or value] [rchrgc=raster or value] [revapmn=raster or value] [gworder=order] [dummy=raster or value] [--help] [--verbose] [--quiet] [--ui]

Flags:

-k
Keep intermediate files (those named *__*)
-v
Show version and change/install date of this module and grass.
--help
Print usage summary
--verbose
Verbose module output
--quiet
Quiet module output
--ui
Force launching GUI dialog

Parameters:

projectname=name [required]
Name of project
projectpath=path [required]
Path to project folder
subbasins=name [required]
Subbasin vector map, statistics will be updated in table
elev0=raster or value
Reference elevation of the climate data to correct T and P.
Default: 0
sdtsav=raster or value
Initial water storage in the subbasin, m3
Default: 0
sl=raster or value
USLE slope length raster from r.watershed
Default: slopelength
stp=raster or value
USLE slope steepness raster from r.watershed
Default: slopesteepness
salb=raster or value
Soil albedo (default value or raster)
Default: 0.15
sno=raster or value
Initial snow water content, mm (default value or raster)
Default: 0
ovn=raster or value
Overland flow N value (default value or raster)
Default: 0.15
rt=raster or value
Return flow travel time, days (0=SWIM estimates, default value or raster)
Default: 0
css=raster or value
Channel slope, m/m (default value or raster)
Default: 0.5
ecp=raster or value
USLE erosion control practice factor P (default value or raster)
Default: 0.5
suborder=order
Order of values in .sub file (variables as given as arguments)
Default: salb,sno,chl,chs,chw,chk,chn,ovn,rt,css,ecp,sl,stp,lat,elev0,sdtsav
mainstreams=name
Main streams for each vector, made with m.swim.routing
Default: mainstreams
elevation=name
Elevation raster for slopes
drainage=name
drainage raster from m.swim.subbasins/r.watershed
Default: drainage
accumulation=name
accumulation raster from m.swim.subbasins/r.watershed
Default: accumulation
chl=raster or value
Main channel length, km (blank to calculate, otherwise value or raster)
Default:
chs=raster or value
Main channel slope, m/m (blank to calculate, value or raster)
Default:
chw=raster or value
Main channel width, m (blank to calculate, value or raster)
Default:
chd=raster or value
Main channel depth, m (blank to calculate, value or raster)
Default:
chk=raster or value
Effective hydraulic conductivity of main channel (default value or raster)
Default: 0.37
chn=raster or value
Channel N value (default value or raster)
Default: 0.075
chxk=raster or value
channel USLE K factor (default value or raster)
Default: 0.28
chc=raster or value
channel USLE C factor (default value or raster)
Default: 1
rteorder=order
Order of values in .rte file (see help for values)
Default: chw,chd,chs,chl,chn,chk,chxk,chc
gwht=raster or value
Initial groundwater height, m (default value or raster)
Default: 1
gwq=raster or value
Initial groundwater flow contribution to streamflow, mm (default value or raster)
Default: 0.5
abf=raster or value
Groundwater alpha factor (default value or raster)
Default: 0.048
syld=raster or value
Specific yield of aquifer (default value or raster)
Default: 0.003
delay=raster or value
Groundwater delay, days (default value or raster)
Default: 200
revapc=raster or value
Fraction of root zone percolation to revap (0-1 or raster)
Default: 0.2
rchrgc=raster or value
Fraction of root zone percolation into deep aquifer (0-1 or raster)
Default: 0.05
revapmn=raster or value
Initial revap storage, mm (default value or raster)
Default: 0
gworder=order
Order of values in .gw file (see help for values)
Default: gwht,gwq,abf,syld,delay,revapc,rchrgc,revapmn
dummy=raster or value
Dummy value as fill value and example
Default: 0

DESCRIPTION

The m.swim.substats module creates the SWIM subbasin statistics input files (.sub, .rte, .gw) and the file.cio file. All parameters maybe given as either default value for all subbasins or as a raster map for which subbasin average values are found and written to the files. By using the drainage, accumulation and mainstreams maps produced by the m.swim.subbasins and m.swim.routing modules, it can also compute the main channel length, slope, depth and width. These four parameters are computed as follows:
Raster maps with subbasin mean values are created implicitly and the values are uploaded to the subbasin table with the following names: mainChannelLength, mainChannelSlope, channelDepth, channelWidth This allows a faster recalculation by setting the arguments chl, chs, chd, chw to these names.

For all other parameters default values are given that apply to all subbasins, except for the USLE slope length and steepness, for which the output of the m.swim.subbasins or r.watershed is used to calculate average values for each subbasin.

NOTES

All parameter arguments are the same as their variable names in the SWIM code.

Although this module has been tested, it is still in beta mode and hasn't been extensively error coded. Please report unexplained errors to the author (see below).

EXAMPLE

Setting up a SWIM project in the North Carolina (basic) testing location:

Create a new mapset and set region:
g.mapset -c mapset=subbasins
g.region rast=elevation@PERMANENT

Stations

Create a stations point vector map:
echo "640579|215607|outlet|0.1
640388|216617|headwater|0.05" > stations.dat
v.in.ascii input=stations.dat out=stations x=1 y=2 columns='x int, y int, name varchar(20), subbsize double'

Subbasins

Make subbasins (default output arguments):
m.swim.subbasins elevation=elevation@PERMANENT stations=stations upthresh=0.1 subbasins=subbasins slopesteepness=slopesteepness slopelength=slopelength

In addition to the subbasins vector and raster map, this also produces catchment raster and vector maps, accumulation, drainage, streams, slopesteepness and slopelength rasters (as needed by the subsequent m.swim.* modules) by default.

Routing

Calculate the routing structure, routing network and mainstreams (the output defaults are: mainstreams=mainstreams, routingnet=routingnetwork, outlets=subbasinoutlets, inlets=subbasininlets; which can also be set explicitly):
m.swim.routing subbasins=subbasins accumulation=accumulation mainstreams=mainstreams

Subbasin statistics

Create the subbasin statistics files in a Sub folder and the file.cio in the projectpath with all default input (mainstreams, drainage, accumulation,  stp and sl also have default values but included here to emphasise that they are needed as input):
m.swim.substats subbasins=subbasins projectname=mypro projectpath=. elevation=elevation@PERMANENT \
mainstreams=mainstreams drainage=drainage accumulation=accumulation stp=slopesteepness sl=slopelength
When recalculating or changing parameters, the calculation can be accelerated by setting chl, chs, chd, chw explicitly:
m.swim.substats subbasins=subbasins projectname=mypro projectpath=. elevation=elevation@PERMANENT \
delay=geology@PERMANENT chl=mainChannelLength chs=mainChannelSlope chd=channelDepth chw=channelWidth

SEE ALSO

m.swim.subbasins, r.watershed, m.swim.hydrotopes, m.swim.routing

Documentation [external]: m.swim

AUTHORS

Michel Wortmann, Potsdam Institute for Climate Impact Research (wortmann@pik-potsdam.de)

Last updated (docs/code): Mon Dec 2 15:41:04 2019 +0100 / Wed Jan 19 23:04:38 2022 +0000