! +-======-+ ! 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 pme (args) expdsc = subwrd(args,1) output = subwrd(args,2) afile = subwrd(args,3) ofile = subwrd(args,4) 'run getenv "GEOSUTIL"' geosutil = result * Plot Time Series Values * ----------------------- 'set dfile 'ofile 'sett' 'getinfo tmin' tmin = result 'getinfo tmax' tmax = result 'set t 'tmin' 'tmax 'define oave = ave( obsg,t='tmin',t='tmax')' 'set t 'tmax 'd oave' oave = subwrd(result,4) 'set t 'tmin' 'tmax 'run minmax obsg' omax = subwrd(result,1) omin = subwrd(result,2) 'set dfile 1' 'sett' 'getinfo tmin' tmin = result 'getinfo tmax' tmax = result 'set t 'tmin' 'tmax 'set vpage 0 11 3.5 8' 'set grads off' 'set ylab %.2f' 'define oave = 'oave 'define pave = ave( preaccg,t='tmin',t='tmax') ' 'define eave = ave( evpaccg,t='tmin',t='tmax') ' if( afile != 'NULL' ) 'define anaave = ave(anaaccg,t='tmin',t='tmax') ' 'run minmax anaaccg' amax = subwrd(result,1) amin = subwrd(result,2) endif 'define pltave = (pave+eave)/2' 'run minmax preaccg' pmax = subwrd(result,1) pmin = subwrd(result,2) 'run minmax evpaccg' emax = subwrd(result,1) emin = subwrd(result,2) if(omax > pmax ) ; pmax = omax ; endif if(omin < pmin ) ; pmin = omin ; endif if(emax > pmax ) ; pmax = emax ; endif if(emin < pmin ) ; pmin = emin ; endif 'set t 'tmin 'd pltave' pltave = subwrd(result,4) pltmin = pltave - 1.5*(pltave-pmin) pltmax = pltave - 1.5*(pltave-pmax) if( afile != 'NULL' ) 'd anaave' anaave = subwrd(result,4) anamin = anaave - 1.5*(anaave-amin) anamax = anaave - 1.5*(anaave-amax) endif 'set axlim 'pltmin' 'pltmax 'set t 'tmin' 'tmax 'set cmark 0' 'set cstyle 1' 'set ccolor 4' 'set cthick 6' 'd preaccg' 'set cmark 0' 'set cstyle 1' 'set ccolor 4' 'set cthick 1' 'd pave' 'set cmark 0' 'set cstyle 1' 'set ccolor 1' 'set cthick 3' 'd obsg' 'set cmark 0' 'set cstyle 1' 'set ccolor 1' 'set cthick 1' 'd oave' 'set cmark 0' 'set cstyle 1' 'set ccolor 2' 'set cthick 6' 'd evpaccg' 'set cmark 0' 'set cstyle 1' 'set ccolor 2' 'set cthick 1' 'd eave' if( afile != 'NULL' ) 'set cmark 0' 'set cstyle 1' 'set ccolor 5' 'set cthick 6' 'd preaccg - anaaccg' 'set cmark 0' 'set cstyle 1' 'set ccolor 5' 'set cthick 1' endif * Get Time-Average Values * ----------------------- 'set t 'tmax 'getinfo date' date = result 'd pave' pave = subwrd(result,4) 'd eave' eave = subwrd(result,4) * Plot Time-Average Values * ------------------------ 'q w2xy 'date' 'pave yp = subwrd(result,6) 'q w2xy 'date' 'eave ye = subwrd(result,6) 'q w2xy 'date' 'oave gp = subwrd(result,6) 'set strsiz .08' 'set string 4 r 5' 'draw string 1.58 'yp ' 'pave 'set string 1 r 5' 'draw string 1.58 'gp ' 'oave 'set string 2 l 5' 'draw string 10.52 'ye ' 'eave 'set t 'tmin' 'tmax 'set vpage 0 11 0 4.5' 'set grads off' if( afile != 'NULL' ) 'define pltnet = evpaccg-preaccg+anaaccg' 'define pltave = ave(evpaccg-preaccg+anaaccg,t='tmin',t='tmax')' 'define anaave = ave(anaaccg,t='tmin',t='tmax')' else 'define pltnet = evpaccg-preaccg' 'define pltave = ave(evpaccg-preaccg ,t='tmin',t='tmax')' endif 'run minmax pltnet' pmax = subwrd(result,1) pmin = subwrd(result,2) 'set t 'tmin 'd pltave' pltave = subwrd(result,4) pltmin = pltave - 1.5*(pltave-pmin) pltmax = pltave - 1.5*(pltave-pmax) 'set axlim 'pltmin' 'pltmax 'set t 'tmin' 'tmax 'set cmark 0' 'set cstyle 1' 'set ccolor 3' 'set cthick 6' 'd pltnet' 'set cmark 0' 'set cstyle 1' 'set ccolor 3' 'set cthick 1' 'd pltave' * Get Time-Average Values * ----------------------- 'set t 'tmax 'd pltave' pltave = subwrd(result,4) * Plot Time-Average Values * ------------------------ 'q w2xy 'date' 'pltave ypme = subwrd(result,6) 'set strsiz .08' 'set string 3 r 5' 'draw string 1.58 'ypme ' 'pltave 'set vpage off' 'set string 1 c 6' 'set strsiz .14' 'draw string 6.15 8.25 'expdsc 'draw string 6.15 7.95 Globally Integrated Precipitation and Evaporation (mm/day)' if( afile != 'NULL' ) 'lines 'geosutil'/plots/tseries/pme.stk0 1' else 'lines 'geosutil'/plots/tseries/pme.stk1 1' endif 'lines 'geosutil'/plots/tseries/pme.stk2 1' 'myprint -name 'output'/PME_TIME_SERIES' return