sameai |
Table of contents
ProcedureSAMEAI ( Are two integer arrays the same? ) LOGICAL FUNCTION SAMEAI ( A1, A2, NDIM ) AbstractIndicate whether two integer arrays are equal. Required_ReadingNone. KeywordsARRAY DeclarationsIMPLICIT NONE INTEGER A1 ( * ) INTEGER A2 ( * ) INTEGER NDIM Brief_I/OVARIABLE I/O DESCRIPTION -------- --- -------------------------------------------------- A1 I First array to be compared. A2 I Second array to be compared. NDIM I Dimension of A1 and A2. The function returns the value .TRUE. if and only if A1 = A2. Detailed_InputA1, A2 are two integer arrays to be compared. A1 and A2 must have the same dimension. NDIM is the common dimension of A1 and A2. Detailed_OutputThe function takes the value .TRUE. if and only if A1 equals A2. ParametersNone. ExceptionsError free. FilesNone. ParticularsThis function can be thought of as a macro. It replaces the loop SAME = .TRUE. I = 1 DO WHILE ( ( I .LE. NDIM ) .AND. SAME ) IF ( A1(I) .NE. A2(I) ) SAME = .FALSE. ELSE I = I + 1 END IF END DO Examples1) Test two integer arrays A1 and A2 for equality, where both arrays have declared length 10: SAME = SAMEAI ( A1, A2, 10 ) RestrictionsNone. Literature_ReferencesNone. Author_and_InstitutionN.J. Bachman (JPL) J. Diaz del Rio (ODC Space) 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.0, 19-DEC-1995 (NJB) |
Fri Dec 31 18:36:44 2021