output_hydrotope_to_catchment Function

public function output_hydrotope_to_catchment(hydrotope_values) result(catchment_values)

Arguments

Type IntentOptional AttributesName
real, intent(in) :: hydrotope_values(output_nhydrotopes)

Return Value real (output_ncatchments)


Called by

proc~~output_hydrotope_to_catchment~~CalledByGraph proc~output_hydrotope_to_catchment output_hydrotope_to_catchment proc~output_day output_day proc~output_day->proc~output_hydrotope_to_catchment proc~time_process_day time_process_day proc~time_process_day->proc~output_day proc~time_process_month time_process_month proc~time_process_month->proc~time_process_day proc~time_process_years time_process_years proc~time_process_years->proc~time_process_month program~swim swim program~swim->proc~time_process_years

Contents


Source Code

  function output_hydrotope_to_catchment(hydrotope_values) result(catchment_values)
    ! Average hydrotope values to catchment
    real, intent(in) :: hydrotope_values(output_nhydrotopes)
    real :: catchment_values(output_ncatchments)
    integer h, hsix, scix
    real share

    catchment_values = 0
    do h = 1, output_nhydrotopes
      hsix = output_hydrotope_subbasin_ix(h)
      scix = output_subbasin_catchment_ix(hsix)
      ! Share of hydrotope in catchment
      share = hydrotope_values(h) * output_hydrotope_subbasin_share(h) &
        * output_subbasin_catchment_share(hsix)
      catchment_values(scix) = catchment_values(scix) + share
      ! Entire basin
      catchment_values(1) = &
        catchment_values(1) + share * output_catchment_basin_share(scix)
    end do
  end function output_hydrotope_to_catchment