<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
Hi, Justin —&nbsp;
<div>If both grids have a lat/lon increment of 1.0 degree, but one starts at -180 and the other starts at 0, GrADS sees those as different and you have to use lterp() to perform operations between those grids.&nbsp;</div>
<div><br>
</div>
<div>Your expression</div>
<div>
<blockquote type="cite">
<div class="gmail_extra">
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;">
<div class="HOEnZb">
<div class="h5">
<div class="gmail_extra">
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;">
<div class="gmail_extra">
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; position: static; z-index: auto;">
<div dir="ltr">
<div style="font-size: 12.8px;"><span style="font-size: 12.8px;">aave(maskout(prectot.2<font color="#ff0000">(x=1,y=1)</font>,mask.1(<font color="#ff0000">x=1,y=1</font>,time=00:30z01feb1980)),lon=-179.5,lon=179.5,lat=-89.5,lat=89.5)</span>&nbsp;</div>
</div>
</blockquote>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</blockquote>
...isn’t quite right. You need to fix the X and Y dimensions *before* you invoke your aave() command, not as a local dimension override within your expression. Here’s an untested example of how it might look:</div>
<div><br>
</div>
<div><font face="Courier" style="font-size: 14px;">set dfile 2</font></div>
<div><font face="Courier" style="font-size: 14px;">set x 1</font></div>
<div><font face="Courier" style="font-size: 14px;">set y 1</font></div>
<div><font face="Courier" style="font-size: 14px;">set t 1</font></div>
<div><font face="Courier" style="font-size: 14px;">d aave(maskout(prectot,lterp(mask.1(time=00:30z01feb1980),prectot)),lon=-179.5, … , … , lat=89.5)</font></div>
<div><br>
</div>
<div><br>
</div>
<div>—Jennifer</div>
<div><br>
</div>
<div><br>
<div>
<div>On Jul 7, 2016, at 4:43 PM, Justin Hicks &lt;<a href="mailto:jhicks2014@gmail.com">jhicks2014@gmail.com</a>&gt; wrote:</div>
<br class="Apple-interchange-newline">
<blockquote type="cite">
<div dir="ltr">Jeff,
<div><br>
</div>
<div>This seems to work. Both of the files are gridded 1 degree, so I'm surprised they didn't work without this function.&nbsp;</div>
<div><br>
</div>
<div>-Justin&nbsp;</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Thu, Jul 7, 2016 at 4:09 PM, Justin Hicks <span dir="ltr">
&lt;<a href="mailto:jhicks2014@gmail.com" target="_blank">jhicks2014@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Jeff,
<div><br>
</div>
<div>Thanks, I'll try the lterp function. I tried changing the xdef and ydef before but I still had the same issue.</div>
<span class="HOEnZb"><font color="#888888">
<div><br>
</div>
<div>-Justin</div>
</font></span></div>
<div class="HOEnZb">
<div class="h5">
<div class="gmail_extra"><br>
<div class="gmail_quote">On Thu, Jul 7, 2016 at 4:03 PM, Jeff Duda <span dir="ltr">
&lt;<a href="mailto:jeffduda319@gmail.com" target="_blank">jeffduda319@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Justin,
<div>As in my previous response to another thread, use the lterp function - it performs linear interpolation to match two grids. It is a fairly simple function. If for whatever reason you don't want to do that or it doesn't work, you can change the XDEF and
 YDEF lines of your control files to match each other, as that information is what GrADS uses to determine if you can perform operations on two grids. The PDEF entries do not have to match.</div>
<div><br>
</div>
<div>Jeff Duda</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">
<div>On Thu, Jul 7, 2016 at 2:38 PM, Justin Hicks <span dir="ltr">&lt;<a href="mailto:jhicks2014@gmail.com" target="_blank">jhicks2014@gmail.com</a>&gt;</span> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; position: static; z-index: auto;">
<div>
<div dir="ltr"><span style="font-size:12.8px">GrADS users,</span>
<div style="font-size:12.8px"><br>
</div>
<div style="font-size:12.8px">I previously used GLDAS files and mask files to calculate monthly area averages. However, I am trying to get MERRA2 data to work with the masks now. I keep getting an error saying:&nbsp;</div>
<div style="font-size:12.8px"><br>
</div>
<div><span style="font-size:12.8px">ga-&gt; run EXAMPLE_MASK_SCRIPT</span><br>
</div>
<div style="font-size:12.8px">
<div style="font-size:12.8px">Error in gagchk: axis sizes are not the same</div>
<div style="font-size:12.8px">Operation error: &nbsp;Incompatable grids&nbsp;</div>
<div style="font-size:12.8px">&nbsp; Dimension = 0</div>
<div style="font-size:12.8px">&nbsp; 1st grid range = -179 181 &nbsp; 2nd = 1 360&nbsp;</div>
<div style="font-size:12.8px">Operation Error: &nbsp;Error from maskout function</div>
<div style="font-size:12.8px">Operation Error: &nbsp;Error from aave function</div>
<div style="font-size:12.8px">&nbsp; Error ocurred at column 1</div>
<div style="font-size:12.8px">DISPLAY error: &nbsp;Invalid expression&nbsp;</div>
<div style="font-size:12.8px">&nbsp; Expression = aave(maskout(prectot.2,mask.1(time=00:30z01feb1980)),lon=-179.5,lon=179.5,lat=-89.5,lat=89.5)</div>
<div><br>
</div>
</div>
<div style="font-size:12.8px"><br>
</div>
<div style="font-size:12.8px">I tried to fix x and y grid points using the following command, but it did not work:</div>
<div style="font-size:12.8px"><br>
</div>
<div style="font-size:12.8px"><span style="font-size:12.8px">aave(maskout(prectot.2<font color="#ff0000">(x=1,y=1)</font>,mask.1(<font color="#ff0000">x=1,y=1</font>,time=00:30z01feb1980)),lon=-179.5,lon=179.5,lat=-89.5,lat=89.5)</span>&nbsp;</div>
<div style="font-size:12.8px"><br>
</div>
<div style="font-size:12.8px"><br>
</div>
<div style="font-size:12.8px"><br>
</div>
<div style="font-size:12.8px"><br>
</div>
<div style="font-size:12.8px"><br>
</div>
<div style="font-size:12.8px">The result of 'q dims' of the mask file is:</div>
<div style="font-size:12.8px"><br>
</div>
<div style="font-size:12.8px">
<div>Default file number is: 1&nbsp;</div>
<div>X is fixed &nbsp; &nbsp; Lon = 0 &nbsp;X = 180.5</div>
<div>Y is fixed &nbsp; &nbsp; Lat = -90 &nbsp;Y = 0.5</div>
<div>Z is fixed &nbsp; &nbsp; Lev = 0 &nbsp;Z = 1</div>
<div>T is fixed &nbsp; &nbsp; Time = 00:30Z01DEC1991 &nbsp;T = 143</div>
<div>E is fixed &nbsp; &nbsp; Ens = 1 &nbsp;E = 1</div>
</div>
<div style="font-size:12.8px"><br>
</div>
<div style="font-size:12.8px">The result of 'q dims' of the MERRA2 file is:&nbsp;</div>
<div style="font-size:12.8px"><br>
</div>
<div style="font-size:12.8px">
<div>Default file number is: 2&nbsp;</div>
<div>X is fixed &nbsp; &nbsp; Lon = 0 &nbsp;X = 1</div>
<div>Y is fixed &nbsp; &nbsp; Lat = -90 &nbsp;Y = 1</div>
<div>Z is fixed &nbsp; &nbsp; Lev = 0 &nbsp;Z = 1</div>
<div>T is fixed &nbsp; &nbsp; Time = 00:30Z01DEC1991 &nbsp;T = 143</div>
<div>E is fixed &nbsp; &nbsp; Ens = 1 &nbsp;E = 1</div>
</div>
<div style="font-size:12.8px"><br>
</div>
<div style="font-size:12.8px"><br>
</div>
<div style="font-size:12.8px">How can I get the x and y grid points to match up? I'm not even sure if this is the issue, as the GLDAS and mask files didn't have matching x and y grid points, yet they still worked.&nbsp;</div>
<div style="font-size:12.8px"><br>
</div>
<div style="font-size:12.8px">-Justin</div>
<div style="margin:2px 0px 0px;font-size:12.8px"><img src="https://ssl.gstatic.com/ui/v1/icons/mail/images/cleardot.gif"></div>
</div>
<br>
</div>
_______________________________________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" rel="noreferrer" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
<br>
</blockquote>
</div>
<span><font color="#888888"><br>
<br clear="all">
<div><br>
</div>
-- <br>
<div data-smartmail="gmail_signature">
<div dir="ltr">Jeff Duda<br>
Post-doctoral research associate<br>
University of Oklahoma School of Meteorology<br>
</div>
</div>
</font></span></div>
<br>
_______________________________________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" rel="noreferrer" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
<br>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
_______________________________________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>
http://gradsusr.org/mailman/listinfo/gradsusr<br>
</blockquote>
</div>
<br>
<div apple-content-edited="true">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div style="font-size: 12px; orphans: 2; widows: 2;">--</div>
<div style="font-size: 12px; orphans: 2; widows: 2;">Jennifer Miletta Adams<br>
Center for Ocean-Land-Atmosphere Studies (COLA)<br>
George Mason University<br>
<br>
<br>
</div>
</div>
</div>
</div>
<br>
</div>
</body>
</html>