reservoir_initialise Subroutine

public subroutine reservoir_initialise(icodes, inum1s, mb, mhyd)

Uses

  • proc~~reservoir_initialise~~UsesGraph proc~reservoir_initialise reservoir_initialise module~input input proc~reservoir_initialise->module~input module~utilities utilities module~input->module~utilities

read reservoir input files and allocate arrays

calls RSV_allocate_reservoir

set reservoir subbasins of array rsvSubbasin

Arguments

Type IntentOptional AttributesName
integer, intent(in), dimension(:):: icodes
integer, intent(in), dimension(:):: inum1s
integer, intent(in) :: mb
integer, intent(in) :: mhyd

Calls

proc~~reservoir_initialise~~CallsGraph proc~reservoir_initialise reservoir_initialise proc~log_info log_info proc~reservoir_initialise->proc~log_info proc~reservoir_open_output reservoir_open_output proc~reservoir_initialise->proc~reservoir_open_output proc~reservoir_routing reservoir_routing proc~reservoir_initialise->proc~reservoir_routing proc~reservoir_read_storage_file reservoir_read_storage_file proc~reservoir_initialise->proc~reservoir_read_storage_file proc~reservoir_read_month_file reservoir_read_month_file proc~reservoir_initialise->proc~reservoir_read_month_file proc~get_config_fid get_config_fid proc~reservoir_initialise->proc~get_config_fid proc~reservoir_read_control_file reservoir_read_control_file proc~reservoir_initialise->proc~reservoir_read_control_file proc~reservoir_initial_values reservoir_initial_values proc~reservoir_initialise->proc~reservoir_initial_values proc~reservoir_init_subbasin reservoir_init_subbasin proc~reservoir_initialise->proc~reservoir_init_subbasin proc~reservoir_allocate reservoir_allocate proc~reservoir_initialise->proc~reservoir_allocate proc~log_warn log_warn proc~reservoir_initialise->proc~log_warn proc~log_message log_message proc~log_info->proc~log_message proc~output_open_file output_open_file proc~reservoir_open_output->proc~output_open_file proc~input_open_file input_open_file proc~reservoir_read_storage_file->proc~input_open_file proc~read_real_column read_real_column proc~reservoir_read_storage_file->proc~read_real_column proc~reservoir_read_month_file->proc~log_warn proc~reservoir_read_month_file->proc~input_open_file proc~reservoir_read_month_file->proc~read_real_column proc~open_file open_file proc~get_config_fid->proc~open_file proc~input_count_rows input_count_rows proc~reservoir_read_control_file->proc~input_count_rows proc~read_logical_column read_logical_column proc~reservoir_read_control_file->proc~read_logical_column proc~read_string_column read_string_column proc~reservoir_read_control_file->proc~read_string_column proc~reservoir_allocate_reservoir reservoir_allocate_reservoir proc~reservoir_read_control_file->proc~reservoir_allocate_reservoir proc~reservoir_read_control_file->proc~input_open_file proc~reservoir_read_control_file->proc~read_real_column proc~read_integer_column read_integer_column proc~reservoir_read_control_file->proc~read_integer_column proc~rsv_pol rsv_pol proc~reservoir_initial_values->proc~rsv_pol proc~log_warn->proc~log_message proc~log_error log_error proc~input_count_rows->proc~log_error proc~input_type_conversion_error input_type_conversion_error proc~read_logical_column->proc~input_type_conversion_error proc~move_lines move_lines proc~read_logical_column->proc~move_lines proc~read_logical_column->proc~log_error proc~read_csv_item read_csv_item proc~read_logical_column->proc~read_csv_item proc~header_column_index header_column_index proc~read_logical_column->proc~header_column_index proc~input_error_column_not_found input_error_column_not_found proc~read_logical_column->proc~input_error_column_not_found proc~open_file->proc~log_error proc~read_string_column->proc~move_lines proc~read_string_column->proc~log_error proc~read_string_column->proc~read_csv_item proc~read_string_column->proc~header_column_index proc~read_string_column->proc~input_error_column_not_found proc~input_open_file->proc~open_file proc~log_write log_write proc~log_message->proc~log_write proc~log_format_message log_format_message proc~log_message->proc~log_format_message proc~read_real_column->proc~input_type_conversion_error proc~read_real_column->proc~move_lines proc~read_real_column->proc~log_error proc~check_range check_range proc~read_real_column->proc~check_range proc~read_real_column->proc~read_csv_item proc~read_real_column->proc~header_column_index proc~read_real_column->proc~input_error_column_not_found proc~output_open_file->proc~open_file proc~read_integer_column->proc~input_type_conversion_error proc~read_integer_column->proc~move_lines proc~check_int_range check_int_range proc~read_integer_column->proc~check_int_range proc~read_integer_column->proc~log_error proc~read_integer_column->proc~read_csv_item proc~read_integer_column->proc~header_column_index proc~read_integer_column->proc~input_error_column_not_found proc~to_string to_string proc~log_write->proc~to_string proc~input_type_conversion_error->proc~log_error proc~check_int_range->proc~log_warn proc~check_int_range->proc~log_error proc~out_of_range_error out_of_range_error proc~check_int_range->proc~out_of_range_error proc~log_error->proc~log_message proc~date_time_str date_time_str proc~log_format_message->proc~date_time_str proc~colourise colourise proc~log_format_message->proc~colourise proc~check_range->proc~log_warn proc~check_range->proc~log_error proc~check_range->proc~out_of_range_error proc~header_column_index->proc~move_lines proc~header_column_index->proc~input_error_column_not_found proc~input_error_column_not_found->proc~log_error proc~out_of_range_error->proc~log_error proc~out_of_range_error->proc~to_string proc~string_index string_index proc~colourise->proc~string_index

Called by

proc~~reservoir_initialise~~CalledByGraph proc~reservoir_initialise reservoir_initialise proc~initialise initialise proc~initialise->proc~reservoir_initialise program~swim swim program~swim->proc~initialise

Contents

Source Code


Source Code

  subroutine reservoir_initialise(icodes, inum1s, mb, mhyd)
    use input, only: get_config_fid

    integer, dimension(:), intent(in) :: icodes
    integer, dimension(:), intent(in) :: inum1s
    integer, intent(in) :: mb
    integer, intent(in) :: mhyd

    read(get_config_fid(), RESERVOIR_PARAMETERS)

    call reservoir_allocate

    if (bRsvModule) then
      call log_warn("reservoir_initialise", "Reservoir MODULE IS ACTIVE !!!")
      !-----------------------------------------------------------------
      ! read reservoir input files and allocate arrays
      !-----------------------------------------------------------------
      ! calls RSV_allocate_reservoir
      call reservoir_read_control_file(mb, mhyd) ! reservoir.ctrl

      call reservoir_read_month_file ! reservoir_monthly.csv

      call reservoir_read_storage_file ! reservoir_storage_conf.csv
      !-----------------------------------------------------------------
      ! set reservoir subbasins of array rsvSubbasin
      call reservoir_init_subbasin
      ! get bRsvHydrograph
      call reservoir_routing(icodes, inum1s, mb, mhyd)
      ! initialise filling status etc.
      call reservoir_initial_values
      ! open output files
      call reservoir_open_output
      call log_info("reservoir_initialise", "Number of reservoir subbasins: ", &
        int=rsv_nReservoirs)
      call log_info("reservoir_initialise", "Reservoir number(s)", ints=rsv_ResSubbasins)
    end if

  end subroutine reservoir_initialise