diff --git a/GEOS_Util/plots/grads_util/cbarn.gs b/GEOS_Util/plots/grads_util/cbarn.gs index e7bbd91c..bd19cb48 100644 --- a/GEOS_Util/plots/grads_util/cbarn.gs +++ b/GEOS_Util/plots/grads_util/cbarn.gs @@ -115,6 +115,8 @@ endwhile ysiz = subwrd(rec2,6) ylo = subwrd(rec4,4) + xmiddle = ( subwrd(rec3,4) + subwrd(rec3,6) )/2 + if( vpos = 'r' ) xhi = subwrd(rec3,6) xd = xsiz - xhi @@ -159,17 +161,17 @@ endwhile if(xmid = '') ; xmid = xhi+xd/2 ; endif xwid = 0.2 - ywid = 0.5*scaley - + ywid = 0.5 xl = xmid-xwid/2 xr = xl + xwid if (ywid*cint > ysiz*barsf) ywid = ysiz*barsf/cint endif + xwid = xwid*sbar*scalex ywid = ywid*sbar*scaley if(ymid = '') ; ymid = ysiz/2 ; endif yb = ymid - ywid*cint/2 - 'set string 1 l 4' + 'set string 1 l 2' vert = 1 else @@ -184,14 +186,15 @@ endwhile if(ymid = '') ; ymid = ylo/2-ywid/2 ; endif yt = ymid + yoffset yb = ymid - if(xmid = '') ; xmid = xsiz/2 ; endif + if(xmid = '') ; xmid = xsiz/2 ; xmid = xmiddle ; endif if (xwid*cint > xsiz*barsf) xwid = xsiz*barsf/cint endif xwid = xwid*sbar*scalex + ywid = ywid*sbar*scaley xl = xmid - xwid*cint/2 - 'set string 1 tc 4' + 'set string 1 tc 2' vert = 0 endif diff --git a/GEOS_Util/plots/grads_util/dc.gs b/GEOS_Util/plots/grads_util/dc.gs index de386da0..b3b4e764 100644 --- a/GEOS_Util/plots/grads_util/dc.gs +++ b/GEOS_Util/plots/grads_util/dc.gs @@ -25,7 +25,7 @@ say say 'You may plot the entire globe, or specify a particular face:' say 'example: dc q1 -cint 5 -face N (N=1,2,3,4,5, or 6)' say -say 'You may shade the background topography when the input field is contoured (i.e., not shaded or grfill)' +say 'You may shade the background topography ' say 'example: dc q1 -cint 5 -toposhade -face N (N=1,2,3,4,5, or 6)' say return @@ -259,14 +259,15 @@ endif ******************************************************* if( face = GLOBAL ) - 'set vpage 0 11 0 8.5' - 'set parea 0.5 3.0 3.0 5.5' +* 'set vpage 0 11 0 8.5' +* 'set parea 0.5 3.0 3.0 5.5' + 'parea 1 2 4 3' endif 'set grads off' * Shade Topo * ---------- -if( toposhade = TRUE & gxout = Contour & (face = GLOBAL | face = 1) ) +if( toposhade = TRUE & (face = GLOBAL | face = 1) ) 'set dfile 'topofile 'set gxout shaded' 'setx' @@ -277,6 +278,7 @@ if( toposhade = TRUE & gxout = Contour & (face = GLOBAL | face = 1) ) 'd topo' 'set cthick 4' 'set dfile 'file +'set gxout 'gxout endif * ---------- @@ -326,7 +328,8 @@ if( face = GLOBAL | face = 1 ) if( scalar = true ) 'set gxout 'gxout - 'd 'q.1 + if( gxout = Contour ) ; 'd 'q.1 ; endif + if( gxout = Shaded ) ; 'd maskout('q.1',abs('q.1')-abs('cint'))' ; endif endif if( vector = true ) 'set ccolor 1' @@ -347,6 +350,7 @@ endif 'd topo' 'set cthick 4' 'set dfile 'file +'set gxout 'gxout endif @@ -355,14 +359,15 @@ endif ******************************************************* if( face = GLOBAL ) - 'set parea 3.0 5.5 3.00 5.50' +* 'set parea 3.0 5.5 3.00 5.50' + 'parea 2 2 4 3' endif 'set xlab off' 'set ylab off' * Shade Topo * ---------- -if( toposhade = TRUE & gxout = Contour & (face = GLOBAL | face = 2) ) +if( toposhade = TRUE & (face = GLOBAL | face = 2) ) 'set dfile 'topofile 'set gxout shaded' 'setx' @@ -375,6 +380,7 @@ ytopo2 = ytopo.2 + 0.5 'd topo' 'set cthick 4' 'set dfile 'file +'set gxout 'gxout endif * ---------- @@ -426,7 +432,8 @@ if( face = GLOBAL | face = 2 ) if( scalar = true ) 'set gxout 'gxout - 'd 'q.1 + if( gxout = Contour ) ; 'd 'q.1 ; endif + if( gxout = Shaded ) ; 'd maskout('q.1',abs('q.1')-abs('cint'))' ; endif endif if( vector = true ) 'set ccolor 1' @@ -449,6 +456,7 @@ ytopo2 = ytopo.2 + 0.5 'd topo' 'set cthick 4' 'set dfile 'file +'set gxout 'gxout endif @@ -457,7 +465,8 @@ endif ******************************************************* if( face = GLOBAL ) - 'set parea 5.5 8.0 3.0 5.5' +* 'set parea 5.5 8.0 3.0 5.5' + 'parea 3 2 4 3' endif 'set xlab off' 'set ylab off' @@ -467,7 +476,7 @@ endif * Shade Topo * ---------- -if( toposhade = TRUE & gxout = Contour & (face = GLOBAL | face = 4) ) +if( toposhade = TRUE & (face = GLOBAL | face = 4) ) 'set dfile 'topofile 'set gxout shaded' 'setx' @@ -478,6 +487,7 @@ if( toposhade = TRUE & gxout = Contour & (face = GLOBAL | face = 4) ) 'd topo' 'set cthick 4' 'set dfile 'file +'set gxout 'gxout endif * ---------- @@ -527,7 +537,8 @@ endif if( face = GLOBAL | face = 4 ) if( scalar = true ) 'set gxout 'gxout - 'd 'q.1 + if( gxout = Contour ) ; 'd 'q.1 ; endif + if( gxout = Shaded ) ; 'd maskout('q.1',abs('q.1')-abs('cint'))' ; endif endif if( vector = true ) 'set ccolor 1' @@ -548,6 +559,7 @@ endif 'd topo' 'set cthick 4' 'set dfile 'file +'set gxout 'gxout endif @@ -557,7 +569,8 @@ endif if( face = GLOBAL ) - 'set parea 8.0 10.5 3.0 5.5' +* 'set parea 8.0 10.5 3.0 5.5' + 'parea 4 2 4 3' endif 'set xlab off' 'set ylab off' @@ -566,7 +579,7 @@ endif * Shade Topo * ---------- -if( toposhade = TRUE & gxout = Contour & (face = GLOBAL | face = 5) ) +if( toposhade = TRUE & (face = GLOBAL | face = 5) ) 'set dfile 'topofile 'set gxout shaded' 'setx' @@ -577,6 +590,7 @@ if( toposhade = TRUE & gxout = Contour & (face = GLOBAL | face = 5) ) 'd topo' 'set cthick 4' 'set dfile 'file +'set gxout 'gxout endif * ---------- @@ -624,7 +638,8 @@ endif if( face = GLOBAL | face = 5 ) if( scalar = true ) 'set gxout 'gxout - 'd 'q.1 + if( gxout = Contour ) ; 'd 'q.1 ; endif + if( gxout = Shaded ) ; 'd maskout('q.1',abs('q.1')-abs('cint'))' ; endif endif if( vector = true ) 'set ccolor 1' @@ -645,6 +660,7 @@ endif 'd topo' 'set cthick 4' 'set dfile 'file +'set gxout 'gxout endif @@ -655,7 +671,8 @@ endif if( face = GLOBAL | face = 3 | face = 31 ) if( face = GLOBAL ) - 'set parea 0.5 3.0 5.5 8.0' +* 'set parea 0.5 3.0 5.5 8.0' + 'parea 1 1 4 3' 'set xyrev on' 'set xflip on' 'set yflip off' @@ -665,7 +682,7 @@ endif * Shade Topo * ---------- -if( toposhade = TRUE & gxout = Contour ) +if( toposhade = TRUE ) 'set dfile 'topofile 'set gxout shaded' 'setx' @@ -676,6 +693,7 @@ if( toposhade = TRUE & gxout = Contour ) 'd maskout( maskout( topo,ynptopo-xxtopo+1) , 'xdimtopo'-ynptopo-xxtopo+2 )' 'set cthick 4' 'set dfile 'file +'set gxout 'gxout endif * ---------- @@ -723,7 +741,9 @@ endif if( scalar = true ) 'set gxout 'gxout - 'd maskout( maskout( 'q.1',ynp-xx+1) , 'xdim'-ynp-xx+2 )' + if( gxout = Contour ) ; 'define maskq = 'q.1 ; endif + if( gxout = Shaded ) ; 'define maskq = maskout('q.1',abs('q.1')-abs('cint'))' ; endif + 'd maskout( maskout( maskq,ynp-xx+1) , 'xdim'-ynp-xx+2 )' endif if( vector = true ) 'set ccolor 1' @@ -757,6 +777,7 @@ endif 'd maskout( maskout( topo,ynptopo-xxtopo+1) , 'xdimtopo'-ynptopo-xxtopo+2 )' 'set cthick 4' 'set dfile 'file +'set gxout 'gxout endif @@ -767,7 +788,8 @@ endif if( face = GLOBAL | face = 3 | face = 32 ) if( face = GLOBAL ) - 'set parea 3.0 5.5 5.5 8.0' +* 'set parea 3.0 5.5 5.5 8.0' + 'parea 2 1 4 3' 'set xyrev off' 'set xflip off' 'set yflip off' @@ -778,7 +800,7 @@ endif * Shade Topo * ---------- -if( toposhade = TRUE & gxout = Contour ) +if( toposhade = TRUE ) 'set dfile 'topofile 'set gxout shaded' 'setx' @@ -789,6 +811,7 @@ if( toposhade = TRUE & gxout = Contour ) 'd maskout( maskout( topo,xxtopo-ynptopo) , 'xdimtopo'-ynptopo-xxtopo )' 'set cthick 4' 'set dfile 'file +'set gxout 'gxout endif * ---------- @@ -837,7 +860,9 @@ endif if( scalar = true ) 'set gxout 'gxout - 'd maskout( maskout( 'q.1',xx-ynp ) , 'xdim'-ynp-xx+1 )' + if( gxout = Contour ) ; 'define maskq = 'q.1 ; endif + if( gxout = Shaded ) ; 'define maskq = maskout('q.1',abs('q.1')-abs('cint'))' ; endif + 'd maskout( maskout( maskq,xx-ynp ) , 'xdim'-ynp-xx+1 )' endif if( vector = true ) 'set ccolor 1' @@ -866,6 +891,7 @@ endif 'd maskout( maskout( topo,xxtopo-ynptopo) , 'xdimtopo'-ynptopo-xxtopo )' 'set cthick 4' 'set dfile 'file +'set gxout 'gxout endif @@ -876,7 +902,8 @@ endif if( face = GLOBAL | face = 3 | face = 34 ) if( face = GLOBAL ) - 'set parea 5.5 8.0 5.5 8.0' +* 'set parea 5.5 8.0 5.5 8.0' + 'parea 3 1 4 3' 'set xyrev on' 'set xflip off' 'set yflip on' @@ -886,7 +913,7 @@ endif * Shade Topo * ---------- -if( toposhade = TRUE & gxout = Contour ) +if( toposhade = TRUE ) 'set dfile 'topofile 'set gxout shaded' 'setx' @@ -897,6 +924,7 @@ if( toposhade = TRUE & gxout = Contour ) 'd maskout( maskout( topo,xxtopo-ynptopo+1) , ynptopo+xxtopo-'xdimtopo' )' 'set cthick 4' 'set dfile 'file +'set gxout 'gxout endif * ---------- @@ -944,7 +972,9 @@ endif if( scalar = true ) 'set gxout 'gxout - 'd maskout( maskout( 'q.1', xx-ynp+1 ), ynp+xx-'xdim' )' + if( gxout = Contour ) ; 'define maskq = 'q.1 ; endif + if( gxout = Shaded ) ; 'define maskq = maskout('q.1',abs('q.1')-abs('cint'))' ; endif + 'd maskout( maskout( maskq, xx-ynp+1 ), ynp+xx-'xdim' )' endif if( vector = true ) 'set ccolor 1' @@ -978,6 +1008,7 @@ endif 'd maskout( maskout( topo,xxtopo-ynptopo+1) , ynptopo+xxtopo-'xdimtopo' )' 'set cthick 4' 'set dfile 'file +'set gxout 'gxout endif @@ -988,7 +1019,8 @@ endif if( face = GLOBAL | face = 3 | face = 35 ) if( face = GLOBAL ) - 'set parea 8.0 10.5 5.5 8.0' +* 'set parea 8.0 10.5 5.5 8.0' + 'parea 4 1 4 3' 'set xyrev off' 'set xflip on' 'set yflip on' @@ -999,7 +1031,7 @@ endif * Shade Topo * ---------- -if( toposhade = TRUE & gxout = Contour ) +if( toposhade = TRUE ) 'set dfile 'topofile 'set gxout shaded' 'setx' @@ -1010,6 +1042,7 @@ if( toposhade = TRUE & gxout = Contour ) 'd maskout( maskout( topo,ynptopo-xxtopo) , ynptopo+xxtopo-'xdimtopo'-1 )' 'set cthick 4' 'set dfile 'file +'set gxout 'gxout endif * ---------- @@ -1057,7 +1090,9 @@ endif if( scalar = true ) 'set gxout 'gxout - 'd maskout( maskout( 'q.1', ynp-xx ), ynp+xx-'xdim'-1 )' + if( gxout = Contour ) ; 'define maskq = 'q.1 ; endif + if( gxout = Shaded ) ; 'define maskq = maskout('q.1',abs('q.1')-abs('cint'))' ; endif + 'd maskout( maskout( maskq, ynp-xx ), ynp+xx-'xdim'-1 )' endif if( vector = true ) 'set ccolor 1' @@ -1091,6 +1126,7 @@ endif 'd maskout( maskout( topo,ynptopo-xxtopo) , ynptopo+xxtopo-'xdimtopo'-1 )' 'set cthick 4' 'set dfile 'file +'set gxout 'gxout endif @@ -1101,7 +1137,8 @@ endif if( face = GLOBAL | face = 6 | face = 61 ) if( face = GLOBAL ) - 'set parea 0.5 3.0 0.5 3.0' +* 'set parea 0.5 3.0 0.5 3.0' + 'parea 1 3 4 3' 'set xyrev off' 'set xflip off' 'set yflip off' @@ -1112,7 +1149,7 @@ endif * Shade Topo * ---------- -if( toposhade = TRUE & gxout = Contour ) +if( toposhade = TRUE ) 'set dfile 'topofile 'set gxout shaded' 'setx' @@ -1123,6 +1160,7 @@ if( toposhade = TRUE & gxout = Contour ) 'd maskout( maskout( topo,ysptopo-xxtopo+1) , ysptopo+xxtopo-'xdimtopo' )' 'set cthick 4' 'set dfile 'file +'set gxout 'gxout endif * ---------- @@ -1169,7 +1207,9 @@ endif if( scalar = true ) 'set gxout 'gxout - 'd maskout( maskout( 'q.1', ysp-xx+1 ), xx+ysp-'xdim' )' + if( gxout = Contour ) ; 'define maskq = 'q.1 ; endif + if( gxout = Shaded ) ; 'define maskq = maskout('q.1',abs('q.1')-abs('cint'))' ; endif + 'd maskout( maskout( maskq, ysp-xx+1 ), xx+ysp-'xdim' )' endif if( vector = true ) 'set ccolor 1' @@ -1198,6 +1238,7 @@ endif 'd maskout( maskout( topo,ysptopo-xxtopo+1) , ysptopo+xxtopo-'xdimtopo' )' 'set cthick 4' 'set dfile 'file +'set gxout 'gxout endif @@ -1208,7 +1249,8 @@ endif if( face = GLOBAL | face = 6 | face = 62 ) if( face = GLOBAL ) - 'set parea 3.0 5.5 0.5 3.0' +* 'set parea 3.0 5.5 0.5 3.0' + 'parea 2 3 4 3' 'set xyrev on' 'set xflip on' 'set yflip off' @@ -1218,7 +1260,7 @@ endif * Shade Topo * ---------- -if( toposhade = TRUE & gxout = Contour ) +if( toposhade = TRUE ) 'set dfile 'topofile 'set gxout shaded' 'setx' @@ -1229,6 +1271,7 @@ if( toposhade = TRUE & gxout = Contour ) 'd maskout( maskout( topo,xxtopo-ysptopo) , ysptopo+xxtopo-'xdimtopo' )' 'set cthick 4' 'set dfile 'file +'set gxout 'gxout endif * ---------- @@ -1275,7 +1318,9 @@ endif if( scalar = true ) 'set gxout 'gxout - 'd maskout( maskout( 'q.1', xx-ysp ), ysp+xx-'xdim' )' + if( gxout = Contour ) ; 'define maskq = 'q.1 ; endif + if( gxout = Shaded ) ; 'define maskq = maskout('q.1',abs('q.1')-abs('cint'))' ; endif + 'd maskout( maskout( maskq, xx-ysp ), ysp+xx-'xdim' )' endif if( vector = true ) 'set ccolor 1' @@ -1304,6 +1349,7 @@ endif 'd maskout( maskout( topo,xxtopo-ysptopo) , ysptopo+xxtopo-'xdimtopo' )' 'set cthick 4' 'set dfile 'file +'set gxout 'gxout endif @@ -1314,7 +1360,8 @@ endif if( face = GLOBAL | face = 6 | face = 64 ) if( face = GLOBAL ) - 'set parea 5.5 8.0 0.5 3.0' +* 'set parea 5.5 8.0 0.5 3.0' + 'parea 3 3 4 3' 'set xyrev off' 'set xflip on' 'set yflip on' @@ -1325,7 +1372,7 @@ endif * Shade Topo * ---------- -if( toposhade = TRUE & gxout = Contour ) +if( toposhade = TRUE ) 'set dfile 'topofile 'set gxout shaded' 'setx' @@ -1337,6 +1384,7 @@ ytopo5 = ytopo.5 + 0.5 'd maskout( maskout( topo,xxtopo-ysptopo) , 'xdimtopo'-xxtopo-ysptopo )' 'set cthick 4' 'set dfile 'file +'set gxout 'gxout endif * ---------- @@ -1384,7 +1432,9 @@ endif if( scalar = true ) 'set gxout 'gxout - 'd maskout( maskout( 'q.1', xx-ysp ), 'xdim'-xx-ysp )' + if( gxout = Contour ) ; 'define maskq = 'q.1 ; endif + if( gxout = Shaded ) ; 'define maskq = maskout('q.1',abs('q.1')-abs('cint'))' ; endif + 'd maskout( maskout( maskq, xx-ysp ), 'xdim'-xx-ysp )' endif if( vector = true ) 'set ccolor 1' @@ -1414,6 +1464,7 @@ ytopo5 = ytopo.5 + 0.5 'd maskout( maskout( topo,xxtopo-ysptopo) , 'xdimtopo'-xxtopo-ysptopo )' 'set cthick 4' 'set dfile 'file +'set gxout 'gxout endif @@ -1424,7 +1475,8 @@ endif if( face = GLOBAL | face = 6 | face = 65 ) if( face = GLOBAL ) - 'set parea 8.0 10.5 0.5 3.0' +* 'set parea 8.0 10.5 0.5 3.0' + 'parea 4 3 4 3' 'set xyrev on' 'set xflip off' 'set yflip on' @@ -1435,7 +1487,7 @@ endif * Shade Topo * ---------- -if( toposhade = TRUE & gxout = Contour ) +if( toposhade = TRUE ) 'set dfile 'topofile 'set gxout shaded' 'setx' @@ -1446,6 +1498,7 @@ if( toposhade = TRUE & gxout = Contour ) 'd maskout( maskout( topo,ysptopo-xxtopo+1) , 'xdimtopo'-ysptopo-xxtopo+1 )' 'set cthick 4' 'set dfile 'file +'set gxout 'gxout endif * ---------- @@ -1492,7 +1545,9 @@ endif if( scalar = true ) 'set gxout 'gxout - 'd maskout( maskout( 'q.1', ysp-xx+1 ), 'xdim'-ysp-xx+1 )' + if( gxout = Contour ) ; 'define maskq = 'q.1 ; endif + if( gxout = Shaded ) ; 'define maskq = maskout('q.1',abs('q.1')-abs('cint'))' ; endif + 'd maskout( maskout( maskq, ysp-xx+1 ), 'xdim'-ysp-xx+1 )' endif if( vector = true ) 'set ccolor 1' @@ -1521,6 +1576,7 @@ endif 'd maskout( maskout( topo,ysptopo-xxtopo+1) , 'xdimtopo'-ysptopo-xxtopo+1 )' 'set cthick 4' 'set dfile 'file +'set gxout 'gxout 'setx' 'sety' @@ -1530,7 +1586,8 @@ endif ******************************************************* 'close 'topofile -if( gxout != Contour ) ; 'set gxout 'gxout ; endif +*if( gxout != Contour ) ; 'set gxout 'gxout ; endif +'set gxout 'gxout 'set arrlab on' 'set dfile 'file diff --git a/GEOS_Util/plots/grads_util/landshade.gs b/GEOS_Util/plots/grads_util/landshade.gs index 25e92043..5d6d0d6c 100644 --- a/GEOS_Util/plots/grads_util/landshade.gs +++ b/GEOS_Util/plots/grads_util/landshade.gs @@ -7,6 +7,10 @@ endif 'run getenv GEOSUTIL' geosutil = result +'q gxout' + gxout = sublin(result,4) + gxout = subwrd(gxout,6) + 'getinfo latmin' latmin = result 'getinfo latmax' @@ -43,5 +47,11 @@ endif 'set ccols 'color' 0' 'set clevs 0.5' 'd mask' +'set gxout contour' +'set cthick 6' +'set clevs 0.99' +'set ccolor 1' +'d mask' +'set gxout 'gxout return diff --git a/GEOS_Util/plots/grads_util/parea b/GEOS_Util/plots/grads_util/parea index 4f31b20e..474391f6 100644 --- a/GEOS_Util/plots/grads_util/parea +++ b/GEOS_Util/plots/grads_util/parea @@ -2,7 +2,7 @@ function parea (args) ************************************************************* ***** ***** -***** Usage: parea xloc yloc xmax ymax ***** +***** Usage: parea xloc yloc xmax ymax ***** ***** ***** ************************************************************* @@ -19,104 +19,83 @@ ymax = subwrd(args,4) left = 0.5 right = 0.2 + top = 0.0 + bot = 0.0 + left = 0.0 + right = 0.0 + scalex = 1.0 scaley = 1.0 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)='-top' ) ; top = subwrd(args,num+1) ; endif if( subwrd(args,num)='-bot' ) ; bot = subwrd(args,num+1) ; endif if( subwrd(args,num)='-left' ) ; left = subwrd(args,num+1) ; endif if( subwrd(args,num)='-right' ) ; right = subwrd(args,num+1) ; endif +if( subwrd(args,num)='-scalex' ) ; scalex = subwrd(args,num+1) ; endif +if( subwrd(args,num)='-scaley' ) ; scaley = subwrd(args,num+1) ; endif endwhile say ' parea: 'xloc' 'yloc' 'xmax' 'ymax -say 'scalex: 'scalex -say 'scaley: 'scaley +say ' ' say ' top: 'top +say ' bot: 'bot +say ' left: 'left +say ' right: 'right -*'set vpage off' - -'set parea off' 'getinfo page' pagex = subwrd(result,1) pagey = subwrd(result,2) -sizex = pagex -sizey = pagey + +dx0 = pagex / xmax +dy0 = pagey / ymax +dx = dx0 - left - right - (1.0-scalex)*dx0 +dy = dy0 - top - bot - (1.0-scaley)*dy0 say ' ' -say 'page sizex: 'sizex -say 'page sizey: 'sizey +say 'page sizex: 'pagex +say 'page sizey: 'pagey say ' ' -pagex = pagex - left - right -pagey = pagey - top - bot - -dx = pagex / xmax -dy = pagey / ymax - -delx = 0.8* dx -dely = 0.8* dy - -if( xloc = 1 ) - x1 = left + (dx-delx)/2 - x2 = x1 + delx -* say 'a x1: 'x1' x2: 'x2' delx: 'x2-x1' xloc: 'xloc' xmax: 'xmax' dx: 'dx -endif -if( xloc = xmax ) - x2 = sizex - right - (dx-delx)/2 - x1 = x2 - delx -* 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 + left + (dx-delx)/2 - x2 = x1 + delx -* say 'c x1: 'x1' x2: 'x2' x2-x1: 'x2-x1' xloc: 'xloc' xmax: 'xmax' dx: 'dx' delx: 'delx -endif - -if( yloc = 1 ) - y2 = sizey - top - (dy-dely)/2 - y1 = y2 - dely -endif -if( yloc = ymax ) - y2 = bot + dy - (dy-dely)/2 - y1 = y2 - dely -endif -if( yloc != 1 & yloc != ymax ) - y2 = sizey - (yloc-1)*dy - top - (dy-dely)/2 - y1 = y2 - dely -endif + x1 = (xloc-1)*dx0 + left + x2 = x1 + dx - 1e-3 + + y2 = pagey - (yloc-1)*dy0 - top - 1e-3 + y1 = y2 - dy + +say 'Initial parea: 'x1' 'x2' 'y1' 'y2 if( x1 < 0 ) - x1 = 0 + x1 = left endif if( y1 < 0 ) - y1 = 0 + y1 = bot endif - if( x2 > sizex ) - x2 = sizex + if( x2 > pagex ) + x2 = pagex-(x2-pagex) +* x2 = pagex-right endif - if( y2 > sizey ) - y2 = sizey + if( y2 > pagey ) + y2 = pagey-(y2-pagey) +* y2 = pagey-top endif -*'set vpage 0 'sizex' 0 'sizey -'set mproj scaled' - say 'parea 'x1' 'x2' (dx: 'x2-x1') 'y1' 'y2' (dy: 'y2-y1')' +say ' Final parea: 'x1' 'x2' 'y1' 'y2 'set parea 'x1' 'x2' 'y1' 'y2 'set grads off' xmid = ( x1 + x2 )/2 -xleft = x1 - 0.20*delx -xright = x2 + 0.10*delx -ybot = y1 - 0.12*dely -ytop = y2 + 0.03*dely -ytop = y2 + 0.04*dely -ymid = ( ybot + ytop )/2 +ymid = ( y1 + y2 )/2 +xleft = x1 +xright = x2 +ybot = y1 +ytop = y2 +say ' ' say 'xmid: 'xmid' ybot: 'ybot' ytop: 'ytop' ymid: 'ymid' xleft: 'xleft' xright: 'xright +say ' ' + return xmid' 'ybot' 'ytop' 'ymid' 'xleft' 'xright diff --git a/GEOS_Util/plots/grads_util/plot.rc b/GEOS_Util/plots/grads_util/plot.rc index ae49753d..247f63db 100644 --- a/GEOS_Util/plots/grads_util/plot.rc +++ b/GEOS_Util/plots/grads_util/plot.rc @@ -633,6 +633,7 @@ DUDTDYN_DYN_250_CLEVS: -7 -6 -5 -4 -3 -2 -1.5 -1 -0.5 0.5 1 1.5 2 3 4 5 6 7 DUDTDYN_DYN_200_CLEVS: -7 -6 -5 -4 -3 -2 -1.5 -1 -0.5 0.5 1 1.5 2 3 4 5 6 7 DUDTDYN_DYN_150_CLEVS: -7 -6 -5 -4 -3 -2 -1.5 -1 -0.5 0.5 1 1.5 2 3 4 5 6 7 DUDTDYN_DYN_100_CLEVS: -7 -6 -5 -4 -3 -2 -1.5 -1 -0.5 0.5 1 1.5 2 3 4 5 6 7 +DUDTDYN_DYN_CLEVS: -18 -16 -14 -12 -10 -8 -6 -4 -2 2 4 6 8 10 12 14 16 18 *DUDTDYN_DYN_FIXED_PLOT_FACTOR: -2 *DUDTDYN_DYN_FIXED_PLOT_CINT: 1.2 @@ -729,6 +730,7 @@ DUDTPHY_MOIST_250_CLEVS: -7 -6 -5 -4 -3 -2 -1.5 -1 -0.5 0.5 1 1.5 2 3 4 5 6 7 DUDTPHY_MOIST_200_CLEVS: -7 -6 -5 -4 -3 -2 -1.5 -1 -0.5 0.5 1 1.5 2 3 4 5 6 7 DUDTPHY_MOIST_150_CLEVS: -7 -6 -5 -4 -3 -2 -1.5 -1 -0.5 0.5 1 1.5 2 3 4 5 6 7 DUDTPHY_MOIST_100_CLEVS: -7 -6 -5 -4 -3 -2 -1.5 -1 -0.5 0.5 1 1.5 2 3 4 5 6 7 +DUDTPHY_MOIST_CLEVS: -18 -16 -14 -12 -10 -8 -6 -4 -2 2 4 6 8 10 12 14 16 18 DVDTPHY_MOIST_TITLE: DVDT from Physics (MOIST+TURB+GWD) (m/sec/day) DVDTPHY_MOIST_FACTOR: 86400 @@ -799,6 +801,7 @@ DUDTTOT_MOIST_CCOLS: 55 49 47 45 44 36 34 33 32 0 21 22 23 24 2 DUDTTOT_MOIST_CLEVS: -0.9 -0.8 -0.7 -0.6 -0.5 -0.4 -0.3 -0.2 -0.1 0.1 0.2 .3 .4 .5 .6 .7 .8 .9 DUDTTOT_MOIST_Z_CCOLS: 55 49 47 45 44 36 34 33 32 0 21 22 23 24 25 26 27 28 69 DUDTTOT_MOIST_Z_CLEVS: -0.9 -0.8 -0.7 -0.6 -0.5 -0.4 -0.3 -0.2 -0.1 0.1 0.2 .3 .4 .5 .6 .7 .8 .9 +DUDTTOT_MOIST_CLEVS: -4.5 -4 -3.5 -3 -2.5 -2 -1.5 -1 -.5 .5 1 1.5 2 2.5 3 3.5 4 4.5 DVDTTOT_MOIST_TITLE: DVDT_TOT (Dynamics + Physics [+ Analysis]) (m/sec/day) diff --git a/GEOS_Util/plots/grads_util/vpage b/GEOS_Util/plots/grads_util/vpage index f5031c41..8f8f55fc 100644 --- a/GEOS_Util/plots/grads_util/vpage +++ b/GEOS_Util/plots/grads_util/vpage @@ -2,7 +2,7 @@ function vpage (args) ************************************************************* ***** ***** -***** Usage: vpage xloc yloc xmax ymax ***** +***** Usage: vpage xloc yloc xmax ymax ***** ***** ***** ************************************************************* @@ -14,7 +14,16 @@ yloc = subwrd(args,2) xmax = subwrd(args,3) ymax = subwrd(args,4) - ytop = 0.5 + top = 0.5 + bot = 0.2 + left = 0.2 +right = 0.2 + + top = 0.0 + bot = 0.0 + left = 0.0 +right = 0.0 + scalex = 1 scaley = 1 @@ -23,81 +32,73 @@ 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 +if( subwrd(args,num)='-top' ) ; top = subwrd(args,num+1) ; endif +if( subwrd(args,num)='-bot' ) ; bot = subwrd(args,num+1) ; endif +if( subwrd(args,num)='-left' ) ; left = subwrd(args,num+1) ; endif +if( subwrd(args,num)='-right' ) ; right = subwrd(args,num+1) ; endif endwhile 'set vpage off' 'getinfo page' -pagex = subwrd(result,1) -pagey = subwrd(result,2)-ytop +pagex = subwrd(result,1) +pagey = subwrd(result,2) -*'set mproj latlon' -*'set mproj scaled' -*diff = (pagex-pagey/1.75)*0.5 -*pagex = pagey/1.65 +dx0 = ( pagex / xmax ) +dy0 = ( pagey / ymax ) -dx = pagex / xmax -dy = pagey / ymax +dx = ( pagex / xmax ) - ( left + right ) +dy = ( pagey / ymax ) - ( top + bot ) -delx = dx * (scalex - 1) -dely = dy * (scaley - 1) + x1 = (xloc-1)*dx0 + left + x2 = x1 + dx - 1e-3 -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 + y2 = pagey - (yloc-1)*dy0 - top + y1 = y2 - dy - 1e-3 -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 +say 'Default page sizex: 'pagex +say 'Default page sizey: 'pagey +say 'Offsets top: 'top' bot: 'bot' left: 'left' right: 'right if( x1 < 0 ) -x1 = 0 + x1 = left endif if( y1 < 0 ) -y1 = 0 + y1 = bot endif -if( x2 > pagex ) -x2 = pagex +if( x2 > pagex-right ) + x2 = pagex-right endif -if( y2 > pagey ) -y2 = pagey +if( y2 > pagey-top ) + y2 = pagey-top endif - say 'vpage 'x1' 'x2' 'y1' 'y2 +say 'set vpage 'x1' 'x2' 'y1' 'y2 'set vpage 'x1' 'x2' 'y1' 'y2 'set grads off' +pagex = x2-x1 +pagey = y2-y1 +'run setenv PAGEX 'pagex +'run setenv PAGEY 'pagey + +*'getinfo page' +*pagex = subwrd(result,1) +*pagey = subwrd(result,2) + +say 'Final page sizex: 'pagex +say 'Final page sizey: 'pagey + xmid = ( x1 + x2 )/2 -xleft = x1 - 0.20*delx -xright = x2 + 0.10*delx -ybot = y1 - 0.12*dely -ytop = y2 + 0.03*dely -ytop = y2 + 0.04*dely -ymid = ( ybot + ytop )/2 +ymid = ( y1 + y2 )/2 +xleft = x1 +xright = x2 +ybot = y1 +ytop = y2 +say ' ' say 'xmid: 'xmid' ybot: 'ybot' ytop: 'ytop' ymid: 'ymid' xleft: 'xleft' xright: 'xright +say ' ' + return xmid' 'ybot' 'ytop' 'ymid' 'xleft' 'xright diff --git a/GEOS_Util/plots/grads_util/writegrads.gs b/GEOS_Util/plots/grads_util/writegrads.gs index bd2c76d9..9888a383 100755 --- a/GEOS_Util/plots/grads_util/writegrads.gs +++ b/GEOS_Util/plots/grads_util/writegrads.gs @@ -27,6 +27,8 @@ function writegrads(args) ydim = result 'getinfo zdim' zdim = result +'getinfo edim' + edim = result 'getinfo tdim' tdim = result @@ -93,6 +95,8 @@ else '!echo vars 'numargs' >> grads.ctl' endif +* -------------------------------------------------------------------- + 'set gxout fwrite' 'set fwrite grads.data' @@ -139,7 +143,12 @@ endif '!echo "'desc'" >> grads.ctl' * say 'Writing Variable: 'name 'set z 1' + e = 1 + while( e<=edim ) + 'set e 'e 'd 'name + e = e + 1 + endwhile else '!echo "'desc'" >> grads.ctl' @@ -150,7 +159,12 @@ endif 'getinfo level' lev = result * say 'Writing Variable: 'name' for Level: 'lev + e = 1 + while( e<=edim ) + 'set e 'e 'd 'name + e = e + 1 + endwhile z=z+1 endwhile else @@ -160,7 +174,12 @@ endif 'getinfo level' lev = result * say 'Writing Variable: 'name' for Level: 'lev + e = 1 + while( e<=edim ) + 'set e 'e 'd 'name + e = e + 1 + endwhile z=z-1 endwhile endif diff --git a/GEOS_Util/plots/precip/precip b/GEOS_Util/plots/precip/precip index 83d104eb..b0073673 100644 --- a/GEOS_Util/plots/precip/precip +++ b/GEOS_Util/plots/precip/precip @@ -44,7 +44,7 @@ endwhile qfile.3 = subwrd(result,2) scale.3 = subwrd(result,3) -if( qname.1 = 'NULL' & qname.2 = 'NULL' & qname.3 = 'NULL') +if( qname.1 = 'NULL' | qname.2 = 'NULL' | qname.3 = 'NULL') 'run getvar TPREC MOIST' qname.1 = subwrd(result,1) qfile.1 = subwrd(result,2) diff --git a/GEOS_Util/plots/zcmp/progz b/GEOS_Util/plots/zcmp/progz index 0b49c601..39240600 100644 --- a/GEOS_Util/plots/zcmp/progz +++ b/GEOS_Util/plots/zcmp/progz @@ -100,6 +100,40 @@ if( mfile = "NULL" ) ; return ; endif 'seasonalf -FUNCTION 'malias'*'scale' -NAME mod0' modfile = subwrd(result,1) +* Release memory for DEFINEd variables not needed +* ----------------------------------------------- +'undefine qdata' +say 'Releasing variables not needed ...' + months = 'jan feb mar apr may jun jul aug sep oct nov dec djf jja son mam ann clim' + m = 1 + month = subwrd(months,m) +while( month != '' ) + k = 1 + season = subwrd(seasons,k) + 'lowercase 'season + season = result + needed = FALSE + while( season != '' ) + if( season = month ) + needed = TRUE + endif + k = k+1 + season = subwrd(seasons,k) + 'lowercase 'season + season = result + endwhile + if( needed = FALSE ) + say ''month' is not NEEDED, needed = 'needed + else + say ''month' is NEEDED, needed = 'needed + endif + if( needed = FALSE ) + 'undefine mod0'month + endif + m = m+1 + month = subwrd(months,m) +endwhile + ******************************************************************* **** Loop over Possible Experiment Datasets for Comparison **** ******************************************************************* @@ -189,6 +223,39 @@ say 'seasonalf -FUNCTION 'oalias'*'cscal.numexp' -NAME exp'numexp 'seasonalf -FUNCTION 'oalias'*'cscal.numexp' -NAME exp'numexp expfile.numexp = subwrd(result,1) +* Release memory for DEFINEd variables not needed +* ----------------------------------------------- +'undefine qdata' +say 'Releasing variables not needed ...' + months = 'jan feb mar apr may jun jul aug sep oct nov dec djf jja son mam ann clim' + m = 1 + month = subwrd(months,m) +while( month != '' ) + k = 1 + season = subwrd(seasons,k) + 'lowercase 'season + season = result + needed = FALSE + while( season != '' ) + if( season = month ) + needed = TRUE + endif + k = k+1 + season = subwrd(seasons,k) + 'lowercase 'season + season = result + endwhile + if( needed = FALSE ) + say ''month' is not NEEDED, needed = 'needed + else + say ''month' is NEEDED, needed = 'needed + endif + if( needed = FALSE ) + 'undefine exp'numexp''month + endif + m = m+1 + month = subwrd(months,m) +endwhile * Loop over Seasons to Process * ----------------------------