* +-======-+ * 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 vpage (args) ************************************************************* ***** ***** ***** Usage: vpage xloc yloc xmax ymax ***** ***** ***** ************************************************************* 'numargs 'args numargs = result xloc = subwrd(args,1) yloc = subwrd(args,2) xmax = subwrd(args,3) ymax = subwrd(args,4) ytop = 0.5 scalex = 1 scaley = 1 num = 0 while( num < numargs ) num = num + 1 if( subwrd(args,num)='-scalex' ) ; scalex = subwrd(args,num+1) ; endif if( subwrd(args,num)='-scaley' ) ; scaley = subwrd(args,num+1) ; endif if( subwrd(args,num)='-ytop' ) ; ytop = subwrd(args,num+1) ; endif endwhile 'set vpage off' 'getinfo page' pagex = subwrd(result,1) pagey = subwrd(result,2)-ytop *'set mproj latlon' *'set mproj scaled' *diff = (pagex-pagey/1.75)*0.5 *pagex = pagey/1.65 dx = pagex / xmax dy = pagey / ymax delx = dx * (scalex - 1) dely = dy * (scaley - 1) if( xloc = 1 ) x1 = (xloc-1)*dx x2 = (xloc-0)*dx + delx * say 'a x1: 'x1' x2: 'x2' delx: 'x2-x1' xloc: 'xloc' xmax: 'xmax' dx: 'dx endif if( xloc = xmax ) x1 = (xloc-1)*dx - delx x2 = (xloc-0)*dx * say 'b x1: 'x1' x2: 'x2' delx: 'x2-x1' xloc: 'xloc' xmax: 'xmax' dx: 'dx endif if( xloc != 1 & xloc != xmax ) x1 = (xloc-1)*dx - (delx/2) x2 = (xloc-0)*dx + (delx/2) * say 'c x1: 'x1' x2: 'x2' x2-x1: 'x2-x1' xloc: 'xloc' xmax: 'xmax' dx: 'dx' delx: 'delx endif if( yloc = 1 ) y2 = pagey - (yloc-1)*dy y1 = pagey - (yloc-0)*dy - dely endif if( yloc = ymax ) y2 = pagey - (yloc-1)*dy + dely y1 = pagey - (yloc-0)*dy endif if( yloc != 1 & yloc != ymax ) y2 = pagey - (yloc-1)*dy + dely/2 y1 = pagey - (yloc-0)*dy - dely/2 endif *say 'delx: 'x2-x1' dely: 'y2-y1' xloc: 'xloc' yloc: 'yloc' xmax: 'xmax' ymax: 'ymax' dx: 'dx' dy: 'dy' x1: 'x1' x2: 'x2' y1: 'y1' y2: 'y2' pagex: 'pagex' pagey: 'pagey if( x1 < 0 ) x1 = 0 endif if( y1 < 0 ) y1 = 0 endif if( x2 > pagex ) x2 = pagex endif if( y2 > pagey ) y2 = pagey endif say 'vpage 'x1' 'x2' 'y1' 'y2 'set vpage 'x1' 'x2' 'y1' 'y2 'set grads off'