Coastal & Marine Geology InfoBank

Home FACS Activities Atlas Geology School Related Sites More

USGS InfoBank program -- times4kml

Skip navigational links
Loading
InfoBank Programs: by Name   by Topic  
Expanded Description
Topic Description
Name
times4kml
Synopsis
/infobank/programs/kml/times4kml/times4kml.for
Description
  Program to convert a DAPS navigation file to x,y,z format for KML

  with Time stamps.
       
COMMENTS
  This program is driven by a script that creates 

  a temporary collection of IDs.
  This program relies on .best_nav_file files for data.
    
RELATED_PROGRAMS
  seis4kml.for     nav4kml.for

    
AUTHOR
  Clint Steele    4/12/2006

    
Added Network Links For Kml
  Sumy Tom        2/19/2010

  Carolyn Degnan, 8/2/2012, Added sp format specification to output positive lat/lons with plus signs.
  Carolyn Degnan, 2/7/2013, Added separate sp output format for Lat less than 10.0 and greater than -10.0.


    
Reads
      read (80, '(q,a)', end=199) NavFilenameLength, NavFilename
      read (84, '(t10,a20)') AkaID
      read (NavFile, '(q,a)', end = 123)
     *    ALineLength, ALine(1:ALineLength)
      read (87, '(q,a)', end = 234)
     *           ALineLength, ALine(1:ALineLength)
      read (ALine, '(i4, i3)') Year, Day
      read (ALine, '(t5,i3,i2,i2,i2,i1)')
     *        Day, Hour, Minute, Second, Tenth
               read (ALine, '(t16,f9.5,t26,f10.5)') Lat, Long
               read (ALine, '(t17,f10.6,t28,f11.6)') Lat, Long
      read (EventsFile, '(q,a)') 
     *    TimeLength, TimeLine(1:TimeLength)
      read (TimeLine(1:TimeLength), '(t8,i3,i2,i2,i2,i1)')
     *    Day, Hour, Minute, Second, Tenth
      read (TimeLine(1:TimeLength), '(t24,i3,i2,i2,i2,i1)')
     *    Day, Hour, Minute, Second, Tenth
      read (NavFile, '(q,a)', end = 99) 
     *    ALineLength, ALine(1:ALineLength)
          read (NavFile, '(q,a)', end = 99) 
     *        ALineLength, ALine(1:ALineLength)
             read (ALine, '(t16,f9.5,t26,f10.5)') Lat, Long  
             read (ALine, '(t17,f10.6,t28,f11.6)') Lat, Long   
          read (ALine, '(t5,i3,i2,i2,i2,i1)')
     *        Day, Hour, Minute, Second, Tenth
              read (EventsFile, '(q,a)', end = 99) 
     *            TimeLength, TimeLine(1:TimeLength)
              read (TimeLine(1:TimeLength), '(t8,i3,i2,i2,i2,i1)')
     *            Day, Hour, Minute, Second, Tenth
              read (TimeLine(1:TimeLength), '(t24,i3,i2,i2,i2,i1)')
     *            Day, Hour, Minute, Second, Tenth
       read (ALine, '(i4, i3)') Year, Day
       read (ALine, '(t5,i3,i2,i2,i2,i1)')
     *           Day, Hour, Minute, Second, Tenth
Writes
      write (AkaID, '(20x)')
          write (87, '(a)') ALine(1:ALineLength)
          write (88, '(a)') ALine(1:ALineLength)
      write (TimeStampFile, '(2x,a)') '<open>1</op
      write (TimeStampFile, '(4x,a)') '<nam
      write (TimeStampFile, '(6x,a)') CapID(1:IDLength+3)//
     *                      '  times  '//
     *                      NavFileName(LastDot+1:NavFileNameLength)
      write (TimeStampFile, '(4x,a)') '</nam
      write (TimeStampFile, '(6x,a)') '<open>1&l
              write (TimesFile, '(2x,a)') '</Documen
              write (TimesFile, '(a)') '</km
         write (TimeStampFile, '(4x,a)') '<NetworkLin
         write (TimeStampFile, '(6x,a)') '<nam
         write (TimeStampFile, '(8x,a)') 'Day '//ALine(5:7)
         write (TimeStampFile, '(6x,a)') '</nam
         write (TimeStampFile, '(6x,a)') '<Lin
         write (TimeStampFile, '(8x,a)') '<hre
         write (TimeStampFile, '(10x,a)') 'http://walrus.wr.usgs'//
     *             '.gov/infobank/'//ID(1:1)//'/'//
     *              ID(1:IDLength)//'/kml/timeskml/'//
     *              LongID(1:IDLength+3)//'.'//
     *              NavFileName(LastDot+1:NavFileNameLength)//
     *              '.JD'//ALine(5:7)//'.kml'
         write (TimeStampFile, '(8x,a)') '</hre
         write (TimeStampFile, '(6x,a)') '</Lin
         write (TimeStampFile, '(4x,a)') '</NetworkLin
         write (TimesFile, '(a)') '<?xml version="1.0" 
     *                            'encoding="UTF-8"?&g
         write (TimesFile, '(a)') '<kml xmlns="http://earth.google.
     *                            'com/kml/2.0"&g
         write (TimesFile, '(2x,a)') '<Document&
              write (HourFile, '(a)') '</Documen
              write (HourFile, '(a)') '</km
          write (HourFile, '(a)') '<?xml version="1.0" 
     *                            'encoding="UTF-8"?&g
          write (HourFile, '(a)') '<kml xmlns="http://earth.google.
     *                            'com/kml/2.0"&g
          write (HourFile, '(a)') '<Documen
          write (HourFile, '(2x,a)')
     *           '<name> Day '//ALine(5:7)//
     *                   'Hour '//ALine(8:9)//'</name>'    
          write (HourFile, '(2x,a)')'<Style id = "red
          write (HourFile, '(4x,a)')'<LabelStyl
          write (HourFile, '(6x,a)')'<scale>0<
          write (HourFile, '(4x,a)')'</LabelStyl
          write (HourFile, '(4x,a)')'<IconStyl
          write (HourFile, '(6x,a)')'<color>ff0000ff<
          write (HourFile, '(6x,a)')'<scale> 0.5 <
          write (HourFile, '(6x,a)')'<Ico
          write (HourFile, '(8x,a)')'<href&
     *                'http://maps.google.com/mapfiles/'//
     *                'kml/shapes/shaded_dot.png</hre
          write (HourFile, '(6x,a)')'</Icon
          write (HourFile, '(4x,a)')'</IconStyl
          write (HourFile, '(2x,a)')'</Styl
          write (HourFile, '(a)')       
          write (TimesFile, '(4x,a)') '<NetworkLink&
          write (TimesFile, '(4x,a)') 
     *            '<name>  Day '//ALine(5:7)//
     *            'Hour '//ALine(8:9)//'</nam
          write (TimesFile, '(4x,a)') '<visibility>0</vis
          write (TimesFile, '(4x,a)') '<Lin
          write (TimesFile, '(6x,a)') '<hre
          write (TimesFile, '(6x,a)') 'http://walrus.wr.usgs.gov'//
     *                                 '/infobank/'//ID(1:1)//'/'//
     *             ID(1:IDLength)//'/kml/timeskml/'
     *             //LongID(1:IDLength+3)//'.'//
     *              NavFileName(LastDot+1:NavFileNameLength)//
     *             '.JD'//ALine(5:7)//'.'//ALine(8:9)//'.kml'
          write (TimesFile, '(6x,a)') '</href>
          write (TimesFile, '(4x,a)') '</Link>'             
          write (TimesFile, '(4x,a)') '</NetworkLin
       write (HourFile, '(4x,a)') '<visibility>0</vis
       write (HourFile, '(4x,a)') '<Placemar
       write (HourFile, '(6x,a)')
     *              '<styleUrl>#red</s
       write (HourFile, '(6x,a)') 
     *              '<visibility>1</vis
       write (HourFile, '(6x,a)') 
     *            '<name&
     *        ALine(5:7)//'/'//
     *        ALine(8:9)//':'//
     *        ALine(10:11)//':'//
     *        ALine(12:13)//
     *            '</nam
       write (HourFile, '(6x,a)') '<Poin
              write (HourFile, '(sp,8x,a,f11.6,a,f10.6,a)')
     *            '<coordinates>',Long,',',Lat,',0</coor
              write (HourFile, '(sp,8x,a,f11.6,a,f9.6,a)')
     *            '<coordinates>',Long,',',Lat,',0</coor
       write (HourFile, '(6x,a)') '</Poin
       write (HourFile, '(4x,a)') '</Placemar
         write (HourFile, '(a)') '</Documen
         write (HourFile, '(a)') '</kml&
         write (TimesFile, '(2x,a)') '</Documen
         write (TimesFile, '(a)') '</km
      write (TimeStampFile, '(a)') '</Documen
      write (TimeStampFile, '(a)') '</km
Opens
      open (unit = 70,
     *      access = 'sequential',
     *      form = 'formatted',
     *      status = 'unknown',
     *      name = '/infobank/tmp/times4kml.control.temp')
      open (unit = 80,
     *      access = 'sequential',
     *      form = 'formatted',
     *      status = 'old',
     *      name = '/infobank/'//ID(1:1)//'/'//ID(1:IDLength)//
     *             '/nav/'//LongID(1:IDLength+3)//'.best_nav_file')
      open (unit = NavFile,
     *      access = 'sequential',
     *      form = 'formatted',
     *      status = 'old',
     *      name = NavFilename(1:NavFilenameLength))
      open (unit = EventsFile,
     *      access = 'sequential',
     *      form = 'formatted',
     *      status = 'unknown',
     *      name = NavFilename(1:NavFilenameLength)//'_events')
      open (unit = TimeStampFile,
     *      access = 'sequential',
     *      form = 'formatted',
     *      status = 'unknown',
     *      name = '/infobank/'//ID(1:1)//'/'//ID(1:IDLength)//
     *             '/kml/'//LongID(1:IDLength+3)//'.'//
     *             NavFilename(LastDot+1:NavFileNameLength)//
     *             '.times.kml')
      open (unit = 84,
     *      access = 'sequential',
     *      form = 'formatted',
     *      status = 'unknown',
     *      name = '/infobank/'//ID(1:1)//'/'//ID(1:IDLength)//
     *             '/meta/'//LongID(1:IDLength+3)//'.ids')
      open (unit = 87,
     *      access = 'sequential',
     *      form = 'formatted',
     *      status = 'unknown',
     *      name = '/infobank/tmp/indexday.temp')
      open (unit = 88,
     *      access = 'sequential',
     *      form = 'formatted',
     *      status = 'unknown',
     *      name = '/infobank/tmp/deletethis.temp')
              open (unit = 88,
     *              access = 'sequential',
     *              form = 'formatted',
     *              status = 'unknown',
     *              name =
     *              '/infobank/tmp/times4kml.'//
     *              NavFileName(LastDot+1:NavFileNameLength)//
     *              '.'//ALine(5:7)//'.temp')
      open (unit = 87,
     *      access = 'sequential',
     *      form = 'formatted',
     *      status = 'old',
     *      name = '/infobank/tmp/indexday.temp')
         open (unit = TimesFile,
     *      access = 'sequential',
     *      form = 'formatted',
     *      status = 'unknown',
     *      name = '/infobank/'//ID(1:1)//'/'//
     *              ID(1:IDLength)//'/kml/timeskml/'//
     *              LongID(1:IDLength+3)//'.'//
     *              NavFileName(LastDot+1:NavFileNameLength)//
     *              '.JD'//ALine(5:7)//'.kml')
          open (unit   = HourFile,
     *          access = 'sequential',
     *          form   = 'formatted',
     *          status = 'unknown',
     *          name   = '/infobank/'//ID(1:1)//'/'//
     *                   ID(1:IDLength)//'/kml/timeskml/'//
     *                    LongID(1:IDLength+3)//
     *                  '.'//NavFileName(LastDot+1:NavFileNameLength)//
     *                  '.JD'//ALine(5:7)//
     *                    '.'//ALine(8:9)//'.kml')
Calls
      call kmlanalyzeid (70, IDLength, LongID, ID, Status)
      call system ('/bin/rm /infobank/'//ID(1:1)//'/'//ID(1:IDLength)//
     *             '/kml/*.times.kml')
      call system ('/bin/rm /infobank/'//ID(1:1)//'/'//ID(1:IDLength)//
     *             '/kml/*.times.kmz')     
         call system ('/bin/rm /infobank/'//ID(1:1)//'/'//
     *                 ID(1:IDLength)//'/kml/timeskml/*')
      call system ('/bin/mkdir -p /infobank/'//ID(1:1)//'/'//
     *             ID(1:IDLength)//'/kml/timeskml')
      call stringlen(KmlFileName, KmlFileNameLength)
      call stringlen (AkaID, AkaIDLength)
       call kmllookat (TimeStampFile, AkaID, 'time',
     *                       IDLength, ID, LongID)
       call changecase ('CAPITALS', CapID(1:IDLength+3))
      call julianday ('YMD', Day, Year, Month, DayofMonth)
      call converttime ('COMPRESS', Day, Hour, Minute, Second, Tenth,
     *    OnTime, TimeError)
      call converttime ('COMPRESS', Day, Hour, Minute, Second, Tenth,
     *    OffTime, TimeError)
          call converttime ('COMPRESS', 
     *        Day, Hour, Minute, Second, Tenth,
     *        ThisTime, TimeError)
              call converttime ('COMPRESS', 
     *            Day, Hour, Minute, Second, Tenth,
     *            OnTime, TimeError)
              call converttime ('COMPRESS', 
     *            Day, Hour, Minute, Second, Tenth,
     *            OffTime, TimeError)
       call julianday ('YMD', Day, Year, Month, DayofMonth)
      call stringlen (NavFilename, NavFileNameLength)
      call kmlzip (KmlFileName(1:KmlFileNameLength))
      call system ('/bin/rm /infobank/tmp/times4kml*')
      call system ('/bin/rm /infobank/tmp/indexday.temp')      
      call system ('/bin/rm /infobank/tmp/deletethis.temp')

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