* +-======-+ * 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 * * +-======-+ function getresource (args) rcfile = subwrd(args,1) tag = subwrd(args,2) envar = NULL * Extract VAR between quotes * -------------------------- last = substr(rcfile,1,1) if( last = '"' ) nmax = 200 n = 2 while ( n grads.txt' checkls = sublin ( read(grads.txt),2 ) rc = close(grads.txt) if( checkls = filename ) '!remove grads.txt' '!grepfile 'filename' 'tag '!getsize grads.txt' size = sublin ( read(size.txt),2 ) rc = close(size.txt) if( size != 0 ) envar = sublin ( read(grads.txt),2 ) rc = close(grads.txt) '!remove grads.txt' '!remove size.txt' else envar = NULL endif else envar = NULL endif * Check for Exact TAG parameter * ----------------------------- if( tag != '' & envar != 'NULL' ) result = subwrd(envar,1) if( result != tag":" ) return NULL endif endif * Remove TAG parameter from result * -------------------------------- if( tag != '' & envar != 'NULL' ) 'numargs 'envar num = result result = '' n = 2 while( n<=num ) result = result' 'subwrd(envar,n) n = n+1 endwhile else result = envar endif if( result != 'NULL' ) ; say 'Get_Resource: 'tag' = 'result ; endif return result