hydrological_modules package

Initialize

miscInitial module

Initializing some variables

class cwatm.hydrological_modules.miscInitial.miscInitial(model)[source]

Bases: object

Miscellaneous repeatedly used expressions Definition if cell area comes from regular grid e.g. 5x5km or from irregular lat/lon Conversion factors between m3 and mm etc.

Note

Only used in the initial phase.

Global variables

Variable [self.var]

Description

Unit

cellArea

Area of cell

m2

DtSec

number of seconds per timestep (default = 86400)

s

twothird

2/3

MtoM3

Coefficient to change units

InvDtSec

InvCellArea

Inverse of cell area of each simulated mesh

1/m2

DtDay

seconds in a timestep (default=86400)

s

InvDtDay

inverse seconds in a timestep (default=86400)

1/s

MMtoM

Coefficient to change units

MtoMM

Coefficient to change units

M3toM

Coefficient to change units

con_precipitation

conversion factor for precipitation

con_e

conversion factor for evaporation

Functions

initial()[source]

Initialization of some basic parameters e.g. cellArea

  • grid area, length definition

  • conversion factors

  • conversion factors for precipitation and pot evaporation

initcondition module

Load initial storage parameter maps

class cwatm.hydrological_modules.initcondition.initcondition(model)[source]

Bases: object

READ/WRITE INITIAL CONDITIONS all initial condition can be stored at the end of a run to be used as a warm start for a following up run

Global variables

Variable [self.var]

Description

Unit

modflow

Flag: True if modflow_coupling = True in settings file

Crops_names

Internal: List of specific crops

includeCrops

1 when includeCrops=True in Settings, 0 otherwise

bool

Crops

Internal: List of specific crops and Kc/Ky parameters

includeDesal

unlimitedDesal

desalAnnualCap

reservoir_transfers

[[‘Giving reservoir’][i], [‘Receiving reservoir’][i], [‘Fraction of li

array

wwt_def

wastewater_to_reservoirs

loadInit

Flag: if true initial conditions are loaded

initLoadFile

load file name of the initial condition data

saveInit

Flag: if true initial conditions are saved

saveInitFile

save file name of the initial condition data

coverTypes

land cover types - forest - grassland - irrPaddy - irrNonPaddy - water

Functions

crops_initialise(xl_settings_file_path)[source]
desalinationCapacity(xl_settings_file_path)[source]
dynamic()[source]

Dynamic part of the initcondition module write initital conditions into a single netcdf file

Note

Several dates can be stored in different netcdf files

initial()[source]
initial part of the initcondition module

Puts all the variables which has to be stored in 2 lists:

  • initCondVar: the name of the variable in the init netcdf file

  • initCondVarValue: the variable as it can be read with the ‘eval’ command

Reads the parameter save_initial and save_initial to know if to save or load initial values

reservoir_transfers(xl_settings_file_path)[source]
wasterwater_def(xl_settings_file_path)[source]
wastewater_to_reservoirs(xl_settings_file_path)[source]

landcoverType module

Generate landcover types

cwatm.hydrological_modules.landcoverType.decompress(map, nanvalue=None)[source]

Decompressing CWatM maps from 1D to 2D with missing values

Parameters

map – compressed map

Returns

decompressed 2D map

class cwatm.hydrological_modules.landcoverType.landcoverType(model)[source]

Bases: object

LAND COVER TYPE

runs the 6 land cover types through soil procedures

This routine calls the soil routine for each land cover type

Global variables

Variable [self.var]

Description

Unit

modflow

Flag: True if modflow_coupling = True in settings file

snowEvap

total evaporation from snow for a snow layers

m

load_initial

Settings initLoad holds initial conditions for variables

input

topwater

quantity of water above the soil (flooding)

m

waterBodyID

lakes/reservoirs map with a single ID for each lake/reservoir

compress_LR

boolean map as mask map for compressing lake/reservoir

decompress_LR

boolean map as mask map for decompressing lake/reservoir

MtoM3C

conversion factor from m to m3 (compressed map)

waterBodyTypTemp

maxGWCapRise

influence of capillary rise above groundwater level

m

minCropKC

minimum crop factor (default 0.2)

irrigatedArea_original

frac_totalnonIrr

Fraction sown with specific non-irrigated crops

%

frac_totalIrr_max

Fraction sown with specific irrigated crops, maximum throughout simula

%

frac_totalnonIrr_max

Fraction sown with specific non-irrigated crops, maximum throughout si

%

GeneralCrop_Irr

Fraction of irrigated land class sown with generally representative cr

%

fallowIrr

Fraction of fallowed irrigated land

%

fallowIrr_max

Fraction of fallowed irrigated land, maximum throughout simulation

%

GeneralCrop_nonIrr

Fraction of grasslands sown with generally representative crop

%

fallownonIrr

Fraction of fallowed non-irrigated land

%

fallownonIrr_max

Fraction of fallowed non-irrigated land, maximum throughout simulation

%

availableArableLand

Fraction of land not currently planted with specific crops

%

sum_gwRecharge

groundwater recharge

m

minInterceptCap

Maximum interception read from file for forest and grassland land cove

m

interceptStor

simulated vegetation interception storage

m

availWaterInfiltration

quantity of water reaching the soil after interception, more snowmelt

m

lakeStorage

resStorage

riverbedExchangeM

Flow from channel into groundwater

m

leakageIntoGw

Canal leakage leading to groundwater recharge

m

leakageIntoRunoff

Canal leakage leading to runoff

m

dynamicLandcover

staticLandCoverMaps

1=staticLandCoverMaps in settings file is True, 0=otherwise

landcoverSum

sum_interceptStor

Total of simulated vegetation interception storage including all landc

m

minTopWaterLayer

maxRootDepth

rootDepth

KSat1

KSat2

KSat3

alpha1

alpha2

alpha3

lambda1

lambda2

lambda3

thetas1

thetas2

thetas3

thetar1

thetar2

thetar3

genuM1

genuM2

genuM3

genuInvM1

genuInvM2

genuInvM3

ws1

Maximum storage capacity in layer 1

m

ws2

Maximum storage capacity in layer 2

m

ws3

Maximum storage capacity in layer 3

m

wres1

Residual storage capacity in layer 1

m

wres2

Residual storage capacity in layer 2

m

wres3

Residual storage capacity in layer 3

m

wrange1

wrange2

wrange3

wfc1

Soil moisture at field capacity in layer 1

wfc2

Soil moisture at field capacity in layer 2

wfc3

Soil moisture at field capacity in layer 3

wwp1

Soil moisture at wilting point in layer 1

wwp2

Soil moisture at wilting point in layer 2

wwp3

Soil moisture at wilting point in layer 3

kUnSat3FC

kunSatFC12

kunSatFC23

rootFraction1

cropCoefficientNC_filename

interceptCapNC_filename

coverFractionNC_filename

sum_topwater

quantity of water on the soil (flooding) (weighted sum for all landcov

m

sum_soil

sum_w1

sum_w2

sum_w3

totalSto

Total soil,snow and vegetation storage for each cell including all lan

m

arnoBetaOro

chosen ModFlow model timestep (1day, 7days, 30days, etc.)

arnoBeta

adjRoot

maxtopwater

maximum heigth of topwater

m

totAvlWater

Field capacity minus wilting point in soil layers 1 and 2

m

fracGlacierCover

pretotalSto

Previous totalSto

m

prefFlow_GW

Preferential flow to groundwater. sum_prefFlow goes either to groundwa

m

sum_prefFlow

Preferential flow from soil to groundwater (summed up for all land cov

m

sum_perc3toGW

Percolation from 3rd soil layer to groundwater (summed up for all land

m

perc3toGW_GW

Percolation from 3rd soil layer to groundwater. sum_perc3toGW goes eit

m

riverbedExchangeM3

lakebedExchangeM

Flow of water from lakes and reservoirs into groundwater

m

sum_actBareSoilEvap

sum_openWaterEvap

sum_runoff

Runoff above the soil, more interflow, including all landcover types

m

sum_directRunoff

sum_interflow

GWVolumeVariation

sum_availWaterInfiltration

sum_capRiseFromGW

Capillary rise from groundwater to 3rd soil layer (summed up for all l

m

sum_act_irrConsumption

cellArea

Area of cell

m2

MtoM3

Coefficient to change units

InvCellArea

Inverse of cell area of each simulated mesh

1/m2

Precipitation

Precipitation (input for the model)

m

coverTypes

land cover types - forest - grassland - irrPaddy - irrNonPaddy - water

SnowMelt

total snow melt from all layers

m

Rain

Precipitation less snow

m

prevSnowCover

snow cover of previous day (only for water balance)

m

SnowCover

snow cover (sum over all layers)

m

ElevationStD

frac_totalIrr

Fraction sown with specific irrigated crops

%

soilLayers

Number of soil layers

soildepth

Thickness of the first soil layer

m

w1

Simulated water storage in the layer 1

m

w2

Simulated water storage in the layer 2

m

w3

Simulated water storage in the layer 3

m

baseflow

simulated baseflow (= groundwater discharge to river)

m

capriseindex

soildepth12

Total thickness of layer 2 and 3

m

leakageriver_factor

leakagelake_factor

modflow_timestep

Chosen ModFlow model timestep (1day, 7days, 30days, etc.)

wwtUrbanLeakage

wwtColArea

urbanleak

fracVegCover

Fraction of specific land covers (0=forest, 1=grasslands, etc.)

%

includeWastewater

lakeVolumeM3C

compressed map of lake volume

m3

lakeStorageC

reservoirStorageM3C

lakeResStorageC

lakeResStorage

act_SurfaceWaterAbstract

Surface water abstractions

m

readAvlChannelStorageM

leakageCanals_M

addtoevapotrans

Irrigation application loss to evaporation

m

act_irrWithdrawal

Irrigation withdrawals

m

act_nonIrrConsumption

Non-irrigation consumption

m

returnFlow

totalET

Total evapotranspiration for each cell including all landcover types

m

sum_actTransTotal

sum_interceptEvap

Functions

dynamic()[source]

Dynamic part of the land cover type module

Calculating soil for each of the 6 land cover class

  • calls evaporation_module.dynamic

  • calls interception_module.dynamic

  • calls soil_module.dynamic

  • calls sealed_water_module.dynamic

And sums every thing up depending on the land cover type fraction

dynamic_fracIrrigation(init=False, dynamic=True)[source]

Dynamic part of the land cover type module

Calculating fraction of land cover

  • loads the fraction of landcover for each year from netcdf maps

  • calculate the fraction of 6 land cover types based on the maps

Parameters
  • init – (optional) True: set for the first time of a run

  • dynamic – used in the dynmic run not in the initial phase

Returns

initial()[source]

Initial part of the land cover type module Initialise the six land cover types

  • Forest No.0

  • Grasland/non irrigated land No.1

  • Paddy irrigation No.2

  • non-Paddy irrigation No.3

  • Sealed area No.4

  • Water covered area No.5

And initialize the soil variables

Hydrology I - from rain to soil

readmeteo module

Read meteorological input data

class cwatm.hydrological_modules.readmeteo.readmeteo(model)[source]

Bases: object

READ METEOROLOGICAL DATA

reads all meteorological data from netcdf4 files

Global variables

Variable [self.var]

Description

Unit

DtDay

seconds in a timestep (default=86400)

s

con_precipitation

conversion factor for precipitation

con_e

conversion factor for evaporation

ETRef

potential evapotranspiration rate from reference crop

m

Precipitation

Precipitation (input for the model)

m

only_radition

TMin

minimum air temperature

K

TMax

maximum air temperature

K

Tavg

Input, average air Temperature

K

Rsds

short wave downward surface radiation fluxes

W/m2

EAct

Psurf

Instantaneous surface pressure

Pa

Qair

specific humidity

kg/kg

Rsdl

long wave downward surface radiation fluxes

W/m2

Wind

wind speed

m/s

EWRef

potential evaporation rate from water surface

m

meteomapsscale

if meteo maps have the same extend as the other spatial static maps ->

meteodown

if meteo maps should be downscaled

InterpolationMethod

buffer

preMaps

choose between steady state precipitation maps for steady state modflo

tempMaps

choose between steady state temperature maps for steady state modflow

evaTMaps

choose between steady state ETP water maps for steady state modflow or

eva0Maps

choose between steady state ETP reference maps for steady state modflo

glaciermeltMaps

glacierrainMaps

wc2_tavg

High resolution WorldClim map for average temperature

K

wc4_tavg

upscaled to low resolution WorldClim map for average temperature

K

wc2_tmin

High resolution WorldClim map for min temperature

K

wc4_tmin

upscaled to low resolution WorldClim map for min temperature

K

wc2_tmax

High resolution WorldClim map for max temperature

K

wc4_tmax

upscaled to low resolution WorldClim map for max temperature

K

wc2_prec

High resolution WorldClim map for precipitation

m

wc4_prec

upscaled to low resolution WorldClim map for precipitation

m

xcoarse_prec

ycoarse_prec

xfine_prec

yfine_prec

meshlist_prec

xcoarse_tavg

ycoarse_tavg

xfine_tavg

yfine_tavg

meshlist_tavg

meteo

prec

precipitation in m

m

temp

average temperature in Celsius deg

°C

WtoMJ

Conversion factor from [W] to [MJ] for radiation: 86400 * 1E-6

includeGlaciers

includeOnlyGlaciersMelt

GlacierMelt

GlacierRain

Functions

downscaling2(input, downscaleName='', wc2=0, wc4=0, x=None, y=None, xfine=None, yfine=None, meshlist=None, MaskMapBoundaries=None, downscale=0)[source]

Downscaling based on Delta method:

Parameters
  • input – low input map

  • downscaleName – High resolution monthly map from WorldClim

  • wc2 – High resolution WorldClim map

  • wc4 – upscaled to low resolution

  • MaskMapBoundaries – if 1 maskmap does not touch meteo input dataset boundary, if 0 maskmap touches it

  • downscale – 0 for no change, 1: for temperature , 2 for pprecipitation, 3 for psurf

Returns

input - downscaled input data

Returns

wc2

Returns

wc4

dynamic()[source]

Dynamic part of the readmeteo module

Read meteo input maps from netcdf files

Note

If option calc_evaporation is False only precipitation, avg. temp., and 2 evaporation vlaues are read Otherwise all the variable needed for Penman-Monteith

Note

If option TemperatureInKelvin = True temperature is assumed to be Kelvin instead of Celsius!

initial()[source]

Initial part of meteo

read multiple file of input

inflow module

Read river discharge time series as inflow data

class cwatm.hydrological_modules.inflow.inflow(model)[source]

Bases: object

READ INFLOW HYDROGRAPHS (OPTIONAL) If option “inflow” is set to 1 the inflow hydrograph code is used otherwise dummy code is used

Global variables

Variable [self.var]

Description

Unit

sampleInflow

location of inflow point

lat/l

noinflowpoints

number of inflow points

inflowTs

inflow time series data

m3/s

totalQInM3

total inflow over time (for mass balance calculation)

m3

inflowM3

inflow to basin

m3

DtSec

number of seconds per timestep (default = 86400)

s

QInM3Old

Inflow from previous day

m3

Functions

dynamic()[source]

Dynamic part of the inflow module Use the inflow points to add inflow from time series file(s)

initial()[source]

Initial part of the inflow module Get the inflow points

calls function hydrological_modules.getlocOutpoints() calls function hydrological_modules.join_struct_arrays2()

snow_frost module

Calculate snow and frost

class cwatm.hydrological_modules.snow_frost.snow_frost(model)[source]

Bases: object

RAIN AND SNOW

Domain: snow calculations evaluated for center points of up to 7 sub-pixel snow zones 1 -7 which each occupy a part of the pixel surface

Variables snow and rain at end of this module are the pixel-average snowfall and rain

Global variables

Variable [self.var]

Description

Unit

load_initial

Settings initLoad holds initial conditions for variables

input

fracGlacierCover

DtDay

seconds in a timestep (default=86400)

s

Precipitation

Precipitation (input for the model)

m

Tavg

Input, average air Temperature

K

SnowMelt

total snow melt from all layers

m

Rain

Precipitation less snow

m

prevSnowCover

snow cover of previous day (only for water balance)

m

SnowCover

snow cover (sum over all layers)

m

ElevationStD

numberSnowLayersFloat

numberSnowLayers

Number of snow layers (up to 10)

glaciertransportZone

Number of layers which can be mimiced as glacier transport zone

deltaInvNorm

Quantile of the normal distribution (for different numbers of snow lay

frac_snow_redistribution

DeltaTSnow

Temperature lapse rate x std. deviation of elevation

°C

SnowDayDegrees

day of the year to degrees: 360/365.25 = 0.9856

SeasonalSnowMeltSin

excludeGlacierArea

summerSeasonStart

day when summer season starts = 165

IceDayDegrees

days of summer (15th June-15th Sept.) to degree: 180/(259-165)

SnowSeason

seasonal melt factor

m (Ce

TempSnowLow

Temperature below which all precipitation is snow

°C

TempSnowHigh

Temperature above which all precipitation is rain

°C

TempSnow

Average temperature at which snow melts

°C

SnowFactor

Multiplier applied to precipitation that falls as snow

SnowMeltCoef

Snow melt coefficient - default: 0.004

IceMeltCoef

Ice melt coefficnet - default 0.007

TempMelt

Average temperature at which snow melts

°C

SnowCoverS

snow cover for each layer

m

Kfrost

Snow depth reduction coefficient, (HH, p. 7.28)

m-1

Afrost

Daily decay coefficient, (Handbook of Hydrology, p. 7.28)

FrostIndexThreshold

Degree Days Frost Threshold (stops infiltration, percolation and capil

SnowWaterEquivalent

Snow water equivalent, (based on snow density of 450 kg/m3) (e.g. Tarb

FrostIndex

FrostIndex - Molnau and Bissel (1983), A Continuous Frozen Ground Inde

extfrostindex

Flag for second frostindex

FrostIndexThreshold2

FrostIndex2 - Molnau and Bissel (1983), A Continuous Frozen Ground Ind

frostInd1

forstindex 1

frostInd2

frostindex 2

frostindexS

array for frostindex

Snow

Snow (equal to a part of Precipitation)

m

snow_redistributed_previous

SnowM1

IceM1

fracVegCover

Fraction of specific land covers (0=forest, 1=grasslands, etc.)

%

Functions

dynamic()[source]

Dynamic part of the snow module

Distinguish between rain/snow and calculates snow melt and glacier melt The equation is a modification of:

References

Speers, D.D., Versteeg, J.D. (1979) Runoff forecasting for reservoir operations - the pastand the future. In: Proceedings 52nd Western Snow Conference, 149-156

Frost index in soil [degree days] based on:

References

Molnau and Bissel (1983, A Continuous Frozen Ground Index for Flood Forecasting. In: Maidment, Handbook of Hydrology, p. 7.28, 7.55)

initial()[source]

Initial part of the snow and frost module

  • loads all the parameters for the day-degree approach for rain, snow and snowmelt

  • loads the parameter for frost

evaporationPot module

Calculate potential Evaporation

class cwatm.hydrological_modules.evaporationPot.evaporationPot(model)[source]

Bases: object

POTENTIAL REFERENCE EVAPO(TRANSPI)RATION Calculate potential evapotranspiration from climate data mainly based on FAO 56 and LISVAP Based on Penman Monteith

References

http://www.fao.org/docrep/X0490E/x0490e08.htm#penman%20monteith%20equation http://www.fao.org/docrep/X0490E/x0490e06.htm http://www.fao.org/docrep/X0490E/x0490e06.htm https://ec.europa.eu/jrc/en/publication/eur-scientific-and-technical-research-reports/lisvap-evaporation-pre-processor-lisflood-water-balance-and-flood-simulation-model

Global variables

Variable [self.var]

Description

Unit

cropCorrect

calibration factor of crop KC factor

pet_modus

Flag: index which ETP approach is used e.g. 1 for Penman-Monteith

bool

AlbedoCanopy

Albedo of vegetation canopy (FAO,1998) default =0.23

AlbedoSoil

Albedo of bare soil surface (Supit et. al. 1994) default = 0.15

AlbedoWater

Albedo of water surface (Supit et. al. 1994) default = 0.05

dem

lat

co2

albedoLand

albedo from land surface (from GlobAlbedo database)

albedoOpenWater

albedo from open water surface (from GlobAlbedo database)

ETRef

potential evapotranspiration rate from reference crop

m

only_radition

TMin

minimum air temperature

K

TMax

maximum air temperature

K

Tavg

Input, average air Temperature

K

Rsds

short wave downward surface radiation fluxes

W/m2

EAct

Psurf

Instantaneous surface pressure

Pa

Qair

specific humidity

kg/kg

Rsdl

long wave downward surface radiation fluxes

W/m2

Wind

wind speed

m/s

EWRef

potential evaporation rate from water surface

m

Functions

dynamic()[source]

Dynamic part of the potential evaporation module

Returns

  • ETRef - potential reference evapotranspiration rate [m/day]

  • EWRef - potential evaporation rate from water surface [m/day]

dynamic_1()[source]

Dynamic part of the potential evaporation module Based on Penman Monteith - FAO 56

dynamic_2()[source]

Dynamic part of the potential evaporation module 2: Milly and Dunne method P. C. D. Milly* and K. A. Dunne, 2016: Potential evapotranspiration and continental drying, Nature Climate Change, DOI: 10.1038/NCLIMATE3046 Energy only PET = 0.8(Rn ? ) equation 8

dynamic_4()[source]

Dynamic part of the potential evaporation module 4. Priestley-Taylor 1.26 * delat https://wetlandscapes.github.io/blog/blog/penman-monteith-and-priestley-taylor/ uses only tmin, tmax, tavg, rsds, rlds (or rsd)

initial()[source]

Initial part of evaporation type module Load inictial parameters

Note

Only run if calc_evaporation is True

initial_1()[source]

Initial part of evaporation type module Load initial parameters 1: Penman Monteith 2: Milly and Dunne method P. C. D. Milly* and K. A. Dunne, 2016: Potential evapotranspiration and continental drying, Nature Climate Change, DOI: 10.1038/NCLIMATE3046 Energy only PET: ET=0.8(Rn ?) equation 8 3: Yang et al. Penman Montheith correction method Yang, Y., Roderick, M. L., Zhang, S., McVicar, T. R., and Donohue, R. J.: Hydrologic implications of vegetation response to elevated CO2 in climate projections, Nat. Clim. Change, 9, 44-48, 10.1038/s41558-018-0361-0, 2019. Equation 14: where the term 2.14 accounts for changing [CO2] on rs

evaporation module

Calculate actual evapotranspiration

class cwatm.hydrological_modules.evaporation.evaporation(model)[source]

Bases: object

Evaporation module Calculate potential evaporation and pot. transpiration

Global variables

Variable [self.var]

Description

Unit

snowEvap

total evaporation from snow for a snow layers

m

cropKC_landCover

Crops_names

Internal: List of specific crops

activatedCrops

load_initial

Settings initLoad holds initial conditions for variables

input

fracCrops_nonIrr

Fraction of cell currently planted with specific non-irr crops

monthCounter

fracCrops_IrrLandDemand

fracCrops_nonIrrLandDemand

ratio_a_p_nonIrr

Ratio actual to potential evapotranspiration, monthly, non-irrigated [

%

totalPotET_month

ratio_a_p_Irr

Ratio actual to potential evapotranspiration, monthly [crop specific]

%

Yield_nonIrr

Relative monthly non-irrigated yield [crop specific]

%

currentKY

Yield sensitivity coefficient [crop specific]

Posit

Yield_Irr

Relative monthly irrigated yield [crop specific]

%

currentKC

Current crop coefficient for specific crops

generalIrrCrop_max

generalnonIrrCrop_max

weighted_KC_nonIrr

weighted_KC_Irr

weighted_KC_Irr_woFallow_fullKc

_weighted_KC_Irr

weighted_KC_Irr_woFallow

PotET_crop

totalPotET_month_segment

PotETaverage_crop_segments

areaCrops_Irr_segment

areaCrops_nonIrr_segment

areaPaddy_Irr_segment

Precipitation_segment

availableArableLand_segment

cropCorrect

calibration factor of crop KC factor

includeCrops

1 when includeCrops=True in Settings, 0 otherwise

bool

Crops

Internal: List of specific crops and Kc/Ky parameters

potTranspiration

Potential transpiration (after removing of evaporation)

m

cropKC

crop coefficient for each of the 4 different land cover types (forest,

minCropKC

minimum crop factor (default 0.2)

irrigatedArea_original

frac_totalnonIrr

Fraction sown with specific non-irrigated crops

%

frac_totalIrr_max

Fraction sown with specific irrigated crops, maximum throughout simula

%

frac_totalnonIrr_max

Fraction sown with specific non-irrigated crops, maximum throughout si

%

GeneralCrop_Irr

Fraction of irrigated land class sown with generally representative cr

%

fallowIrr

Fraction of fallowed irrigated land

%

fallowIrr_max

Fraction of fallowed irrigated land, maximum throughout simulation

%

GeneralCrop_nonIrr

Fraction of grasslands sown with generally representative crop

%

fallownonIrr

Fraction of fallowed non-irrigated land

%

fallownonIrr_max

Fraction of fallowed non-irrigated land, maximum throughout simulation

%

availableArableLand

Fraction of land not currently planted with specific crops

%

cellArea

Area of cell

m2

ETRef

potential evapotranspiration rate from reference crop

m

Precipitation

Precipitation (input for the model)

m

SnowMelt

total snow melt from all layers

m

Rain

Precipitation less snow

m

prevSnowCover

snow cover of previous day (only for water balance)

m

SnowCover

snow cover (sum over all layers)

m

potBareSoilEvap

potential bare soil evaporation (calculated with minus snow evaporatio

m

irr_Paddy_month

fracCrops_Irr

Fraction of cell currently planted with specific irrigated crops

%

actTransTotal_month_nonIrr

Internal variable: Running total of transpiration for specific non-ir

m

actTransTotal_month_Irr

Internal variable: Running total of transpiration for specific irriga

m

irr_crop_month

frac_totalIrr

Fraction sown with specific irrigated crops

%

weighted_KC_nonIrr_woFallow

totalPotET

Potential evaporation per land use class

m

fracVegCover

Fraction of specific land covers (0=forest, 1=grasslands, etc.)

%

adminSegments

Domestic agents

Int

Functions

dynamic(coverType, No)[source]

Dynamic part of the soil module

calculating potential Evaporation for each land cover class with kc factor get crop coefficient, use potential ET, calculate potential bare soil evaporation and transpiration

Parameters
  • coverType – Land cover type: forest, grassland …

  • No – number of land cover type: forest = 0, grassland = 1 …

Returns

potential evaporation from bare soil, potential transpiration

interception module

Calculate interception

class cwatm.hydrological_modules.interception.interception(model)[source]

Bases: object

INTERCEPTION

Global variables

Variable [self.var]

Description

Unit

snowEvap

total evaporation from snow for a snow layers

m

potTranspiration

Potential transpiration (after removing of evaporation)

m

interceptCap

interception capacity of vegetation

m

interceptEvap

simulated evaporation from water intercepted by vegetation

m

minInterceptCap

Maximum interception read from file for forest and grassland land cove

m

interceptStor

simulated vegetation interception storage

m

availWaterInfiltration

quantity of water reaching the soil after interception, more snowmelt

m

twothird

2/3

EWRef

potential evaporation rate from water surface

m

SnowMelt

total snow melt from all layers

m

Rain

Precipitation less snow

m

actualET

simulated evapotranspiration from soil, flooded area and vegetation

m

Functions

dynamic(coverType, No)[source]

Dynamic part of the interception module calculating interception for each land cover class

Parameters
  • coverType – Land cover type: forest, grassland …

  • No – number of land cover type: forest = 0, grassland = 1 …

Returns

interception evaporation, interception storage, reduced pot. transpiration

sealed_water module

Calculate water runoff from impermeable surface

class cwatm.hydrological_modules.sealed_water.sealed_water(model)[source]

Bases: object

Sealed and open water runoff

calculated runoff from impermeable surface (sealed) and into water bodies

Global variables

Variable [self.var]

Description

Unit

modflow

Flag: True if modflow_coupling = True in settings file

availWaterInfiltration

quantity of water reaching the soil after interception, more snowmelt

m

EWRef

potential evaporation rate from water surface

m

actualET

simulated evapotranspiration from soil, flooded area and vegetation

m

directRunoff

Simulated surface runoff

m

openWaterEvap

Simulated evaporation from open areas

m

actTransTotal

Total actual transpiration from the three soil layers

m

actBareSoilEvap

Simulated evaporation from the first soil layer

m

capillar

Flow from groundwater to the third CWATM soil layer. Used with MODFLOW

m

Functions

dynamic(coverType, No)[source]

Dynamic part of the sealed_water module

runoff calculation for open water and sealed areas

Hydrology II - from soil to river

soil module

Calculate fluxes in 3 layer soil

class cwatm.hydrological_modules.soil.soil(model)[source]

Bases: object

SOIL

Calculation vertical transfer of water based on Arno scheme

Global variables

Variable [self.var]

Description

Unit

capRiseFrac

fraction of a grid cell where capillar rise may happen

m

modflow

Flag: True if modflow_coupling = True in settings file

snowEvap

total evaporation from snow for a snow layers

m

fracCrops_nonIrr

Fraction of cell currently planted with specific non-irr crops

currentKC

Current crop coefficient for specific crops

weighted_KC_Irr_woFallow_fullKc

weighted_KC_Irr_woFallow

storGroundwater

Groundwater storage (non-fossil). This is primarily used when not usin

m

includeCrops

1 when includeCrops=True in Settings, 0 otherwise

bool

Crops

Internal: List of specific crops and Kc/Ky parameters

potTranspiration

Potential transpiration (after removing of evaporation)

m

interceptEvap

simulated evaporation from water intercepted by vegetation

m

cropKC

crop coefficient for each of the 4 different land cover types (forest,

topwater

quantity of water above the soil (flooding)

m

minCropKC

minimum crop factor (default 0.2)

availWaterInfiltration

quantity of water reaching the soil after interception, more snowmelt

m

rootDepth

KSat1

KSat2

KSat3

genuM1

genuM2

genuM3

genuInvM1

genuInvM2

genuInvM3

ws1

Maximum storage capacity in layer 1

m

ws2

Maximum storage capacity in layer 2

m

ws3

Maximum storage capacity in layer 3

m

wres1

Residual storage capacity in layer 1

m

wres2

Residual storage capacity in layer 2

m

wres3

Residual storage capacity in layer 3

m

wrange1

wrange2

wrange3

wfc1

Soil moisture at field capacity in layer 1

wfc2

Soil moisture at field capacity in layer 2

wfc3

Soil moisture at field capacity in layer 3

wwp1

Soil moisture at wilting point in layer 1

wwp2

Soil moisture at wilting point in layer 2

wwp3

Soil moisture at wilting point in layer 3

kunSatFC12

kunSatFC23

arnoBeta

adjRoot

maxtopwater

maximum heigth of topwater

m

cellArea

Area of cell

m2

EWRef

potential evaporation rate from water surface

m

FrostIndexThreshold

Degree Days Frost Threshold (stops infiltration, percolation and capil

FrostIndex

FrostIndex - Molnau and Bissel (1983), A Continuous Frozen Ground Inde

potBareSoilEvap

potential bare soil evaporation (calculated with minus snow evaporatio

m

irr_Paddy_month

fracCrops_Irr

Fraction of cell currently planted with specific irrigated crops

%

actTransTotal_month_nonIrr

Internal variable: Running total of transpiration for specific non-ir

m

actTransTotal_month_Irr

Internal variable: Running total of transpiration for specific irriga

m

irr_crop_month

frac_totalIrr

Fraction sown with specific irrigated crops

%

weighted_KC_nonIrr_woFallow

totalPotET

Potential evaporation per land use class

m

actualET

simulated evapotranspiration from soil, flooded area and vegetation

m

soilLayers

Number of soil layers

soildepth

Thickness of the first soil layer

m

w1

Simulated water storage in the layer 1

m

w2

Simulated water storage in the layer 2

m

w3

Simulated water storage in the layer 3

m

directRunoff

Simulated surface runoff

m

interflow

Simulated flow reaching runoff instead of groundwater

m

openWaterEvap

Simulated evaporation from open areas

m

actTransTotal

Total actual transpiration from the three soil layers

m

actBareSoilEvap

Simulated evaporation from the first soil layer

m

percolationImp

Fraction of area covered by the corresponding landcover type

m

cropGroupNumber

soil water depletion fraction, Van Diepen et al., 1988: WOFOST 6.0, p.

cPrefFlow

Factor influencing preferential flow (flow from surface to GW)

pumping_actual

gwdepth_observations

Input, gw_depth_observations, groundwater depth observations

m

gwdepth_adjuster

Groundwater depth adjuster

m

rws

Transpiration reduction factor (in case of water stress)

prefFlow

Flow going directly from soil surface to groundwater [land class speci

m

infiltration

Water actually infiltrating the soil

m

capRiseFromGW

Simulated capillary rise from groundwater

m

NoSubSteps

Number of sub steps to calculate soil percolation

perc1to2

Simulated water flow from soil layer 1 to soil layer 2

m

perc2to3

Simulated water flow from soil layer 2 to soil layer 3

m

perc3toGW

Simulated water flow from soil layer 3 to groundwater

m

theta1

fraction of water in soil compartment 1 for each land use class

theta2

fraction of water in soil compartment 2 for each land use class

theta3

fraction of water in soil compartment 3 for each land use class

actTransTotal_forest

Transpiration from forest land cover

m

actTransTotal_grasslands

Transpiration from grasslands land cover

m

actTransTotal_paddy

Transpiration from paddy land cover

m

actTransTotal_nonpaddy

Transpiration from non-paddy land cover

m

actTransTotal_crops_Irr

Transpiration associated with specific irrigated crops

m

actTransTotal_crops_nonIrr

Transpiration associated with specific non-irr crops

m

irr_crop

irrM3_crop_month_segment

irrM3_Paddy_month_segment

gwRecharge

groundwater recharge

m

baseflow

simulated baseflow (= groundwater discharge to river)

m

capillar

Flow from groundwater to the third CWATM soil layer. Used with MODFLOW

m

capriseindex

soildepth12

Total thickness of layer 2 and 3

m

fracVegCover

Fraction of specific land covers (0=forest, 1=grasslands, etc.)

%

adminSegments

Domestic agents

Int

act_irrConsumption

actual irrigation water consumption

m

act_irrNonpaddyWithdrawal

non-paddy irrigation withdrawal

m

act_irrPaddyWithdrawal

paddy irrigation withdrawal

m

Functions

dynamic(coverType, No)[source]

Dynamic part of the soil module

For each of the land cover classes the vertical water transport is simulated Distribution of water holding capiacity in 3 soil layers based on saturation excess overland flow, preferential flow Dependend on soil depth, soil hydraulic parameters

initial()[source]

Initial part of the soil module

  • Initialize all the hydraulic properties of soil

  • Set soil depth

capillarRise module

Calculate capillar rise from groundwater

class cwatm.hydrological_modules.capillarRise.capillarRise(model)[source]

Bases: object

CAPILLAR RISE calculate cell fraction influenced by capillary rise

Global variables

Variable [self.var]

Description

Unit

dzRel0100

relative elevation above flood plains (max elevation above plain)

m

dzRel0090

relative elevation above flood plains (90% elevation above plain)

m

dzRel0080

relative elevation above flood plains (80% elevation above plain)

m

dzRel0070

relative elevation above flood plains (70% elevation above plain)

m

dzRel0060

relative elevation above flood plains (60% elevation above plain)

m

dzRel0050

relative elevation above flood plains (median elevation above plain)

m

dzRel0040

relative elevation above flood plains (40% elevation above plain)

m

dzRel0030

relative elevation above flood plains (30% elevation above plain)

m

dzRel0020

relative elevation above flood plains (20% elevation above plain)

m

dzRel0010

relative elevation above flood plains (10% elevation above plain)

m

dzRel0005

relative elevation above flood plains (5% elevation above plain)

m

dzRel0001

relative elevation above flood plains (1% elevation above plain)

m

capRiseFrac

fraction of a grid cell where capillar rise may happen

m

modflow

Flag: True if modflow_coupling = True in settings file

storGroundwater

Groundwater storage (non-fossil). This is primarily used when not usin

m

specificYield

groundwater reservoir parameters (if ModFlow is not used) used to comp

m

maxGWCapRise

influence of capillary rise above groundwater level

m

Functions

dynamic()[source]

Dynamic part of the capillar Rise module calculate cell fraction influenced by capillary rise depending on appr. height of groundwater and relative elevation of grid cell

Returns

capRiseFrac = cell fraction influenced by capillary rise

groundwater module

Calculate groundwater

class cwatm.hydrological_modules.groundwater.groundwater(model)[source]

Bases: object

GROUNDWATER

Global variables

Variable [self.var]

Description

Unit

modflow

Flag: True if modflow_coupling = True in settings file

load_initial

Settings initLoad holds initial conditions for variables

input

storGroundwater

Groundwater storage (non-fossil). This is primarily used when not usin

m

specificYield

groundwater reservoir parameters (if ModFlow is not used) used to comp

m

recessionCoeff

groundwater storage times this coefficient gives baseflow

frac

readAvlStorGroundwater

same as storGroundwater but equal to 0 when inferior to a treshold

m

prestorGroundwater

storGroundwater at the beginning of each step

m

sum_gwRecharge

groundwater recharge

m

baseflow

simulated baseflow (= groundwater discharge to river)

m

capillar

Flow from groundwater to the third CWATM soil layer. Used with MODFLOW

m

nonFossilGroundwaterAbs

Non-fossil groundwater abstraction. Used primarily without MODFLOW.

m

Functions

dynamic()[source]

Dynamic part of the groundwater module Calculate groundwater storage and baseflow

initial()[source]

Initial part of the groundwater module

  • load parameters from settings file

  • initial groundwater storage

runoff_concentration module

Calculate runoff concentration - from grid cell to grid cell corner

class cwatm.hydrological_modules.runoff_concentration.runoff_concentration(model)[source]

Bases: object

Runoff concentration

this is the part between runoff generation and routing for each gridcell and for each land cover class the generated runoff is concentrated at a corner of a gridcell this concentration needs some lag-time (and peak time) and leads to diffusion lag-time/ peak time is calculated using slope, length and land cover class diffusion is calculated using a triangular-weighting-function

Q(t) = sum_{i=0}^{max} c(i) * Q_{\mathrm{GW}} (t - i + 1)

where c(i) = \int_{i-1}^{i} {2 \over{max}} - | u - {max \over {2}} | * {4 \over{max^2}} du

see also:

http://stackoverflow.com/questions/24040984/transformation-using-triangular-weighting-function-in-python

Global variables

Variable [self.var]

Description

Unit

load_initial

Settings initLoad holds initial conditions for variables

input

leakageIntoRunoff

Canal leakage leading to runoff

m

fracGlacierCover

sum_interflow

cellArea

Area of cell

m2

coverTypes

land cover types - forest - grassland - irrPaddy - irrNonPaddy - water

runoff

includeGlaciers

includeOnlyGlaciersMelt

GlacierMelt

GlacierRain

runoff_peak

peak time of runoff in seconds for each land use class

s

tpeak_interflow

peak time of interflow

s

tpeak_baseflow

peak time of baseflow

s

tpeak_glaciers

maxtime_runoff_conc

maximum time till all flow is at the outlet

s

runoff_conc

runoff after concentration - triangular-weighting method

m

gridcell_storage

sum_landSurfaceRunoff

Runoff concentration above the soil more interflow including all landc

m

landSurfaceRunoff

Runoff concentration above the soil more interflow

m

directRunoffGlacier

directRunoff

Simulated surface runoff

m

interflow

Simulated flow reaching runoff instead of groundwater

m

baseflow

simulated baseflow (= groundwater discharge to river)

m

fracVegCover

Fraction of specific land covers (0=forest, 1=grasslands, etc.)

%

prergridcell

Functions

dynamic()[source]

Dynamic part of the runoff concentration module

For surface runoff for each land cover class and for interflow and for baseflow the runoff concentration time is calculated

Note

the time demanding part is calculated in a c++ library

initial()[source]

Initial part of the runoff concentration module

Setting the peak time for:

  • surface runoff = 3

  • interflow = 4

  • baseflow = 5

based on the slope the concentration time for each land cover type is calculated

Note

only if option includeRunoffConcentration is TRUE

Hydrology III - Socio-economic - Water demand

water_demand.water_demand

Calculate water demand from different sectors

class cwatm.hydrological_modules.water_demand.water_demand.water_demand(model)[source]

Bases: object

WATERDEMAND

Calculating water demand and attributing sources to satisfy demands Industrial, domestic, and livestock are based on precalculated maps Agricultural water demand based on water need by plants

Global variables

Variable [self.var]

Description

Unit

modflow

Flag: True if modflow_coupling = True in settings file

load_initial

Settings initLoad holds initial conditions for variables

input

readAvlStorGroundwater

same as storGroundwater but equal to 0 when inferior to a treshold

m

includeDesal

unlimitedDesal

desalAnnualCap

reservoir_transfers

[[‘Giving reservoir’][i], [‘Receiving reservoir’][i], [‘Fraction of li

array

loadInit

Flag: if true initial conditions are loaded

efficiencyPaddy

Input, irrPaddy_efficiency, paddy irrigation efficiency, the amount of

frac

efficiencyNonpaddy

Input, irrNonPaddy_efficiency, non-paddy irrigation efficiency, the am

frac

returnfractionIrr

Input, irrigation_returnfraction, the fraction of non-efficient water

frac

irrPaddyDemand

Paddy irrigation demand

m

compress_LR

boolean map as mask map for compressing lake/reservoir

decompress_LR

boolean map as mask map for decompressing lake/reservoir

waterBodyID_C

resYearC

Compressed map of resYear

waterBodyTyp_unchanged

resVolumeC

compressed map of reservoir volume

Milli

resId_restricted

waterBodyBuffer

waterBodyBuffer_wwt

reservoir_transfers_net_M3

net reservoir transfers, after exports, transfers, and imports

m3

reservoir_transfers_in_M3

water received into reservoirs

m3

reservoir_transfers_out_M3

water given from reservoirs

m3

reservoir_transfers_from_outside_M3

water received into reservoirs from Outside

m3

reservoir_transfers_to_outside_M3

water given from reservoirs to the Outside

m3

MtoM3C

conversion factor from m to m3 (compressed map)

waterBodyTypCTemp

pot_livestockConsumption

cellArea

Area of cell

m2

MtoM3

Coefficient to change units

InvDtSec

InvCellArea

Inverse of cell area of each simulated mesh

1/m2

M3toM

Coefficient to change units

GW_pumping

Input, True if Groundwater_pumping=True

bool

availableGWStorageFraction

groundwater_storage_available

Groundwater storage. Used with MODFLOW.

m

gwstorage_full

Groundwater storage at full capacity

m

wwtColArea

wwtSewerCollection

wwtOverflowOutM

fracVegCover

Fraction of specific land covers (0=forest, 1=grasslands, etc.)

%

adminSegments

Domestic agents

Int

nonFossilGroundwaterAbs

Non-fossil groundwater abstraction. Used primarily without MODFLOW.

m

includeWastewater

reservoir_transfers_net_M3C

reservoir_transfers_in_M3C

reservoir_transfers_out_M3C

reservoir_transfers_from_outside_M3C

reservoir_transfers_to_outside_M3C

lakeVolumeM3C

compressed map of lake volume

m3

lakeStorageC

reservoirStorageM3C

lakeResStorageC

lakeResStorage

smalllakeVolumeM3

smalllakeStorage

act_SurfaceWaterAbstract

Surface water abstractions

m

readAvlChannelStorageM

leakageCanals_M

addtoevapotrans

Irrigation application loss to evaporation

m

act_irrWithdrawal

Irrigation withdrawals

m

act_nonIrrConsumption

Non-irrigation consumption

m

returnFlow

act_irrConsumption

actual irrigation water consumption

m

act_irrNonpaddyWithdrawal

non-paddy irrigation withdrawal

m

act_irrPaddyWithdrawal

paddy irrigation withdrawal

m

unmetDemand

Unmet groundwater demand to determine potential fossil groundwaterwate

m

act_nonIrrWithdrawal

Non-irrigation withdrawals

m

returnflowIrr

nonIrrReturnFlowFraction

unmet_lost

Fossil water that disappears instead of becoming return flow

m

channelStorage

Channel water storage

m3

act_totalWaterWithdrawal

Total water withdrawals

m

act_bigLakeResAbst

Abstractions to satisfy demands from lakes and reservoirs

m

act_smallLakeResAbst

Abstractions from small lakes at demand location

m

waterdemandFixed

modfPumpingM

activate_domestic_agents

Input, True if activate_domestic_agents = True

bool

domesticDemand

Domestic demand

m

swAbstractionFraction_domestic

With domestic agents, derived from surface water over total water requ

%

demand_unit

pot_domesticConsumption

sectorSourceAbstractionFractions

swAbstractionFraction_Channel_Domesti

Input, Fraction of Domestic demands to be satisfied with Channel

%

swAbstractionFraction_Lift_Domestic

Input, Fraction of Domestic demands to be satisfied with Lift

%

swAbstractionFraction_Res_Domestic

Input, Fraction of Domestic demands to be satisfied with Reservoirs

%

swAbstractionFraction_Lake_Domestic

Input, Fraction of Domestic demands to be satisfied with Lake

%

gwAbstractionFraction_Domestic

Fraction of domestic water demand to be satisfied by groundwater

%

dom_efficiency

envFlow

industryDemand

pot_industryConsumption

ind_efficiency

unmetDemandPaddy

Unmet paddy demand

m

unmetDemandNonpaddy

Unmet nonpaddy demand

m

irrDemand

Cover-specific Irrigation demand

m/m

irrNonpaddyDemand

totalIrrDemand

Irrigation demand

m

livestockDemand

liv_efficiency

wwtEffluentsGenerated

wwtSewerCollection_domestic

wwtSewerCollection_industry

includeIndusDomesDemand

Input, True if includeIndusDomesDemand = True

bool

activate_irrigation_agents

Input, True if activate_irrigation_agents = True

bool

relaxGWagent

relaxSWagent

irrWithdrawalSW_max

irrWithdrawalGW_max

relax_irrigation_agents

relax_abstraction_fraction_initial

waterdemandFixedYear

swAbstractionFraction_Channel_Livesto

Input, Fraction of Livestock demands to be satisfied from Channels

%

swAbstractionFraction_Channel_Industr

Input, Fraction of Industrial water demand to be satisfied by Channels

%

swAbstractionFraction_Channel_Irrigat

Input, Fraction of Irrigation demand to be satisfied from Channels

%

swAbstractionFraction_Lake_Livestock

Input, Fraction of Livestock water demands to be satisfied by Lakes

%

swAbstractionFraction_Lake_Industry

Input, Fraction of Industrial water demand to be satisfied by Lakes

%

swAbstractionFraction_Lake_Irrigation

Input, Fraction of Irrigation demand to be satisfied by Lakes

%

swAbstractionFraction_Res_Livestock

Input, Fraction of Livestock water demands to be satisfied by Reservoi

%

swAbstractionFraction_Res_Industry

Input, Fraction of Industrial water demand to be satisfied by Reservoi

%

swAbstractionFraction_Res_Irrigation

Input, Fraction of Irrigation demand to be satisfied by Reservoirs

%

othAbstractionFraction_Desal_Domestic

othAbstractionFraction_Desal_Livestoc

othAbstractionFraction_Desal_Industry

othAbstractionFraction_Desal_Irrigati

wwtAbstractionFraction_Res_Domestic

wwtAbstractionFraction_Res_Livestock

wwtAbstractionFraction_Res_Industry

wwtAbstractionFraction_Res_Irrigation

gwAbstractionFraction_Livestock

Fraction of livestock water demand to be satisfied by groundwater

%

gwAbstractionFraction_Industry

Fraction of industrial water demand to be satisfied by groundwater

%

gwAbstractionFraction_Irrigation

Fraction of irrigation water demand to be satisfied by groundwater

%

using_reservoir_command_areas

True if using_reservoir_command_areas = True, False otherwise

bool

load_command_areas

load_command_areas_wwt

reservoir_command_areas

reservoir_command_areas_wwt

Water_conveyance_efficiency

segmentArea

segmentArea_wwt

canals

canals_wwt

canalsArea

canalsAreaC

canalsArea_wwt

canalsArea_wwtC

swAbstractionFraction_Lift_Livestock

Input, Fraction of Livestock water demands to be satisfied from Lift a

%

swAbstractionFraction_Lift_Industry

Input, Fraction of Industrial water demand to be satisfied from Lift a

%

swAbstractionFraction_Lift_Irrigation

Input, Fraction of Irrigation demand to be satisfied from Lift areas

%

using_lift_areas

True if using_lift_areas = True in Settings, False otherwise

bool

lift_command_areas

allocSegments

swAbstractionFraction

Input, Fraction of demands to be satisfied with surface water

%

allocation_zone

modflowPumping

leakage

Canal leakage leading to either groundwater recharge or runoff

m3

pumping

Pumping_daily

Groundwater abstraction asked of MODFLOW. modfPumpingM_actual is the r

m

modflowDepth2

modflowTopography

allowedPumping

ratio_irrWithdrawalGW_month

ratio_irrWithdrawalSW_month

act_irrWithdrawalSW_month

Running total agent surface water withdrawals for the month

m

act_irrWithdrawalGW_month

Running total agent groundwater withdrawals for the month

m

Desal_Domestic

Desal_Industry

Desal_Livestock

Desal_Irrigation

Channel_Domestic

Channel water abstracted for domestic

m

Channel_Industry

Channel water abstracted for industry

m

Channel_Livestock

Channel water abstracted for livestock

m

Channel_Irrigation

Channel water abstracted for irrigation

m

Lift_Domestic

Lift_Industry

Lift_Livestock

Lift_Irrigation

wwt_Domestic

wwt_Industry

wwt_Livestock

wwt_Irrigation

Lake_Domestic

Lake_Industry

Lake_Livestock

Lake_Irrigation

Res_Domestic

Res_Industry

Res_Livestock

Res_Irrigation

GW_Domestic

Groundwater withdrawals to satisfy domestic water requests

m

GW_Industry

Groundwater withdrawals to satisfy Industrial water requests

m

GW_Livestock

Groundwater withdrawals to satisfy Livestock water requests

m

GW_Irrigation

Groundwater withdrawals for Irrigation

m

abstractedLakeReservoirM3

Abstractions from lakes and reservoirs at the location of the waterbod

m3

leakage_wwtC_daily

act_bigLakeResAbst_wwt

act_DesalWaterAbstractM

act_totalIrrConsumption

Total irrigation consumption

m

act_totalWaterConsumption

Total water consumption

m

act_indConsumption

Industrial consumption

m

act_domConsumption

Domestic consumption

m

act_livConsumption

Livestock consumptions

m

returnflowNonIrr

nonIrruse

act_indDemand

Industrial demand

m

act_domDemand

Domestic demand

m

act_livDemand

Livestock demands

m

nonIrrDemand

totalWaterDemand

Irrigation and non-irrigation demand

m

act_indWithdrawal

Industrial withdrawal

m

act_domWithdrawal

Domestic withdrawal

m

act_livWithdrawal

Livestock withdrawals

m

pot_GroundwaterAbstract

Potential groundwater abstraction. Primarily used without MODFLOW.

m

WB_elec

Fractions of live storage to be exported from basin

366-d

act_nonpaddyConsumption

Non-paddy irrigation consumption

m

act_paddyConsumption

Paddy consumption

m

pot_nonIrrConsumption

act_DesalWaterAbstractM3

AvlDesalM3

act_channelAbst

Abstractions to satisfy demands from channels

m

metRemainSegment_lift

act_channelAbstract_Lift

Abstractions from the channel in lift areas at the location of the cha

m

abstractedLakeReservoirM3C

Compressed abstractedLakeReservoirM3

m3

remainNeed

act_ResAbst_wwt

act_lakeAbst

Abstractions from lakes at demand location

m

inZero_C

swAbstractionFraction_nonIrr

Input, Fraction of non-irrigation demands to be satisfied with surface

%

act_ResAbst

Abstractions from reservoirs at demand location

m

leakageC_daily

leakageCanalsC_M

act_irrPaddyDemand

paddy irrigation demand

m

act_irrNonpaddyDemand

non-paddy irrigation demand

m

Channel_Domestic_fromZone

Channel_Livestock_fromZone

Channel_Industry_fromZone

Channel_Irrigation_fromZone

GW_Domestic_fromZone

GW_Livestock_fromZone

GW_Industry_fromZone

GW_Irrigation_fromZone

PumpingM3_daily

unmet_lostirr

Fossil water for irrigation that disappears instead of becoming return

m

unmet_lostNonirr

Fossil water for non-irrigation that disappears instead of becoming re

m

wwtEffluentsGenerated_domestic

wwtEffluentsGenerated_industry

wwtSewerCollectedBySoruce

waterabstraction

Functions

dynamic()[source]

Dynamic part of the water demand module

  • calculate the fraction of water from surface water vs. groundwater

  • get non-Irrigation water demand and its return flow fraction

initial()[source]

Initial part of the water demand module

water_demand.domestic

Read water demand for domestic

class cwatm.hydrological_modules.water_demand.domestic.waterdemand_domestic(model)[source]

Bases: object

WATERDEMAND domestic

calculating water demand - domenstic based on precalculated maps

Global variables

Variable [self.var]

Description

Unit

domesticTime

Monthly’ when domesticTimeMonthly = True, and ‘Yearly’ otherwise.

str

domWithdrawalVar

Input, domesticWithdrawalvarname, variable name for netCDF

str

domConsumptionVar

Input, domesticConsuptionvarname, variable name for netCDF

str

domestic_agent_SW_request_month_m3

map of domestic agent surface water request, in million m3 per month

Mm3

domestic_agent_GW_request_month_m3

map of domestic agent groundwater request, in million m3 per month

Mm3

InvCellArea

Inverse of cell area of each simulated mesh

1/m2

M3toM

Coefficient to change units

activate_domestic_agents

Input, True if activate_domestic_agents = True

bool

domesticDemand

Domestic demand

m

swAbstractionFraction_domestic

With domestic agents, derived from surface water over total water requ

%

demand_unit

pot_domesticConsumption

sectorSourceAbstractionFractions

swAbstractionFraction_Channel_Domesti

Input, Fraction of Domestic demands to be satisfied with Channel

%

swAbstractionFraction_Lift_Domestic

Input, Fraction of Domestic demands to be satisfied with Lift

%

swAbstractionFraction_Res_Domestic

Input, Fraction of Domestic demands to be satisfied with Reservoirs

%

swAbstractionFraction_Lake_Domestic

Input, Fraction of Domestic demands to be satisfied with Lake

%

gwAbstractionFraction_Domestic

Fraction of domestic water demand to be satisfied by groundwater

%

dom_efficiency

Functions

dynamic(wd_date)[source]

Dynamic part of the water demand module - domestic read monthly (or yearly) water demand from netcdf and transform (if necessary) to [m/day]

initial()[source]

Initial part of the water demand module

water_demand.industry

Read water demand for industry

class cwatm.hydrological_modules.water_demand.industry.waterdemand_industry(model)[source]

Bases: object

WATERDEMAND domestic

calculating water demand - industry based on precalculated maps

Global variables

Variable [self.var]

Description

Unit

industryTime

Monthly’ when industryTimeMonthly = True, and ‘Yearly’ otherwise.

str

indWithdrawalVar

Settings industryWithdrawalvarname, variable name in industryWaterDema

str

indConsumptionVar

Settings industryConsuptionvarname, variable name in domesticWaterDema

strin

InvCellArea

Inverse of cell area of each simulated mesh

1/m2

M3toM

Coefficient to change units

demand_unit

industryDemand

pot_industryConsumption

ind_efficiency

Functions

dynamic(wd_date)[source]

Dynamic part of the water demand module - industry read monthly (or yearly) water demand from netcdf and transform (if necessary) to [m/day]

initial()[source]

Initial part of the water demand module - industry

water_demand.livestock

Read water demand for livestock

class cwatm.hydrological_modules.water_demand.livestock.waterdemand_livestock(model)[source]

Bases: object

WATERDEMAND livestock

calculating water demand - livestock based on precalculated maps

Global variables

Variable [self.var]

Description

Unit

domesticTime

Monthly’ when domesticTimeMonthly = True, and ‘Yearly’ otherwise.

str

livestockTime

livVar

uselivestock

True if uselivestock=True in Settings, False otherwise

bool

pot_livestockConsumption

InvCellArea

Inverse of cell area of each simulated mesh

1/m2

M3toM

Coefficient to change units

demand_unit

livestockDemand

liv_efficiency

Functions

dynamic(wd_date)[source]

Dynamic part of the water demand module - livestock read monthly (or yearly) water demand from netcdf and transform (if necessary) to [m/day]

initial()[source]

Initial part of the water demand module - livestock

water_demand.irrigation

Calculate water demand for irrigation

class cwatm.hydrological_modules.water_demand.irrigation.waterdemand_irrigation(model)[source]

Bases: object

WATERDEMAND

calculating water demand - irrigation Agricultural water demand based on water need by plants

Global variables

Variable [self.var]

Description

Unit

load_initial

Settings initLoad holds initial conditions for variables

input

cropKC

crop coefficient for each of the 4 different land cover types (forest,

topwater

quantity of water above the soil (flooding)

m

efficiencyPaddy

Input, irrPaddy_efficiency, paddy irrigation efficiency, the amount of

frac

efficiencyNonpaddy

Input, irrNonPaddy_efficiency, non-paddy irrigation efficiency, the am

frac

returnfractionIrr

Input, irrigation_returnfraction, the fraction of non-efficient water

frac

alphaDepletion

Input, alphaDepletion, irrigation aims to alphaDepletion of field capa

frac

minimum_irrigation

Cover-specific irrigation in metres is 0 if less than this, currently

1/m2

pot_irrConsumption

Cover-specific potential irrigation consumption

m/m

fraction_IncreaseIrrigation_Nonpaddy

Input, fraction_IncreaseIrrigation_Nonpaddy, scales pot_irrConsumption

frac

irrPaddyDemand

Paddy irrigation demand

m

availWaterInfiltration

quantity of water reaching the soil after interception, more snowmelt

m

ws1

Maximum storage capacity in layer 1

m

ws2

Maximum storage capacity in layer 2

m

wfc1

Soil moisture at field capacity in layer 1

wfc2

Soil moisture at field capacity in layer 2

wwp1

Soil moisture at wilting point in layer 1

wwp2

Soil moisture at wilting point in layer 2

arnoBeta

maxtopwater

maximum heigth of topwater

m

totAvlWater

Field capacity minus wilting point in soil layers 1 and 2

m

InvCellArea

Inverse of cell area of each simulated mesh

1/m2

totalPotET

Potential evaporation per land use class

m

w1

Simulated water storage in the layer 1

m

w2

Simulated water storage in the layer 2

m

fracVegCover

Fraction of specific land covers (0=forest, 1=grasslands, etc.)

%

unmetDemand

Unmet groundwater demand to determine potential fossil groundwaterwate

m

unmetDemandPaddy

Unmet paddy demand

m

unmetDemandNonpaddy

Unmet nonpaddy demand

m

irrDemand

Cover-specific Irrigation demand

m/m

irrNonpaddyDemand

totalIrrDemand

Irrigation demand

m

Functions

dynamic()[source]

Dynamic part of the water demand module

  • calculate the fraction of water from surface water vs. groundwater

  • get non-Irrigation water demand and its return flow fraction

initial()[source]

Initial part of the water demand module irrigation

water_demand.environmental_need

Read water for environmental need

class cwatm.hydrological_modules.water_demand.environmental_need.waterdemand_environmental_need(model)[source]

Bases: object

WATERDEMAND environment_need

calculating water demand - environmental need based on precalculated maps done before in CWatM

Global variables

Variable [self.var]

Description

Unit

cut_ef_map

if TRUE calculated maps of environmental flow are clipped to the area

bool

use_environflow

envFlowm3s

M3toM

Coefficient to change units

chanLength

Input, Channel length

m

channelAlpha

envFlow

Functions

dynamic()[source]

Dynamic part of the water demand module - environment read monthly (or yearly) water demand from netcdf and transform (if necessary) to [m/day]

initial()[source]

Initial part of the water demand module - environment

Hydrology IV - Lakes, reservoirs and river

lakes_reservoirs module

Calculate water retention in lakes

class cwatm.hydrological_modules.lakes_reservoirs.lakes_reservoirs(model)[source]

Bases: object

LAKES AND RESERVOIRS

Note

Calculate water retention in lakes and reservoirs

Using the Modified Puls approach to calculate retention of a lake See also: LISFLOOD manual Annex 3 (Burek et al. 2013)

for Modified Puls Method the Q(inflow)1 has to be used. It is assumed that this is the same as Q(inflow)2 for the first timestep has to be checked if this works in forecasting mode!

Lake Routine using Modified Puls Method (see Maniak, p.331ff)

{Qin1 + Qin2 \over{2}} - {Qout1 + Qout2 \over{2}} = {S2 - S1 \over{\delta time}}

changed into:

{S2 \over{time + Qout2/2}} = {S1 \over{dtime + Qout1/2}} - Qout1 + {Qin1 + Qin2 \over{2}}

Outgoing discharge (Qout) are linked to storage (S) by elevation.

Now some assumption to make life easier:

1.) storage volume is increase proportional to elevation: S = A * H where: H: elevation, A: area of lake

2.) Q_{\mathrm{out}} = c * b * H^{2.0} (c: weir constant, b: width)

2.0 because it fits to a parabolic cross section see (Aigner 2008) (and it is much easier to calculate (that’s the main reason)

c: for a perfect weir with mu=0.577 and Poleni: {2 \over{3}} \mu * \sqrt{2*g} = 1.7

c: for a parabolic weir: around 1.8

because it is a imperfect weir: C = c * 0.85 = 1.5

results in formular: Q = 1.5 * b * H^2 = a*H^2 -> H = \sqrt{Q/a}

Solving the equation:

{S2 \over{dtime + Qout2/2}} = {S1 \over{dtime + Qout1/2}} - Qout1 + {Qin1 + Qin2 \over{2}}

SI = {S2 \over{dtime}} + {Qout2 \over{2}} = {A*H \over{DtRouting}} + {Q \over{2}} = {A \over{DtRouting*\sqrt{a}* \sqrt{Q}}} + {Q \over{2}}

-> replacement: {A \over{DtSec * \sqrt{a}}} = Lakefactor, Y = \sqrt{Q}

Y^2 + 2 * Lakefactor *Y - 2 * SI=0

solution of this quadratic equation:

Q = (-LakeFactor + \sqrt{LakeFactor^2+2*SI})^2

Global variables

Variable [self.var]

Description

Unit

modflow

Flag: True if modflow_coupling = True in settings file

load_initial

Settings initLoad holds initial conditions for variables

input

wastewater_to_reservoirs

saveInit

Flag: if true initial conditions are saved

waterBodyID

lakes/reservoirs map with a single ID for each lake/reservoir

waterBodyOut

biggest outlet (biggest accumulation of ldd network) of a waterbody

dirUp

river network in upstream direction

ldd_LR

change river network (put pits in where lakes are)

lddCompress_LR

compressed river network lakes/reservoirs (without missing values)

dirUp_LR

river network direction upstream lake/reservoirs

dirupLen_LR

number of bifurcation upstream lake/reservoir

dirupID_LR

index river upstream lake/reservoir

downstruct_LR

river network downstream lake/reservoir

catchment_LR

catchments lake/reservoir

dirDown_LR

river network direktion downstream lake/reservoir

lendirDown_LR

number of river network connections lake/reservoir

compress_LR

boolean map as mask map for compressing lake/reservoir

decompress_LR

boolean map as mask map for decompressing lake/reservoir

waterBodyOutC

compressed map biggest outlet of each lake/reservoir

waterBodyID_C

resYear

Settings waterBodyYear, with first operating year of reservoirs

map

resYearC

Compressed map of resYear

waterBodyTyp

Settings, waterBodyTyp, with waterbody type 1-4

map

waterBodyTyp_unchanged

includeType4

True if there is a reservoir of waterbody type 4 in waterBodyTyp map

bool

waterBodyTypC

water body types 3 reservoirs and lakes (used as reservoirs but before

resVolumeC

compressed map of reservoir volume

Milli

resId_restricted

waterBodyBuffer

waterBodyBuffer_wwt

lakeArea

area of each lake/reservoir

m2

lakeAreaC

compressed map of the area of each lake/reservoir

m2

lakeDis0

compressed map average discharge at the outlet of a lake/reservoir

m3/s

lakeDis0C

average discharge at the outlet of a lake/reservoir

m3/s

lakeAC

compressed map of parameter of channel width, gravity and weir coeffic

reservoir_transfers_net_M3

net reservoir transfers, after exports, transfers, and imports

m3

reservoir_transfers_in_M3

water received into reservoirs

m3

reservoir_transfers_out_M3

water given from reservoirs

m3

reservoir_transfers_from_outside_M3

water received into reservoirs from Outside

m3

reservoir_transfers_to_outside_M3

water given from reservoirs to the Outside

m3

resVolumeOnlyReservoirs

resVolumeOnlyReservoirsC

resVolume

lakeEvaFactorC

compressed map of a factor which increases evaporation from lake becau

reslakeoutflow

lakeVolume

volume of lakes

m3

outLake

outflow from lakes

m

lakeInflow

lakeOutflow

reservoirStorage

MtoM3C

conversion factor from m to m3 (compressed map)

EvapWaterBodyM

Evaporation from lakes and reservoirs

m

lakeResInflowM

lakeResOutflowM

lakedaycorrect

lakeFactor

factor for the Modified Puls approach to calculate retention of the la

lakeFactorSqr

square root factor for the Modified Puls approach to calculate retenti

lakeInflowOldC

inflow to the lake from previous days

m/3

lakeOutflowC

compressed map of lake outflow

m3/s

lakeLevelC

compressed map of lake level

m

conLimitC

normLimitC

floodLimitC

adjust_Normal_FloodC

norm_floodLimitC

minQC

normQC

nondmgQC

deltaO

deltaLN

deltaLF

deltaNFL

reservoirFillC

waterBodyTypCTemp

waterBodyTypTemp

sumEvapWaterBodyC

sumlakeResInflow

sumlakeResOutflow

lakeResStorage_release_ratio

lakeResStorage_release_ratioC

lakeIn

lakeEvapWaterBodyC

resEvapWaterBodyC

lakeResInflowM_2

lakeResOutflowM_2

downstruct

lakeStorage

resStorage

cellArea

Area of cell

m2

DtSec

number of seconds per timestep (default = 86400)

s

MtoM3

Coefficient to change units

InvDtSec

UpArea1

upstream area of a grid cell

m2

lddCompress

compressed river network (without missing values)

lakeEvaFactor

a factor which increases evaporation from lake because of wind

dtRouting

number of seconds per routing timestep

s

evapWaterBodyC

Compressed version of EvapWaterBodyM

m

sumLakeEvapWaterBodyC

noRoutingSteps

sumResEvapWaterBodyC

discharge

Channel discharge

m3/s

inflowDt

prelakeResStorage

runoff

includeWastewater

reservoir_transfers_net_M3C

reservoir_transfers_in_M3C

reservoir_transfers_out_M3C

reservoir_transfers_from_outside_M3C

reservoir_transfers_to_outside_M3C

lakeVolumeM3C

compressed map of lake volume

m3

lakeStorageC

reservoirStorageM3C

lakeResStorageC

lakeResStorage

Functions

dynamic()[source]

Dynamic part set lakes and reservoirs for each year

dynamic_inloop(NoRoutingExecuted)[source]

Dynamic part to calculate outflow from lakes and reservoirs

  • lakes with modified Puls approach

  • reservoirs with special filling levels

Parameters

NoRoutingExecuted – actual number of routing substep

Returns

outLdd: outflow in m3 to the network

Note

outflow to adjected lakes and reservoirs is calculated separately

initWaterbodies()[source]

Initialize water bodies Read parameters from maps e.g area, location, initial average discharge, type 9reservoir or lake) etc.

Compress numpy array from mask map to the size of lakes+reservoirs (marked as capital C at the end of the variable name)

initial_lakes()[source]

Initial part of the lakes module Using the Modified Puls approach to calculate retention of a lake

initial_reservoirs()[source]

Initial part of the reservoir module Using the appraoch of LISFLOOD

See also

LISFLOOD manual Annex 1: (Burek et al. 2013)

lakes_res_small module

Calculate water retention in small lakes

class cwatm.hydrological_modules.lakes_res_small.lakes_res_small(model)[source]

Bases: object

Small LAKES AND RESERVOIRS

Note

Calculate water retention in lakes and reservoirs

Using the Modified Puls approach to calculate retention of a lake See also: LISFLOOD manual Annex 3 (Burek et al. 2013)

Global variables

Variable [self.var]

Description

Unit

load_initial

Settings initLoad holds initial conditions for variables

input

smallpart

smalllakeArea

smalllakeDis0

smalllakeA

smalllakeFactor

smalllakeFactorSqr

smalllakeInflowOld

smalllakeOutflow

smalllakeLevel

minsmalllakeVolumeM3

preSmalllakeStorage

smallLakedaycorrect

smallLakeIn

smallevapWaterBody

smallLakeout

smallrunoffDiff

cellArea

Area of cell

m2

DtSec

number of seconds per timestep (default = 86400)

s

InvDtSec

EWRef

potential evaporation rate from water surface

m

lakeEvaFactor

a factor which increases evaporation from lake because of wind

runoff

smalllakeVolumeM3

smalllakeStorage

Functions

dynamic()[source]

Dynamic part to calculate outflow from small lakes and reservoirs

  • lakes with modified Puls approach

  • reservoirs with special filling levels

Flow out of lake:

Returns

outflow in m3 to the network

initial()[source]

Initialize small lakes and reservoirs Read parameters from maps e.g area, location, initial average discharge, type: reservoir or lake) etc.

routing_reservoirs.routing_kinematic module

River routing - kinematic wave

class cwatm.hydrological_modules.routing_reservoirs.routing_kinematic.routing_kinematic(model)[source]

Bases: object

ROUTING

routing using the kinematic wave

Global variables

Variable [self.var]

Description

Unit

modflow

Flag: True if modflow_coupling = True in settings file

load_initial

Settings initLoad holds initial conditions for variables

input

inflowM3

inflow to basin

m3

Crops

Internal: List of specific crops and Kc/Ky parameters

waterBodyID

lakes/reservoirs map with a single ID for each lake/reservoir

dirUp

river network in upstream direction

dirupLen_LR

number of bifurcation upstream lake/reservoir

dirupID_LR

index river upstream lake/reservoir

dirDown_LR

river network direktion downstream lake/reservoir

lendirDown_LR

number of river network connections lake/reservoir

compress_LR

boolean map as mask map for compressing lake/reservoir

lakeArea

area of each lake/reservoir

m2

lakeEvaFactorC

compressed map of a factor which increases evaporation from lake becau

EvapWaterBodyM

Evaporation from lakes and reservoirs

m

lakeResInflowM

lakeResOutflowM

downstruct

riverbedExchangeM3

sum_openWaterEvap

cellArea

Area of cell

m2

DtSec

number of seconds per timestep (default = 86400)

s

ETRef

potential evapotranspiration rate from reference crop

m

EWRef

potential evaporation rate from water surface

m

QInM3Old

Inflow from previous day

m3

UpArea1

upstream area of a grid cell

m2

lddCompress

compressed river network (without missing values)

lakeEvaFactor

a factor which increases evaporation from lake because of wind

dtRouting

number of seconds per routing timestep

s

evapWaterBodyC

Compressed version of EvapWaterBodyM

m

sumLakeEvapWaterBodyC

noRoutingSteps

sumResEvapWaterBodyC

discharge

Channel discharge

m3/s

inflowDt

prelakeResStorage

catchmentAll

sumsideflow

EvapoChannel

Channel evaporation

m3

prechannelStorage

chanLength

Input, Channel length

m

totalCrossSectionArea

dirupLen

dirupID

catchment

dirDown

lendirDown

UpArea

beta

chanMan

Input, Channel Manning’s roughness coefficient

chanGrad

chanWidth

Input, Channel width

m

chanDepth

Input, Channel depth

m

invbeta

invchanLength

invdtRouting

totalCrossSectionAreaBankFull

chanWettedPerimeterAlpha

alpPower

channelAlpha

invchannelAlpha

riverbedExchange

Xcel

QDelta

dis_outlet

humanConsumption

humanUse

natureUse

ETRefAverage_segments

precipEffectiveAverage_segments

head_segments

Simulated water level, averaged over adminSegments [masl]

gwdepth_adjusted_segments

Adjusted depth to groundwater table, averaged over adminSegments

m

gwdepth_segments

Groundwater depth, averaged over adminSegments

m

adminSegments_area

Spatial area of domestic agents

m2

runoff

openWaterEvap

Simulated evaporation from open areas

m

infiltration

Water actually infiltrating the soil

m

actTransTotal_paddy

Transpiration from paddy land cover

m

actTransTotal_nonpaddy

Transpiration from non-paddy land cover

m

actTransTotal_crops_nonIrr

Transpiration associated with specific non-irr crops

m

head

Simulated ModFlow water level [masl]

m

gwdepth_adjusted

Adjusted depth to groundwater table

m

gwdepth

Depth to groundwater table

m

fracVegCover

Fraction of specific land covers (0=forest, 1=grasslands, etc.)

%

adminSegments

Domestic agents

Int

lakeResStorage

act_SurfaceWaterAbstract

Surface water abstractions

m

addtoevapotrans

Irrigation application loss to evaporation

m

act_irrWithdrawal

Irrigation withdrawals

m

act_nonIrrConsumption

Non-irrigation consumption

m

returnFlow

act_nonIrrWithdrawal

Non-irrigation withdrawals

m

channelStorage

Channel water storage

m3

act_bigLakeResAbst

Abstractions to satisfy demands from lakes and reservoirs

m

act_smallLakeResAbst

Abstractions from small lakes at demand location

m

Functions

catchment(point)[source]

Get the catchment from “global” LDD and a point

  • load and create a river network

  • calculate catchment upstream of point

dynamic()[source]

Dynamic part of the routing module

  • calculate evaporation from channels

  • calculate riverbed exchange between riverbed and groundwater

  • if option waterbodies is true, calculate retention from water bodies

  • calculate sideflow -> inflow to river

  • calculate kinematic wave -> using C++ library for computational speed

initial()[source]

Initial part of the routing module

  • load and create a river network

  • calculate river network parameter e.g. river length, width, depth, gradient etc.

  • calculate initial filling

  • calculate manning’s roughness coefficient

routing_reservoirs.routing_sub module

Sub routines for river routing

cwatm.hydrological_modules.routing_reservoirs.routing_sub.Compress(map, mask)[source]

compressing map from 2D to 1D without missing values

Parameters
  • map – input map

  • mask – mask map

Returns

compressed map

cwatm.hydrological_modules.routing_reservoirs.routing_sub.catchment1(dirUp, points)[source]

calculates all cells which belongs to a catchment from point onward

Parameters
  • dirUp

  • points

Returns

subcatchment

cwatm.hydrological_modules.routing_reservoirs.routing_sub.decompress1(map)[source]

Decompressing map from 1D to 2D with missing values

Parameters

map – compressed map

Returns

decompressed 2D map

cwatm.hydrological_modules.routing_reservoirs.routing_sub.defLdd2(ldd)[source]

defines river network

Parameters

ldd – river network

Returns

ldd variables

cwatm.hydrological_modules.routing_reservoirs.routing_sub.dirDownstream(dirUp, lddcomp, dirDown)[source]

runs the river network tree downstream - from source to outlet

Parameters
  • dirUp

  • lddcomp

  • dirDown

Returns

direction downstream

cwatm.hydrological_modules.routing_reservoirs.routing_sub.dirUpstream(dirshort)[source]

runs the network tree upstream from outlet to source

Parameters

dirshort

Returns

direction upstream

cwatm.hydrological_modules.routing_reservoirs.routing_sub.downstream1(dirUp, weight)[source]

calculated 1 cell downstream

Parameters
  • dirUp

  • weight

Returns

dowmnstream 1 cell

cwatm.hydrological_modules.routing_reservoirs.routing_sub.lddrepair(lddnp, lddOrder)[source]

repairs a river network

  • eliminate unsound parts

  • add pits at points with no connections

Parameters
  • lddnp – rivernetwork as 1D array

  • lddOrder

Returns

repaired ldd

cwatm.hydrological_modules.routing_reservoirs.routing_sub.lddshort(lddnp, lddOrder)[source]

return short for calculating a catchment from a river network

Parameters
  • lddnp – rivernetwork as 1D array

  • lddOrder

Returns

short ldd

cwatm.hydrological_modules.routing_reservoirs.routing_sub.postorder(dirUp, catchment, node, catch, dirDown)[source]

Routine to run a postorder tree traversal

Parameters
  • dirUp

  • catchment

  • node

  • catch

  • dirDown

Returns

dirDown and catchment

cwatm.hydrological_modules.routing_reservoirs.routing_sub.subcatchment1(dirUp, points, ups)[source]

calculates subcatchments of points

Parameters
  • dirUp

  • points

  • ups

Returns

subcatchment

cwatm.hydrological_modules.routing_reservoirs.routing_sub.upstream1(downstruct, weight)[source]

Calculates 1 cell upstream

Parameters
  • downstruct

  • weight

Returns

upstream 1cell

cwatm.hydrological_modules.routing_reservoirs.routing_sub.upstreamArea(dirDown, dirshort, area)[source]

calculates upstream area

Parameters
  • dirDown – array which point from each cell to the next downstream cell

  • dirshort

  • area – area in m2 for a single gridcell

Returns

upstream area

Hydrology V - Water balance

waterbalance module

class cwatm.hydrological_modules.waterbalance.waterbalance(model)[source]

Bases: object

WATER BALANCE

  • check if water balance per time step is closed ( = 0)

  • produce an annual overview - income, outcome storage

Global variables

Variable [self.var]

Description

Unit

lakeReservoirStorage

snowEvap

total evaporation from snow for a snow layers

m

storGroundwater

Groundwater storage (non-fossil). This is primarily used when not usin

m

prestorGroundwater

storGroundwater at the beginning of each step

m

preSmalllakeStorage

smallLakedaycorrect

smallLakeIn

smallevapWaterBody

smallLakeout

EvapWaterBodyM

Evaporation from lakes and reservoirs

m

lakeResInflowM

lakeResOutflowM

sum_gwRecharge

groundwater recharge

m

lakeStorage

resStorage

totalSto

Total soil,snow and vegetation storage for each cell including all lan

m

pretotalSto

Previous totalSto

m

sum_prefFlow

Preferential flow from soil to groundwater (summed up for all land cov

m

sum_perc3toGW

Percolation from 3rd soil layer to groundwater (summed up for all land

m

sum_actBareSoilEvap

sum_openWaterEvap

sum_directRunoff

sum_interflow

sum_capRiseFromGW

Capillary rise from groundwater to 3rd soil layer (summed up for all l

m

sum_act_irrConsumption

cellArea

Area of cell

m2

DtSec

number of seconds per timestep (default = 86400)

s

Precipitation

Precipitation (input for the model)

m

lddCompress

compressed river network (without missing values)

discharge

Channel discharge

m3/s

prelakeResStorage

catchmentAll

sumsideflow

EvapoChannel

Channel evaporation

m3

prechannelStorage

runoff

gridcell_storage

baseflow

simulated baseflow (= groundwater discharge to river)

m

nonFossilGroundwaterAbs

Non-fossil groundwater abstraction. Used primarily without MODFLOW.

m

lakeResStorage

smalllakeStorage

act_SurfaceWaterAbstract

Surface water abstractions

m

addtoevapotrans

Irrigation application loss to evaporation

m

act_irrWithdrawal

Irrigation withdrawals

m

act_nonIrrConsumption

Non-irrigation consumption

m

returnFlow

unmetDemand

Unmet groundwater demand to determine potential fossil groundwaterwate

m

act_nonIrrWithdrawal

Non-irrigation withdrawals

m

returnflowIrr

nonIrrReturnFlowFraction

unmet_lost

Fossil water that disappears instead of becoming return flow

m

channelStorage

Channel water storage

m3

act_totalWaterWithdrawal

Total water withdrawals

m

totalET

Total evapotranspiration for each cell including all landcover types

m

sum_actTransTotal

sum_interceptEvap

prergridcell

nonIrrReturnFlow

localQW

channelStorageBefore

sumbalance

sum_balanceStore

sum_balanceFlux

Functions

checkWaterSoilGround()[source]

Check water balance of snow, vegetation, soil, groundwater

dynamic()[source]

Dynamic part of the water balance module If option sumWaterBalance sum water balance for certain variables

initial()[source]

Initial part of the water balance module

waterBalanceCheck(fluxesIn, fluxesOut, preStorages, endStorages, processName, printTrue=False)[source]

Dynamic part of the water balance module

Returns the water balance for a list of input, output, and storage map files

Parameters
  • fluxesIn – income

  • fluxesOut – this goes out

  • preStorages – this was in before

  • endStorages – this was in afterwards

  • processName – name of the process

  • printTrue – calculate it?

Returns

waterBalanceCheckSum(fluxesIn, fluxesOut, preStorages, endStorages, processName, printTrue=False)[source]

Returns the water balance for a list of input, output, and storage map files and sums it up for a catchment

Parameters
  • fluxesIn – income

  • fluxesOut – this goes out

  • preStorages – this was in before

  • endStorages – this was in afterwards

  • processName – name of the process

  • printTrue – calculate it?

Returns

Water balance as output on the screen