HYPE
All Classes Namespaces Files Functions Variables Pages
Functions/Subroutines
output_module Module Reference

Functions/Subroutines

subroutine, public prepare_outputfiles (dir, n, na, iens, runens, allsim, ensstat)
 
subroutine, public close_outputfiles (n, na, iens, ensstat)
 
subroutine open_subbasinfiles (dir, n, iens, runens, allens, ensstat)
 
subroutine create_filename_for_basin (filename, basinid, usesuffix1, suffix1, suffix2, suffix2format, suffix3, suffix4)
 
subroutine, public write_subbasinfiles (io, idt, ndt, ct)
 
subroutine, public write_subbasinfiles_in_parallel (io, idt, ndt, iens, ct)
 
subroutine, public write_regionfiles (io, idt, ndt, ct)
 
subroutine, public write_regionfiles_in_parallel (io, idt, ndt, iens, ct)
 
subroutine, public write_subbasinfiles_class (io, idt, ndt, ct)
 
subroutine, public write_subbasinfiles_class_in_parallel (io, idt, ndt, iens, ct)
 
subroutine close_subbasinfiles (n, iens, ensstat)
 
subroutine open_timefiles (dir, n, iens, runens, allens, ensstat)
 
subroutine open_timefiles_classes (dir, n, iens, runens, allens, ensstat)
 
subroutine, public write_timefiles (io, idt, ndt, ct)
 
subroutine, public write_timefiles_netcdf (io, idt, ndt, ct)
 
subroutine, public write_timefiles_in_parallel (io, idt, ndt, iens, ct)
 
subroutine, public write_timefiles_netcdf_in_parallel (io, idt, ndt, iens, ct)
 
subroutine close_timefiles (iens, ensstat)
 
subroutine close_timefiles_class (iens, ensstat)
 
subroutine, public save_mapfiles (dir, ntime, iens, runens, allens)
 
subroutine, public save_loadfiles (dir, year)
 
subroutine, public write_subbasin_assessment (filedir, na, sas2, iens, runens)
 
subroutine, public write_simulation_assessment (dir, iens, n, optcrit, performance, runens, ccrit, cthres)
 
subroutine, public save_respar (dir, numpar, n)
 
subroutine get_parametervalues (varindex, n, dim, values, num)
 
subroutine, public prepare_save_all_simulations (dir, filename, funit, numpar, nperf, numcrit)
 
subroutine write_ensemble_simulations_heading (funit, numpar, nperf, numcrit, popflag)
 
subroutine, public save_ensemble_simulations (dir, numpar, nperf, numcrit, nsim, optcrit, performance, parameters)
 
subroutine, public write_simulation_results_perf_and_par (funit, i, mpar, numpar, nperf, numcrit, optcrit, performance, parameters, mlab, jpop, igen, iacc)
 

Detailed Description

Prepare for and save result.

Procedures for preparing output data and for saving result files

Function/Subroutine Documentation

◆ close_outputfiles()

subroutine, public output_module::close_outputfiles ( integer, intent(in)  n,
integer, intent(in)  na,
integer, intent(in)  iens,
integer, intent(in), optional  ensstat 
)

Manage standard output files; close files.

Parameters
[in]nNumber of subbasins
[in]naNumber of aquifers
[in]iensCurrent simulation
[in]ensstatFlag for writing parallell ensemble files
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ close_subbasinfiles()

subroutine output_module::close_subbasinfiles ( integer, intent(in)  n,
integer, intent(in)  iens,
integer, intent(in), optional  ensstat 
)

Close files for subbasin and output region printout.

Parameters
[in]nNumber of subbasins
[in]iensCurrent simulation
[in]ensstatFlag for writing parallell ensemble files
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ close_timefiles()

subroutine output_module::close_timefiles ( integer, intent(in)  iens,
integer, intent(in), optional  ensstat 
)

Close files for timeserie output.

Parameters
[in]iensCurrent simulation
[in]ensstatFlag for writing parallell ensemble files
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ close_timefiles_class()

subroutine output_module::close_timefiles_class ( integer, intent(in)  iens,
integer, intent(in), optional  ensstat 
)

Close files for timeserie output for classes.

Parameters
[in]iensCurrent simulation
[in]ensstatFlag for writing parallell ensemble files
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create_filename_for_basin()

subroutine output_module::create_filename_for_basin ( character(len=*), intent(out)  filename,
integer, intent(in)  basinid,
logical, intent(in)  usesuffix1,
character(len=*), intent(in), optional  suffix1,
integer, intent(in), optional  suffix2,
logical, intent(in), optional  suffix2format,
integer, intent(in), optional  suffix3,
character(len=*), intent(in), optional  suffix4 
)

Create file name string for subbasin- or outregion file.

Parameters
[in]basinidsubid or outregid; to be name of file
[in]usesuffix1status of using suffix1
[in]suffix1string file suffix
[in]suffix2integer file suffix
[in]suffix2formatuse 6 character suffix instead of three
[in]suffix3integer suffix for classoutput
[in]suffix4classgroup name suffix
+ Here is the caller graph for this function:

◆ get_parametervalues()

subroutine output_module::get_parametervalues ( integer, intent(in)  varindex,
integer, intent(in)  n,
integer, intent(in)  dim,
real, dimension(dim), intent(out)  values,
integer, intent(out)  num 
)

Collect parameter values from model variables.

Parameters
[in]varindexmodel parameter index
[in]nnumber of subbasins
[in]dimmax number of parameter values (soil types/land uses/subbasins)
[out]valuesparameter values
[out]numnumber of parameter values (soil types/land uses/subbasins) that are used

Algoritm
Depending on variable type: Find variable dimension and parameter values

+ Here is the caller graph for this function:

◆ open_subbasinfiles()

subroutine output_module::open_subbasinfiles ( character(len=*), intent(in)  dir,
integer, intent(in)  n,
integer, intent(in)  iens,
logical, intent(in)  runens,
logical, intent(in)  allens,
integer, intent(in), optional  ensstat 
)

Opens files for subbasin and output region printout, including classoutput.

Parameters
[in]dirResult file directory
[in]nNumber of subbasins
[in]iensCurrent simulation
[in]runensFlag for ensemble simulation
[in]allensFlag for writing all ensemble results, i.e. 6 characters for integer
[in]ensstatFlag for writing parallell ensemble files
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ open_timefiles()

subroutine output_module::open_timefiles ( character(len=*), intent(in)  dir,
integer, intent(in)  n,
integer, intent(in)  iens,
logical, intent(in)  runens,
logical, intent(in)  allens,
integer, intent(in), optional  ensstat 
)

Opens files for timeserie printout.

Parameters
[in]dirFile directory
[in]nNumber of data columns (subbasins)
[in]iensCurrent simulation
[in]runensFlag for ensemble run
[in]allensFlag for writing all ensemble results
[in]ensstatFlag for writing parallell ensemble files
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ open_timefiles_classes()

subroutine output_module::open_timefiles_classes ( character(len=*), intent(in)  dir,
integer, intent(in)  n,
integer, intent(in)  iens,
logical, intent(in)  runens,
logical, intent(in)  allens,
integer, intent(in), optional  ensstat 
)

Opens files for timeserie printout of classes.

Parameters
[in]dirFile directory
[in]nNumber of data columns (subbasins)
[in]iensCurrent simulation
[in]runensFlag for ensemble run
[in]allensFlag for writing all ensemble results
[in]ensstatFlag for writing parallell ensemble files
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ prepare_outputfiles()

subroutine, public output_module::prepare_outputfiles ( character(len=*), intent(in)  dir,
integer, intent(in)  n,
integer, intent(in)  na,
integer, intent(in)  iens,
logical, intent(in)  runens,
logical, intent(in)  allsim,
integer, intent(in), optional  ensstat 
)

Manage standard output files; opens files and write heading.

Parameters
[in]dirResult file directory
[in]nNumber of subbasins
[in]naNumber of aquifers
[in]iensCurrent simulation
[in]runensFlag for using ensemble number of ensemble simulation
[in]allsimFlag for writing all simulation results
[in]ensstatFlag for writing parallell ensemble files
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ prepare_save_all_simulations()

subroutine, public output_module::prepare_save_all_simulations ( character(len=*), intent(in)  dir,
character(len=*), intent(in)  filename,
integer, intent(in)  funit,
integer, intent(in)  numpar,
integer, intent(in)  nperf,
integer, intent(in)  numcrit 
)

Prepare a file to writes result from all MonteCarlo simulations.

Parameters
[in]dirFile directory
[in]funitUnit to be connected to file
[in]numparNumber of optimised parameters
[in]nperfNumber of performance measures
[in]numcritNumber of optimised variables
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save_ensemble_simulations()

subroutine, public output_module::save_ensemble_simulations ( character(len=*), intent(in)  dir,
integer, intent(in)  numpar,
integer, intent(in)  nperf,
integer, intent(in)  numcrit,
integer, intent(in)  nsim,
real, dimension(nsim), intent(in)  optcrit,
real, dimension(nsim,nperf,numcrit), intent(in)  performance,
real, dimension(nsim,numpar), intent(in)  parameters 
)

Write to file result from the nsim best MonteCarlo simulations.

Parameters
[in]dirFile directory
[in]numparNumber of optimised parameters
[in]nperfNumber of performance measures
[in]numcritNumber of optimised variables
[in]nsimNumber of simulations to be saved
[in]optcritOptimation criterion for simulations
[in]performancePerformance measures for simulations
[in]parametersParameter values for simulations
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save_loadfiles()

subroutine, public output_module::save_loadfiles ( character(len=*), intent(in)  dir,
integer, intent(in)  year 
)

Save the loads for the last year to files. Subroutine is called once per year. Could be the load of a part (period) of the last year.

Consequences Module worldvar variable accload are zeroed.

Parameters
[in]dirFile directory
[in]yearCurrent year

Algorithm
Preparation to write heading

Save data to one file per substance (not including T2)

  • Open file
  • Write heading prepared above
  • Write data for each subbasin on rows

Reset accumulation variables to zero at end of year (or output period)

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

◆ save_mapfiles()

subroutine, public output_module::save_mapfiles ( character(len=*), intent(in)  dir,
integer, intent(in)  ntime,
integer, intent(in)  iens,
logical, intent(in)  runens,
logical, intent(in)  allens 
)

Writes the files with data in format suitable for mapping.

Parameters
[in]dirFile directory
[in]ntimeNumber of values in vector = number of timesteps
[in]iensCurrent simulation
[in]runensFlag for ensemble simulation
[in]allensFlag for writing all ensemble results
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save_respar()

subroutine, public output_module::save_respar ( character(len=*), intent(in)  dir,
integer, intent(in)  numpar,
integer, intent(in)  n 
)

Save optimal values of optimized parameters to file respar.txt.

Parameters
[in]dirFile directory
[in]numparnumber of parameters that has been calibrated
[in]nnumber of subbasins

Algoritm
Allocate and initiate local variables

Open file for writing parameter and write heading

For every calibrated parameter:

  • Get current parameter value
  • Write parameter to file
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ write_ensemble_simulations_heading()

subroutine output_module::write_ensemble_simulations_heading ( integer, intent(in)  funit,
integer, intent(in)  numpar,
integer, intent(in)  nperf,
integer, intent(in)  numcrit,
logical, intent(in)  popflag 
)
private

Write heading to file for MonteCarlo simulations.

Parameters
[in]funitFile unit
[in]numparNumber of optimised parameters
[in]nperfNumber of performance measures
[in]numcritNumber of optimised variables
[in]popflagFlag for population columns included
+ Here is the caller graph for this function:

◆ write_regionfiles()

subroutine, public output_module::write_regionfiles ( integer, intent(in)  io,
integer, intent(in)  idt,
integer, intent(in)  ndt,
type(timeinformationtype), intent(in)  ct 
)

Calculate and write output region files.

Parameters
[in]ioCurrent output
[in]idtCurrent time step
[in]ndtMaximum simulation time steps
[in]ctCurrent time
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ write_regionfiles_in_parallel()

subroutine, public output_module::write_regionfiles_in_parallel ( integer, intent(in)  io,
integer, intent(in)  idt,
integer, intent(in)  ndt,
integer, intent(in)  iens,
type(timeinformationtype), intent(in)  ct 
)

Calculate and write output region files.

Parameters
[in]ioCurrent output
[in]idtCurrent time step
[in]ndtMaximum simulation time steps
[in]iensCurrent simulation
[in]ctCurrent date-time
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ write_simulation_assessment()

subroutine, public output_module::write_simulation_assessment ( character(len=*), intent(in)  dir,
integer, intent(in)  iens,
integer, intent(in)  n,
real, intent(in)  optcrit,
real, dimension(maxperf,n), intent(in)  performance,
logical, intent(in)  runens,
real, intent(in), optional  ccrit,
real, intent(in), optional  cthres 
)

Writes the simulation assessment to hyss file and separate file.

Parameters
[in]dirFile directory
[in]iensCurrent simulation
[in]nDimension of performance measures
[in]optcritOpimization criterion value
[in]runensFlag for ensemble simulation
[in]ccritconditional criteria
[in]cthresconditional criteria threshold
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ write_simulation_results_perf_and_par()

subroutine, public output_module::write_simulation_results_perf_and_par ( integer, intent(in)  funit,
integer, intent(in)  i,
integer, intent(in)  mpar,
integer, intent(in)  numpar,
integer, intent(in)  nperf,
integer, intent(in)  numcrit,
real, intent(in)  optcrit,
real, dimension(nperf,numcrit), intent(in)  performance,
real, dimension(mpar), intent(in)  parameters,
logical, intent(in)  mlab,
integer, intent(in), optional  jpop,
integer, intent(in), optional  igen,
integer, intent(in), optional  iacc 
)

Write the performance result and used parameter values from the last simulations to a file.

Parameters
[in]funitFile unit
[in]iSimulation number
[in]mparDimension of parameters
[in]numparNumber of optimised parameters
[in]nperfNumber of performance measures
[in]numcritNumber of optimised variables
[in]optcritValue of optimation criterion for the simulation
[in]performanceperformance criteria for the simulation
[in]parametersParameter values for the simulation
[in]mlabMATLAB format for print out
[in]jpopPopulation Index in DE-MC simulation
[in]igenGeneration Index in DE-MC simulation
[in]iaccAcceptance Index in DE-MC simulation
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ write_subbasin_assessment()

subroutine, public output_module::write_subbasin_assessment ( character(len=*), intent(in)  filedir,
integer, intent(in)  na,
real, dimension(:,:,:), intent(in)  sas2,
integer, intent(in)  iens,
logical, intent(in)  runens 
)

Writes subbasin/output region assessment to file subassX.txt for each pair of compared variables.

Parameters
[in]filedirFile directory
[in]nadimension of performance measures (variables)
[in]sas2assessment values
[in]iensCurrent simulation
[in]runensFlag for ensemble simulation

Algorithm
Set number format, default is four decimals

Set subass writing format, number of columns

For every pair of variables to be compared

  • Determine the filename and open a file
  • Create comment row of file
  • Create heading of columns
  • Write heading to file
  • Write data to file
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ write_subbasinfiles()

subroutine, public output_module::write_subbasinfiles ( integer, intent(in)  io,
integer, intent(in)  idt,
integer, intent(in)  ndt,
type(timeinformationtype), intent(in)  ct 
)

Calculate and write subbasin files.

Parameters
[in]ioCurrent output
[in]idtCurrent time
[in]ndtMaximum simulation time
[in]ctcurrent time
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ write_subbasinfiles_class()

subroutine, public output_module::write_subbasinfiles_class ( integer, intent(in)  io,
integer, intent(in)  idt,
integer, intent(in)  ndt,
type(timeinformationtype), intent(in)  ct 
)

Calculate and write subbasin files.

Parameters
[in]ioCurrent output
[in]idtCurrent time
[in]ndtMaximum simulation time
[in]ctcurrent time
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ write_subbasinfiles_class_in_parallel()

subroutine, public output_module::write_subbasinfiles_class_in_parallel ( integer, intent(in)  io,
integer, intent(in)  idt,
integer, intent(in)  ndt,
integer, intent(in)  iens,
type(timeinformationtype), intent(in)  ct 
)

Calculate and write subbasin files (special for assimilation) Writes sequences' files in parallel.

Parameters
[in]ioCurrent output
[in]idtCurrent time
[in]ndtMaximum simulation time
[in]iensCurrent simulation
[in]ctcurrent time
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ write_subbasinfiles_in_parallel()

subroutine, public output_module::write_subbasinfiles_in_parallel ( integer, intent(in)  io,
integer, intent(in)  idt,
integer, intent(in)  ndt,
integer, intent(in)  iens,
type(timeinformationtype), intent(in)  ct 
)

Calculate and write subbasin files (special for assimilation) Writes sequences' files in parallel.

Parameters
[in]ioCurrent output
[in]idtCurrent time step
[in]ndtMaximum simulation time
[in]iensCurrent simulation
[in]ctcurrent time
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ write_timefiles()

subroutine, public output_module::write_timefiles ( integer, intent(in)  io,
integer, intent(in)  idt,
integer, intent(in)  ndt,
type(timeinformationtype), intent(in)  ct 
)

Calculate time aggregate of time-output and writes to file.

Parameters
[in]ioCurrent output
[in]idtCurrent time
[in]ndtMaximum simulation time
[in]ctcurrent time
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ write_timefiles_in_parallel()

subroutine, public output_module::write_timefiles_in_parallel ( integer, intent(in)  io,
integer, intent(in)  idt,
integer, intent(in)  ndt,
integer, intent(in)  iens,
type(timeinformationtype), intent(in)  ct 
)

Calculate time aggregate of time-output and writes to file (special for data assimilation)

Parameters
[in]ioCurrent output
[in]idtCurrent timestep
[in]ndtMaximum simulation time
[in]iensCurrent simulation
[in]ctcurrent time
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ write_timefiles_netcdf()

subroutine, public output_module::write_timefiles_netcdf ( integer, intent(in)  io,
integer, intent(in)  idt,
integer, intent(in)  ndt,
type(timeinformationtype), intent(in)  ct 
)

Calculate time aggregate of time-output and writes to file.

Parameters
[in]ioCurrent output
[in]idtCurrent time
[in]ndtMaximum simulation time
[in]ctcurrent time
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ write_timefiles_netcdf_in_parallel()

subroutine, public output_module::write_timefiles_netcdf_in_parallel ( integer, intent(in)  io,
integer, intent(in)  idt,
integer, intent(in)  ndt,
integer, intent(in)  iens,
type(timeinformationtype), intent(in)  ct 
)

Calculate time aggregate of time-output and writes to file (special for data assimilation)

Parameters
[in]ioCurrent output
[in]idtCurrent time
[in]ndtMaximum simulation time
[in]iensCurrent simulation
[in]ctcurrent time
+ Here is the call graph for this function:
+ Here is the caller graph for this function: