C Library Functions  - copy (3)

NAME

copy(3f) - [M_datapac:VECTOR_OPERATION] copy the elements of one vector into another vector

CONTENTS

Synopsis
Description
Input Arguments
Output Arguments
Examples
Author
Maintainer
License

SYNOPSIS

SUBROUTINE COPY(X,N,Y)

       REAL(kind=wp),intent(in)     :: X(:)
       INTEGER,intent(in)           :: N
       REAL(kind=wp),intent(inout)  :: Y(:)

DESCRIPTION

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.

INPUT ARGUMENTS

X The vector of observations to be copied. the input vector X remains unaltered.
N The integer number of observations in the vector X.

OUTPUT ARGUMENTS

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.

EXAMPLES

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_copy

Results:

   1.00 2.00 3.00 -1.00 -1.00 -1.00

AUTHOR

The original DATAPAC library was written by James Filliben of the Statistical Engineering Division, National Institute of Standards and Technology.

MAINTAINER

John Urban, 2022.05.31

LICENSE

CC0-1.0


Nemo Release 3.1 copy (3) July 22, 2023
Generated by manServer 1.08 from 016c4c76-3dca-40be-b7ef-0b19a5920e31 using man macros.