Functions/Subroutines | |
subroutine, public | model_version_information (funit) |
subroutine, public | define_output_variables () |
subroutine, public | load_modeldefined_input (dir, dir2, nsmax, ns, indexarray, bdate, edate, loadxoms, loadregs, loadcrun, status) |
subroutine, public | reload_modeldefined_observations (dir, status) |
subroutine, public | close_modeldefined_observations () |
subroutine, public | open_modeldefined_outputfiles (dir, n, na) |
subroutine, public | close_modeldefined_outputfiles (na) |
subroutine | load_xoms_files (dir, ns, bdate, edate, status) |
subroutine | reload_xoms_files (dir, status) |
subroutine | close_xoms_files () |
subroutine, public | get_current_xoms (cd, n) |
subroutine, public | load_data_for_regression_parameter_estimate (dir, nsbase, ns, indexarray, status) |
subroutine | load_regression_parameters (dir, status) |
subroutine, public | deallocate_regest_input_variables () |
subroutine, public | get_regest_parameter (isub, ipar, rgpar, term) |
subroutine, public | load_slc_output_for_routing_network (dir, nsbase, bdate, edate, status) |
subroutine, public | get_slc_output_for_routing_network (sumaland, runoff, crunoff) |
Variables | |
Variables for HYPE input files: XobsXOxx.txt | |
integer, parameter, public | max_xoms = 10 |
character(len=20), dimension(max_xoms, 2), public | xoms_filename = RESHAPE(SOURCE=(/ 'XobsXOM0.txt','XobsXOM1.txt','XobsXOM2.txt','XobsXOM3.txt','XobsXOM4.txt', 'XobsXOM5.txt','XobsXOM6.txt','XobsXOM7.txt','XobsXOM8.txt','XobsXOM9.txt', 'XobsXOS0.txt','XobsXOS1.txt','XobsXOS2.txt','XobsXOS3.txt','XobsXOS4.txt', 'XobsXOS5.txt','XobsXOS6.txt','XobsXOS7.txt','XobsXOS8.txt','XobsXOS9.txt'/), SHAPE=(/max_xoms,2/)) |
integer | num_xomsfiles |
integer, dimension(2), public | num_xoms |
integer | max_nstn |
integer, dimension(max_xoms, 2) | ncom |
integer, dimension(:,:), allocatable | xoms_funit |
integer, dimension(:,:), allocatable | xoms_nstn |
integer, dimension(:,:), allocatable | xomindex |
integer, dimension(:,:), allocatable | xosindex |
integer, dimension(max_xoms, 2) | xoms_timeformat |
type(datetype), dimension(:,:), allocatable | xoms_fbdate |
type(datetype), dimension(:,:), allocatable | xoms_fedate |
real, dimension(:,:), allocatable, public | xom |
real, dimension(:,:), allocatable, public | xos |
Variables for HYPE input files: timeCOUT.txt etc | |
integer, dimension(:), allocatable | funit_slc_output |
integer | slc_output_timeformat |
integer | nlandbasins |
integer, dimension(:,:), allocatable | runoffindex |
Variables for HYPE regression parameter estimates input data | |
integer | npar_regr |
integer | npc_catdes |
integer | ngroup_cat |
integer, dimension(:), allocatable | indx_par |
integer, dimension(:,:), allocatable | ndes_reg |
integer, dimension(:,:,:), allocatable | idx_catdes |
real, dimension(:,:,:), allocatable | wght_catdes |
integer, dimension(:), allocatable | clust_group |
real, dimension(:,:), allocatable | catdes |
This module is used to define HYPE version and output variables. It handles specific input data (files) for the HYPE model; observations in XobsXOMN.txt, XobsXOSN.txt and regression parameters in reg_par.txt, CatchDes.txt, CatchGroup.txt.
subroutine, public modeldata_module::close_modeldefined_observations |
Close files with model specific observations (xom0..xom9,xos0..xos9)
subroutine, public modeldata_module::close_modeldefined_outputfiles | ( | integer, intent(in) | na | ) |
Close files for printout.
[in] | na | Number of aquifers |
|
private |
Close files with observations.
subroutine, public modeldata_module::deallocate_regest_input_variables |
Deallocate input data for regression parameter estimates.
subroutine, public modeldata_module::define_output_variables |
Set variables holding output information from the HYPE model; outvarid.
Algoritm
Initialize outvarid structure
Set each HYPE variable id's information (name, type, units etc.) to outvarid structure
Set other variables based on the outvarid indices for other functions that depend on finding correct outvar
subroutine, public modeldata_module::get_current_xoms | ( | type(datetype), intent(in) | cd, |
integer, intent(in) | n | ||
) |
Get current observations from file.
subroutine, public modeldata_module::get_regest_parameter | ( | integer, intent(in) | isub, |
integer, intent(in) | ipar, | ||
real, intent(inout) | rgpar, | ||
real, intent(in), optional | term | ||
) |
Calculate regression parameter estimate from regression coefficients and catchment characteristics.
[in] | isub | current subbasin |
[in] | ipar | current regression parameter |
[in,out] | rgpar | parameter value |
[in] | term | term to be added to parameter |
subroutine, public modeldata_module::get_slc_output_for_routing_network | ( | real, dimension(nsub), intent(in) | sumaland, |
real, dimension(nsub), intent(out) | runoff, | ||
real, dimension(numsubstances,nsub), intent(out) | crunoff | ||
) |
Collect the current runoff fromm pre calculated slc output crun and coNN.
[in] | sumaland | land area fraction for subbasins |
[out] | runoff | runoff for subbasins |
[out] | crunoff | load of runoff |
subroutine, public modeldata_module::load_data_for_regression_parameter_estimate | ( | character(len=*), intent(in) | dir, |
integer, intent(in) | nsbase, | ||
integer, intent(in) | ns, | ||
integer, dimension(ns), intent(in) | indexarray, | ||
integer, intent(out) | status | ||
) |
Reads three files with basin characteristics, and regression coefficients for parameters.
[in] | dir | File directory (modeldir) |
[in] | nsbase | Number of subbasins (model set-up) |
[in] | ns | Number of subbasins (submodel) |
[in] | indexarray | index for basemodel |
[out] | status | Status of subroutine |
Algorithm
Initialise
Read catchment group and catchment descriptor information (CatchGroup.txt,CatchDes.txt)
Read reg_par.txt
subroutine, public modeldata_module::load_modeldefined_input | ( | character(len=*), intent(in) | dir, |
character(len=*), intent(in) | dir2, | ||
integer, intent(in) | nsmax, | ||
integer, intent(in) | ns, | ||
integer, dimension(ns), intent(in) | indexarray, | ||
type(datetype), intent(in) | bdate, | ||
type(datetype), intent(in) | edate, | ||
logical, intent(in) | loadxoms, | ||
logical, intent(in) | loadregs, | ||
logical, intent(in) | loadcrun, | ||
integer, intent(out) | status | ||
) |
Reads files with model specific input For HYPE it is files with different observations (xom0..xom9,xos0..xos9), files for regression estimated parameters, and timefiles with runoff from pre-run.
[in] | dir | File directory (modeldir) |
[in] | dir2 | File directory (otherobsdir) |
[in] | nsmax | Number of subbasins, basemodel |
[in] | ns | Number of subbasins, submodel |
[in] | indexarray | index for basemodel |
[in] | bdate | Begin simulation date |
[in] | edate | End simulation date |
[in] | loadxoms | flag for using xoms-files |
[in] | loadregs | flag for using regression estimation-files |
[in] | loadcrun | flag for using pre calculated slc output |
[out] | status | Status of subroutine |
|
private |
Read parameter values from file.
Consequences The module variables npar_regr, ndes_reg, idx_catdes, wght_catdes, indx_par will be allocated and set.
[in] | dir | File directory |
[out] | status | Status of subroutine |
Algorithm
Allocate and load regression parameter coefficients
subroutine, public modeldata_module::load_slc_output_for_routing_network | ( | character(len=*), intent(in) | dir, |
integer, intent(in) | nsbase, | ||
type(datetype), intent(in) | bdate, | ||
type(datetype), intent(in) | edate, | ||
integer, intent(out) | status | ||
) |
Prepare time output files from pre calculated slc output crun and coNN.
[in] | dir | File directory (modeldir) |
[in] | nsbase | Number of subbasins (model set-up) |
[in] | bdate | Begin simulation date |
[in] | edate | End simulation date |
[out] | status | Status of subroutine |
Algorithm
Initialise
Check for correct model set up
Load a file with coupling between subbasins (routing) and (possible fewer) "landbasins" for land runoff The result will be a number of areas nlandbasins<=nsub (submodel not allowed) and a indexarray runoffindex(1:nsub)=ilandbasin These are module variables here in this modeldata_module
Read file
Find the unique runoffid in the key file, and the number of them
Find index in runoffid-variable for all subbasins, in subbasin order
Prepare to read pre-calculated land runoff and substances
For every input file:
Get filename
Check that file exist
Count comment rows
Check landbasins' runoff' ids, those in runoff file against those in runoffkey file, and get a index linking them
Check time period
Prepare reading file
subroutine modeldata_module::load_xoms_files | ( | character(len=*), intent(in) | dir, |
integer, intent(in) | ns, | ||
type(datetype), intent(in) | bdate, | ||
type(datetype), intent(in) | edate, | ||
integer, intent(out) | status | ||
) |
Reads files with different observations (xom0..xom9,xos0..xos9)
[in] | dir | File directory (otherobsdir, was forcingdir) |
[in] | ns | Number of subbasins |
[in] | bdate | Begin simulation date |
[in] | edate | End simulation date |
[out] | status | Status of subroutine |
subroutine, public modeldata_module::model_version_information | ( | integer, intent(in) | funit | ) |
Information about the model version to print in log-file.
[in] | funit | fileunit for log-file |
subroutine, public modeldata_module::open_modeldefined_outputfiles | ( | character(len=*), intent(in) | dir, |
integer, intent(in) | n, | ||
integer, intent(in) | na | ||
) |
Opens files for printout.
[in] | dir | Result file directory |
[in] | n | Number of subbasins |
[in] | na | Number of aquifers |
subroutine, public modeldata_module::reload_modeldefined_observations | ( | character(len=*), intent(in) | dir, |
integer, intent(out) | status | ||
) |
Reload files with model specific observation input For HYPE it is files with different observations (xom0..xom9,xos0..xos9)
[in] | dir | File directory (otherobsdir) |
[out] | status | Status of subroutine |
subroutine modeldata_module::reload_xoms_files | ( | character(len=*), intent(in) | dir, |
integer, intent(out) | status | ||
) |
Prepare files with different observations (xom0..xom9,xos0..xos9) for rereading No checks.
[in] | dir | File directory (otherobsdir, was forcingdir) |
[out] | status | Status of subroutine |
|
private |
catchment descriptors for catchments to be used in parameter regionalization (nsub,npc_catdes)
|
private |
group id of catchment after catchments are grouped based on their charactersistics (nsub)
|
private |
|
private |
indices of the pca of catchment descriptors used for regionalization of the parameter (ngroup_cat,npar_regr,npc_catdes)
|
private |
contains info on whether a given parameter is regionally estimated and which parameter order it has (max_par)
|
private |
Maximum number of stations (columns) in any file.
integer, parameter, public modeldata_module::max_xoms = 10 |
Maximum number of xom- resp xos-files (0-9)
|
private |
Number of comment rows in Xoms files (starting with !!)
|
private |
number of descriptors used to regionalize each of the parameters in each group (ngroup_cat,npar_regr)
|
private |
maximum number of catchment groups
|
private |
Number of land basins (<= normal subbasins still used for routing)
|
private |
number of parameters to be estimated using a regression relationship
|
private |
maximum number of catchment descriptors
integer, dimension(2), public modeldata_module::num_xoms |
Number of xom- resp xos-files each.
|
private |
Number of xom- resp xos-files (max filenumber)
|
private |
Index of land basin for each subbasin.
|
private |
|
private |
weights of the pca used to estimate the model parameter (ngroup_cat,npar_regr,npc_catdes)
real, dimension(:,:), allocatable, public modeldata_module::xom |
Observations of current time step of variable averaged over period (nvar,nobs)
|
private |
Index of observations of variable averaged over period (nvar,subbasin)
|
private |
File starting date within simulation period (nvar,2)
|
private |
File ending date within simulation period (nvar,2)
character(len=20), dimension(max_xoms,2), public modeldata_module::xoms_filename = RESHAPE(SOURCE=(/ 'XobsXOM0.txt','XobsXOM1.txt','XobsXOM2.txt','XobsXOM3.txt','XobsXOM4.txt', 'XobsXOM5.txt','XobsXOM6.txt','XobsXOM7.txt','XobsXOM8.txt','XobsXOM9.txt', 'XobsXOS0.txt','XobsXOS1.txt','XobsXOS2.txt','XobsXOS3.txt','XobsXOS4.txt', 'XobsXOS5.txt','XobsXOS6.txt','XobsXOS7.txt','XobsXOS8.txt','XobsXOS9.txt'/), SHAPE=(/max_xoms,2/)) |
Filenames for Xoms-files.
|
private |
File unit of files with observations (nvar,2)
|
private |
Number of stations (columns in file) (nvar,2)
|
private |
Date-time format of Xoms files (0 only date, 1 date and time)
real, dimension(:,:), allocatable, public modeldata_module::xos |
Observations of current time step of variable summed over period (nvar,nobs)
|
private |
Index of observations of variable summed over period (nvar,subbasin)