Coastal & Marine Geology InfoBank

Home FACS Activities Atlas Geology School Related Sites More

USGS InfoBank program -- header

Skip navigational links
Loading
InfoBank Programs: by Name   by Topic  
Expanded Description
Topic Description
Name
header
Synopsis
/infobank/programs/share/header.for
Description
  Subroutine to generate, update, and maintain DRS data file header

  records. 
       
PROCESS
  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.
  If the argument NumOutFiles is negative, header generation for all
  output files is suppressed. The input files will still be set to the
  first record after the header records.
    
USAGE
  "a" = argument, "r" = referenced, "s" = set

  call header                           (with the following arguments)
         NumInFiles                  [variable i*4 ar]
         NumOutFiles                 [variable i*4 ar]
    
INPUT
  Input:

    NumInFiles   = number of input  files
    NumOutFiles  = number of output files
    
OUTPUT
  Output:

    None
    
PROMPTS
    No prompting will occur if the executing process is not

    INTERACTIVE. Otherwise, if the file type of any of the output
    files 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: (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 (blank line = end of comments) for file'
    
INCLUDE_FILES
  drsvt    [logical name]

    
SUBROUTINES
  vescinit            (shared DRS external routine) 

  idate               (VAX FORTRAN System routine)  
  getusrnam           (shared DRS external routine) 
  getmode             (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)
    
FUNCTIONS
  index               (FORTRAN intrinsic function)  

  iargc               (shared DRS external function)
    
FILES_USED
  unit=6(write)

  unit=*(read,write)
  unit=<expr>(read,inqre,
  unit=(l)outputfile(write)
    
MAINTENANCE
  New header "formats" should be added to 

   subroutine DICTIONARY.
  New comment "reminders" should be added to 
   subroutine COMMENTS.
    
DISCLAIMER
  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.
    
AUTHOR
  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 
                                compatibility
  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     12/4/95   Removed VMS specific references.

    
Reads
              read (89 + LoopCount600, '(a)', iostat = ErrorFlag) 
     *            InputHeader (LoopCount500, LoopCount600)
              read (FileType, '(i3)', iostat = ErrorFlag) LetterType
                  read (*, '(a)', iostat = ErrorFlag)  Comment
                  read (*, '(a)')  Comment
                      read (*, '(a)') Comment
Writes
              write (OutputFile, 2) Month, Day, Year,
     *                              UserName (1:LengthUserName),
     *                              FileOut  (LoopCount700)
     *                                       (1:LengthFileOut)
              write (OutputFile, '(''! '', a)')
     *            ProgramName (1:LengthProgName)
                  write (OutputFile, '(''! '', a)')
     *               Description(LetterType) (1:LengthDescript)
                  write (OutputFile, '(''! '', a)')
     *               Mnemonic(LetterType) (1:LengthMnemonic)
                  write (OutputFile, '(''! '', a)') 
     *               Fortran(LetterType) (1:LengthFortran)
                  write (OutputFile, '(''! '', a)') 
     *               C(LetterType) (1:LengthC)
                  write (OutputFile, 5) 
                      write (OutputFile, '(''! '', a)')
     *                    Comment (1:LengthComment)
                      write (OutputFile, '(''! '', a)')
     *                    Comment (1:LengthComment)
                      write (OutputFile, '(''! '', a)')
     *                    Comment (1:LengthComment)
                  write (6, 9) VBold, VNone, 
     *                  FileOut(LoopCount700) (1:LengthFileOut)
                         write (OutputFile, '(''! '', a)')
     *                       Comment (1:LengthComment)
              write (OutputFile, '(''!  '')' )
                                  write (OutputFile, '(''!*'', a)' ) 
     *                          InputHeader (LoopCount775, LoopCount750)
     *                                      (2:LengthHeader)
                                  write (OutputFile, '(''!*'', a)' ) 
     *                          InputHeader (LoopCount775, LoopCount750)
     *                                      (3:LengthHeader)
                              write (OutputFile, '(''! '', a)' )
     *                          InputHeader (LoopCount775, LoopCount750)
     *                                      (3:LengthHeader)
                          write (OutputFile, '(''!  '')' )
Opens
Calls
      call idate     (SystemDate)
      call getusrnam (UserName)
      call getmode   (Mode)
      call getjpihed (ProgramName)
      call stringlen (ProgramName, LengthProgName)
                  call forerror (ErrorFlag)
                  call getarg (LoopCount800, Argument)
                  call changecase ('CAPITALS', Argument)
          call dictionary (Description, Mnemonic, Fortran, 
     *                     C, Component)
              call parsename (FileOut (LoopCount700),
     *                      Node, LengthNode,
     *                      Device, LengthDevice,
     *                      Directory, LengthDirectory,
     *                      SubDirectory, LengthSubDir, SubDirCount, 
     *                      FileName, LengthName,
     *                      FileType, LengthType,
     *                      Version, LengthVersion)
              call stringlen (UserName, LengthUserName)
              call stringlen (FileOut (LoopCount700), LengthFileOut)
                  call stringlen (Description(LetterType), 
     *                            LengthDescript)
                  call stringlen (Mnemonic(LetterType), LengthMnemonic)
                  call stringlen (Fortran(LetterType), LengthFortran)
                  call stringlen (C(LetterType), LengthC)
                  call stringlen (Comment, LengthComment)
                  call stringlen (Comment, LengthComment)
                  call stringlen (Comment, LengthComment)
                  call comments (FileType)
                      call stringlen (Comment, LengthComment)
                      call stringlen
     *                    (InputHeader (LoopCount775, LoopCount750),
     *                     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 USA.gov logo U.S. Department of the Interior | U.S. Geological Survey
URL: http://walrus.wr.usgs.gov/infobank/programs/share/header.doc.html
Page Contact Information: InfoBank staff
Page Last Modified: Mon Sep 16 03:36:57 PDT 2013  (chd)