#!/bin/csh -f * +-======-+ * Copyright (c) 2003-2018 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 * * +-======-+ if( ! -e STATSFILE.txt ) then set STATSFILE = 'stats' else set STATSFILE = `cat STATSFILE.txt` endif if( $STATSFILE != 'stats' & \ $STATSFILE != 'globl' ) then echo 'Wrong STATSFILE: '$STATSFILE exit endif set EXPDIRS = `echo $argv` @ num = $#EXPDIRS # Create list of files in Control Experiment # ------------------------------------------ set files0 = `/bin/ls -1 $EXPDIRS[1]/*${STATSFILE}*ctl1 | grep -v aero` # Create list of files in ALL Experiments # --------------------------------------- set allfiles = '' @ n = 1 while( $n <= $num ) set fnew = `/bin/ls -1 $EXPDIRS[$n]/*${STATSFILE}*ctl1 | grep -v aero` set allfiles = `echo $allfiles $fnew` @ n = $n + 1 end # Create list of subset files co-existing in ALL Experiments # ---------------------------------------------------------- echo Creating List of Subset Files ... set subset = '' foreach file ($files0 ) set base = `basename $file` # Find 'stats' node # ----------------- @ statsnode = 0 set node = NULL while ( $node != ${STATSFILE} ) @ statsnode = $statsnode + 1 set node = `echo $base | cut -d. -f${statsnode}` end @ statsnode1 = $statsnode @ statsnode2 = $statsnode + 1 #set date = `echo $base | cut -d. -f${statsnode1}-` # date includes both beginning and ending times set date = `echo $base | cut -d. -f${statsnode1}-${statsnode2}` # date includes only beginning time (required when comparing forecasts of different lengths) set test = '' foreach dum ($allfiles) set dum2 = `echo $dum | grep $date` if( $#dum2 != 0 ) then set test = `echo $test $dum` endif end if( $#test == $num ) set subset = `echo $subset $file` end if(-e subset_files) /bin/rm -f subset_files echo $#subset > subset_files @ n = 1 while( $n <= $#subset ) echo $subset[$n] >> subset_files @ n = $n + 1 end