output_initialise_labelled Subroutine

public subroutine output_initialise_labelled(hydrotope_input_fid, subbasin_input_fid)

Uses

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

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: hydrotope_input_fid
integer, intent(in) :: subbasin_input_fid

Calls

proc~~output_initialise_labelled~~CallsGraph proc~output_initialise_labelled output_initialise_labelled proc~read_string_column read_string_column proc~output_initialise_labelled->proc~read_string_column proc~has_column has_column proc~output_initialise_labelled->proc~has_column proc~log_error log_error proc~output_initialise_labelled->proc~log_error proc~read_string_column->proc~log_error proc~move_lines move_lines proc~read_string_column->proc~move_lines proc~read_csv_item read_csv_item proc~read_string_column->proc~read_csv_item proc~header_column_index header_column_index proc~read_string_column->proc~header_column_index proc~input_error_column_not_found input_error_column_not_found proc~read_string_column->proc~input_error_column_not_found proc~has_column->proc~header_column_index proc~log_message log_message proc~log_error->proc~log_message proc~header_column_index->proc~move_lines proc~header_column_index->proc~input_error_column_not_found 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~input_error_column_not_found->proc~log_error proc~to_string to_string 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~~output_initialise_labelled~~CalledByGraph proc~output_initialise_labelled output_initialise_labelled proc~output_initialise_storage output_initialise_storage proc~output_initialise_storage->proc~output_initialise_labelled proc~output_initialise output_initialise proc~output_initialise->proc~output_initialise_storage proc~initialise initialise proc~initialise->proc~output_initialise program~swim swim program~swim->proc~initialise

Contents


Source Code

  subroutine output_initialise_labelled(hydrotope_input_fid, subbasin_input_fid)
    use utilities, only: string_index
    !use input, only: read_string_column
    use input, only: read_string_column, has_column
    integer, intent(in) :: hydrotope_input_fid, subbasin_input_fid
    integer i, ucount
    logical ir

    ir = any(output_files(:)%space == 4)
    if (ir .and. has_column("output_label", hydrotope_input_fid)) then
      allocate(output_hydrotope_label(output_nhydrotopes))
      output_hydrotope_label = ''
      call read_string_column(hydrotope_input_fid, 'output_label', output_hydrotope_label)
      ucount = 0
      do i = 1, output_nhydrotopes
        if (trim(output_hydrotope_label(i)) /= '') ucount = ucount + 1
      end do
      allocate(output_hydrotope_label_ix(ucount))
      ucount = 0
      do i = 1, output_nhydrotopes
        if (trim(output_hydrotope_label(i)) /= '') then
          ucount = ucount + 1
          output_hydrotope_label_ix(ucount) = i
        end if
      end do
    else if (ir) then
      call log_error("output_initialise_labelled", &
        "hydrotope_label output requested but output_label column not found.")
    end if

    ir = any(output_files(:)%space == 5)
    if (ir .and. has_column("output_label", subbasin_input_fid)) then
      allocate(output_subbasin_label(output_nsubbasins))
      output_subbasin_label = ''
      call read_string_column(subbasin_input_fid, 'output_label', output_subbasin_label)
      ucount = 0
      do i = 1, output_nsubbasins
        if (trim(output_subbasin_label(i)) /= '') ucount = ucount + 1
      end do
      allocate(output_subbasin_label_ix(ucount))
      ucount = 0
      do i = 1, output_nsubbasins
        if (trim(output_subbasin_label(i)) /= '') then
          ucount = ucount + 1
          output_subbasin_label_ix(ucount) = i
        end if
      end do
    else if (ir) then
      call log_error("output_initialise_labelled", &
        "subbasin_label output requested but output_label column not found.")
    end if
  end subroutine output_initialise_labelled