management_read_wu_inout Subroutine

public subroutine management_read_wu_inout(iyr, nDaysSim, nbyr)

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: iyr
integer, intent(in) :: nDaysSim
integer, intent(in) :: nbyr

Calls

proc~~management_read_wu_inout~~CallsGraph proc~management_read_wu_inout management_read_wu_inout proc~management_read_time_series management_read_time_series proc~management_read_wu_inout->proc~management_read_time_series proc~management_convert_to_daily management_convert_to_daily proc~management_read_time_series->proc~management_convert_to_daily proc~open_file open_file proc~management_read_time_series->proc~open_file proc~read_real_column read_real_column proc~management_read_time_series->proc~read_real_column proc~days_in_month days_in_month proc~management_convert_to_daily->proc~days_in_month proc~log_error log_error proc~open_file->proc~log_error proc~input_type_conversion_error input_type_conversion_error proc~read_real_column->proc~input_type_conversion_error proc~move_lines move_lines 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_csv_item read_csv_item proc~read_real_column->proc~read_csv_item proc~header_column_index header_column_index proc~read_real_column->proc~header_column_index proc~input_error_column_not_found input_error_column_not_found proc~read_real_column->proc~input_error_column_not_found proc~input_type_conversion_error->proc~log_error proc~log_message log_message proc~log_error->proc~log_message proc~check_range->proc~log_error proc~log_warn log_warn proc~check_range->proc~log_warn proc~out_of_range_error out_of_range_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~is_leap_year is_leap_year proc~days_in_month->proc~is_leap_year 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~~management_read_wu_inout~~CalledByGraph proc~management_read_wu_inout management_read_wu_inout proc~management_initialise management_initialise proc~management_initialise->proc~management_read_wu_inout proc~initialise initialise proc~initialise->proc~management_initialise program~swim swim program~swim->proc~initialise

Contents


Source Code

  subroutine management_read_wu_inout(iyr, ndayssim, nbyr)
    integer, intent(in) :: iyr
    integer, intent(in) :: nDaysSim
    integer, intent(in) :: nbyr
    integer :: wu_id, ts_type
    character(len=path_max_length) :: fname

    do wu_id = 1, wam_nWU ! total number of water transfer users
      ! generate input time series file name
      fname = trim(TWU(wu_id)%name)//".csv"

      ts_type = TWU(wu_id) % ts_ ! format of input time series (constant monthly / monthly / daily)
      select case (ts_type)
        case(1) ! read constant monthly (nval = 12) and convert to daily ts
          ! and store in: TWU(wu_id)%data
          call management_read_time_series(12, fname, len_trim(fname), wu_id, iyr, nDaysSim, nbyr)

        case(2) ! read monthly time series (nval=years*12) and convert to daily ts
          ! and store in: TWU(wu_id)%data
          call management_read_time_series(12*nbyr, fname, len_trim(fname), wu_id, iyr, nDaysSim, nbyr)

        case(3) ! read daily time series (nval = nDaysSim)
          ! and store in: TWU(wu_id)%data
          call management_read_time_series(nDaysSim, fname, len_trim(fname), wu_id, iyr, nDaysSim, nbyr)
      end select
    end do

  end subroutine management_read_wu_inout