Coastal & Marine Geology InfoBank

Home FACS Activities Atlas Geology School Related Sites More

USGS InfoBank program -- gerry2daps

Skip navigational links
InfoBank Programs: by Name   by Topic  
Expanded Description
Topic Description
  Program to reformat a comma-delimited navigation file

  from Gerry Hatcher into the DAPS navigation file format.
  Input  file    = navigation file

  Output file    = DAPS time/lat/lon/etc file
  Enter name of input file:
  Enter name of output file:
  The input format is:

  ( t1,   i2,   month
    t4,   i2,   day
    t7,   i2,   year
   t10,   i2,   hour
   t13,   i2,   minute
   t16,   i2,   second
   t19,f14.12,  ship latitude
   t35,f16.12,  ship longitude
   t51, f,      fish latitude
   , f,         fish longitude
   , f,         speed
   , f,         ship heading
   , f,         ship course
   , f,         ship depth
   , a,         line
   , a,         fish data age Ms
   , f,         fish heading
   , f,         fish pitch
   , f,         fish roll
   , f,         fish altitude
   , f,         fish pres depth
   , f)         fish water depth
  The DAPS ship nav output format is:

  ( t1, i4.4,   Year
    t5, i3,3,   DayOfYear
    t8, i2.2,   Hour
   t10, i2.2,   Minute
   t12, i2.2,   Second
   t14, i1.1,   TenthOfSecond
   t16, f9.5,   ShipLatitude
   t26,f10.5,   ShipLongitude
   t37, a,      Line
   t50, f9.2,   Speed
   t60, f9.2,   ShipHeading
   t70, f9.2,   ShipCourse
   t80, f9.2,   ShipDepth)

  The DAPS fish nav output format is:
  ( t1, i4.4,   Year
    t5, i3,3,   DayOfYear
    t8, i2.2,   Hour
   t10, i2.2,   Minute
   t12, i2.2,   Second
   t14, i1.1,   TenthOfSecond
   t16, f9.5,   FishLatitude
   t26,f10.5,   FishLongitude
   t37, a,      Line
   t50, f9.2,   Speed
   t60, f9.2,   FishHeading
   t70, f9.2,   FishPitch
   t80, f9.2,   FishRoll
   t90, f9.2,   FishAltitude
   t100, f9.2,  FishPressureDepth
   t110, f9.2,  FishWaterDepth
   t120, a      FishDataAgeMS)
  openem     (external shareable)

  forerror   (external shareable)
  julianday  (external shareable)
  getcentury (external shareable)
  changecase (external shareable)
  stringlen  (external shareable)
  Clint Steele     04/26/2007

  based on /infobank/programs/refmt/mips2daps
  Clint Steele   commented out "fish" output portion  12/15/2009
      (has yet to be collected)

          read (InputUnit, '(q,a)', end = 900, iostat = ErrorFlag)
     *        ALineLength, ALine(1:ALineLength)
          read (ALine(1:Slash1-1), '(i)') Month
          read (ALine(Slash1+1:Slash2-1), '(i)') Day
          read (ALine(Slash2+1:Comma(1)-1), '(i)') Year
          read (ALine(Comma(1)+1:Comma(2)-1), 
     *        '(i2,1x,i2,1x,i2)') Hour, Minute, Second
          read (ALine(Comma(2)+1:Comma(3)-1),   '(f)') ShipLatitude
          read (ALine(Comma(3)+1:Comma(4)-1),   '(f)') ShipLongitude
          read (ALine(Comma(4)+1:Comma(5)-1),   '(f)') FishLatitude
          read (ALine(Comma(5)+1:Comma(6)-1),   '(f)') FishLongitude
          read (ALine(Comma(6)+1:Comma(7)-1),   '(f)') Speed
          read (ALine(Comma(7)+1:Comma(8)-1),   '(f)') ShipHeading
          read (ALine(Comma(8)+1:Comma(9)-1),   '(f)') ShipCourse
          read (ALine(Comma(9)+1:Comma(10)-1),  '(f)') ShipDepth
          read (ALine(Comma(10)+1:Comma(11)-1), '(q,a)') 
     *        LineLength, Line(1:LineLength)
          read (ALine(Comma(11)+1:Comma(12)-1), '(q,a)') 
     *        FishDataAgeMSLength, FishDataAgeMS(1:FishDataAgeMSLength)
          read (ALine(Comma(12)+1:Comma(13)-1), '(f)') FishHeading
          read (ALine(Comma(13)+1:Comma(14)-1), '(f)') FishPitch
          read (ALine(Comma(14)+1:Comma(15)-1), '(f)') FishRoll
          read (ALine(Comma(15)+1:Comma(16)-1), '(f)') FishAltitude
              write (ShipOutputUnit, '(a)') '!* '//
     *            InputFileName(1:InputFileNameLength)
              write (ShipOutputUnit, '(a)') '!  '//ALine(1:ALineLength)
              write (ShipOutputUnit, '(a)') '!'
          write (Line, '(50x)')
          write (FishDataAgeMS, '(50x)')
              write (ShipOutputUnit, 40)
     *            Year+Century,
     *            DayOfYear, Hour, Minute, Second,
     *            ShipLatitude, ShipLongitude, 
     *            Line(1:LineLength), Speed,
     *            ShipHeading, ShipCourse, ShipDepth
      call openem (1, 1)
      call stringlen (InputFileName, InputFileNameLength)
              call getcentury (Year, Century)
              call forerror (ErrorFlag)
              call julianday 
     *            ('JULIAN', DayOfYear, Year+Century, Month, Day)
              call changecase ('SMALLS', Line(1:LineLength))
              call changecase ('CAPITALS', Line(1:LineLength))

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 logo U.S. Department of the Interior | U.S. Geological Survey
Page Contact Information: InfoBank staff
Page Last Modified: Mon Sep 16 03:38:33 PDT 2013  (chd)