NECI_ICOPY Subroutine

public subroutine NECI_ICOPY(N, A, IA, B, IB)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: N
integer, intent(in) :: A(IA*N)
integer, intent(in) :: IA
integer, intent(out) :: B(IB*N)
integer, intent(in) :: IB

Contents

Source Code


Source Code

    SUBROUTINE NECI_ICOPY(N, A, IA, B, IB)
        ! Copy elements from integer array A to B.
        ! Simple version of BLAS routine ICOPY, which isn't always implemented
        ! in BLAS.
        ! Fortran 90 array features allow this to be done in one line of
        ! standard fortran, so this is just for legacy purposes.
        ! In:
        !    N: number of elements in A.
        !    A: vector to be copied.
        !    IA: increment between elements to be copied in A.
        !        IA=1 for continuous data blocks.
        !    IB: increment between elements to be copied to in B.
        !        IB=1 for continuous data blocks.
        ! Out:
        !    B: result vector.
        IMPLICIT NONE
!        Arguments
        INTEGER, INTENT(IN) :: N, IA, IB
        INTEGER, INTENT(IN) :: A(IA * N)
        INTEGER, INTENT(OUT) :: B(IB * N)
!        Variables
        INTEGER I, IAX, IBX

        DO I = 1, N
            IAX = (I - 1) * IA + 1
            IBX = (I - 1) * IB + 1
            B(IBX) = A(IAX)
        ENDDO

        RETURN
    END SUBROUTINE NECI_ICOPY