Coastal & Marine Geology InfoBank

Home FACS Activities Atlas Geology School Related Sites More

USGS InfoBank program -- sortids

Skip navigational links
Loading
InfoBank Programs: by Name   by Topic  
Expanded Description
Topic Description
Name
sortids
Synopsis
/infobank/programs/share/sortids.for
Description
  Subroutine to sort a list of activity IDs and insert

  blank lines between changes in years and ships.
       
USAGE
  IDHtml -- unit number of HTML file being created

  ProgramName -- name of calling program
  OutputCount -- number of records output
    
AUTHOR
  Clint Steele    6/5/96


    
Reads
          read (CountUnit, '(a1)', end = 7699) Junk 
          read (IDList, '(q,a)', end = 111)
     *             PathLength, FilePath(1:PathLength)
             read (DateFile, '(a)') DateLine
             read (DateLine(18:19), '(i2)') Year
          read (IDList, '(q,a)', end = 1011) 
     *          PathLength, FilePath(1:PathLength)
             read (FilePath(3:4), '(a)') ThisYear
                read (Years(YearCount), '(i2)') ShortYear(YearCount)
          read (KeepUnit, '(q,a)', end = 99)
     *        ALineLength, ALine
             read (IDList, '(7x,q,a)', end = 11) 
     *             PathLength, FilePath(1:PathLength)
                 read (96, '(a)') DateLine
                 read (96, '(a)') DateLine
                 read (ThisYear, '(i2)') ThisLongYear
                 read (IDFile, '(q,a)', end = 7003)
     *               IDLineLength, IDLine(1:IDLineLength)
                 read (IDLine(1:9), '(a)') InfoBankID
                 read (IDLine(1:IDLineLength), '(t10,a19)')
     *               DisplayID
                 read (IDLine(1:IDLineLength), '(t30,q,a)')
     *               LinkLineLength, LinkLine(1:LinkLineLength)
Writes
          write (FilePath, '(255x)')
              write (IDSort, 147) Year + Century, 
     *            FilePath(1:1), FilePath(2:2),
     *            FilePath(1:PathLength)
              write (IDSort, 148) Year + Century, 
     *            FilePath(1:1), FilePath(2:3),
     *            FilePath(1:PathLength)
      write (command, '(255x)')
      write (Command, 102) SortName(1:SortNameLength),
     *                     ListName(1:ListNameLength)
      write (IDHtml, '(2x,a)') '<t
      write (IDHtml, '(4x,a)') 
     *       '<td class="light" 
     *       'valign="top" align="right" width="10%"&g
      write (IDHtml, '(6x,a)') '<b>Year
      write (IDHtml, '(4x,a,/)') '</t
      write (IDHtml, '(4x,a)')
     *       '<td class="light" valign="middle
          write (IDHtml, 1002) (MainPath(1:MainLength), 
     *                          LongYear(Count), 
     *                          ShortYear(Count),
     *                          Count = 1,YearCount)
          write (IDHtml, 1012) (MainPath(1:MainLength-5), 
     *                          LongYear(Count), 
     *                          ShortYear(Count),
     *                          Count = 1,YearCount)
      write (IDHtml, '(4x,a)') '</t
      write (IDHtml, '(2x,a,/)') '</t
                write (IDHtml, '(2x,a)') '<t
                write (IDHtml, '(4x,a)')
     *            '<td class="light
                write (IDHtml, '(6x,a)') 
     *            '<table class="border" rules="all
                write (IDHtml, '(8x,a)') '<t
                write (IDHtml, '(10x,a)') '<td>'          
                write (IDHtml, '(10x,a)') 
     *            '<table class="border" rules="all
                write (IDHtml, '(12x,a)') '<t
                write (IDHtml, '(14x,a)')
     *            '<td class="dark
                write (IDHtml, '(16x,a)') Label(1:LabelLength)
                write (IDHtml, '(14x,a)') '</t
                write (IDHtml, '(14x,a)') '<td class = "light
                   write (IDHtml, '(16x,a)') '<a href="
     *               Value(1:ValueLength)//'" target="new">
     *               Value(1:ValueLength)//'</
                   write (IDHtml, '(16x,a)') Value(1:ValueLength)  
                write (IDHtml, '(14x,a)') '</td>'       
                write (IDHtml, '(12x,a)') '</tr
          write (IDHtml, '(10x,a)') '</tabl
          write (IDHtml, '(10x,a)') '</t
             write (IDHtml, '(10x,a)') '<t
             write (IDHtml, '(10x,a)') '<table
             write (IDHtml, '(12x,a)') '<t
             write (IDHtml, '(14x,a)') '<t
             write (IDhtml, '(16x,a)') 
     *                      '<a href="'//ImgValue(1:ImgValueLength
     *          '" ><img src="'//ImgValue(1:ImgValueLen
     *                      '" width="200" />&l
             write (IDHtml, '(12x,a)') '</t
             write (IDHtml, '(10x,a)') '</t
             write (IDHtml, '(10x,a)') '</tabl
             write (IDHtml, '(10x,a)') '</td
          write (IDHtml, '(8x,a)') '</tr
          write (IDHtml, '(6x,a)') '</table&
          write (IDHtml, '(4x,a)') '</t
          write (IDHtml, '(2x,a)') '<t
          write (IDHtml, '(4x,a)')
     *        '<th class="dark" colspan="5"&
     *        "*** Note: Separate pages are used for each year ***"//
     *        '</t
          write (IDHtml, '(2x,a)') '</t
      write (IDHtml, '(2x,a)') '<t
      write (IDHtml, '(4x,a)')
     *       '<td ></td>&l
      write (IDHtml, '(6x,a)') 
     *        '<table class="noborder" width="600
      write (IDHtml, '(8x,a)') '<t
      write (IDHtml, '(10x,a)')
     *       '<t
             write (ALongYear, '(i4.4)') LongYear(PageLoop)
         write (LastIDPath, '(255x)')
         write (IDPath, '(255x)')
             write (FilePath, '(255x)')
             write (HtmlPath, '(255x)')
             write (KmlPath, '(255x)')
             write (KmzPath, '(255x)')
             write (LongID, '(10x)')
                 write (LongID, 56) FilePath(1:1), FilePath(2:2), 
     *                              FilePath(3:4), FilePath(5:6)
                 write (LongID, 56) FilePath(1:1), FilePath(2:3), 
     *                              FilePath(4:5), FilePath(6:7)
             write (HtmlPath, 55) FilePath(1:1), 
     *           FilePath(1:PathLength), LongID(1:PathLength+3)
             write (IDPath, '(255x)')
             write (IDPath, 555) FilePath(1:1), 
     *           FilePath(1:PathLength), LongID(1:PathLength+3)
                     write (IDHtml, 338)
                     write (IDHtml, 38) ThisLongYear, 
     *                              MainPath(1:MainLength-5), 
     *                              ThisLongYear, ThisLongYear
                     write (IDHtml, 318) ThisLongYear,
     *                              ThisLongYear, ThisLongYear
                 write (IDHTML, 738)
                 write (IDHtml, '(20x,a)') '</t
                 write (IDHtml, '(20x,a)') '<t
             write (IDHtml, '(22x,a)')
     *                  '<td class="light" 
     *                  'valign="bottom" align="center" '//
     *                  'width="150">
                     write (IDHtml, '(a)')
     *                 '<a href="http://walrus.wr.usgs.gov
     *                 KmzPath(1:KmzPathLength)//'">
     *                 '<img src="http://walrus.wr.usgs.gov
     *                  ResizedIndex(1:ResIndexLength)//
     *                  '" width="150" '//
     *                  'alt="thumbnail map"></a><br />
                     write (IDHtml, '(a)')
     *                 '<a href="http://walrus.wr.usgs.gov
     *                  KmzPath(1:KmzPathLength)//'">
     *                 '<img src="http://walrus.wr.usgs.gov
     *                  ResizedJpg(1:ResJpgLength)//
     *                  '" width="150" '//
     *                  'alt="thumbnail map"></a><br /&g
                     write (IDHtml, '(24x,a)')
     *                   '<b>'//LinkLine(1:LinkLineLength)//
                     write (IDHtml, '(24x,a)')
     *                   '<br />'//LinkLine(1:LinkLineL
             write (IDHtml, '(2x,a)')
     *           '<a href="http://maps.google.com/maps?q=
     *           'http://walrus.wr.usgs.gov'//
     *           KmzPath(1:KmzPathLength)//
     *           '&t=h" target="new" >
     *           '<img src="http://walrus.wr.usgs.gov
     *           '/infobank/programs/html/tools/'//
     *           'googlemaps.jpg" alt="Google Maps icon" '//
     *           'width="12" border="0">&l
             write (IDHtml, '(2x,a)')
     *           '<a href="http://maps.google.com/maps?q=
     *           'http://walrus.wr.usgs.gov'//
     *           KmlPath(1:KmlPathLength)//
     *           '&t=h" target="new" >
     *           '<img src="http://walrus.wr.usgs.gov
     *           '/infobank/programs/html/tools/'//
     *           'googlemaps.jpg" alt="Google Maps icon" '//
     *           'width="12" border="0">&l
                 write (IDHtml, '(24x,a)') ' '
             write (IDHtml, '(2x,a)')
     *           '<a href="http://walrus.wr.usgs.gov
     *           KmzPath(1:KmzPathLength)//'" > 
     *           '<img src="http://walrus.wr.usgs.gov
     *           '/infobank/programs/html/tools/'//
     *           'googleearth.jpg" alt="Google Earth icon" '//
     *           'width="12" border="0">&l
             write (IDHtml, '(2x,a)')
     *           '<a href="http://walrus.wr.usgs.gov
     *           '/infobank/programs/kml'//
     *           '/participants4kml/participants/'//
     *           KmlPath(1:KmlPathLength)//'" > 
     *           '<img src="http://walrus.wr.usgs.gov
     *           '/infobank/programs/html/tools/'//
     *           'googleearth.jpg" alt="Google Earth icon" '//
     *           'width="12" border="0">&l
                     write (IDHtml, '(24x,a)')
     *                   '   '//
     *                   '<img src="http://walrus.wr.usgs.gov/
     *                   'infobank/programs/html/tools/book.gif" '//
     *                   'alt="icon of a book" height="14"&g
                       write (IDHtml, '(24x,a)')
     *                   '<br />('//InfoBankID(1:InfoBankIDLength
                 write (IDHtml, '(24x,a)')
     *               '<br />'//DateLine(10:15)//DateLine(18
     *               ' - '//DateLine(34:39)//DateLine(42:43)
             write (IDHtml, '(22x,a)') '</t
         write (IDHtml, 1004)
         write (IDHtml, 1104)
         write (IDHtml, 1204)
Opens
      open (unit = CountUnit,
     *      access = 'sequential',
     *      form = 'formatted',
     *      status = 'unknown',
     *      name = ListName(1:ListNameLength))
      open (unit = IDList,
     *      access = 'sequential',
     *      file   =  ListName(1:ListNameLength),
     *      form   = 'formatted',
     *      status = 'unknown')
      open (unit = IDSort,
     *      access = 'sequential',
     *      file   =  SortName(1:SortNameLength),
     *      form   = 'formatted',
     *      status = 'unknown')
             open (unit = DateFile,
     *             access = 'sequential',
     *             form = 'formatted',
     *             status = 'old',
     *             file =  "/infobank/"//FilePath(1:1)//'/'//
     *                    FilePath(1:PathLength)//'/meta/'//
     *                    FilePathLong(1:PathLength+3)//'.dates')
      open (unit = IDList,
     *      access = 'sequential',
     *      file   =  ListName(1:ListNameLength),
     *      form   = 'formatted',
     *      status = 'unknown')
             open (unit = IDHtml,
     *             access = 'append',
     *             status = 'unknown',
     *             form = 'formatted',
     *             name = MainPath(26:MainLength-5)//'_'//
     *                    ALongYear//'.html')
         open (unit = IDList,
     *       access = 'sequential',
     *       file   =  ListName(1:ListNameLength),
     *       form   = 'formatted',
     *       status = 'unknown')
                 open (unit = 96,
     *                 access = 'sequential',
     *                 form = 'formatted',
     *                 status = 'old',
     *                 name = '/infobank/'//FilePath(1:1)//'/'//
     *                        FilePath(1:6)//'/meta/'//
     *                        LongID(1:9)//'.dates')
                 open (unit = 96,
     *                 access = 'sequential',
     *                 form = 'formatted',
     *                 status = 'old',
     *                 name = '/infobank/'//FilePath(1:1)//'/'//
     *                        FilePath(1:7)//'/meta/'//
     *                        LongID(1:10)//'.dates')
             open (unit = IDFile,
     *                 access = 'sequential',
     *                 form = 'formatted',
     *                 status = 'unknown',
     *                 name =  IDPath(1:IDPathLength))
Calls
      call stringlen (ProgramName, ProgramNameLength)
      call stringlen (MainPath, MainLength)
      call stringlen (ListName, ListNameLength)
      call stringlen (SortName, SortNameLength)
          call changecase ('SMALLS', FilePath(1:PathLength))
              call stringlen (FilePath, PathLength)
          call getcentury (Year, Century)
      call stringlen (Command, CommandLength)
      call system (Command(1:CommandLength))
                call getcentury (ShortYear(YearCount), Century)
      call includeit (IDHtml,
     *    '/infobank/programs/html/tools/virtualglobesstart.tabs')
      call includeit (IDHtml,
     *    '/infobank/programs/html/tools/virtualglobesend.tabs')
      call includeit (IDHtml,
     *    '/infobank/programs/html/tools/iconlegendstart.tabs')
      call includeit (IDHtml,
     *    '/infobank/programs/html/tools/virtualglobeslegend.keep')
      call includeit (IDHtml,
     *    '/infobank/programs/html/tools/analogmaterialslegend.keep')
      call includeit (IDHtml,
     *    '/infobank/programs/html/tools/publicationslegend.keep')
      call includeit (IDHtml,
     *    '/infobank/programs/html/tools/iconlegendend.tabs')
      call includeit (IDHtml, 
     *        '/infobank/programs/keep/contents.keep')
         call getunit(KeepUnit)
          call stringlen (Label, LabelLength)
             call stringlen (Value, ValueLength)
          call system ('/bin/mv '//
     *        MainPath(26:MainLength)//
     *        ' /infobank/tmp/sortids.originalfile.temp')
          call system ('/bin/mv '//
     *        ListName(1:ListNameLength)//
     *        ' /infobank/tmp/sortids.idslist.temp')
             call system ('/bin/grep '//
     *           ALongYear(1:4)//' '//
     *           '/infobank/tmp/sortids.idslist.temp > 
     *           ListName(1:ListNameLength))
             call system ('/bin/cat '//
     *           '/infobank/tmp/sortids.originalfile.temp > 
     *           MainPath(26:MainLength-5)//'_'//
     *           ALongYear//'.html')
             call stringlen (FilePath, PathLength)
             call stringlen (HtmlPath, HtmlLength)
             call stringlen (IDPath, IDPathLength)
                 call getcentury (ThisLongYear, Century)
                 call changecase ('CAPITALS', CapShip)
             call changecase ('CAPITALS', CapID(1:PathLength+3))
                       call system ('mogrify jpg '//HtmlPath(1:Html)//
     *                    LongID(1:PathLEngth+3)//'.index.png')
                     call stringlen (KmlPath, KmlPathLength)
                     call stringlen (KmzPath, KmzPathLength)
                     call stringlen (KmlPath, KmlPathLength)
                     call stringlen (KmzPath, KmzPathLength)
                     call stringlen (ResizedIndex, ResIndexLength)
                        call system ('/bin/cp '//
     *                             HtmlPath(1:Html)//
     *                             LongID(1:PathLength + 3)//
     *                             '.index.jpg '//
     *                              ResizedIndex(1:ResIndexLength))
                        call system ('mogrify -resize 150x150 '//
     *                               ResizedIndex(1:ResIndexLength)) 
                     call stringlen (ResizedJPG, ResJpgLength)
                       call system ('/bin/cp '//
     *                             HtmlPath(1:Html)//
     *                             LongID(1:PathLength + 3)//
     *                             '.nav.jpg '//
     *                              ResizedJpg(1:ResJpgLength))
                        call system ('mogrify -resize 150x150 '//
     *                               ResizedJpg(1:ResJpgLength)) 
                 call stringlen (InfoBankID, InfoBankIDLength)
                 call stringlen (DisplayID, DisplayIDLength)
             call htmlfoot (IDHtml, MainPath(1:MainLength))
                 call system ('/bin/cp '//
     *                 MainPath(26:MainLength-5)//'_'//
     *                 ALongYear//'.html '//
     *                 MainPath(26:MainLength))

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/share/sortids.doc.html
Page Contact Information: InfoBank staff
Page Last Modified: Mon Sep 16 03:36:55 PDT 2013  (chd)