Coastal & Marine Geology InfoBank

Home FACS Activities Atlas Geology School Related Sites More

USGS InfoBank program -- starin

Skip navigational links
Loading
InfoBank Programs: by Name   by Topic  
Expanded Description
Topic Description
Name
starin
Synopsis
/infobank/programs/share/starin.for
Description
  Subroutine to handle star-convention input filenames.

       
COMMENTS
  If run BATCH, star convention can be used as long as the resulting

  search yields only 1 file.
   
  On UNIX allows usage of '*', '?', and '[' in star-filenames.
   
    
USAGE
  "a" = argument, "r" = referenced, "s" = set

  
  call starin                           (with the following arguments)
         SearchName                  [variable char*100 asr]
  
      where "SearchName" is a character string (*100) that is potentially
      a star-name passed to STARIN and is changed to a single filename 
      upon return.
   
    
SUBROUTINES
  getmode             (MCS shareable routine)

     
    
FUNCTIONS
  index               (FORTRAN intrinsic function)  

     
    
FILES_USED
  unit=*(read,write)

  unit=6(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
  Clint Steele   8/13/88    .for

  Clint Steele   9/30/88    Changed input from unit 5 to *
  Clint Steele  11/22/88    Added check for BACKGROUND mode
  Clint Steele  11/23/88    Changed LIB$GETJPI to CALL GETMODE
  Michael Hamer 11/30/95    Updated for UNIX (Super Shark)
  Carolyn Degnan 9/23/04    added implicit none.

    
Reads
            read (*, '(q,a)', end = 999) Length, SearchName
               read (TmpUnitNum, '(a)', iostat = ReadErrorFlag) Aline
                     read (*, '(q,a)', end = 999) Length, SearchName
          read (*, '(q,a)', end = 999) Length, SearchName
          read (SearchName(1:Length), '(i)', iostat = ErrorFlag) 
     *                 Number
                read (*, '(q,a)', end = 999) Length, SearchName
Writes
            write (6, 3) LoopCount, FileName(LoopCount)(1:70)
          write (6, 9) SearchName(1:60)
Opens
         open (unit   = TmpUnitNum,
     *         form   = 'Formatted',
     *         status = 'OLD',
     *         file   = 'tmp.starin',
     *         iostat = ErrorFlag)
Calls
      call getmode (Mode)
      call stringlen (SearchName, StringLength)
      call stringlen (SystemCommand, StringLength)
      call stringlen (SystemCommand, StringLength)
      call system (SystemCommand(1:StringLength))        ! UNIX SPEC
      call stat ('tmp.starin', statb)
         call system ('/bin/rm tmp.starin')
         call yesno ('Y[N]', Response)
            call forerror (ErrorFlag)
               call stringlen (Aline, StringLength)

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