#!/bin/csh -f # +-======-+ # Copyright (c) 2003-2007 United States Government as represented by # the Admistrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # THIS OPEN SOURCE AGREEMENT ("AGREEMENT") DEFINES THE RIGHTS OF USE, # REPRODUCTION, DISTRIBUTION, MODIFICATION AND REDISTRIBUTION OF CERTAIN # COMPUTER SOFTWARE ORIGINALLY RELEASED BY THE UNITED STATES GOVERNMENT AS # REPRESENTED BY THE GOVERNMENT AGENCY LISTED BELOW ("GOVERNMENT AGENCY"). # THE UNITED STATES GOVERNMENT, AS REPRESENTED BY GOVERNMENT AGENCY, IS AN # INTENDED THIRD-PARTY BENEFICIARY OF ALL SUBSEQUENT DISTRIBUTIONS OR # REDISTRIBUTIONS OF THE SUBJECT SOFTWARE. ANYONE WHO USES, REPRODUCES, # DISTRIBUTES, MODIFIES OR REDISTRIBUTES THE SUBJECT SOFTWARE, AS DEFINED # HEREIN, OR ANY PART THEREOF, IS, BY THAT ACTION, ACCEPTING IN FULL THE # RESPONSIBILITIES AND OBLIGATIONS CONTAINED IN THIS AGREEMENT. # # Government Agency: National Aeronautics and Space Administration # Government Agency Original Software Designation: GSC-15354-1 # Government Agency Original Software Title: GEOS-5 GCM Modeling Software # User Registration Requested. Please Visit http://opensource.gsfc.nasa.gov # Government Agency Point of Contact for Original Software: # Dale Hithon, SRA Assistant, (301) 286-2691 # # +-======-+ @ nmax = $#argv set HISTORYRC = $argv[1] set COLLS = '' @ n = 1 while( $n < $nmax ) @ m = $n + 1 set COLLS = `echo $COLLS $argv[$m]` @ n = $n + 1 end if( .$COLLS[1] == . ) then set collections = `$GEOSUTIL/post/get_streams $HISTORYRC` else set collections = `echo $COLLS` endif # Find Archive Template # --------------------- set archives = '' if( .$COLLS[1] == . ) then foreach collection ($collections) set archive = `grep $collection.archive: $HISTORYRC | cut -d "'" -f2` if( ."$archive" == . ) set archive = $collection set archives = `echo $archives $archive` end else foreach COLL ($COLLS) foreach collection ($collections) if( .$COLL == . | .$COLL == .$collection ) then set archive = `grep $collection.archive: $HISTORYRC | cut -d "'" -f2` if( ."$archive" == . ) set archive = $collection set archives = `echo $archives $archive` endif end end endif #set ncolls = $#collections #echo NCOLLS: $ncolls #if( $ncolls != 0 ) then # @ n = 1 # while( $n <= $ncolls ) # echo $collections[$n] $archives[$n] # @ n = $n + 1 # end #endif echo $archives