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

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

      FN2LUN ( Map name of open file to its logical unit. )
 
      SUBROUTINE FN2LUN ( FILNAM, LUNIT )
 

Abstract

      Map the name of an open file to its associated logical unit.

Required_Reading

     None.

Keywords

      FILES

Declarations

 
      CHARACTER*(*)    FILNAM
      INTEGER          LUNIT
 

Brief_I/O

     VARIABLE  I/O  DESCRIPTION
     --------  ---  --------------------------------------------------
     FILNAM     I   Name of the file to be mapped to its logical unit.
     LUNIT      O   The logical unit associated with the filename.

Detailed_Input

     FILNAM   is the filename that is to be mapped to its associated
              Fortran logical unit.

Detailed_Output

     LUNIT    is the Fortran logical unit that is associated with the
              filename FILNAM. The file must be open for this routine
              to work properly.

Parameters

     None.

Exceptions

     1) If the filename is blank, the error SPICE(BLANKFILENAME) will
        be signalled.

     2) If an error occurs during the execution of the Fortran INQUIRE
        statement, the error SPICE(INQUIREFAILED) is signalled.

     3) If the filename is not associated with an open file, the
        error SPICE(FILENOTOPEN) will be signalled.

     4) If the filename is not associated with an existing file, the
        error SPICE(FILEDOESNOTEXIST) will be signalled.

     5) In the event of an error the contents of the variable LUNIT
        are not defined, and should not be used.

Files

     None.

Particulars

     Use the Fortran INQUIRE statement to determine the filename
     that is associated with the Fortran logical unit LUNIT.

Examples

     The following code fragment illustrates the use of FN2LUN.

     C
     C      Convert the logical unit to its filename and display it.
     C
            CALL FN2LUN ( FNAME, LUNIT )
            WRITE (*,*) 'The logical unit is: ', LUNIT

Restrictions

     None.

Literature_References

     None.

Author_and_Institution

     K.R. Gehringer  (JPL)

Version

    SPICELIB Version 1.0.0, 16-AUG-1994 (KRG)
Wed Apr  5 17:46:37 2017