Coastal & Marine Geology InfoBank

Home FACS Activities Atlas Geology School Related Sites More

USGS InfoBank program -- headem

Skip navigational links
InfoBank Programs: by Name   by Topic  
Expanded Description
Topic Description
  Subroutine to generate, update, and maintain DRS data file header

  Header information for the current process is inserted into

  each output file as well as the header information from each input
  file. In addition, this subroutine sets the record pointer in each
  input file(s) to the first data record.
  Subroutine is called primarily by OPENEM.

  "a" = argument, "r" = referenced, "s" = set

  call headem                           (with the following arguments)
         InUnit                      [variable i*4 ar]
         OutUnit                     [variable i*4 ar]
    InUnit   = unit number of input  file
    OutUnit  = unit number of output file
  If the argument OutUnit is negative, header generation for all 
  output file is suppressed. The input file will still be set to the
  first record after the header records.
    No prompting will occur if the executing process is not

    INTERACTIVE. Otherwise, if the file type of any of the output
    file is unknown the user will be prompted for the following:
        'Please enter a description of the data:'
        ' (eg: Edited navigation data)'
        'Please enter mnemonic format:'
        ' (eg: (year,day,hr,min,sec,tenths,lat,long) )'
        'Please enter the FORTRAN format:'
        ' (eg: (i4.4,i3.3,3i2.2,i1.1,t16,f9.5,t26,f10.5) )'
    If the executing process is INTERACTIVE, the user will be prompted
    for the following for each output file:
        'Enter comment lines (<CTRL>Z = end of comments) for
  drsvt    [logical name]

  vescinit            (shared DRS external routine) 

  idate               (VAX FORTRAN System routine)  
  getusrnam           (shared DRS external routine) 
  getjpihed           (shared DRS external routine) 
  stringlen           (shared DRS external routine) 
  forerror            (shared DRS external routine) 
  dictionary          (shared DRS external routine) 
  comments            (shared DRS external routine) 
  parsename           (shared DRS external routine)
  getarg              (shared DRS external routine)
  changecase          (shared DRS external routine)
  index               (FORTRAN intrinsic function)  


  New header "formats" should be added to 

   subroutine DICTIONARY.
  New comment "reminders" should be added to 
   subroutine COMMENTS.
  Although this program has been used by the U.S. Geological Survey,

  no warranty, expressed or implied, is made by the Survey as to the
  accuracy and functioning of the program and related program
  material nor shall the fact of distribution constitute any such
  warranty, and no responsibility is assured by the Survey in
  connection therewith.
  Clint Steele      1/2/85     .for

  Ed Maple          8/27/85   Added call to BUCK and system calls
                                for program, user, mode outside of
                                if (MODE .EQ. INTERACTIVE) loop.
  Jean Riordan      2/05/88   Modified for DRS$SHARE cleanup and UNIX 
  Clint Steele      9/27/88   Replaced filename construction with call
                                to PARSENAME.
                              Added 1 character to FileOut name.
                              Changed i/o from unit * to 5 and 6.
                              Added handler for comments in col. 2.
                              Removed call to BUCK for UNIX.
  Clint Steele      9/30/88   Changed input unit 5 to *.
  Clint Steele      11/16/88  Added ability to override output header desire
                                with -header or -noheader parameters.
  Clint Steele      11/22/88  Added recognition of background spawned
                                process as "BACKGROUND"
  Clint Steele      11/23/88  Changed LOG_MODE to CALL GETMODE
  Clint Steele       2/22/90  Canibalized into HEADEM for NAVED

          read (InUnit, '(a)', iostat = ErrorFlag) 
     *        InputHeader (LoopCount500)
      read (FileType, '(i3)', iostat = ErrorFlag) LetterType
          read (*, '(a)', iostat = ErrorFlag)  Comment
          read (*, '(a)')  Comment
          read (*, '(a)', iostat = ErrorFlag) Comment
      write (OutUnit, 2) Month, Day, Year,
     *                      UserName (1:LengthUserName),
     *                      FileOut  (1:LengthFileOut)
      write (OutUnit, '(''! '', a)')
     *    ProgramName (1:LengthProgName - 1)
          write (OutUnit, '(''! '', a)')
     *       Description(LetterType) (1:LengthDescript)
          write (OutUnit, '(''! '', a)')
     *       Mnemonic(LetterType) (1:LengthMnemonic)
          write (OutUnit, '(''! '', a)') 
     *       Fortran(LetterType) (1:LengthFortran)
              write (OutUnit, '(''! '', a)')
     *            Comment (1:LengthComment)
              write (OutUnit, '(''! '', a)')
     *            Comment (1:LengthComment)
              write (OutUnit, '(''! '', a)')
     *            Comment (1:LengthComment)
      write (6, 9) 
     *      FileOut (1:LengthFileOut)
             write (OutUnit, '(''! '', a)')
     *           Comment (1:LengthComment)
      write (OutUnit, '(''!  '')' )
                      write (OutUnit, '(''!*'', a)' ) 
     *              InputHeader (LoopCount775)
     *                          (2:LengthHeader)
                      write (OutUnit, '(''!*'', a)' ) 
     *              InputHeader (LoopCount775)
     *                          (3:LengthHeader)
                  write (OutUnit, '(''! '', a)' )
     *              InputHeader (LoopCount775)
     *                          (3:LengthHeader)
              write (OutUnit, '(''!  '')' )
      call idate     (SystemDate)                        ! UNIX SPEC
      call getusrnam (UserName)
      call getjpihed (ProgramName)
      call stringlen (ProgramName, LengthProgName)
              call forerror (ErrorFlag)
      call dictionary (Description, Mnemonic, Fortran, C, ComponentName)
      call parsename (FileOut,
     *                  Node, LengthNode,
     *                  Device, LengthDevice,
     *                  Directory, LengthDirectory,
     *                  SubDirectory, LengthSubDir, SubDirCount, 
     *                  FileName, LengthName,
     *                  FileType, LengthType,
     *                  Version, LengthVersion)
      call stringlen (UserName, LengthUserName)
      call stringlen (FileOut, LengthFileOut)
          call stringlen (Description(LetterType), 
     *                    LengthDescript)
          call stringlen (Mnemonic(LetterType), LengthMnemonic)
          call stringlen (Fortran(LetterType), LengthFortran)
          call stringlen (Comment, LengthComment)
          call stringlen (Comment, LengthComment)
          call stringlen (Comment, LengthComment)
      call comments (FileType)
          call stringlen (Comment, LengthComment)
          call stringlen
     *        (InputHeader (LoopCount775),
     *         LengthHeader)

Skip footer navigational links

Coastal and Marine Science Centers:  Pacific   St. Petersburg   Woods Hole  
InfoBank   Coastal and Marine Geology Program   Geologic Information   Ask-A-Geologist   USGS Disclaimer  

Accessibility FOIA Privacy Policies and Notices

Take Pride in America logo logo U.S. Department of the Interior | U.S. Geological Survey
Page Contact Information: InfoBank staff
Page Last Modified: Mon Sep 16 03:39:12 PDT 2013  (chd)