model

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2022 License: GPL-3.0 Imports: 17 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrintInts

func PrintInts(fp string, cids []int, vals map[int]int)

Prints a set of rasters for verification

func UcascGaussian

func UcascGaussian(a, s float64) float64

Types

type Domain

type Domain struct {
	Frc     *FORC // forcing (variable) data
	Strc    *STRC // structural (unchanging) data (eg, topography, solar irradiation fractions)
	Mpr     *MAPR // land use/surficial geology mapping for parameter assignment
	Obs     *OBS  // model observations/calibration targets
	Nc, Ngw int   // number of cells; number of groundwater reservoirs
	// mons    []int // monitor cell IDs
	// Fgwnc   []float64 // cell count of each gw zone
	Dir string // model directory/prefix
}

Domain holds all data and is the parent to all sub models

func LoadDomain

func LoadDomain(mdlprfx string) *Domain

LoadDomain loads all data from which sub-domain scale models can be derived

func (*Domain) Drain

func (dom *Domain) Drain(lus []*Surface, dm0 []float64, xg []int, nSteps int) []float64

func (*Domain) EvaluateQuick

func (dom *Domain) EvaluateQuick(lus []*Surface, dms []float64, xg, xm, gxr []int, prnt bool) []float64

func (*Domain) EvaluateToSteadyState

func (dom *Domain) EvaluateToSteadyState(mmpyr float64, lus []*Surface, cxr map[int]int, xg []int, prnt bool) (dm0 []float64)

func (*Domain) EvaluateVerbose

func (dom *Domain) EvaluateVerbose(lus []*Surface, dms []float64, xg, xm, gxr []int, prnt bool) []float64

func (*Domain) FindDm0s

func (dom *Domain) FindDm0s(lus []*Surface, mmpyr float64, cxr map[int]int, xg []int, prnt bool) []float64

func (*Domain) Parameterize

func (dom *Domain) Parameterize(TOPMODELm []float64, acasc, soildepth, maxFcasc, dinc float64, prnt bool) ([]*Surface, []int, []int, map[int]int, []int)

func (*Domain) PreRunCheck

func (dom *Domain) PreRunCheck(lus []*Surface, cxr map[int]int, xg, xm []int)

func (*Domain) Print

func (d *Domain) Print()

type FORC

type FORC struct {
	T      []time.Time // [date ID]
	Ya, Ea [][]float64 // [staID][DateID] atmospheric exchange terms
	// O           [][]float64 // observed discharge (use Oxr for cross-reference)
	XR map[int]int // mapping of model grid cell id to met index
	// Oxr, mt     []int       // mapping of outlet cell ID to O[][]
	// mt          []int // month [1,12] cross-reference
	IntervalSec float64
}

FORC holds forcing data

func LoadGobFORC

func LoadGobFORC(fp string) (*FORC, error)

LoadGobFORC loads

func (*FORC) PrintAndCheck

func (frc *FORC) PrintAndCheck(dir string, ocids []int) error

SaveGob FORC to gob

func (*FORC) SaveGob

func (frc *FORC) SaveGob(fp string) error

SaveGob FORC to gob

type MAPR

type MAPR struct {
	// LU               lusg.LandUseColl // [luid]LandUse
	// GW                     map[int]lusg.TOPMODEL // [gwid]GWzone
	Ksat, Uca, Fimp, Ifct map[int]float64 // [sgid]percolation rate; [cellid]upslope contributing area/cell count; [cellid]fraction impervious; [cellid]interception factor (~=Fcov*LAI)
	LUx, SGx, GWx         map[int]int     // cross reference of cid to lu/sg/gw
	Fngwc                 []float64       // size/area/number of cells for each GWzone
	Strms                 []int           // cell IDs of stream cells
}

MAPR holds mappings of landuse, surficial geology and groundwater zones

land use (class): uniform parameters applied to land category
surficial geology: ksat/infiltration rate  uniformly applied to surficial geology category
ground water zone: paramater assigned to gw zone

func LoadGobMAPR

func LoadGobMAPR(fp string) (*MAPR, error)

LoadGobMAPR loads

func (*MAPR) SaveGob

func (m *MAPR) SaveGob(fp string) error

SaveGob MAPR to gob

type OBS

type OBS struct {
	Td   []time.Time // [date ID]
	Oq   [][]float64 // observed discharge (use Oxr for cross-reference)
	Oqxr []int       // mapping of outlet cell ID to Oq[][]; other cell IDs to montior; month [1,12] cross-reference
	// contains filtered or unexported fields
}

OBS holds forcing data

func (*OBS) AddFluxCsv

func (obs *OBS) AddFluxCsv(csvdir string, cxr map[int]int, cellarea float64)

AddFluxCsv reads csv file of "Date","Flow","Flag"

func (*OBS) ToDaily

func (obs *OBS) ToDaily(dat []float64) []float64

type RTR

type RTR struct {
	// SwsCidXR, SwsStrmXR map[int][]int // cross reference sws to cids; sws to stream cell ids
	SwsCidXR  map[int][]int // cross reference sws to cids
	Sws, Dsws map[int]int   // cross reference of cid to sub-watershed ID; map upsws{downsws}

}

RTR holds topological info for subwatershed routing

func LoadGobRTR

func LoadGobRTR(fp string) (*RTR, error)

LoadGobRTR loads

func (*RTR) SaveGob

func (r *RTR) SaveGob(fp string) error

SaveGob RTR to gob

type STRC

type STRC struct {
	DwnGrad     map[int]float64 // gradient (slope) of cell
	UpCnt       map[int]int     // cell upslope count (unit contributing area)
	CIDs, DwnXR []int           // topologically-ordered (grid)cell IDs; downslope cell array index
	// Acell, Wcell float64         // cell area, cell width
	Wcell float64 // cell width
	CID0  int     // cell id of outlet cell.  <0 for all cells
}

STRC holds model structural data

func LoadGobSTRC

func LoadGobSTRC(fp string) (*STRC, error)

LoadGobSTRC loads

func (*STRC) PrintAndCheck

func (s *STRC) PrintAndCheck(dir string) []int

Prints a set of rasters for verification

func (*STRC) SaveGob

func (s *STRC) SaveGob(fp string) error

SaveGob STRC to gob

type Surface

type Surface struct {
	// ID, GwID               int
	Hru                       hru.HRU
	Fcasc, Drel, Dinc, Bo, Tm float64
}

func (*Surface) Update

func (s *Surface) Update(dm, frc, ep float64) (aet, runoff, recharge float64)

Jump to

Keyboard shortcuts

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