Coastal & Marine Geology InfoBank

Home FACS Activities Atlas Geology School Related Sites More

USGS InfoBank program -- parseholdings

Skip navigational links
Loading
InfoBank Programs: by Name   by Topic  
Expanded Description
Topic Description
Name
parseholdings
Synopsis
/infobank/programs/dbase/parseholdings/parseholdings.for
Description
  Program to validate and parse holdings spreadsheets by

  Activity ID, Container #, Accession #, Scientist, and Teams.
       
AUTHOR
  Clint Steele     8/17/2005

  Carolyn Degnan   04/06/2011, added simicolon to comma as delimiter
  Carolyn Degnan   05/26/2011, added a check that these 6 files
  have been removed prior to running this program:
  /infobank/tmp/parseholdings.txt.temp
  /infobank/tmp/parseholdings.containers.sorted.temp
  /infobank/tmp/parseholdings.teams.sorted.temp
  /infobank/tmp/parseholdings.activities.sorted.temp
  /infobank/tmp/parseholdings.accessions.sorted.temp
  /infobank/tmp/parseholdings.scientists.sorted.temp
  unified indents - CDegnan, 04/26/2013

    
Reads
          read (HoldngsListKeep, '(q,a)', end = 99)
     *        HoldingsLineLength, HoldingsLine(1:HoldingsLineLength)
          read (ParsTxtTemp, '(q,a)', end = 98)
     *        ALineLength(RecordCount),
     *        ALine(RecordCount)(1:ALineLength(RecordCount))
          read (ParsContainSortTemp, '(i8,t10,i)', err=10, end=100) 
     *        ItemNumber,
     *        ContainerNumber
          read (ParsTeamsSortTemp, '(i8,t10,q,a)', err=11, end=101) 
     *        ItemNumber,
     *        ThisTeamLength, ThisTeam(1:ThisTeamLength)
          read (Container(ItemNumber), '(i)', err=11) ContainerNumber
          read (ParsActivSortTemp, '(i8,t10,q,a)', err=12, end=102) 
     *        ItemNumber,
     *        ThisActivityLength, ThisActivity(1:ThisActivityLength)
              read (Container(ItemNumber)(1:ContainerLength), '(i)',
     *              err = 12)
     *            ContainerNumber
          read (ParsAccessSortTemp, '(i8,t10,q,a)', err=13, end=103) 
     *        ItemNumber,
     *        ThisAccessionLength, ThisAccession(1:ThisAccessionLength)
          read (ParsScientSortTemp, '(i8,t10,q,a)', err=61, end=601) 
     *        ItemNumber,
     *        ThisScientistLength, ThisScientist(1:ThisScientistLength)
          read (Container(ItemNumber), '(i)', err=61) ContainerNumber
Writes
                      write (TempAccession, '(2000x)')
                      write (Accession(RecordCount), '(2000x)')
              write (ParsContainersTemp, '(i8.8,t10,a)') Loop,
     *            Container(Loop)(1:ContainerLength)
              write (ParsActivitiesTemp, '(i8.8,t10,a)') Loop,
     *            Activity(Loop)(1:ActivityLength)
              write (ParsAccessionsTemp, '(i8.8,t10,a)') Loop,
     *            Accession(Loop)(1:AccessionLength)
              write (ParsTeamsTemp, '(i8.8,t10,a)') Loop,
     *            Team(Loop)(1:TeamLength) 
              write (SciTemp, '(2000x)')
                  write (ParsScientistsTemp, '(i8.8,t10,a)') Loop,
     *                   SciTemp(SciStart:SciTempLength)
                      write (ParsScientistsTemp, '(i8.8,t10,a)') Loop,
     *                   SciTemp(SciStart:Delimiter-1)
                  write (ParsScientistsTemp, '(i8.8,t10,a)') Loop,
     *                SciTemp(SciStart:SciTempLength)
          write (ThisContainer, '(i5.5)') ContainerNumber
          write (ActivityItems, '(a)') 
     *        ALine(ItemNumber)(1:ALineLength(ItemNumber))
          write (ThisContainer, '(i5.5)') ContainerNumber
          write (ActivityItems, '(a)')
     *        ALine(ItemNumber)(1:ALineLength(ItemNumber))
              write (ParsIDsSortTemp, '(i5.5,t10,a)')
     *            ContainerNumber,
     *            ThisActivity(1:ThisActivityLength)
          write (ActivityItems, '(a)')
     *        ALine(ItemNumber)(1:ALineLength(ItemNumber))
          write (ActivityItems, '(a)')
     *        ALine(ItemNumber)(1:ALineLength(ItemNumber))
          write (ThisContainer, '(i5.5)') ContainerNumber
          write (ActivityItems, '(a)')
     *        ALine(ItemNumber)(1:ALineLength(ItemNumber))
Opens
      open (unit = HoldngsListKeep,
     *      access = 'sequential',
     *      form = 'formatted',
     *      status = 'old',
     *      name = '/infobank/programs/keep/holdings_list.keep')
      open (unit = ParsTxtTemp,
     *      access = 'sequential',
     *      form = 'formatted',
     *      status = 'unknown',
     *      name = '/infobank/tmp/parseholdings.txt.temp')
      open (unit = ParsContainersTemp,
     *      access = 'sequential',
     *      form = 'formatted',
     *      status = 'unknown',
     *      name = '/infobank/tmp/parseholdings.containers.temp')
      open (unit = ParsActivitiesTemp,
     *      access = 'sequential',
     *      form = 'formatted',
     *      status = 'unknown',
     *      name = '/infobank/tmp/parseholdings.activities.temp')
      open (unit = ParsAccessionsTemp,
     *      access = 'sequential',
     *      form = 'formatted',
     *      status = 'unknown',
     *      name = '/infobank/tmp/parseholdings.accessions.temp')
      open (unit = ParsTeamsTemp,
     *      access = 'sequential',
     *      form = 'formatted',
     *      status = 'unknown',
     *      name = '/infobank/tmp/parseholdings.teams.temp')
      open (unit = ParsScientistsTemp,
     *      access = 'sequential',
     *      form = 'formatted',
     *      status = 'unknown',
     *      name = '/infobank/tmp/parseholdings.scientists.temp')
      open (unit = ParsContainSortTemp,
     *      access = 'sequential',
     *      form = 'formatted',
     *      status = 'unknown',
     *      name = '/infobank/tmp/parseholdings.containers.sorted.temp')
          open (unit = ActivityItems,
     *          access = 'append',
     *          form = 'formatted',
     *          status = 'unknown',
     *          name = '/infobank/programs/dbase/'//
     *                 'parseholdings/containers/'//
     *         ThisContainer(5:5)//'/'//
     *         ThisContainer(1:5)//'.items')
      open (unit = ParsTeamsSortTemp,
     *      access = 'sequential',
     *      form = 'formatted',
     *      status = 'unknown',
     *      name = '/infobank/tmp/parseholdings.teams.sorted.temp')
          open (unit = ActivityItems,
     *          access = 'append',
     *          form = 'formatted',
     *          status = 'unknown',
     *          name = '/infobank/programs/dbase/'//
     *                 'parseholdings/teams/'//
     *         ThisTeam(1:ThisTeamLength)//'/'//
     *         ThisContainer(1:5)//'.items')
      open (unit = ParsActivSortTemp,
     *      access = 'sequential',
     *      form = 'formatted',
     *      status = 'unknown',
     *      name = '/infobank/tmp/parseholdings.activities.sorted.temp')
      open (unit = ParsIDsSortTemp,
     *      access = 'sequential',
     *      form = 'formatted',
     *      status = 'unknown',
     *      name = '/infobank/tmp/parseholdings.ids.temp')
          open (unit = ActivityItems,
     *          access = 'append',
     *          form = 'formatted',
     *          status = 'unknown',
     *          name = '/infobank/programs/dbase/'//
     *                 'parseholdings/activities/'//
     *         ThisActivity(1:ThisActivityLength)//'.items')
      open (unit = ParsAccessSortTemp,
     *      access = 'sequential',
     *      form = 'formatted',
     *      status = 'unknown',
     *      name = '/infobank/tmp/parseholdings.accessions.sorted.temp')
              open (unit = ActivityItems,
     *          access = 'append',
     *          form = 'formatted',
     *          status = 'unknown',
     *          name = '/infobank/programs/dbase/'//
     *                 'parseholdings/accessions/'//
     *          ThisAccession(RightAnchor+1:LeftAnchor-1)//'.items')
              open (unit = ActivityItems,
     *          access = 'append',
     *          form = 'formatted',
     *          status = 'unknown',
     *          name = '/infobank/programs/dbase/'//
     *                 'parseholdings/accessions/'//
     *          ThisAccession(1:ThisAccessionLength)//'.items')
      open (unit = ParsScientSortTemp,
     *      access = 'sequential',
     *      form = 'formatted',
     *      status = 'unknown',
     *      name = '/infobank/tmp/parseholdings.scientists.sorted.temp')
          open (unit = ActivityItems,
     *          access = 'append',
     *          form = 'formatted',
     *          status = 'unknown',
     *          name = '/infobank/programs/dbase/'//
     *                 'parseholdings/scientists/'//
     *         ThisScientist(1:ThisScientistLength)//'/'//
     *         ThisContainer(1:5)//'.items')
Calls
      call executiontime (480)
          call system ('/bin/rm /infobank/tmp/parseholdings.txt.temp')
          call system ('/bin/rm '//
     *        '/infobank/tmp/parseholdings.containers.sorted.temp')
          call system ('/bin/rm '//
     *        '/infobank/tmp/parseholdings.teams.sorted.temp')
          call system ('/bin/rm '//
     *        '/infobank/tmp/parseholdings.activities.sorted.temp')
          call system ('/bin/rm '//
     *        '/infobank/tmp/parseholdings.accessions.sorted.temp')
          call system ('/bin/rm '//
     *        '/infobank/tmp/parseholdings.scientists.sorted.temp')
          call system ('/bin/cat '//
     *        HoldingsLine(1:HoldingsLineLength)//' >&g
     *    '/infobank/tmp/parseholdings.txt.temp')
          call changecase ('SMALLS', Activity(Loop))
          call changecase ('SMALLS', Accession(Loop))
          call changecase ('SMALLS', Team(Loop))
          call changecase ('SMALLS', Scientist(Loop))
          call stringlen (Container(Loop), ContainerLength)
          call stringlen (Activity(Loop), ActivityLength)
          call stringlen (Accession(Loop), AccessionLength)          
          call stringlen (Team(Loop), TeamLength)
          call stringlen (Scientist(Loop), ScientistLength)
      call system ('/bin/sort -k 2 -k 1 '//
     *    '/infobank/tmp/parseholdings.containers.temp > 
     *    '/infobank/tmp/parseholdings.containers.sorted.temp')
      call system ('/bin/sort -k 2 -k 1 '//
     *    '/infobank/tmp/parseholdings.activities.temp > 
     *    '/infobank/tmp/parseholdings.activities.sorted.temp')
      call system ('/bin/sort -k 2 -k 1 '//
     *    '/infobank/tmp/parseholdings.accessions.temp > 
     *    '/infobank/tmp/parseholdings.accessions.sorted.temp')
      call system ('/bin/sort -k 2 -k 1 '//
     *    '/infobank/tmp/parseholdings.teams.temp > 
     *    '/infobank/tmp/parseholdings.teams.sorted.temp')
      call system ('/bin/sort -k 2 -k 1 '//
     *    '/infobank/tmp/parseholdings.scientists.temp > 
     *    '/infobank/tmp/parseholdings.scientists.sorted.temp')
      call system
     *    ('/bin/rm /infobank/tmp/parseholdings.containers.temp')
      call system
     *    ('/bin/rm /infobank/tmp/parseholdings.activities.temp')
      call system
     *    ('/bin/rm /infobank/tmp/parseholdings.accessions.temp')
      call system
     *    ('/bin/rm /infobank/tmp/parseholdings.teams.temp')
      call system
     *    ('/bin/rm /infobank/tmp/parseholdings.scientists.temp')
          call system ('/bin/rm /infobank/programs/dbase/'//
     *        'parseholdings/teams/cmg/*'//
     *        Counter(Loop:Loop)//'.items')
      call system ('/bin/rm /infobank/programs/dbase/'//
     *             'parseholdings/teams/*/*.items')
              call system ('/bin/mkdir '//
     *            '/infobank/programs/dbase/'//
     *            'parseholdings/teams/'//
     *            ThisTeam(1:ThisTeamLength))
              call system ('/bin/cp '//
     *            '/infobank/programs/index.html '//
     *            '/infobank/programs/dbase/'//
     *            'parseholdings/teams/'//
     *            ThisTeam(1:ThisTeamLength)//'/index.html')
          call system ('/bin/rm /infobank/programs/dbase/'//
     *        'parseholdings/activities/'//
     *        Alphabet(Loop:Loop)//'*.items')
      call system ('/bin/rm /infobank/programs/dbase/'//
     *                 'parseholdings/activities/_*.items')
          call stringlen (Container(ItemNumber), ContainerLength)
              call stringlen (ThisActivity(1:ThisActivityLength),
     *                        ThisActivityLength)
      call system ('/bin/rm /infobank/tmp/parseholdings.ids.temp')
      call system ('/bin/rm /infobank/programs/dbase/'//
     *             'parseholdings/accessions/*.items')
          call stringlen (Container(ItemNumber), ContainerLength)
      call system ('/bin/rm /infobank/programs/dbase/'//
     *    'parseholdings/scientists/*.items')
          call system ('/bin/rm /infobank/programs/dbase/'//
     *                 'parseholdings/scientists/'//
     *                 Alphabet(Loop:Loop)//'*/*.items')
              call system ('/bin/mkdir '//
     *                     '/infobank/programs/dbase/'//
     *                     'parseholdings/scientists/'//
     *                     ThisScientist(1:ThisScientistLength))
              call system ('cp /infobank/programs/index.html '//
     *                     '/infobank/programs/dbase/'//
     *                     'parseholdings/scientists/'//
     *                     ThisScientist(1:ThisScientistLength))

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/dbase/parseholdings/parseholdings.doc.html
Page Contact Information: InfoBank staff
Page Last Modified: Mon Sep 16 03:37:51 PDT 2013  (chd)