sort_four_arrays_by_time Subroutine

public subroutine sort_four_arrays_by_time(U, V, T, ID, rc)

Uses

  • proc~~sort_four_arrays_by_time~~UsesGraph proc~sort_four_arrays_by_time sort_four_arrays_by_time module~mapl_sortmod MAPL_SortMod proc~sort_four_arrays_by_time->module~mapl_sortmod iso_fortran_env iso_fortran_env module~mapl_sortmod->iso_fortran_env module~mapl_exceptionhandling MAPL_ExceptionHandling module~mapl_sortmod->module~mapl_exceptionhandling module~mapl_errorhandlingmod MAPL_ErrorHandlingMod module~mapl_exceptionhandling->module~mapl_errorhandlingmod module~mapl_throwmod MAPL_ThrowMod module~mapl_exceptionhandling->module~mapl_throwmod module~mapl_errorhandlingmod->module~mapl_throwmod mpi mpi module~mapl_errorhandlingmod->mpi

Arguments

Type IntentOptional Attributes Name
real(kind=ESMF_KIND_R8) :: U(:)
real(kind=ESMF_KIND_R8) :: V(:)
real(kind=ESMF_KIND_R8) :: T(:)
integer :: ID(:)
integer, intent(out), optional :: rc

Calls

proc~~sort_four_arrays_by_time~~CallsGraph proc~sort_four_arrays_by_time sort_four_arrays_by_time interface~mapl_assert MAPL_Assert proc~sort_four_arrays_by_time->interface~mapl_assert interface~mapl_sort MAPL_Sort proc~sort_four_arrays_by_time->interface~mapl_sort proc~mapl_return MAPL_Return proc~sort_four_arrays_by_time->proc~mapl_return at at proc~mapl_return->at insert insert proc~mapl_return->insert proc~mapl_throw_exception MAPL_throw_exception proc~mapl_return->proc~mapl_throw_exception

Called by

proc~~sort_four_arrays_by_time~~CalledByGraph proc~sort_four_arrays_by_time sort_four_arrays_by_time interface~sort_multi_arrays_by_time sort_multi_arrays_by_time interface~sort_multi_arrays_by_time->proc~sort_four_arrays_by_time

Source Code

  subroutine sort_four_arrays_by_time(U,V,T,ID,rc)
    use MAPL_SortMod
    real(ESMF_KIND_R8) :: U(:), V(:), T(:)
    integer :: ID(:)
    integer, optional, intent(out) :: rc

    integer :: i, len
    integer, allocatable :: IA(:)
    integer(ESMF_KIND_I8), allocatable :: IX(:)
    real(ESMF_KIND_R8), allocatable :: X(:)
    integer, allocatable :: NX(:)

    _ASSERT(size(U)==size(V), 'U,V different dimension')
    _ASSERT(size(U)==size(T), 'U,T different dimension')
    len = size (T)

    allocate (IA(len), IX(len), X(len), NX(len))
    do i=1, len
       IX(i)=T(i)
       IA(i)=i
    enddo
    call MAPL_Sort(IX,IA)

    X = U
    do i=1, len
       U(i) = X(IA(i))
    enddo
    X = V
    do i=1, len
       V(i) = X(IA(i))
    enddo
    X = T
    do i=1, len
       T(i) = X(IA(i))
    enddo
    NX = ID
    do i=1, len
       ID(i) = NX(IA(i))
    enddo
    _RETURN(_SUCCESS)
  end subroutine sort_four_arrays_by_time