Coastal & Marine Geology InfoBank

Home FACS Activities Atlas Geology School Related Sites More

USGS InfoBank program -- whatfmt

Skip navigational links
Loading
InfoBank Programs: by Name   by Topic  
Expanded Description
Topic Description
Name
whatfmt
Synopsis
/infobank/programs/share/whatfmt.for
Description
  Subroutine to prompt for and return a FORTRAN-type format.

       
COMMENTS
  If the filename is a known DRS data file type, a default format statement

  is provided.
    
USAGE
  "a" = argument, "r" = referenced, "s" = set

  
  call whatfmt                          (with the following arguments)
         LogicalUnit                 [variable i*4 r]
         AFormat                     [variable char*(*) asr]
    
  Input:
    LogicalUnit = FORTRAN logical unit number of file.
  Output:
    AFormat = Format one wishes to use is returned to the main program.
             
    
PROMPTS
  Enter the format:

      
  Note: The routine does not verify the format or count parenthesis,
        but will insert starting and ending parenthesis if the response
        to the prompt does not contain them.
           
    
SUBROUTINES
  dictionary          (shared DRS external routine) 

  stringlen           (shared DRS external routine) 
  parsename           (shared DRS external routine)
           
    
FUNCTIONS
  index               (FORTRAN intrinsic function)  

           
    
FILES_USED
  unit=(d)logicalunit(inqre)

  unit=6(write)
  unit=*(read,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
  DRS Group, PMG, USGS, Menlo Park   02/04/82

   
  Ed Maple      9/24/84  Deleted currently undefined formats 
  Ed Maple      1/21/85  Delete rest of formats, and call to yesno
  Clint Steele  2/26/85  Convert to any length format
  Jean Riordan  1/18/88  DRS$SHARE cleanup for UNIX compatibility
  Clint Steele  1/25/88  Added check for surrounding parenthesis
  Clint Steele  3/01/88  Added passed unit number to call.
  Clint Steele  3/10/88  Added default format for known filetypes.
  Clint Steele  9/27/88  Replaced filename construction with call
                           to PARSENAME.
                         Replaced * i/o with units 5 and 6
                         Added temporary variable setting TempAFormat
  Clint Steele  9/30/88  Changed input from unit 5 to *

    
Reads
          read (FileType, '(i3)', iostat = ErrorFlag) LetterType
      read (*, '(a)') AFormat
Writes
          write (6, '(a)')
     *       Description(LetterType) (0:LengthDescript)
          write (6, '(a)')
     *       Mnemonic(LetterType) (0:LengthMnemonic)
          write (6, '(a)') 
     *       Fortran(LetterType) (0:LengthFortran)
          write (6, '(a)') 
     *       C(LetterType) (0:LengthC)
Opens
Calls
      call parsename (InputName, 
     *                      Node, LengthNode,
     *                      Device, LengthDevice,
     *                      Directory, LengthDirectory,
     *                      SubDirectory, LengthSubDir, SubDirCount, 
     *                      FileName, LengthName,
     *                      FileType, LengthType,
     *                      Version, LengthVersion)
              call dictionary (Description, Mnemonic, Fortran, 
     *                         C, Component)
          call stringlen (Description(LetterType), LengthDescript)
          call stringlen (Mnemonic(LetterType), LengthMnemonic)
          call stringlen (Fortran(LetterType), LengthFortran)
          call stringlen (C(LetterType), LengthC)
          call stringlen (Fortran(LetterType), LengthFortran)
      call stringlen (AFormat, Length)

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