USGS InfoBank banner.  USGS, Coastal and Marine Geology, InfoBank banner.
 USGS Coastal and Marine Geology banner.    Search InfoBank.
USGS InfoBank program -- buck Skip navigational links
    ________   ________   ______________   ________   _________   _______________   ________  
  tab edge  Home  tab edge  Data  tab edge  Activities  tab edge  FACS  tab edge  Atlas  tab edge  Definitions  tab edge  More  tab edge  
   
InfoBank Programs: by Name   by Data Type   General Tools   GIS   Plotting   Web   USGS Disclaimer   InfoBank Programs   Boothill  
Expanded description of application
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

    
Opens
     open (unit   = OutputUnit,
*          form   = 'FORMATTED', 
*          status = 'UNKNOWN', 
*          file   = BuckFile, 
*          iostat = ErrorFlag) 

    
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)

    
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

InfoBank   Menlo Park Center   Santa Cruz Center   St. Petersburg Center   Woods Hole Center   Coastal and Marine Geology Program  
U. S. Department of the Interior   U. S. Geological Survey   Geologic Information   Ask-A-Geologist   USGS privacy statement   Disclaimer  

URL:
Maintainer: Clint Steele
Comments: e-mail
Last modified: Wed Jan 29 13:09:23 PST 2003  (wcs)