catchment_initialise Subroutine

public subroutine catchment_initialise(sbar, flu)

Uses

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

Arguments

Type IntentOptional AttributesName
real(kind=dp), intent(in) :: sbar(:)
real(kind=dp), intent(out) :: flu(:)

Calls

proc~~catchment_initialise~~CallsGraph proc~catchment_initialise catchment_initialise proc~get_config_fid get_config_fid proc~catchment_initialise->proc~get_config_fid proc~input_open_file input_open_file proc~catchment_initialise->proc~input_open_file proc~catchment_allocate catchment_allocate proc~catchment_initialise->proc~catchment_allocate proc~open_file open_file proc~get_config_fid->proc~open_file proc~input_open_file->proc~open_file proc~log_error log_error proc~open_file->proc~log_error proc~log_message log_message proc~log_error->proc~log_message 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~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~~catchment_initialise~~CalledByGraph proc~catchment_initialise catchment_initialise proc~initialise initialise proc~initialise->proc~catchment_initialise program~swim swim program~swim->proc~initialise

Contents

Source Code


Source Code

  subroutine catchment_initialise(sbar, flu)
    use input, only : input_open_file, get_config_fid
    real(dp), intent(in) :: sbar(:)
    real(dp), intent(out) :: flu(:)

    read(get_config_fid(), CATCHMENT_PARAMETERS)

    catchment_input_file_id = input_open_file(catchment_input_file)

    call catchment_allocate

    ! calculate total catchment (drainage) area "da" in km2
    da = sum(sbar(:)) / 10 ** 6
    da9 = 100. * da
    ! fraction of subbasin area of total catchment area
    flu(:) = sbar(:) / (da * 10 ** 6)
  end subroutine catchment_initialise