Coastal & Marine Geology InfoBank

Home FACS Activities Atlas Geology School Related Sites More

USGS InfoBank program -- buck

Skip navigational links
Loading
InfoBank Programs: by Name   by Topic  
Expanded Description
Topic Description
Name
buck
Synopsis
/infobank/programs/share/buck.for
Description
  Subroutine to create and maintain an online 'buck'.

       
COMMENTS
  Writes to an output file date/time of run, program being run, user

  running the program, mode in which user is operating, input/output 
  files used.
   
  Output file is named MMMYY.BUC
    where MMM is a 3 character month and YY is the last 2 digits of the year.
  On VMS, the file is in pmg$buck
  On UNIX, the file is in the user's working directory.
    
  If the .BUC file does not exist it is created.  If one exists,
  it is appended to.  If the month or year changes, a new .BUC
  file is created.
  
  Subroutine is called primarily by HEADER and is part of the
  shareable image library.
                              
    
USAGE
  "a" = argument, "r" = referenced, "s" = set

  
  call buck                             (with the following arguments)
         NumInFiles                  [variable i*4 r]
         NumOutFiles                 [variable i*4 r]
         
  Input:
    NumInFiles  =  number of input files opened
    NumOutFiles =  number of output files opened
  Output:
    None
      
    
SUBROUTINES
  time                (VAX FORTRAN System routine)  

  date                (VAX FORTRAN System routine)  
  getusrnam           (shared pmg external routine) 
  getsymbol           (shared pmg external routine) 
  getjpihed           (shared pmg external routine) 
  stringlen           (shared pmg external routine) 
  forerror            (shared pmg external routine) 
  parsename           (shared pmg external routine)
  getmode             (shared pmg external routine)
      
    
FUNCTIONS
  abs                 (FORTRAN intrinsic function)  

  index               (FORTRAN intrinsic function)  
  fseek               (UNIX FORTRAN run time library function)
      
    
FILES_USED
  unit=(l)loopcount(inqre)

  unit=(p)outputunit(open,write,close)
  unit=*(write)
      
    
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
  Ed Maple            8/27/85             .for

  Jean Riordan        2/2/88    
           Modified for pmg$SHARE and UNIX compatibility.
  Clint Steele        2/4/88    Added UNIX code.
  Clint Steele        9/27/88   Added to documentation.
                                Changed getsymbol calls to SPEC VMS.
                                Replaced sections of code that handled 
                                  filenames with calls to PARSENAME.
                                Improved construction of BuckFile name.
                                Removed RECL = 1024 for UNIX opens.
                                Changed BuckFile output format.
  Clint Steele       11/23/88   Changed LOG_MODE to CALL GETMODE
  Clint Steele        6/6/91    Changed DRS to PMG
  Clint Steele        8/16/91   Changed to pmg$buck reference
  Clint Steele        12/4/95   Removed VMS references

    
Reads
Writes
      write (SystemDate, 200) SystemDateTime(10:11),     
     *    SystemDateTime(5:7), SystemDateTime(23:24)     
          write (OutputUnit, 500, iostat = ErrorFlag) 
     *                    SystemDate, 
     *                    SystemTime,
     *                    UserName    (1:LengthUser),
     *                    CPUNode     (1:LengthCPUNode),
     *                    Mode,
     *                    ProgramName (1:LengthProgram),
     *                    InputFile   (1:LengthInput),
     *                    OutputFile  (1:LengthOutput)
Opens
          open (unit   = OutputUnit,
     *          form   = 'FORMATTED', 
     *          status = 'UNKNOWN', 
     *          file   = BuckFile, 
     *          iostat = ErrorFlag) 
Calls
      call getusrnam (UserName)
      call getmode   (Mode)
      call getjpihed (ProgramName)
          call parsename (InputName, 
     *                    Node,         LengthNode,
     *                    Device,       LengthDevice,
     *                    Directory,    LengthDirectory,
     *                    SubDirectory, LengthSubDir,     SubDirCount, 
     *                    FileName,     LengthName,
     *                    FileType,     LengthType,
     *                    Version,      LengthVersion)
          call parsename (InputName, 
     *                    Node,         LengthNode,
     *                    Device,       LengthDevice,
     *                    Directory,    LengthDirectory,
     *                    SubDirectory, LengthSubDir,     SubDirCount, 
     *                    FileName,     LengthName,
     *                    FileType,     LengthType,
     *                    Version,      LengthVersion)
      call stringlen (UserName,    LengthUser)
      call stringlen (ProgramName, LengthProgram)
      call stringlen (InputFile,   LengthInput)
      call stringlen (OutputFile,  LengthOutput)
          call forerror (ErrorFlag)
              call forerror (ErrorFlag)

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/buck.doc.html
Page Contact Information: InfoBank staff
Page Last Modified: Mon Sep 16 03:36:55 PDT 2013  (chd)