copy(3f) - [M_datapac:VECTOR_OPERATION] copy the elements of one vector into another vector
Synopsis
Description
Input Arguments
Output Arguments
Examples
Author
Maintainer
License
SUBROUTINE COPY(X,N,Y)
REAL(kind=wp),intent(in) :: X(:) INTEGER,intent(in) :: N REAL(kind=wp),intent(inout) :: Y(:)
COPY(3f) copies the contents of the REAL vector X into the REAL vector Y.The first element of X is copied into the first element of Y; the second element of X is copied into the second element of Y, etc.
This pre-f90 procedure can be replaced with modern array syntax and should not be required in new code.
X The vector of observations to be copied. the input vector X remains unaltered. N The integer number of observations in the vector X.
Y The vector into which the copied data values from X will be sequentially placed such that Y will have its first N elements identical to the vector X.
Sample program:
program demo_copy use M_datapac, only : copy implicit none character(len=*),parameter :: g=(*(g0.3,1x)) real,allocatable :: from(:), to(:) from=[1.0,2.0,3.0,4.0,5.0] to=[-1.0,-1.0,-1.0,-1.0,-1.0,-1.0] call copy(from,3,to) write(*,g)to end program demo_copyResults:
1.00 2.00 3.00 -1.00 -1.00 -1.00
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 | copy (3) | February 23, 2025 |