Index of Functions: A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X 
Index Page
remlai

Table of contents
Procedure
Abstract
Required_Reading
Keywords
Declarations
Brief_I/O
Detailed_Input
Detailed_Output
Parameters
Exceptions
Files
Particulars
Examples
Restrictions
Literature_References
Author_and_Institution
Version

Procedure

     REMLAI ( Remove elements from an integer array )

     SUBROUTINE REMLAI ( NE, LOC, ARRAY, NA )

Abstract

     Remove one or more elements from an integer array at the
     indicated location.

Required_Reading

     None.

Keywords

     ARRAY
     ASSIGNMENT

Declarations

     IMPLICIT NONE

     INTEGER          NE
     INTEGER          LOC
     INTEGER          ARRAY ( * )
     INTEGER          NA

Brief_I/O

     VARIABLE  I/O  DESCRIPTION
     --------  ---  --------------------------------------------------
     NE         I   Number of elements to be removed.
     LOC        I   Location of the first removed element.
     ARRAY     I-O  Input/output array.
     NA        I-O  Number of elements in the input/output array.

Detailed_Input

     NE       is the number of elements to be removed.

     LOC      is the location in the array at which the first
              element is to be removed.

     ARRAY    on input, is the original array.

     NA       on input, is the number of elements in ARRAY.

Detailed_Output

     ARRAY    on output, is the original array with elements
              LOC through LOC+NE-1 removed. Succeeding elements
              are moved forward to fill the vacated spaces.

     NA       on output, is the number of elements in ARRAY.

Parameters

     None.

Exceptions

     1)  If LOC is not in the interval [1, NA], the error
         SPICE(INVALIDINDEX) is signaled.

     2)  If the number of elements to be removed is greater than the
         number of elements that can be removed, the error
         SPICE(NONEXISTELEMENTS) is signaled.

     3)  If NE is less than one, the array is not modified.

     4)  If NA is less than one, any location is invalid, and, the
         error SPICE(INVALIDINDEX) is signaled.

Files

     None.

Particulars

     The elements in positions LOC through LOC+NE-1 are overwritten
     as the elements beginning at LOC+NE are moved back.

Examples

     Let

           NA = 7      ARRAY(1) = 1
                       ARRAY(2) = 2
                       ARRAY(3) = 3
                       ARRAY(4) = 4
                       ARRAY(5) = 5
                       ARRAY(6) = 6
                       ARRAY(7) = 7

     Then the call

           CALL REMLAI ( 3, 3, ARRAY, NA )

     yields the following result:

           NA = 4      ARRAY(1) = 1
                       ARRAY(2) = 2
                       ARRAY(3) = 6
                       ARRAY(4) = 7


     The following calls would signal errors:

     CALL REMLAI ( 3,  1, ARRAY, -1 )
     CALL REMLAI ( 3, -1, ARRAY,  7 )
     CALL REMLAI ( 3,  6, ARRAY,  7 )

Restrictions

     None.

Literature_References

     None.

Author_and_Institution

     J. Diaz del Rio    (ODC Space)
     H.A. Neilan        (JPL)
     W.L. Taber         (JPL)
     I.M. Underwood     (JPL)

Version

    SPICELIB Version 1.1.0, 03-OCT-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 (IMU) (HAN)
Fri Dec 31 18:36:42 2021