Coastal & Marine Geology InfoBank

Home FACS Activities Atlas Geology School Related Sites More

USGS InfoBank program -- merge

Skip navigational links
Loading
InfoBank Programs: by Name   by Topic  
Expanded Description
Topic Description
Name
merge
Synopsis
/infobank/programs/plt/naved/merge.for
Description
  Subroutine to write data to an output file for NAVED.

       
AUTHOR
  Clint Steele         


  Fixed the problem of the time field, TimeEdit, not being 
  written to the output file correctly.  The lat and lon values
  are substituted in fine when the user uses the "replace"
  option but the time was being replaced continuously as the last 
  time chosen from the Edit file.      MHamer 1/17/91 
  JR 11/12 Changed coastdimension from 100k to 300k 
    
USAGE
  "a" = argument, "r" = referenced, "s" = set

  
  call merge                            (with the following arguments)
         OutputFilename          [variable char*100 asr]
         NumberEdit              [variable i*4 r]
         EditFilename            [variable char*100 ar]
         BackFileNm              [variable char*100 ar]
         FileStatus              [variable char*11 r]
         CoastEditArea           [variable char*12 r]
         StatusFlag              [variable char*4 s]
         Year                    [variable i*4 r]
    
SUBROUTINES
  specialmode         (internal)                    

  opener1              (internal)                    
  converttime         (external DRS shareable routine)
  forerror            (external DRS shareable routine)
  stringlen           (external DRS shareable routine)
    
FUNCTIONS
  index               (FORTRAN intrinsic function)  

    
FILES_USED
  unit=*(read,write)

  unit=(l)Editunit(read,inqre,close)
  unit=(l)outputunit(write,close)

    
Reads
                  read (EditUnit, ' (a) ', iostat = ErrorFlag, 
     *                  end = 4) EditDataRecord
                      read (EditDataRecord, ' 
     *                        (i3.3, 3i2.2, i1.1) ' ) 
     *                    EditTempDay, 
     *                    EditTempHour, 
     *                    EditTempMinute, 
     *                    EditTempSecond, 
     *                    EditTempTenths
60                          read (BackUnit, ' (a) ', 
     *                           iostat = ErrorFlag, end = 4)
     *                           BackDataRecord
                                read (BackDataRecord, ' 
     *                                (i3.3, 3i2.2, i1.1) ' ) 
     *                            BackTempDay, 
     *                            BackTempHour, 
     *                            BackTempMinute, 
     *                            BackTempSecond, 
     *                            BackTempTenths
                          read (EditUnit, ' (a) ', 
     *                          iostat = ErrorFlag, 
     *                          end = 4) EditDataRecord
                          read (EditDataRecord,
     *                         ' (i3.3, 3i2.2, i1.1) ' ) 
     *                        EditTempDay, 
     *                        EditTempHour, 
     *                        EditTempMinute, 
     *                        EditTempSecond, 
     *                        EditTempTenths
Writes
                      write (OutputUnit, 6) Year, 
     *                                DayEdit, 
     *                                HourEdit, 
     *                                MinuteEdit, 
     *                                SecondEdit, 
     *                                TenthsEdit, 
     *                                LatEdit  (EditCount), 
     *                                LongEdit (EditCount) 
              write (OutputUnit,  802) CoastEditArea, 
     *            AreaSouth, AreaNorth, AreaEast, AreaWest,
     *            CoastCounter
                      write (OutputUnit,  805) 
     *                    CoastEditLine(GroupCount), 
     *                    GroupSouth, GroupNorth, GroupEast, GroupWest,
     *                    CoastCounter
                               write (OutputUnit, 806) 
     *                           LatEdit  (Loop), LongEdit (Loop) +360.0
                               write (OutputUnit, 806) 
     *                           LatEdit  (Loop), LongEdit (Loop)
                          write (OutputUnit, ' (a) ') 
     *                          EditDataRecord(1:RecordLength)
                          write (OutputUnit, ' (/) ')
                            write (OutputUnit, 3)
     *                       EditDataRecord (1:RecordLength),
     *                       LatEdit (EditCount),
     *                       LongEdit (EditCount)
                                      write (OutputUnit, 3)
     *                                 BackDataRecord 
     *                                       (1:RecordLength),
     *                                 LatEdit (EditCount),
     *                                 LongEdit (EditCount)
                              write (OutputUnit, 3) 
     *                            EditDataRecord (1:RecordLength),
     *                            LatEdit  (EditCount), 
     *                            LongEdit (EditCount) 
                              write (OutputUnit, 3) 
     *                            EditDataRecord (1:RecordLength),
     *                            LatEdit  (EditCount), 
     *                            LongEdit (EditCount)
                          write (OutputUnit, 3) 
     *                                 EditDataRecord 
     *                                     (1:RecordLength),
     *                                 LatEdit  (LoopCount), 
     *                                 LongEdit (LoopCount)
Opens
Calls
      call specialmode ('TEXT')
      call opener1 (EditUnit,
     *             EditFilename,
     *             'FORMATTED',
     *             'OLD',
     *             ErrorFlag)
      call opener1 (BackUnit,
     *             BackFileNm,
     *             'FORMATTED',
     *             'OLD',
     *             ErrorFlag)
          call starout (EditFilename, OutputFilename)
      call opener1 (OutputUnit,
     *             OutputFilename,
     *             'FORMATTED',
          call yesno ('Y[N]Q', Answer)
              call headem (EditUnit, OutputUnit)
                      call converttime ('EXPAND  ', 
     *                                 DayEdit, 
     *                                 HourEdit, 
     *                                 MinuteEdit, 
     *                                 SecondEdit, 
     *                                 TenthsEdit, 
     *                                 TimeEdit (EditCount),
     *                                 EditFlagTimeStat)
                      call stringlen (EditDataRecord, RecordLength)
                      call converttime ('COMPRESS', 
     *                            EditTempDay, 
     *                            EditTempHour, 
     *                            EditTempMinute, 
     *                            EditTempSecond, 
     *                            EditTempTenths, 
     *                            EditTempTime,
     *                            EditFlagTimeStat)
                            call stringlen 
     *                       (EditDataRecord, RecordLength)
                      call converttime ('COMPRESS', 
     *                             BackTempDay, 
     *                             BackTempHour, 
     *                             BackTempMinute, 
     *                             BackTempSecond, 
     *                             BackTempTenths, 
     *                             BackTempTime,
     *                             BackFlagTimeStat)
                                      call stringlen 
     *                                 (BackDataRecord, 
     *                                 RecordLength)
                          call stringlen 
     *                        (EditDataRecord, RecordLength)
                          call stringlen 
     *                        (EditDataRecord, RecordLength)
                      call forerror (ErrorFlag) 
                          call converttime ('EXPAND  ', 
     *                                       DayEdit, 
     *                                       HourEdit, 
     *                                       MinuteEdit, 
     *                                       SecondEdit, 
     *                                       TenthsEdit, 
     *                                       TimeEdit (LoopCount),
     *                                       EditFlagTimeStat)
                          call stringlen 
     *                        (EditDataRecord, RecordLength)

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