Coastal & Marine Geology InfoBank

Home FACS Activities Atlas Geology School Related Sites More

USGS InfoBank program -- whdates

Skip navigational links
Loading
InfoBank Programs: by Name   by Topic  
Expanded Description
Topic Description
Name
whdates
Synopsis
/infobank/programs/refmt/whprereport2meta/whdates.for
Description
  Subroutine to make a .dates file for whreport2html

       
AUTHOR
  Clint Steele    11/3/2006

  set for post-cruise '7. Start Date'
  added for pre-cruise '6. Start Date' - CDegnan   9/26/2007
  edited for pre-cruise '6. Start Date and Port'
            followed by '7. End Date and Port' - CDegnan, 2/5/2010

    
Reads
      read (90, '(q,a)', end=99) ALineLength, ALine(1:ALineLength)
          read (ALine(1:ALineLength), '(a)') StartLine
              read (StartLine(5:Comma-1), '(i)') StartDay
              read (StartLine(Comma+1:StartDash-1), '(i)') StartYear
              read (StartLine(Dash(1)-4:Dash(1)-1), '(i)') 
     *            StartYear
              read (StartLine(Dash(1)+1:Dash(2)-1), '(i)')
     *            StartingMonth
                  read (StartLine(Dash(2)+1:StartLineLength), '(i)')
     *                StartDay
                  read (StartLine(Dash(2)+1:Dash(3)-2), '(i)')
     *                StartDay
                  read (StartLine(Dash(3)+2:StartLineLength), '(a)')
     *                StartPort(1:StartPortLength)
          read (90, '(q,a)', end=99)
     *        ALineLength, ALine(1:ALineLength)
          read (90, '(q,a)', end=99)
     *        ALineLength, ALine(1:ALineLength)
              read (ALine(1:ALineLength), '(a)') EndLine
                  read (EndLine(5:Comma-1), '(i)') EndDay
                  read (EndLine(Comma+1:EndDash-1), '(i)') EndYear
                 read (EndLine(Dash(1)-4:Dash(1)-1), '(i)')
     *               EndYear
                 read (EndLine(Dash(1)+1:Dash(2)-1), '(i)')
     *               EndingMonth
                      read (EndLine(Dash(2)+1:EndLineLength), '(i)')
     *                    EndDay
                      read (EndLine(Dash(2)+1:Dash(3)-2), '(i)')
     *                    EndDay
                      read (EndLine(Dash(3)+2:EndLineLength), '(a)')
     *                    EndPort(1:EndPortLength)
              read (90, '(q,a)', end=99)
     *            ALineLength, ALine(1:ALineLength)
                  read (ALine(1:ALineLength), '(a)') NextLine
                  read (90, '(q,a)', end=99)
     *                ALineLength, ALine(1:ALineLength)
                  read (ALine(1:ALineLength), '(a)') StartPort
                  read (90, '(q,a)', end=99)
     *                ALineLength, ALine(1:ALineLength)
                  read (ALine(1:ALineLength), '(a)') EndPort
Writes
          write (StartLine, '(4096x)')
              write (EndLine, '(4096x)')
              write (91, '(a,t10,
     *            i2.2,a,i2.2,a,i4.4,
     *            t21,a,i3.3,a,
     *            i2.2,a,i2.2,a,i4.4,
     *            t45,a,i3.3,a)') 
     *            CapID(1:CapIDLength), 
     *            StartingMonth, '/', StartDay, '/', StartYear,
     *            '(JD ',StartJDay,') -->
     *            EndingMonth, '/', EndDay, '/', EndYear,
     *            '(JD ',EndJDay,')'
              write (92, '(i4.4,i3.3,a,
     *            t16,a,t37,a,t45,a,a)')
     *            StartYear, StartJDay, '0000000',
     *            '  0.00000    0.00000',
     *            CapID(1:CapIDLength),
     *            'IN PORT LEAVE ', StartPort(1:StartPortLength)
              write (92, '(i4.4,i3.3,a,
     *            t16,a,t37,a,t45,a,a)')
     *            EndYear, EndJDay, '0000000',
     *            '  0.00000    0.00000',
     *            CapID(1:CapIDLength),
     *            'IN PORT ARRIVE ', EndPort(1:EndPortLength)
                  write (NextLine, '(4096x)')
                      write (92, '(i4.4,i3.3,a,
     *                    t16,a,t37,a,t45,a,a)')
     *                    StartYear, StartJDay, '0000000',
     *                    '  0.00000    0.00000',
     *                    CapID(1:CapIDLength),
     *                    'IN PORT LEAVE ',
     *                    StartLine(StartDash+1:StartLineLength)
                      write (92, '(i4.4,i3.3,a,
     *                   t16,a,t37,a,t45,a,a)')
     *                    EndYear, EndJDay, '0000000',
     *                    '  0.00000    0.00000',
     *                    CapID(1:CapIDLength),
     *                    'IN PORT ARRIVE',
     *                    EndLine(EndDash+1:EndLineLength)
                  write (StartPort, '(4096x)')
                  write (EndPort, '(4096x)')
                      write (92, '(i4.4,i3.3,a,
     *                    t16,a,t37,a,t45,a,a)')
     *                    StartYear, StartJDay, '0000000',
     *                    '  0.00000    0.00000',
     *                    CapID(1:CapIDLength),
     *                    'IN PORT LEAVE  ',
     *                    StartPort(1:StartPortLength)
                      write (92, '(i4.4,i3.3,a,
     *                    t16,a,t37,a,t45,a,a)')
     *                    EndYear, EndJDay, '0000000',
     *                    '  0.00000    0.00000',
     *                    CapID(1:CapIDLength),
     *                    'IN PORT ARRIVE ',
     *                    EndPort(1:EndPortLength)
Opens
      open (unit   = 91,
     *      access = 'sequential',
     *      form   = 'formatted',
     *      status = 'unknown',
     *      name   = OutName(1:OutNameLength)//'.dates')
      open (unit   = 92,
     *      access = 'sequential',
     *      form   = 'formatted',
     *      status = 'unknown',
     *      name   = OutName(1:OutNameLength)//'.ports')
Calls
      call stringlen (CapID, CapIDLength)
      call stringlen (OutName, OutNameLength)
          call stringlen (StartLine, StartLineLength)
              call changecase ('CAPITALS', StartMonth)
                  call stringlen (StartPort(1:StartPortLength),
     *                StartPortLength)
          call julianday ('JULIAN', StartJDay, 
     *        StartYear, StartingMonth, StartDay)
              call stringlen (EndLine, EndLineLength)
                  call changecase ('CAPITALS', EndMonth)
                      call stringlen (EndPort(1:EndPortLength),
     *                    EndPortLength)
              call julianday ('JULIAN', EndJDay,
     *            EndYear, EndingMonth, EndDay)
                  call stringlen (NextLine, NextLineLength)
                  call stringlen (StartPort, StartPortLength)
                  call stringlen (EndPort, EndPortLength)

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/refmt/whprereport2meta/whdates.doc.html
Page Contact Information: InfoBank staff
Page Last Modified: Mon Sep 16 03:38:29 PDT 2013  (chd)