* +-======-+ * 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 makez (args) name= subwrd(args,1) tag = subwrd(args,2) mask= subwrd(args,3) 'alias 'name alias = result 'chckname 'alias flag = result 'getinfo xfreq' xfreq = result if( xfreq = 'varying' ) 'getinfo lonmin' lonmin = result 'getinfo lonmax' lonmax = result 'getinfo dlon' dlon = result lontot = lonmax - lonmin + dlon/2 *'setz' 'setlats' * Variable is in File * ------------------- if( flag = '0' ) say 'Computing Zonal Mean for Data Variable: 'alias say ' LONMIN:LONMAX = 'lonmin':'lonmax say ' Reading Variable into Memory ...' if( mask = '' ) 'define temp = 'alias else 'define temp = maskout('alias',abs('mask'))' endif 'set lon 0' say ' Computing Zonal Mean ...' if( lontot > 360 ) say 'define 'name''tag' = ave(temp,lon='lonmin',lon='lonmax',-b)' 'define 'name''tag' = ave(temp,lon='lonmin',lon='lonmax',-b)' else say 'define 'name''tag' = ave(temp,lon='lonmin',lon='lonmax')' 'define 'name''tag' = ave(temp,lon='lonmin',lon='lonmax')' endif 'set lon 'lonmin' 'lonmax 'undefine temp' else * Variable is locally defined * --------------------------- say 'Computing Zonal Mean for Local Variable: 'alias say ' LONMIN:LONMAX = 'lonmin':'lonmax 'set lon 0' if( mask = '' ) if( lontot > 360 ) say 'define 'name''tag' = ave('alias',lon='lonmin',lon='lonmax',-b)' 'define 'name''tag' = ave('alias',lon='lonmin',lon='lonmax',-b)' else say 'define 'name''tag' = ave('alias',lon='lonmin',lon='lonmax')' 'define 'name''tag' = ave('alias',lon='lonmin',lon='lonmax')' endif else if( lontot > 360 ) say 'define 'name''tag' = ave(maskout('alias',abs('mask')),lon='lonmin',lon='lonmax',-b)' 'define 'name''tag' = ave(maskout('alias',abs('mask')),lon='lonmin',lon='lonmax',-b)' else say 'define 'name''tag' = ave(maskout('alias',abs('mask')),lon='lonmin',lon='lonmax')' 'define 'name''tag' = ave(maskout('alias',abs('mask')),lon='lonmin',lon='lonmax')' endif endif 'set lon 'lonmin' 'lonmax endif else *'setz' 'setlats' 'define 'name''tag' = 'alias endif