* +-======-+ * 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 plot (args) std = subwrd(args,1) cor = subwrd(args,2) col = subwrd(args,3) lon1= subwrd(args,4) lon2= subwrd(args,5) lat1= subwrd(args,6) lat2= subwrd(args,7) cmin= subwrd(args,8) cmax= subwrd(args,9) dlat = (lat2-lat1)/2 dlon = (lon2-lon1)/2 latm = (lat1+lat2)/2 lonm = (lon1+lon2)/2 if( dlon > dlat ) lat1 = latm-dlon lat2 = latm+dlon dlat = dlon endif if( dlat > dlon ) lon1 = lonm-dlat lon2 = lonm+dlat dlon = dlat endif if( dlat < 0.1 ) dlon = 0.1 dlat = 0.1 endif lat1 = lat1-dlat lat2 = lat2+dlat lon1 = lon1-dlon lon2 = lon2+dlon if( lat1 < 0 ) ; lat1 = 0 ; endif if( lon1 < 0 ) ; lon1 = 0 ; endif rat = (lat2-lat1)/(lon2-lon1) say 'lat1 = 'lat1' lat2 = 'lat2' dlat = 'lat2-lat1 say 'lon1 = 'lon1' lon2 = 'lon2' dlon = 'lon2-lon1 say ' rat = 'rat 'set grads off' 'set gxout contour' 'set csmooth on' 'set frame off' 'set grid off' * Determine Bounds on X & Y axes * ------------------------------ 'd sqrt( 'lon1'*'lon1' + 'lat1'*'lat1' )' rx1 = subwrd(result,4) ry1 = subwrd(result,4) 'd sqrt( 'lon2'*'lon2' + 'lat1'*'lat1' )' rx2 = subwrd(result,4) 'd sqrt( 'lon1'*'lon1' + 'lat2'*'lat2' )' ry2 = subwrd(result,4) dx = rx2-rx1 dy = ry2-ry1 ratx = dx/dy raty = dy/dx say 'dx = 'dx' dy = 'dy say 'ratx = 'ratx' raty = 'raty if( ratx > 3 | raty > 3 ) say 'setting mproj off' 'set mproj off' else say 'setting mproj latlon' 'set mproj latlon' endif 'set mproj off' * Compute Radii Standard Deviations * --------------------------------- 'set lat 'lat1' 'lat2 'set lon 'lon1' 'lon2 'define r = sqrt( lat*lat + lon*lon )' 'define rn = sqrt( lat*lat + (lon-1)*(lon-1) )' 'set lat 'lat1 'set lon 'lon1 'd r' rmin = subwrd(result,4) 'set lat 'lat2 'set lon 'lon2 'd r' rmax = subwrd(result,4) rcnt = (rmax-rmin)/5 'set lat 'lat1' 'lat2 'set lon 'lon1' 'lon2 * Draw Radii Standard Deviations * ------------------------------ 'set xlopts 1 3 .10' 'set ylopts 1 3 .10' 'set xlab %.2f' 'set ylab %.2f' dx = (rx2-rx1)/6 'set cthick 1' 'set ccolor 1' 'set cstyle 1' 'set cint 'rcnt 'set xaxis 'rx1' 'rx2' 'dx *'set yaxis 'ry1' 'ry2 'set ylopts 0 0 0' 'd r' 'set cthick 6' 'set ccolor 1' 'set cstyle 1' 'set clevs 1.0' 'd r' 'set cthick 1' 'set ccolor 3' 'set cstyle 1' 'set cint 0.1' 'd rn' * Dray X and Y Axis * ----------------- 'q w2xy 'lon1' 'lat1 x1 = subwrd(result,3) y1 = subwrd(result,6) 'q w2xy 'lon2' 'lat1 x2 = subwrd(result,3) y2 = subwrd(result,6) 'set line 1 1 6' 'draw line 'x1' 'y1' 'x2' 'y2 'q w2xy 'lon1' 'lat1 x1 = subwrd(result,3) y1 = subwrd(result,6) 'q w2xy 'lon1' 'lat2 x2 = subwrd(result,3) y2 = subwrd(result,6) 'set line 1 1 6' 'draw line 'x1' 'y1' 'x2' 'y2 * Draw Radial Axis * ---------------- 'd pow('cmin',2)' num1 = subwrd(result,4) 'd pow('cmax',1/2)' num5 = subwrd(result,4) cint = (num5-num1)/4 num2 = num1+cint num3 = num2+cint num4 = num3+cint drawrad (num1,lon1,lon2,lat1,lat2) drawrad (num2,lon1,lon2,lat1,lat2) drawrad (num3,lon1,lon2,lat1,lat2) drawrad (num4,lon1,lon2,lat1,lat2) drawrad (num5,lon1,lon2,lat1,lat2) * Plot STD and COR * ---------------- 'd 'std r1 = subwrd(result,4) 'd 'cor r2 = subwrd(result,4) 'd acos('r2')' th = subwrd(result,4) 'd 'std'*sin('th')' wy = subwrd(result,4) wx = r1*r2 'q w2xy 'wx' 'wy x2 = subwrd(result,3) y2 = subwrd(result,6) say 'std = 'std' r1 = 'r1 say 'cor = 'cor' r2 = 'r2 say ' th = 'th say ' wx = 'wx' x2 = 'x2 say ' wy = 'wy' y2 = 'y2 'set line 'col 'set xaxis 'x1' 'x2 'set yaxis 'y1' 'y2 'draw mark 3 'x2' 'y2' 0.1' 'set string 1 l 3' 'set strsiz 0.11' return function drawrad (num,lon1,lon2,lat1,lat2) 'd sqrt( 'lat2'*'lat2' + 'lon2'*'lon2' )' rmax = subwrd(result,4) 'q w2xy 0 0' x0 = subwrd(result,3) y0 = subwrd(result,6) 'q w2xy 'lon1' 'lat1 x1 = subwrd(result,3) y1 = subwrd(result,6) wx = lon2*num wx = rmax*num 'd acos('num')' th = subwrd(result,4) 'd 'lon2'*sin('th')' 'd 'rmax'*sin('th')' wy = subwrd(result,4) if( wy > lat2 ) d = wy-lat2 wy = lat2 'd 'd'/tan('th')' wx = wx - subwrd(result,4) endif if( wx > lon2 ) d = wx-lon2 wx = lon2 'd 'd'*tan('th')' wy = wy - subwrd(result,4) endif 'q w2xy 'wx' 'wy x2 = subwrd(result,3) y2 = subwrd(result,6) lona = lon1 lata = lat1 if( lona>0 ) 'd 'lona'*tan('th')' lata = subwrd(result,4) endif if( lata