reservoir_read_control_file Subroutine

public subroutine reservoir_read_control_file(mb, mhyd)

Uses

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

Arguments

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

Calls

proc~~reservoir_read_control_file~~CallsGraph proc~reservoir_read_control_file reservoir_read_control_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~input_open_file input_open_file proc~reservoir_read_control_file->proc~input_open_file proc~read_real_column read_real_column 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~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~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~open_file open_file proc~input_open_file->proc~open_file 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~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~input_type_conversion_error->proc~log_error proc~check_int_range->proc~log_error proc~log_warn log_warn proc~check_int_range->proc~log_warn proc~out_of_range_error out_of_range_error proc~check_int_range->proc~out_of_range_error proc~log_message log_message proc~log_error->proc~log_message proc~check_range->proc~log_error proc~check_range->proc~log_warn 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~open_file->proc~log_error proc~input_error_column_not_found->proc~log_error proc~log_warn->proc~log_message proc~out_of_range_error->proc~log_error proc~to_string to_string proc~out_of_range_error->proc~to_string 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~log_write->proc~to_string 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~string_index string_index proc~colourise->proc~string_index

Called by

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

Contents


Source Code

  subroutine reservoir_read_control_file(mb, mhyd) ! reservoir.ctrl
    use input, only : read_logical_column, read_real_column, read_integer_column, read_string_column
    use input, only : input_count_rows, input_open_file

    integer, intent(in) :: mb
    integer, intent(in) :: mhyd
    integer :: i
    integer, dimension(:), allocatable :: act
    integer :: fid

    fid = input_open_file(trim(reservoir_input_file))

    rsv_nReservoirs = input_count_rows(fid, .true.)

    allocate(rsv_ResSubbasins(rsv_nReservoirs))
    allocate(act(rsv_nReservoirs))
    rsv_ResSubbasins = 0

    rewind(fid)

    call read_integer_column(fid, "subbasins_id", rsv_ResSubbasins, 0)

    call reservoir_allocate_reservoir(mb, mhyd)

    call read_string_column(fid, "rsv_reservoir_name", rsv_ResNames, "")
    call read_real_column(fid, "capac_max", rsv_Capac_Max, 0.0_dp)
    rsv_Capac_Max = rsv_Capac_Max * 10 ** 6 ! convert [million m^3] into [m^3]
    call read_real_column(fid, "dead_stor", rsv_dead_stor_capac, 0.0_dp)
    rsv_dead_stor_capac = rsv_dead_stor_capac * 10 ** 6 ! convert [million m^3] into [m^3]
    call read_real_column(fid, "start_fill", rsv_Start_Fill, 0.0_dp)
    call read_logical_column(fid, "res_active", rsv_active, .true.)
    call read_real_column(fid, "res_activate_thresh", rsv_activate_thresh, 0.0_dp)
    call read_real_column(fid, "level_max", rsv_level_max, 0.0_dp)
    call read_real_column(fid, "level_min", rsv_level_min, 0.0_dp)
    call read_real_column(fid, "level_hpp", rsv_level_hpp, 0.0_dp)
    call read_real_column(fid, "cap_hpp", rsv_cap_hpp, 0.0_dp)
    call read_real_column(fid, "efficiency", rsv_eff_hpp, 0.0_dp)
    call read_real_column(fid, "rsv_loss_seepage", rsv_loss_seepage, 0.0_dp)
    call read_real_column(fid, "rsv_gwc", rsv_gwc, 0.0_dp)
    call read_real_column(fid, "rsv_evapc", rsv_evapc, 0.0_dp)
    call read_integer_column(fid, "rsv_start_year", rsv_start_year, 0)
    call read_integer_column(fid, "rsv_start_day", rsv_start_day, 0)
    call read_integer_column(fid, "rsv_mngmt", rsv_Mngmt, 0)
    call read_real_column(fid, "rsv_shr_withdr", rsv_shr_withdr, 0.0_dp)

    close(fid)

    ! assign rsv_active
    do i = 1, rsv_nReservoirs
      if (act(i) > 0 ) rsv_active(i) = .true.
    end do

  end subroutine reservoir_read_control_file