HYPE
Loading...
Searching...
No Matches
worvar.f90 File Reference

Data Types

type  worldvar::forcingdatatype
type  worldvar::observationdatatype
type  worldvar::calibrationinfo
type  worldvar::optimizationtype
type  worldvar::accumulationinfo
type  worldvar::basemodeltype
type  worldvar::outstatetype
type  worldvar::instatetype
type  worldvar::outvarinfotype
type  worldvar::outputvariabletype
type  worldvar::outputdatatype
type  worldvar::outputtype
type  worldvar::classgrouptype
type  worldvar::outregioninfotype
type  worldvar::testoutvartype
type  worldvar::netcdf_time_definition

Modules

module  worldvar

Procedures

subroutine worldvar::allocate_outvar_test (nout)
subroutine worldvar::da_allocate_accumulation (n, nsta)
subroutine worldvar::allocate_accumulation (n)
subroutine worldvar::reallocate_outvar_information (nnew, nnewclass)
subroutine worldvar::get_classgroup_classes (name, nslc, classindex)
integer function worldvar::get_classgroup_index (name)
subroutine worldvar::set_output (itype, iout, maxout, dimout, outv, n, per, ndec, nsig, useperiod, aggarea, maxa, na, area, classgroupname)
subroutine worldvar::set_netcdfoutput_time_definition (str, indate)
subroutine worldvar::initialize_outstate (localoutstate)
subroutine worldvar::set_outstate_dates (dim, dates, localoutstate)
logical function worldvar::status_write_outstate (d, localoutstate)
type(datetype) function worldvar::get_current_date_memory (i)
real function, dimension(n) worldvar::get_current_qobs (i, n)
real function, dimension(n) worldvar::get_current_wobs (i, n)
real function, dimension(xcolworldvar::get_current_xobs (i)
real function, dimension(xorcolworldvar::get_current_xoregobs (i)
real function, dimension(xcgcolworldvar::get_current_xcgobs (i)
real function, dimension(obsdata%ncols) worldvar::get_current_forcing_from_memory (i, obsdata)
subroutine worldvar::set_criteria_settings (a, n, c, ccg, ccgrec, per, lim, subass, dec, w, critvars, par, cond, thres)
subroutine worldvar::set_maxmap (tstep, per)
subroutine worldvar::deallocate_worldvar ()
subroutine worldvar::allocate_mcvariables (nbest, npar, nperf, numcrit)
subroutine worldvar::deallocate_mcvariables ()
subroutine worldvar::prepare_ens_fileunit_array (nsub, ensstat)
subroutine worldvar::get_fileunit (newfileunit)
subroutine worldvar::fileunit_free (funit)
subroutine worldvar::get_seq_filename (fname)
character(len=fnlen) function worldvar::add_date_to_filename (date, fnlen, filename)
subroutine worldvar::set_directory (idir, dir, ddir)
subroutine worldvar::count_optim_par (dim1, dim2)
subroutine worldvar::allocate_and_initialize_forcingdata_structure ()
integer function worldvar::get_forcing_id (name)
character(len=ll) function worldvar::get_steplength_string (ll, iperiod)

Variables

Miscellaneous constant parameters and variables
integer, parameter worldvar::maxcharpath = 400
integer, parameter worldvar::maxcrit = 100
integer, parameter worldvar::maxoptpar = 100
integer, parameter worldvar::maxclassingroup = 100
integer, parameter worldvar::maxgeoclasscol = 13
integer, parameter worldvar::maxclassdatacol = 17
integer, parameter worldvar::maxlinelength = 6800000
integer, parameter worldvar::maxdatefiles = 20
real, parameter worldvar::meandaysofyear = 365.25
integer, parameter worldvar::seconds_per_day = 86400
character(len=2), parameter worldvar::comment_str ='!!'
Constant file parameters

Files that are frequently used have their own file unit number and file name parameter. Files opened and closed in sequence use the temporary fileunit 101. The HYSS log-file uses the standard output fileunit 6.

integer, parameter worldvar::fileunit_base = 200
integer, parameter worldvar::max_files = 100000
logical, dimension(max_files), private worldvar::fileunit_occupied
integer, parameter worldvar::fileunit_temp = 101
integer, parameter worldvar::fileunit_qobs = 104
integer worldvar::fileunit_wobs
integer, parameter worldvar::fileunit_xobs = 105
integer, parameter worldvar::fileunit_mc = 106
integer, parameter worldvar::fileunit_callog = 107
integer, parameter worldvar::fileunit_xoreg = 108
integer, parameter worldvar::fileunit_tests = 109
integer, parameter worldvar::fileunit_psts = 110
integer, dimension(:,:,:), allocatable worldvar::fid_assim_ens
character(len=8), parameter worldvar::filename_qobs = 'Qobs.txt'
character(len=8), parameter worldvar::filename_wobs = 'Wobs.txt'
character(len=8), parameter worldvar::filename_xobs = 'Xobs.txt'
character(len=12), parameter worldvar::filename_xoreg = 'Xoregobs.txt'
character(len=10), parameter worldvar::filename_mc = 'allsim.txt'
character(len=12), parameter worldvar::filename_best = 'bestsims.txt'
character(len=10), parameter worldvar::filename_upd = 'update.txt'
character(len=15), parameter worldvar::filename_callog = 'calibration.log'
character(len=20), parameter worldvar::filename_resetstate = 'reset_state_save.txt'
Data type parameters

These codes are used when reading model run settings and model parameter values from files.

integer, parameter worldvar::i_str =0
integer, parameter worldvar::i_intg =1
integer, parameter worldvar::i_real =2
Forcing data constants

Codes for forcing data and other observations in forcing data structure

integer, parameter worldvar::i_pobs = 1
integer, parameter worldvar::i_tobs = 2
integer, parameter worldvar::i_tminobs = 3
integer, parameter worldvar::i_tmaxobs = 4
integer, parameter worldvar::i_rhobs = 5
integer, parameter worldvar::i_sfobs = 6
integer, parameter worldvar::i_swobs = 7
integer, parameter worldvar::i_uobs = 8
integer, parameter worldvar::i_uwobs = 9
integer, parameter worldvar::i_vwobs = 10
integer, parameter worldvar::max_forcingdata = 10
Criterion related constant parameters

An index code is used for simulation assessment criteria-arrays. Short names for criteria are defined.

integer, parameter worldvar::i_rnse = 1
integer, parameter worldvar::i_snse = 2
integer, parameter worldvar::i_mnse = 3
integer, parameter worldvar::i_rmae = 4
integer, parameter worldvar::i_sre = 5
integer, parameter worldvar::i_rre = 6
integer, parameter worldvar::i_mre = 7
integer, parameter worldvar::i_rra = 8
integer, parameter worldvar::i_sra = 9
integer, parameter worldvar::i_mra = 10
integer, parameter worldvar::i_tau = 11
integer, parameter worldvar::i_mdnse = 12
integer, parameter worldvar::i_mdra = 13
integer, parameter worldvar::i_mstdre = 14
integer, parameter worldvar::i_mcc = 15
integer, parameter worldvar::i_mdkg = 16
integer, parameter worldvar::i_akg = 17
integer, parameter worldvar::i_asckg = 18
integer, parameter worldvar::i_mabsre = 19
integer, parameter worldvar::i_mnrmse = 20
integer, parameter worldvar::i_mnw = 21
integer, parameter worldvar::i_snr = 22
integer, parameter worldvar::i_smb = 23
integer, parameter worldvar::i_numrc = 24
integer, parameter worldvar::i_nummc = 25
integer, parameter worldvar::maxperf = 25
integer, parameter worldvar::maxsubass = 22
character(len=5), dimension(maxperf), parameter worldvar::performance_name = (/'rr2 ','sr2 ', 'mr2 ','rmae ','sre ','rre ','mre ','rra ', 'sra ','mra ','tau ','md2 ','mda ','mrs ', 'mcc ','mdkg ','akg ','asckg','mar ','mdnr ', 'mnw ','snr ','smb ','numrc','nummc'/)
Variables for model simulation setting

Information about the model simulation comes from the file info.txt.

character(len=maxcharpathworldvar::infodir
character(len=maxcharpathworldvar::modeldir
character(len=maxcharpathworldvar::forcingdir
character(len=maxcharpathworldvar::otherobsdir
character(len=maxcharpathworldvar::loadleakdir
character(len=maxcharpathworldvar::resdir
character(len=maxcharpathworldvar::logdir
type(datetypeworldvar::steplen
type(datetypeworldvar::bdate
type(datetypeworldvar::sdate
type(datetype), dimension(maxdatefilesworldvar::readadddate
type(datetype), dimension(maxdatefilesworldvar::readnpddate
type(datetype), dimension(maxdatefilesworldvar::readclddate
type(datetypeworldvar::outstartdate
type(datetype), dimension(:), allocatable worldvar::psdates
logical worldvar::readdaily
logical worldvar::writematlab
logical worldvar::writeload
logical worldvar::writeattr
logical worldvar::writencattr
logical worldvar::readobsid
logical worldvar::readpstime
logical worldvar::readoutregion
logical worldvar::resultseq
logical worldvar::parseq
logical worldvar::usestop84
integer worldvar::num_classgroups
integer worldvar::simsequence
integer worldvar::ndt
integer worldvar::indatacheckonoff
integer worldvar::indatachecklevel
logical worldvar::resetstate
logical worldvar::simsubmodel
type(basemodeltypeworldvar::basemodel
type(instatetypeworldvar::instate
type(outstatetypeworldvar::outstate
type(outstatetypeworldvar::outstateensemble
Forcing data and other observations variables and structures
type(datetype), dimension(:), allocatable worldvar::dates
integer, dimension(:), allocatable worldvar::winxobsindex
real, dimension(:,:), allocatable worldvar::qobs
real, dimension(:,:), allocatable worldvar::wobs
real, dimension(:,:), allocatable worldvar::xobs
real, dimension(:,:), allocatable worldvar::xoregobs
real, dimension(:,:), allocatable worldvar::xcgobs
integer worldvar::numwobsstn
integer worldvar::ncomrowsofwobs
integer worldvar::ncomrowsofxobs
integer worldvar::ncomrowsofxoregobs
integer worldvar::xcol = 0
integer worldvar::xorcol = 0
integer worldvar::xcgcol = 0
integer worldvar::readformat
integer, dimension(4) worldvar::qxtimeformat
integer worldvar::outputtimeformat
type(datetypeworldvar::bwdate
type(datetypeworldvar::ewdate
type(datetypeworldvar::bxdate
type(datetypeworldvar::exdate
type(datetypeworldvar::bxrdate
type(datetypeworldvar::exrdate
type(datetypeworldvar::bpsdate
type(datetypeworldvar::epsdate
logical worldvar::readwobs = .FALSE.
logical worldvar::conductwobs = .FALSE.
logical worldvar::conductwinx = .FALSE.
type(forcingdatatype), dimension(:), allocatable worldvar::forcingdata
logical worldvar::dailypsfile = .FALSE.
logical worldvar::monthlypsfile = .FALSE.
logical worldvar::yearlypsfile = .FALSE.
integer worldvar::pstscol
type(observationdatatypeworldvar::qobsdata
type(observationdatatype), dimension(:), allocatable worldvar::xobsdata
type(observationdatatype), dimension(:), allocatable worldvar::xregobsdata
type(observationdatatype), dimension(:,:), allocatable worldvar::xcgobsdata
integer worldvar::nc_timevar
Constant parameters for output
integer, parameter worldvar::max_typeofoutput = 4
integer, parameter worldvar::maxoutbasins = 10000
integer, parameter worldvar::maxcritbasins = 150000
integer, parameter worldvar::ncmaxattr = 50
integer, parameter worldvar::i_t =0
integer, parameter worldvar::i_d =1
integer, parameter worldvar::i_w =2
integer, parameter worldvar::i_m =3
integer, parameter worldvar::i_y =4
integer, parameter worldvar::i_s =5
integer, parameter worldvar::i_h =6
integer, parameter worldvar::max_typeofperiods = 6
character(len=2), dimension(0:max_typeofperiods), parameter worldvar::outperiodname = (/'TS','DD','WK','MO','YR','SP','HR'/)
Variables for output

These variables hold information about wanted output, accumulation of output variables for period output. HYSS handles three kind of output. Basin output gives one file for each subbasin with time series of selected variables in columns. Time output gives one file for each selected variable with time series for each subbasin in columns. Map output gives one file for each selected variable with subbasins in rows and possibly several time periods in columns.

type(outputtype), dimension(:), allocatable worldvar::output
type(classgrouptype), dimension(:), allocatable worldvar::classgroup2
type(outregioninfotype), dimension(:), allocatable worldvar::outregion
type(outvarinfotype), dimension(:), allocatable worldvar::outvarinfo
type(outvarinfotype), dimension(:), allocatable worldvar::outvarclassinfo
type(outvarinfotype), dimension(:), allocatable worldvar::outvarinfotemp
type(outvarinfotype), dimension(:), allocatable worldvar::outvarclassinfotemp
type(testoutvartype), dimension(:), allocatable worldvar::outvartest
type(netcdf_time_definitionworldvar::nc_timedef
integer worldvar::noutput
integer worldvar::noutreg
character(len=20), dimension(:), allocatable worldvar::maptime
character(len=50), dimension(:), allocatable worldvar::ncfileatt_name
character(len=500), dimension(:), allocatable worldvar::ncfileatt_text
character(len=50), dimension(:), allocatable worldvar::fileatt_name
character(len=500), dimension(:), allocatable worldvar::fileatt_text
integer worldvar::tmap
integer worldvar::dtskip
integer worldvar::dtmonday
integer worldvar::maxmap
integer worldvar::idtlag
Variables for criteria evaluation, optimisation and parameter ensemble simulation

A number of variables are used during calibration. These include information about what calibration to do, including calibration parameter settings, model parameter space to optimize, and index-variables to locate them. Also result of on-going optimization, control variables for optimization progress.

integer worldvar::dimpar
integer worldvar::numoptimpar
integer worldvar::optimfunccall
integer worldvar::linesearchcallcount
integer worldvar::calvarper
integer worldvar::calvarlim
integer worldvar::subassoutput
integer worldvar::subassform
integer worldvar::ncrit
integer worldvar::nacrit
integer, dimension(maxoptparworldvar::optparid
real worldvar::optimstarttime
logical worldvar::weightsub = .FALSE.
logical worldvar::doopt = .FALSE.
logical worldvar::doens = .FALSE.
logical worldvar::anycondcrit = .FALSE.
type(calibrationinfo), dimension(:), allocatable worldvar::calvar
type(accumulationinfo), dimension(:), allocatable worldvar::acccalvar
real, dimension(:,:), allocatable worldvar::optparmin
real, dimension(:,:), allocatable worldvar::optparmax
real, dimension(:,:), allocatable worldvar::optparprecision
integer, dimension(:,:), allocatable worldvar::parindex
type(optimizationtypeworldvar::optim
real, dimension(:,:), allocatable worldvar::bestmcparameters
real, dimension(:), allocatable worldvar::bestmcoptcrit
real, dimension(:,:,:), allocatable worldvar::bestmcperformance
real, dimension(:), allocatable worldvar::bestmccondcrit
Criteria calculation variables

Several criteria may be calculated during a simulation, but only one (often a combination of different criteria) is used for optimization. Criteria are most often calculated from variables accumulated during the simulation, but some need all values present when the criterion is calculated.

integer worldvar::nsubcrit
double precision, dimension(:,:,:), allocatable worldvar::critvec
real, dimension(:,:), allocatable worldvar::rs
real, dimension(:,:), allocatable worldvar::cs
integer, dimension(:,:), allocatable worldvar::ts
real, dimension(:,:), allocatable worldvar::ktcomp
real, dimension(:,:), allocatable worldvar::ktcomp2
real, dimension(:,:), allocatable worldvar::ktcomp3
real, dimension(:,:), allocatable worldvar::ktcomp4
real, dimension(:,:), allocatable worldvar::ktrec
real, dimension(:,:), allocatable worldvar::ktrec2
real, dimension(:,:), allocatable worldvar::ktrec3
real, dimension(:,:), allocatable worldvar::ktrec4
integer, dimension(:), allocatable worldvar::ktnum
integer, dimension(:), allocatable worldvar::ktnum2
integer, dimension(:), allocatable worldvar::ktnum3
integer, dimension(:), allocatable worldvar::ktnum4
integer, dimension(:), allocatable worldvar::subinclcrit
logical, dimension(:), allocatable worldvar::subforcrit
real, dimension(:), allocatable worldvar::subweightcrit
Variables for Data Assimilation

Most variables needed for the assimilation-routines are defined in the assimilation-modules. However, one basic flag called doassimilation is declared here, and read from info.txt by data.f90 (assimilation y/n).

logical worldvar::doassimilation = .FALSE.

Detailed Description

Contains module worldvar.