prep/gobBuilder2/main.go
-
read instruction file M:/Peel/RDRR-PWRMM21/PWRMM21.rdrr
-
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:
- cross-referencing subbasin to/from grid cell IDs;
- downslope subbasin topography
(swsFP
)
Build land use, surficial geology and gw zone mapping (MAPR
)
luFPprfx, sgFP, gwzFP
Collects:
-
surface land use properties
- land use type (
surfaceid
)
- canopy type (
canopyid
)
- fraction ([0,1]) of impervious cover (
perimp
)
- fraction ([0,1]) of canopy cover (
percov
)
-
surficial/shallow geology
material properties as 8 types (based on OGS characterization):
- [Low, Low-med, Medium, High-Med, High (permeability), Alluvium, Organic, Variable]
-
Ground water reservoirs
Areas of distinct interconnected shallow groundwater systems, indexed (could be related to physiography). This is further broken down to:
- cell and stream cross-referencing
- TOPMODEL unit contributing areas $(a_i)$
These data are translated to a set of distributed (cell-based) model parameters:
- Saturated conductivity of shallow soil zone $(K_\text{sat})$
- Fraction imperviousness $(f_\text{imp})$
- 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
- Builds cross-reference: met id to cell id
- Reads timeseries arrays of meteorological forcings:
- atmospheric yield $(Y_a)$
- 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.