utilities Module


Used by

  • module~~utilities~~UsedByGraph module~utilities utilities module~river river module~river->module~utilities module~subbasin subbasin module~subbasin->module~utilities proc~output_check_requested_vars output_check_requested_vars proc~output_check_requested_vars->module~utilities module~vegetation vegetation module~vegetation->module~utilities proc~output_open_files output_open_files proc~output_open_files->module~utilities proc~hydrotope_subbasin_division hydrotope_subbasin_division proc~hydrotope_subbasin_division->module~utilities module~erosion erosion module~erosion->module~utilities proc~soil_curve_number_alpha soil_curve_number_alpha proc~soil_curve_number_alpha->module~utilities module~hydrotope hydrotope module~hydrotope->module~utilities proc~output_initialise_user_input output_initialise_user_input proc~output_initialise_user_input->module~utilities module~input input proc~output_initialise_user_input->module~input proc~soil_read_input soil_read_input proc~soil_read_input->module~utilities proc~soil_read_input->module~input proc~output_initialise output_initialise proc~output_initialise->module~utilities proc~output_open_file output_open_file proc~output_open_file->module~utilities proc~management_convert_to_daily management_convert_to_daily proc~management_convert_to_daily->module~utilities module~catchment catchment module~catchment->module~utilities module~catchment->module~subbasin module~catchment->module~input proc~catchment_read_subcatch_params catchment_read_subcatch_params proc~catchment_read_subcatch_params->module~utilities proc~catchment_read_subcatch_params->module~river module~evapotranspiration evapotranspiration proc~catchment_read_subcatch_params->module~evapotranspiration module~snow snow proc~catchment_read_subcatch_params->module~snow module~soil soil proc~catchment_read_subcatch_params->module~soil proc~catchment_read_subcatch_params->module~input module~groundwater groundwater proc~catchment_read_subcatch_params->module~groundwater proc~soil_initialise soil_initialise proc~soil_initialise->module~utilities module~output output proc~soil_initialise->module~output proc~soil_initialise->module~input module~landuse landuse module~landuse->module~utilities module~reservoir reservoir module~reservoir->module~utilities proc~print_splash print_splash proc~print_splash->module~utilities module~management management module~management->module~utilities module~evapotranspiration->module~utilities proc~time_initialise time_initialise proc~time_initialise->module~utilities proc~time_initialise->module~input module~snow->module~utilities proc~management_initialise management_initialise proc~management_initialise->module~utilities proc~print_help print_help proc~print_help->module~utilities proc~hydrotope_allocate hydrotope_allocate proc~hydrotope_allocate->module~utilities module~soil->module~utilities module~time time module~time->module~utilities proc~subbasin_initialise subbasin_initialise proc~subbasin_initialise->module~utilities proc~subbasin_initialise->module~output proc~subbasin_initialise->module~input proc~output_print_variables output_print_variables proc~output_print_variables->module~utilities proc~initialise initialise proc~initialise->module~utilities proc~initialise->module~river proc~initialise->module~subbasin proc~initialise->module~vegetation proc~initialise->module~erosion proc~initialise->module~hydrotope proc~initialise->module~catchment proc~initialise->module~landuse proc~initialise->module~reservoir proc~initialise->module~management proc~initialise->module~evapotranspiration proc~initialise->module~snow proc~initialise->module~soil proc~initialise->module~time proc~initialise->module~output module~nutrient nutrient proc~initialise->module~nutrient module~crop crop proc~initialise->module~crop proc~initialise->module~input proc~initialise->module~groundwater module~output->module~utilities proc~output_register_var output_register_var proc~output_register_var->module~utilities module~nutrient->module~utilities module~crop->module~utilities module~input->module~utilities proc~output_initialise_labelled output_initialise_labelled proc~output_initialise_labelled->module~utilities proc~output_initialise_labelled->module~input proc~output_initialise_storage_index output_initialise_storage_index proc~output_initialise_storage_index->module~utilities proc~management_read_time_series management_read_time_series proc~management_read_time_series->module~utilities proc~management_read_time_series->module~input module~groundwater->module~utilities proc~crop_growth crop_growth proc~crop_growth->module~vegetation proc~crop_growth->module~nutrient proc~snow_read_input snow_read_input proc~snow_read_input->module~input proc~management_write_user_output management_write_user_output proc~management_write_user_output->module~output proc~vegetation_initialise vegetation_initialise proc~vegetation_initialise->module~output proc~vegetation_initialise->module~input proc~snow_initialise snow_initialise proc~snow_initialise->module~output proc~snow_initialise->module~input proc~reservoir_read_storage_file reservoir_read_storage_file proc~reservoir_read_storage_file->module~input proc~runsubbasin runsubbasin proc~runsubbasin->module~river proc~runsubbasin->module~vegetation proc~runsubbasin->module~erosion proc~runsubbasin->module~hydrotope proc~runsubbasin->module~landuse proc~runsubbasin->module~reservoir proc~runsubbasin->module~management proc~runsubbasin->module~evapotranspiration proc~runsubbasin->module~snow proc~runsubbasin->module~soil proc~runsubbasin->module~output proc~runsubbasin->module~nutrient proc~runsubbasin->module~crop proc~runsubbasin->module~groundwater proc~evapotranspiration_read_input evapotranspiration_read_input proc~evapotranspiration_read_input->module~input proc~management_read_ctrl management_read_ctrl proc~management_read_ctrl->module~input proc~print_module_parameters print_module_parameters proc~print_module_parameters->module~river proc~print_module_parameters->module~subbasin proc~print_module_parameters->module~vegetation proc~print_module_parameters->module~erosion proc~print_module_parameters->module~catchment proc~print_module_parameters->module~landuse proc~print_module_parameters->module~reservoir proc~print_module_parameters->module~management proc~print_module_parameters->module~evapotranspiration proc~print_module_parameters->module~snow proc~print_module_parameters->module~soil proc~print_module_parameters->module~time proc~print_module_parameters->module~output proc~print_module_parameters->module~nutrient proc~print_module_parameters->module~crop proc~print_module_parameters->module~input proc~print_module_parameters->module~groundwater proc~groundwater_initialise groundwater_initialise proc~groundwater_initialise->module~output proc~groundwater_initialise->module~input proc~river_route_add river_route_add proc~river_route_add->module~management proc~river_route_add->module~output proc~groundwater_read_input groundwater_read_input proc~groundwater_read_input->module~input proc~time_finish_year time_finish_year proc~time_finish_year->module~subbasin proc~time_finish_year->module~output proc~time_finish_year->module~crop proc~terminate terminate proc~terminate->module~river proc~terminate->module~subbasin proc~terminate->module~vegetation proc~terminate->module~erosion proc~terminate->module~hydrotope proc~terminate->module~catchment proc~terminate->module~reservoir proc~terminate->module~management proc~terminate->module~evapotranspiration proc~terminate->module~snow proc~terminate->module~soil proc~terminate->module~time proc~terminate->module~output proc~terminate->module~nutrient proc~terminate->module~crop proc~terminate->module~input proc~terminate->module~groundwater proc~crop_initialise crop_initialise proc~crop_initialise->module~output proc~crop_initialise->module~input proc~reservoir_read_month_file reservoir_read_month_file proc~reservoir_read_month_file->module~input proc~river_read_input river_read_input proc~river_read_input->module~input proc~subbasin_read_climate subbasin_read_climate proc~subbasin_read_climate->module~input proc~subbasin_read_routing subbasin_read_routing proc~subbasin_read_routing->module~input proc~hydrotope_initialise hydrotope_initialise proc~hydrotope_initialise->module~output proc~hydrotope_initialise->module~input proc~time_process_day time_process_day proc~time_process_day->module~river proc~time_process_day->module~subbasin proc~time_process_day->module~vegetation proc~time_process_day->module~erosion proc~time_process_day->module~hydrotope proc~time_process_day->module~catchment proc~time_process_day->module~reservoir proc~time_process_day->module~management proc~time_process_day->module~evapotranspiration proc~time_process_day->module~snow proc~time_process_day->module~soil proc~time_process_day->module~output proc~time_process_day->module~nutrient proc~time_process_day->module~crop proc~time_process_day->module~input proc~time_process_day->module~groundwater proc~erosion_initialise erosion_initialise proc~erosion_initialise->module~input proc~vegetation_store_output vegetation_store_output proc~vegetation_store_output->module~output proc~nutrient_initialise nutrient_initialise proc~nutrient_initialise->module~input proc~reservoir_subbasin reservoir_subbasin proc~reservoir_subbasin->module~hydrotope proc~reservoir_subbasin->module~evapotranspiration proc~reservoir_subbasin->module~snow proc~reservoir_subbasin->module~soil proc~reservoir_subbasin->module~output proc~reservoir_subbasin->module~groundwater proc~vegetation_water_stress vegetation_water_stress proc~vegetation_water_stress->module~landuse proc~vegetation_water_stress->module~management proc~time_process_month time_process_month proc~time_process_month->module~vegetation proc~time_process_month->module~catchment proc~time_process_month->module~evapotranspiration proc~time_process_month->module~snow proc~time_process_month->module~soil proc~time_process_month->module~output proc~time_process_month->module~nutrient proc~time_process_month->module~crop proc~snow_process snow_process proc~snow_process->module~output proc~catchment_initialise catchment_initialise proc~catchment_initialise->module~input proc~crop_read_management_input crop_read_management_input proc~crop_read_management_input->module~input proc~crop_read_input crop_read_input proc~crop_read_input->module~vegetation proc~crop_read_input->module~input proc~subbasin_allocate_obs_discharge subbasin_allocate_obs_discharge proc~subbasin_allocate_obs_discharge->module~input proc~subbasin_read_input subbasin_read_input proc~subbasin_read_input->module~input proc~vegetation_process vegetation_process proc~vegetation_process->module~snow proc~vegetation_process->module~nutrient proc~vegetation_adjust_energy_ratio vegetation_adjust_energy_ratio proc~vegetation_adjust_energy_ratio->module~snow proc~river_initialise river_initialise proc~river_initialise->module~output proc~river_initialise->module~input proc~landuse_initialise landuse_initialise proc~landuse_initialise->module~input proc~landuse_read_input landuse_read_input proc~landuse_read_input->module~input proc~hydrotope_read_input hydrotope_read_input proc~hydrotope_read_input->module~input proc~hydrotope_process hydrotope_process proc~hydrotope_process->module~vegetation proc~hydrotope_process->module~erosion proc~hydrotope_process->module~landuse proc~hydrotope_process->module~management proc~hydrotope_process->module~evapotranspiration proc~hydrotope_process->module~snow proc~hydrotope_process->module~soil proc~hydrotope_process->module~nutrient proc~hydrotope_process->module~crop proc~hydrotope_process->module~groundwater proc~catchment_initialise_subcatchm catchment_initialise_subcatchm proc~catchment_initialise_subcatchm->module~river proc~catchment_initialise_subcatchm->module~evapotranspiration proc~catchment_initialise_subcatchm->module~snow proc~catchment_initialise_subcatchm->module~soil proc~catchment_initialise_subcatchm->module~groundwater program~swim swim program~swim->module~time proc~crop_operation crop_operation proc~crop_operation->module~output proc~subbasin_initialise_weather_gen subbasin_initialise_weather_gen proc~subbasin_initialise_weather_gen->module~output proc~subbasin_initialise_weather_gen->module~input proc~reservoir_open_output reservoir_open_output proc~reservoir_open_output->module~output proc~reservoir_initialise reservoir_initialise proc~reservoir_initialise->module~input proc~catchment_assign_subcatch catchment_assign_subcatch proc~catchment_assign_subcatch->module~river proc~catchment_assign_subcatch->module~evapotranspiration proc~catchment_assign_subcatch->module~snow proc~catchment_assign_subcatch->module~soil proc~catchment_assign_subcatch->module~groundwater proc~reservoir_read_control_file reservoir_read_control_file proc~reservoir_read_control_file->module~input proc~evapotranspiration_initialise evapotranspiration_initialise proc~evapotranspiration_initialise->module~output proc~evapotranspiration_initialise->module~input proc~crop_process crop_process proc~crop_process->module~vegetation proc~erosion_read_input erosion_read_input proc~erosion_read_input->module~input proc~vegetation_temperature_stress vegetation_temperature_stress proc~vegetation_temperature_stress->module~landuse proc~vegetation_temperature_stress->module~snow proc~time_initialise_year time_initialise_year proc~time_initialise_year->module~subbasin proc~time_initialise_year->module~crop proc~time_initialise_year->module~input

Contents


Variables

TypeVisibility AttributesNameInitial
real(kind=dp), public, save:: abfzwo
real(kind=dp), public, save:: del0
integer, public, parameter:: dp =4
real(kind=dp), public, save:: evafac
real(kind=dp), public, save:: gwafac
integer, public, parameter:: identifier_max_length =32
integer, public :: ifod =59
integer, public :: ifoe =60
integer, public :: ifom =61
integer, public :: ihei =50
integer, public :: imai =25
integer, public :: imea =46
integer, public :: ipas =47
integer, public :: irp =40
integer, public :: iwet =55
integer, public :: iwetf =63
integer, public, save, dimension(4):: k10 =(/73, 24, 881, 52/)
integer, public, save, dimension(4):: k11 =(/6, 302, 597, 3/)
integer, public, parameter:: log_debug_level =10
integer, public, parameter:: log_error_level =40
integer, public :: log_in_progess =0
integer, public, parameter:: log_info_level =20
integer, public, parameter:: log_warning_level =30
type(logger), public, save:: master_log
real(kind=dp), public, save:: ndmo(12)
integer, public, parameter:: output_label_max_length =64
integer, public, parameter:: output_max_variables =32
integer, public, parameter:: path_max_length =1024
character(len=4), public :: prog
character(len=5), public :: rot_variant
character(len=8), public :: till
real(kind=dp), public, save:: xn1 =10.

Derived Types

type, public :: logger

Components

TypeVisibility AttributesNameInitial
integer, public :: fileunit =-1
character(len=path_max_length), public :: logfile
integer, public :: logfile_threshold =huge(1)
integer, public :: stderr =0
integer, public :: stderr_threshold =log_debug_level
integer, public :: stdout =6
integer, public :: stdout_threshold =log_debug_level

Functions

public function colourise(str, colour) result(cstr)

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in) :: str
character(len=*), intent(in) :: colour

Return Value character(len=len)

public function date_time_str()

Arguments

None

Return Value character(len=19)

public function day_of_month(ida, month, year, nc)

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: ida
integer, intent(in) :: month
integer, intent(in) :: year
integer, intent(in), dimension(13):: nc

Return Value integer

public function days_in_month(month, year)

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: month
integer, intent(in) :: year

Return Value integer

public function gamma_distribution(rn1, ai, k7)

Arguments

Type IntentOptional AttributesName
real(kind=dp) :: rn1
real(kind=dp) :: ai
integer :: k7

Return Value real(kind=dp)

public function hydrograph_storage_location(icodes, ihouts, inum1s, mhyd, nsubs, subnr)

Arguments

Type IntentOptional AttributesName
integer, intent(in), dimension(:):: icodes
integer, intent(in), dimension(:):: ihouts
integer, intent(in), dimension(:):: inum1s
integer, intent(in) :: mhyd
integer, intent(in) :: nsubs
integer, intent(in) :: subnr(nsubs)

Return Value integer (nsubs)

public function indeces_in_array(entries, array) result(outarray)

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in), dimension(:):: entries
character(len=*), intent(in), dimension(:):: array

Return Value integer, dimension(size(entries))

public function is_leap_year(year)

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: year

Return Value logical

public function log_create(logfile, stderr_level, stdout_level, logfile_level) result(log)

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in) :: logfile
character(len=*), intent(in), optional :: stderr_level
character(len=*), intent(in), optional :: stdout_level
character(len=*), intent(in), optional :: logfile_level

Return Value type(logger)

public function log_format_message(level, tag, message, colour, datetime) result(msg)

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: level
character(len=*), intent(in) :: tag
character(len=*), intent(in) :: message
logical, intent(in), optional :: colour
logical, intent(in), optional :: datetime

Return Value character(len=23)

public function log_str2level(str)

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in) :: str

Return Value integer

public function open_file(fname, status)

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in) :: fname
character(len=1), intent(in), optional :: status

Return Value integer

public function random_n(k)

Arguments

Type IntentOptional AttributesName
integer :: k

Return Value real(kind=dp)

public function string_index(str, array)

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in) :: str
character(len=*), intent(in) :: array(:)

Return Value integer

public function to_string(real, int, logical, fmt)

Arguments

Type IntentOptional AttributesName
real(kind=dp), intent(in), optional :: real
integer, intent(in), optional :: int
logical, intent(in), optional :: logical
character(len=*), intent(in), optional :: fmt

Return Value character(len=64)


Subroutines

public subroutine check_int_range(values, name, range, index)

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: values(:)
character, intent(in) :: name
integer, intent(in) :: range(2)
integer, intent(in), optional :: index

public subroutine check_range(values, name, range, index, closed)

Arguments

Type IntentOptional AttributesName
real(kind=dp), intent(in) :: values(:)
character, intent(in) :: name
real(kind=dp), intent(in) :: range(2)
integer, intent(in), optional :: index
character(len=1), intent(in), optional :: closed

public subroutine extend_unique_string(nonunique, unique)

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in), dimension(:):: nonunique
character(len=*), intent(inout), dimension(:):: unique

public subroutine input_split(str, delim, before)

Arguments

Type IntentOptional AttributesName
character(len=300) :: str
character :: delim
character(len=200) :: before

public subroutine log_debug(source, message, log, i1, i2, int, real, ints, reals)

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in) :: source
character(len=*), intent(in) :: message
type(logger), intent(in), optional :: log
integer, intent(in), optional :: i1
integer, intent(in), optional :: i2
integer, intent(in), optional :: int
real(kind=dp), intent(in), optional :: real
integer, intent(in), optional :: ints(:)
real(kind=dp), intent(in), optional :: reals(:)

public subroutine log_error(source, message, log, i1, i2, int, real, ints, reals)

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in) :: source
character(len=*), intent(in) :: message
type(logger), intent(in), optional :: log
integer, intent(in), optional :: i1
integer, intent(in), optional :: i2
integer, intent(in), optional :: int
real(kind=dp), intent(in), optional :: real
integer, intent(in), optional :: ints(:)
real(kind=dp), intent(in), optional :: reals(:)

public subroutine log_info(source, message, log, i1, i2, int, real, ints, reals)

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in) :: source
character(len=*), intent(in) :: message
type(logger), intent(in), optional :: log
integer, intent(in), optional :: i1
integer, intent(in), optional :: i2
integer, intent(in), optional :: int
real(kind=dp), intent(in), optional :: real
integer, intent(in), optional :: ints(:)
real(kind=dp), intent(in), optional :: reals(:)

public subroutine log_message(source, level, message, log, i1, i2, int, real, ints, reals)

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in) :: source
integer, intent(in) :: level
character(len=*), intent(in) :: message
type(logger), intent(in), optional :: log
integer, intent(in), optional :: i1
integer, intent(in), optional :: i2
integer, intent(in), optional :: int
real(kind=dp), intent(in), optional :: real
integer, intent(in), optional :: ints(:)
real(kind=dp), intent(in), optional :: reals(:)

public subroutine log_progress(source, step, total)

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in) :: source
integer, intent(in) :: step
integer, intent(in) :: total

public subroutine log_warn(source, message, log, i1, i2, int, real, ints, reals)

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in) :: source
character(len=*), intent(in) :: message
type(logger), intent(in), optional :: log
integer, intent(in), optional :: i1
integer, intent(in), optional :: i2
integer, intent(in), optional :: int
real(kind=dp), intent(in), optional :: real
integer, intent(in), optional :: ints(:)
real(kind=dp), intent(in), optional :: reals(:)

public subroutine log_write(fid, msg, i1, i2, int, real, ints, reals, advance, clear)

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: fid
character(len=*), intent(in) :: msg
integer, intent(in), optional :: i1
integer, intent(in), optional :: i2
integer, intent(in), optional :: int
real(kind=dp), intent(in), optional :: real
integer, intent(in), optional :: ints(:)
real(kind=dp), intent(in), optional :: reals(:)
logical, intent(in), optional :: advance
integer, intent(in), optional :: clear

public subroutine out_of_range_error(name, range, value, int_range, int_value, counter, index)

Arguments

Type IntentOptional AttributesName
character, intent(in) :: name
real(kind=dp), intent(in), optional :: range(2)
real(kind=dp), intent(in), optional :: value
integer, intent(in), optional :: int_range(2)
integer, intent(in), optional :: int_value
integer, intent(in), optional :: counter
integer, intent(in), optional :: index