HYPE
Loading...
Searching...
No Matches
modeldata_module Module Reference

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

Detailed Description

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.

Function/Subroutine Documentation

◆ close_modeldefined_observations()

subroutine, public modeldata_module::close_modeldefined_observations

Close files with model specific observations (xom0..xom9,xos0..xos9).

Here is the call graph for this function:
Here is the caller graph for this function:

◆ close_modeldefined_outputfiles()

subroutine, public modeldata_module::close_modeldefined_outputfiles ( integer, intent(in) na)

Close files for printout.

Parameters
[in]naNumber of aquifers
Here is the call graph for this function:
Here is the caller graph for this function:

◆ close_xoms_files()

subroutine modeldata_module::close_xoms_files
private

Close files with observations.

Here is the caller graph for this function:

◆ deallocate_regest_input_variables()

subroutine, public modeldata_module::deallocate_regest_input_variables

Deallocate input data for regression parameter estimates.

Here is the caller graph for this function:

◆ define_output_variables()

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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_current_xoms()

subroutine, public modeldata_module::get_current_xoms ( type(datetype), intent(in) cd,
integer, intent(in) n )

Get current observations from file.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_regest_parameter()

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.

Parameters
[in]isubcurrent subbasin
[in]iparcurrent regression parameter
[in,out]rgparparameter value
[in]termterm to be added to parameter
Here is the caller graph for this function:

◆ get_slc_output_for_routing_network()

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.

Parameters
[in]sumalandland area fraction for subbasins
[out]runoffrunoff for subbasins
[out]crunoffload of runoff
Here is the caller graph for this function:

◆ load_data_for_regression_parameter_estimate()

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.

Parameters
[in]dirFile directory (modeldir)
[in]nsbaseNumber of subbasins (model set-up)
[in]nsNumber of subbasins (submodel)
[in]indexarrayindex for basemodel
[out]statusStatus of subroutine

Algorithm
Initialise

Read catchment group and catchment descriptor information (CatchGroup.txt,CatchDes.txt)

Read reg_par.txt

Here is the call graph for this function:
Here is the caller graph for this function:

◆ load_modeldefined_input()

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.

Parameters
[in]dirFile directory (modeldir)
[in]dir2File directory (otherobsdir)
[in]nsmaxNumber of subbasins, basemodel
[in]nsNumber of subbasins, submodel
[in]indexarrayindex for basemodel
[in]bdateBegin simulation date
[in]edateEnd simulation date
[in]loadxomsflag for using xoms-files
[in]loadregsflag for using regression estimation-files
[in]loadcrunflag for using pre calculated slc output
[out]statusStatus of subroutine
Here is the call graph for this function:
Here is the caller graph for this function:

◆ load_regression_parameters()

subroutine modeldata_module::load_regression_parameters ( character(len=*), intent(in) dir,
integer, intent(out) status )
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.

Parameters
[in]dirFile directory
[out]statusStatus of subroutine

Algorithm

Allocate and load regression parameter coefficients

Here is the call graph for this function:
Here is the caller graph for this function:

◆ load_slc_output_for_routing_network()

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.

Parameters
[in]dirFile directory (modeldir)
[in]nsbaseNumber of subbasins (model set-up)
[in]bdateBegin simulation date
[in]edateEnd simulation date
[out]statusStatus 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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ load_xoms_files()

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 )
private

Reads files with different observations (xom0..xom9,xos0..xos9).

Parameters
[in]dirFile directory (otherobsdir, was forcingdir)
[in]nsNumber of subbasins
[in]bdateBegin simulation date
[in]edateEnd simulation date
[out]statusStatus of subroutine
Here is the call graph for this function:
Here is the caller graph for this function:

◆ model_version_information()

subroutine, public modeldata_module::model_version_information ( integer, intent(in) funit)

Information about the model version to print in log-file.

Parameters
[in]funitfileunit for log-file
Here is the caller graph for this function:

◆ open_modeldefined_outputfiles()

subroutine, public modeldata_module::open_modeldefined_outputfiles ( character(len=*), intent(in) dir,
integer, intent(in) n,
integer, intent(in) na )

Opens files for printout.

Parameters
[in]dirResult file directory
[in]nNumber of subbasins
[in]naNumber of aquifers
Here is the call graph for this function:
Here is the caller graph for this function:

◆ reload_modeldefined_observations()

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).

Parameters
[in]dirFile directory (otherobsdir)
[out]statusStatus of subroutine
Here is the call graph for this function:
Here is the caller graph for this function:

◆ reload_xoms_files()

subroutine modeldata_module::reload_xoms_files ( character(len=*), intent(in) dir,
integer, intent(out) status )
private

Prepare files with different observations (xom0..xom9,xos0..xos9) for rereading No checks.

Parameters
[in]dirFile directory (otherobsdir, was forcingdir)
[out]statusStatus of subroutine
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ catdes

real, dimension(:,:), allocatable modeldata_module::catdes
private

catchment descriptors for catchments to be used in parameter regionalization (nsub,npc_catdes)

◆ clust_group

integer, dimension(:), allocatable modeldata_module::clust_group
private

group id of catchment after catchments are grouped based on their charactersistics (nsub)

◆ funit_slc_output

integer, dimension(:), allocatable modeldata_module::funit_slc_output
private

◆ idx_catdes

integer, dimension(:,:,:), allocatable modeldata_module::idx_catdes
private

indices of the pca of catchment descriptors used for regionalization of the parameter (ngroup_cat,npar_regr,npc_catdes)

◆ indx_par

integer, dimension(:), allocatable modeldata_module::indx_par
private

contains info on whether a given parameter is regionally estimated and which parameter order it has (max_par)

◆ max_nstn

integer modeldata_module::max_nstn
private

Maximum number of stations (columns) in any file.

◆ max_xoms

integer, parameter, public modeldata_module::max_xoms = 10

Maximum number of xom- resp xos-files (0-9).

◆ ncom

integer, dimension(max_xoms,2) modeldata_module::ncom
private

Number of comment rows in Xoms files (starting with !!).

◆ ndes_reg

integer, dimension(:,:), allocatable modeldata_module::ndes_reg
private

number of descriptors used to regionalize each of the parameters in each group (ngroup_cat,npar_regr)

◆ ngroup_cat

integer modeldata_module::ngroup_cat
private

maximum number of catchment groups

◆ nlandbasins

integer modeldata_module::nlandbasins
private

Number of land basins (<= normal subbasins still used for routing).

◆ npar_regr

integer modeldata_module::npar_regr
private

number of parameters to be estimated using a regression relationship

◆ npc_catdes

integer modeldata_module::npc_catdes
private

maximum number of catchment descriptors

◆ num_xoms

integer, dimension(2), public modeldata_module::num_xoms

Number of xom- resp xos-files each.

◆ num_xomsfiles

integer modeldata_module::num_xomsfiles
private

Number of xom- resp xos-files (max filenumber).

◆ runoffindex

integer, dimension(:,:), allocatable modeldata_module::runoffindex
private

Index of land basin for each subbasin.

◆ slc_output_timeformat

integer modeldata_module::slc_output_timeformat
private

◆ wght_catdes

real, dimension(:,:,:), allocatable modeldata_module::wght_catdes
private

weights of the pca used to estimate the model parameter (ngroup_cat,npar_regr,npc_catdes)

◆ xom

real, dimension(:,:), allocatable, public modeldata_module::xom

Observations of current time step of variable averaged over period (nvar,nobs).

◆ xomindex

integer, dimension(:,:), allocatable modeldata_module::xomindex
private

Index of observations of variable averaged over period (nvar,subbasin).

◆ xoms_fbdate

type(datetype), dimension(:,:), allocatable modeldata_module::xoms_fbdate
private

File starting date within simulation period (nvar,2).

◆ xoms_fedate

type(datetype), dimension(:,:), allocatable modeldata_module::xoms_fedate
private

File ending date within simulation period (nvar,2).

◆ xoms_filename

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.

◆ xoms_funit

integer, dimension(:,:), allocatable modeldata_module::xoms_funit
private

File unit of files with observations (nvar,2).

◆ xoms_nstn

integer, dimension(:,:), allocatable modeldata_module::xoms_nstn
private

Number of stations (columns in file) (nvar,2).

◆ xoms_timeformat

integer, dimension(max_xoms,2) modeldata_module::xoms_timeformat
private

Date-time format of Xoms files (0 only date, 1 date and time).

◆ xos

real, dimension(:,:), allocatable, public modeldata_module::xos

Observations of current time step of variable summed over period (nvar,nobs).

◆ xosindex

integer, dimension(:,:), allocatable modeldata_module::xosindex
private

Index of observations of variable summed over period (nvar,subbasin).