movec |
Table of contents
ProcedureMOVEC ( Move a character array to another ) SUBROUTINE MOVEC ( ARRFRM, NDIM, ARRTO ) AbstractCopy the elements of one character array into another array. Required_ReadingNone. KeywordsARRAY DeclarationsIMPLICIT NONE CHARACTER*(*) ARRFRM ( * ) INTEGER NDIM CHARACTER*(*) ARRTO ( * ) Brief_I/OVARIABLE I/O DESCRIPTION -------- --- -------------------------------------------------- ARRFRM I Character array to be moved. NDIM I Number of elements to copy, i.e. the dimension of ARRFRM and ARRTO. ARRTO O Destination array. Detailed_InputARRFRM is an array from which to copy items. NDIM is the number of items to copy. Detailed_OutputARRTO is the array to which items should be copied. ParametersNone. ExceptionsError free. FilesNone. ParticularsThis routine is simply shorthand for the following 3 lines of code. DO I = 1, NDIM ARRTO(I) = ARRFRM(I) END DO ExamplesOften one needs to make a temporary copy of an array so that it can be manipulated without altering the original array. As pointed out in particulars, you could just do this within the code that needs the copy. However, if you have several arrays to copy, you can cut the number of lines of code that are needed by a third. For example: DO I = 1, 19 TEMPA(I) = A(I) END DO DO I = 1, 38 TEMPB(I) = B(I) END DO Can be rewritten as CALL MOVEC ( A, 19, TEMPA ) CALL MOVEC ( B, 38, TEMPB ) RestrictionsNone. Literature_ReferencesNone. Author_and_InstitutionJ. Diaz del Rio (ODC Space) W.M. Owen (JPL) W.L. Taber (JPL) VersionSPICELIB Version 1.1.0, 12-AUG-2021 (JDR) Added IMPLICIT NONE statement. Edited the header to comply with NAIF standard. SPICELIB Version 1.0.1, 10-MAR-1992 (WLT) Comment section for permuted index source lines was added following the header. SPICELIB Version 1.0.0, 31-JAN-1990 (WMO) |
Fri Dec 31 18:36:34 2021