USGS InfoBank banner.  USGS, Coastal and Marine Geology, InfoBank banner.
 USGS Coastal and Marine Geology banner.    Search InfoBank.
USGS InfoBank program -- mergeit 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
Topic Description
Name
mergeit
Synopsis
/infobank/programs/edit/mergeit/mergeit.for
Description
  Program to merge 2 data files.
    
Input
  First file is "gospel" with all values preserved exactly as input.

  Second file will be inserted to match times in "gospel" file.
  Where there is no value in the second file for a time in the first,
  program will optionally interpolate a value or plug in a dummy value.
  When the variant file ends before the invariant file, the remaining
  times from the invariant file will be given a dummy value.
  Times are in Julian day, hour, decimal minute.
  Up to 10 invariant values and up to 10 variant values
  can be input per record.
    
Author
  Clint Steele           .for             11/1/83

  B. Blubaugh      03/14/85
  deleted prompt for cruzid; deleted format checks (answer y or n)
  C. Degnan        06/16/86
  removed ida,ihr,rmin time option and made interpolation optional
  C. Degnan        06/16/86
  added special crossing 180 degree longitude interpolation handler
  C. Degnan        09/08/87
  added default format option for mergeing navigation to data
  E. Maple         09/09/87
  modified for changes to yesno, structured more according to MAT
  C. Degnan        09/30/88
  added option to interpolate up to a maximum allowable time gap
  C. Degnan        07/14/88
  will not write out dummy record if longitude is to be 9-filled
  M. Hamer         06/17/91
  updated prompts to inform the user of what the program wants as input.
  M. Hamer         05/03/99
  removed percentage calls
    
Prompts
  First  input file = INVARIANT file

  Second input file = VARIANT   file
  Enter input  file name:
  Enter output file name:
  How many INVARIANT VALUES will be input? (max. of 10)
  Enter INVARIANT file input FORMAT
         (ida,ihr,imin,isec,iten,cval(s) ):
  How many VARIANT VALUES will be input? (max. of 10)
  Are any of the VARIANT values a LONGITUDE (y or n)?
  Note: program will NOT write out dummy longitude records;
        so if you want dummy longitude records, answer N....
  [if "y", then]  LONGITUDE must be rval #2!
  [if "y", then]  ex: (i4,i3,3(i2),i1,t16,f9.5,t26,f10.5,...)
  Enter VARIANT file input FORMAT
         (iyr,ida,ihr,imin,isec,iten,rval(s) ):
  Enter OUTPUT file FORMAT
         (iyr,ida,ihr,imin,isec,iten,cval(s),rval(s) ):
  Interpolate VARIANT fields for INVARIANT times (y or n)?
  [if YES interpolate,] Enter maximum allowable interpolation time gap
  DDDHHMMSST:
  Enter dummy a value for each variant field (eg. 99.9,999.99):
    
Subroutines
  converttime (external shareable)

  openem      (external shareable)
  showlines   (external shareable)
  yesno       (external shareable)

    
Reads
     read (iunitinvar, '(q)') ilen
 read (*, '(a)') cfmt90
 read (*, '(a)') cfmt91
 read (*, '(a)') cfmt92
    read (*, '(q,a)') ilen_cfmt90, cfmt90
    read (*, '(a)') cfmt91
    read (*, '(a)') cfmt92
     read (5, cfmttm) iyr1, ida1, ihr1, imin1, isec1, iten1
     read (iunitinvar, cfmt90, err = 99, end = 98)
*        iyr1, ida1, ihr1, imin1, isec1, iten1,
*        (cval1 (j), j = 1, numinvar)
         read (iunitvar, cfmt91, err = 97, end = 96)
*            iyr3, ida3, ihr3, imin3, isec3, iten3,
*            (rval3 (j), j = 1, numvar)
         read (iunitinvar, cfmt90, err = 99, end = 98)
*            iyr1, ida1, ihr1, imin1, isec1, iten1,
*            (cval1 (j), j = 1, numinvar)
    
Writes
     write (cfmt90temp, 20) ilen
     write (cfmt92temp, 22) ilen
         write (ioutunit, cfmt92) 
*              iyr1, ida1, ihr1, imin1, isec1, iten1,
*             (cval1 (i), i = 1, numinvar),
*             (rval3 (j), j = 1, numvar)
         write (ioutunit, cfmt92) 
*             iyr1, ida1, ihr1, imin1, isec1, iten1,
*             (cval1 (i), i = 1, numinvar),
*             (rval2 (j), j = 1, numvar)
         write (ioutunit, cfmt92) 
*             iyr1, ida1, ihr1, imin1, isec1, iten1,
*             (cval1 (i), i = 1, numinvar),
*             (rval4 (j), j = 1, numvar)
     write (ioutunit, cfmt92) 
*         iyr1, ida1, ihr1, imin1, isec1, iten1,
*         (cval1 (i), i = 1, numinvar),
*         (rdummy (j), j = 1, numvar)
         write (ioutunit, cfmt92) 
*              iyr1, ida1, ihr1, imin1, isec1, iten1,
*             (cval1 (i), i = 1, numinvar),
*             (rdummy (j), j = 1, numvar)
    
Calls
 call openem (2, 1)
 call showlines (iunitinvar, 3)
 call showlines (iunitinvar, 3)
     call stringlen (cfmt90temp, length)
 call stringlen (cfmt90, ilen_cfmt90)
 call showlines (iunitvar, 3)
 call yesno ('Y[N]', answer)
 call showlines (iunitvar, 3)
     call stringlen (cfmt91temp, length)
 call stringlen (cfmt91, ilen_cfmt91)
 call showlines (iunitvar, 3)
       call stringlen (cfmt92temp, length)
 call stringlen (cfmt92, ilen_cfmt92)
 call yesno ('[Y]N', answer)
    call showlines (iunitinvar, 3)
 call yesno ('[Y]N', answer)
    call showlines (iunitvar, 3)
    call stringlen (cfmt91, ilen_cfmt91)
 call yesno ('[Y]N', answer)
    call showlines (iunitvar, 3)
    call stringlen (cfmt92, ilen_cfmt92)
 call yesno ('[Y]N', answer)
     call converttime ('COMPRESS', ida1, ihr1, imin1, isec1, 
*                      iten1, itmgap, ErrorFlag)
     call converttime ('COMPRESS', ida1, ihr1, imin1, isec1, 
*                      iten1, itm1inv, ErrorFlag)

         call converttime ('COMPRESS', ida3, ihr3, imin3, isec3, 
*                          iten3, itm3var, 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: /infobank/programs/edit/mergeit/mergeit.doc.html
Maintainer: Clint Steele
Comments: e-mail
Last modified: Wed Nov 20 15:01:09 PST 2002  (wcs)