prep

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: 13 Imported by: 0

README

Prepare model input files

prep/gobBuilder2/main.go

  1. read instruction file M:/Peel/RDRR-PWRMM21/PWRMM21.rdrr

  2. save to go binaries (*.gob) for efficiency

    • Set main model file directory path (gobDir)
    • Load grid definition (gdefFP)

Load model structure (STRC)

loads Hydrologically corrected Digital Elevation Model (HDEM) includes grid cell topography (upslope cells, outlet cell, etc.) (hdemFP)

ADD URBAN DIVERSION

Load sub-basins and routing topology (RTR)

Builds:

  1. cross-referencing subbasin to/from grid cell IDs;
  2. downslope subbasin topography

(swsFP)

Build land use, surficial geology and gw zone mapping (MAPR)

luFPprfx, sgFP, gwzFP

Collects:

  1. surface land use properties

    1. land use type (surfaceid)
    2. canopy type (canopyid)
    3. fraction ([0,1]) of impervious cover (perimp)
    4. fraction ([0,1]) of canopy cover (percov)
  2. surficial/shallow geology

    material properties as 8 types (based on OGS characterization):

    • [Low, Low-med, Medium, High-Med, High (permeability), Alluvium, Organic, Variable]
  3. Ground water reservoirs

    Areas of distinct interconnected shallow groundwater systems, indexed (could be related to physiography). This is further broken down to:

    1. cell and stream cross-referencing
    2. TOPMODEL unit contributing areas $(a_i)$

These data are translated to a set of distributed (cell-based) model parameters:

  1. Saturated conductivity of shallow soil zone $(K_\text{sat})$
  2. Fraction imperviousness $(f_\text{imp})$
  3. Land use
    • Depression storage $(h_\text{dep})$
    • Interception storage $(h_\text{can})$
    • Soil extinction depth $(z_\text{ext})$
    • Soil porosity $(\phi)$
    • Soil Field Capacity $(\theta_\text{fc})$

Cross-referencing from cells to land use, surficial geology and groundwater reservoir are made.

Load sub-watershed forcings (FORC)

midFP, ncfp

  1. Builds cross-reference: met id to cell id
  2. Reads timeseries arrays of meteorological forcings:
    1. atmospheric yield $(Y_a)$
    2. atmospheric demand) $(E_a)$

Output

The rdrr prep creates 4 input files in the root directory:

  • .domain.STRC.gob
  • .domain.RTR.gob
  • .domain.MAPR.gob
  • .domain.FORC.gob

these are written as Go(lang) binary files.

Code Structure (check)

The model (i.e., structural data, parameters, etc.) is structured as follows:

Model domain

This is the overarching placeholder for all necessary data to run a model. The idea here is to collect data from a greater region that can be parsed to smaller areas where the numerical model is to be applied, say to some given basin outlet cell ID. This allows for a single greater set of input data to be consolidated into fewer computer files

Subdomain

When the user wishes to run the model, there may be interest to specific areas and not the entire domain. For instance, user has only to specify the cell ID from which a catchment area drains to; or a grid definition with pre-defined active cells can be inputted.

Sample

While the Domain and Subdomain carry mostly structural (i.e., unchanging) data, the sample is where a Subdomain is parameterized. Samples are handy when one attempts to optimize or perform a Monte Carlo analysis of parameter space using the same Subdomain.

Subsample

For larger catchments, it may be advantageous to sub-divide the Subdomain for a particular parameter sample, say by subwatersheds of a predefined catchment area. This can be leveraged when scaling the model across multi-processor computer architectures. Subsample also holds sample results once the model has been evaluated.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildFORC

func BuildFORC(gobDir, ncfp string, cmxr map[int]int, outlets []int, carea float64) *model.FORC

BuildFORC builds the gob containing forcing data: 1) loads FEWS NetCDF (bin) output; 2) returns sorted dates; 3) computes basin; 4) parses precipitation into rainfall by optimizing t_crit

func BuildMAPR

func BuildMAPR(gobDir, lufp, sgfp, gwfp string, gd *grid.Definition, strc *model.STRC, upslopes map[int][]int) *model.MAPR

BuildMAPR returns (and saves) the parameter mapping scheme

func BuildRTR

func BuildRTR(gobDir string, strc *model.STRC, gd *grid.Definition, swsFP string) *model.RTR

BuildRTR returns (and saves) the topological routing scheme amongst sub-basins

func BuildSTRC

func BuildSTRC(gd *grid.Definition, gobDir, demFP string, cid0 int) (*model.STRC, map[int][]int, []int)

BuildSTRC builds the structural (static) form of the model

func GobBuilder

func GobBuilder(controlFP string, skipFRC bool)

Types

This section is empty.

Jump to

Keyboard shortcuts

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