swat

package
v0.0.0-...-0f7942d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 21, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Steady

func Steady(ws WaterShed, wf map[int]float64, ord []int, mmpy float64, msg bool)

Steady initializes model stores to a steady precipitation (input as mm/year)

func TopoToOutlet

func TopoToOutlet(outlet int) []int

TopoToOutlet returns an ordered set of subbasin IDs leading to an outlet

Types

type Channel

type Channel struct {
	// contains filtered or unexported fields
}

Channel is a channel units in SWAT ref: Neitsch, S.L., J.G. Arnold, J.R., Kiniry, J.R. Williams, 2011. Soil and Water Assessment Tool: Theoretical Documentation Version 2009 (September 2011). 647pp.

func (*Channel) New

func (c *Channel) New(CHW, CHD, CHL, CHS, CHN float64)

New variable storage routing method channel constructor CHW: (W_bankfull) width of channel top at bank [m] CHD: (depth_bankfull) depth of water filled to bank [m] CHL: (L_ch) length of main channel [km] CHS: (slp_ch) length of main channel [-] CHN: (n) Manning's n value for the main channel

func (*Channel) Route

func (c *Channel) Route(vinavg float64) (vout2 float64)

Route volumes (pg.432) variable storage rounting method (as built in HYMO) ref: Williams, J.R. and R.W. Hann, 1978. Optimal operation of large agricultural watersheds with water quality contraints. Texas Water Resources Institute, Texas A&M Univ. Tech. Rept. No. 96. ref: Williams J.R., 1969. Flood routing with variable travel time or variable storage coefficients. Transactions of the ASAE 12(1): 100--103.

type HRU

type HRU struct {
	// contains filtered or unexported fields
}

HRU SWAT hydrologic response unit

func (*HRU) New

func (m *HRU) New(sz SoilLayer, HRUFR, HRUSLP, OVN, CN2, CV, ESCO float64, IWATABLE bool)

New SWAT HRU constructor HRUFR: fraction of subbasin area contained in HRU HRUSLP: (slp) average slope steepness m/m OVN: (n) Manning's n value for overland flow CN2: moisture condition II curve number CV: aboveground biomass and residue kg/ha ESCO: soil evporation compensation coefficient [0,1] (pg.138) IWATABLE: high water table code: set to true when seasonal high water table present

type SCSCN

type SCSCN struct {
	// contains filtered or unexported fields
}

SCSCN is the soil conservation service (now known as the Natural Resources Conservation Service (NRCS)) curve number (CN) number runoff generation technique, after the SWAT model implimentation defaulted SWAT ICN=0: daily curve number as a function of soil moisture ref: Neitsch, S.L., J.G. Arnold, J.R., Kiniry, J.R. Williams, 2011. Soil and Water Assessment Tool: Theoretical Documentation Version 2009 (September 2011). 647pp.

func (*SCSCN) New

func (c *SCSCN) New(cn, fc, sat, slp float64)

New constructor cn: cn number; fc: amount of water held at field capacity (mm); sat amount of water held at saturation (mm) slp: average fraction slope for the subbasin (CN method assumes a slope fraction of 0.05)

func (*SCSCN) Update

func (c *SCSCN) Update(p, sw float64, froz bool) float64

Update state. p: precipitation (mm) sw: is the soil water content of the entrire profile excluding the amount of water held in the profile at wilting point (mm) (pg.104)

type SoilLayer

type SoilLayer struct {
	// contains filtered or unexported fields
}

SoilLayer is a soil layer unit use in SWAT

func (*SoilLayer) New

func (sl *SoilLayer) New(CLAY, SOLBD, SOLAWC, SOLK float64)

New SWAT soil zone layer constructor CLAY: (m_c) percent clay content SOLBD: bulk density of soil (Mg/m³=g/cm³) SOLAWC: available water capacity as fraction of total soil volume [-] SOLK: (ksat) saturated hydraulic conductivity mm/hr

type SubBasin

type SubBasin struct {
	Ca float64 // parameters

	Outflow int // SubBasin id outflow from this SubBasin (<0: farfield outflow)
	// contains filtered or unexported fields
}

SubBasin SWAT subbasin

func (*SubBasin) Copy

func (b *SubBasin) Copy() *SubBasin

Copy (deep) a SubBasin struct

func (*SubBasin) Initialize

func (bsn *SubBasin) Initialize(q0mm float64)

Initialize SubBasin state

func (*SubBasin) New

func (b *SubBasin) New(HRUs []*HRU, Chn *Channel, SUBKM, SLSUBBSN, CHL, CHS, CHN, SURLAG, GWDELAY, ALPHABF float64)

New SWAT SubBasin constructor SUBKM: area of subbasin [km2] SLSUBBSN: (L_slp) average slope length [m] CHL: (L) longest tributary channel length in subbasin [km] CHS: (slp_ch) average slope of tributary channels m/m CHN: (n) Manning's n value for tributary channels CHW: (W_bankfull) width of channel top at bank [m] CHD: (depth_bankfull) depth of water wht filled to bank [m] SURLAG: surface runoff lag coefficient [0,15] GWDELAY: (delta_gw) delay time for aquifer recharge [days] GWQMN: (aq_shthr) threshold water level in aquifer for baseflow [mm] ALPHABF: (alpha_bf) baseflow recession coeficient (1/k)

func (*SubBasin) Renew

func (b *SubBasin) Renew(CNf, ESCO, CHN, OVN, SURLAG, GWDELAY, ALPHABF, GWQMN float64)

Renew subbasin for resampling parameters

func (*SubBasin) Storage

func (bsn *SubBasin) Storage() float64

Storage returns the current moisture state [mm]

func (*SubBasin) StorageAll

func (bsn *SubBasin) StorageAll() (aq, psto, qstr, vstr, sz float64)

StorageAll returns the moisture states of all components [mm]

func (*SubBasin) Update

func (bsn *SubBasin) Update(vin, p, ep float64) (r, i, a, g, b, vout float64)

Update state (all in [mm])

type WaterShed

type WaterShed = map[int]*SubBasin

WaterShed holds a collection of subbasins that make up a watershed

func Load

func Load(fbsn, fhru, frte, ftopo string) (WaterShed, []int)

Load a set of .csv files to build a SWAT model structure

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL