move(3f) - [M_datapac:VECTOR_OPERATION] move selected elements of one vector into another vector
Synopsis
Description
Input Arguments
Output Arguments
Examples
Author
Maintainer
License
SUBROUTINE MOVE(X,M,Ix1,Iy1,Y)
REAL(kind=wp),intent(in) :: X(:) INTEGER,intent(in) :: M INTEGER,intent(in) :: Ix1 INTEGER,intent(in) :: Iy1 REAL(kind=wp),intent(out) :: Y(:)
MOVE(3f) moves (copies) M elements of the REAL vector X (starting with position Ix1) into the REAL vector Y (starting with position Iy1).
This allows the data analyst to take any subvector in X and place it anywhere in the vector Y.
X The vector of observations, part (or all) of which is to be moved (copied) over into the vector Y. The input vector X remains unaltered. M The integer number of elements in the vector X to be moved. IX1 The integer value which defines the position in the vector X of the first element to be moved. IY1 The integer value which defines the position in the vector Y where the first element to be moved will be placed.
Y The vector into which the copied data values from the vector X will be sequentially placed, starting in position IY1 of Y. The m elements in positions IY1, IY1+1, ... , IY1+M-1will be identical to the M elements in the X vector IN positions
IX1, IX1+1, ... , IX1+M-1.
Sample program:
program demo_move use M_datapac, only : move, label real,allocatable :: x(:), y(:) call label(move) x=[10.0,20.0,30.0,40.0,50.0,60.0,70.0,80.0,90.0,100.0,110.0,120.0] if(allocated(y))deallocate(y) allocate(y(size(x))) y=99.0 call MOVE(X,4,5,1,Y) write(*,*)int(y) end program demo_move
The original DATAPAC library was written by James Filliben of the Statistical Engineering Division, National Institute of Standards and Technology.
John Urban, 2022.05.31
CC0-1.0
Nemo Release 3.1 | move (3) | February 23, 2025 |