* +-======-+ * 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 * * +-======-+ function sett (args) * Initialize Time based on Existance of Pre-Set Environment Variables * ------------------------------------------------------------------- 'run getenv "TBEG"' begdate = result begyear = substr(begdate,1,4) begmonth = substr(begdate,5,2) 'run getenv "TEND"' enddate = result endyear = substr(enddate,1,4) endmonth = substr(enddate,5,2) 'getinfo tdim' tdim = result * Initialize Hour and Day * ----------------------- 'set t 1' 'getinfo date' date = substr(result,1,5) * Initialize Tmin and Tmax * ------------------------ if( begdate != "NULL" ) month = getmon(begmonth) tmin = date''month''begyear else 'set t 1' 'getinfo date' tmin = result endif if( enddate != "NULL" ) month = getmon(endmonth) tmax = date''month''endyear else 'set t 'tdim 'getinfo date' tmax = result endif * Set TIME Boundaries based on Climatology dates (if active) * ---------------------------------------------------------- begYYYYMM = 'NULL' endYYYYMM = 'NULL' 'q ctlinfo' title = sublin(result,2) n = 1 word = subwrd(title,n) while( word != '' ) n = n + 1 word = subwrd(title,n) if( word = "Climatology:" ) begYYYYMM = subwrd(title,n+1) endYYYYMM = subwrd(title,n+3) endif endwhile if( begYYYYMM != 'NULL' & endYYYYMM != 'NULL' ) 'set t 1 'tdim say 'Setting T 1 to 'tdim else 'set time 'tmin' 'tmax say 'Setting Time Dates: 'tmin' to 'tmax endif return function getmon(num) if( num = "01" ) ; month = JAN ; endif if( num = "02" ) ; month = FEB ; endif if( num = "03" ) ; month = MAR ; endif if( num = "04" ) ; month = APR ; endif if( num = "05" ) ; month = MAY ; endif if( num = "06" ) ; month = JUN ; endif if( num = "07" ) ; month = JUL ; endif if( num = "08" ) ; month = AUG ; endif if( num = "09" ) ; month = SEP ; endif if( num = "10" ) ; month = OCT ; endif if( num = "11" ) ; month = NOV ; endif if( num = "12" ) ; month = DEC ; endif return month