[gradsusr] Error: Axis sizes not the same

Jennifer M Adams jadams21 at gmu.edu
Fri Jul 8 09:42:14 EDT 2016


Hi, Justin —
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.

Your expression
aave(maskout(prectot.2(x=1,y=1),mask.1(x=1,y=1,time=00:30z01feb1980)),lon=-179.5,lon=179.5,lat=-89.5,lat=89.5)
...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:

set dfile 2
set x 1
set y 1
set t 1
d aave(maskout(prectot,lterp(mask.1(time=00:30z01feb1980),prectot)),lon=-179.5, … , … , lat=89.5)


—Jennifer


On Jul 7, 2016, at 4:43 PM, Justin Hicks <jhicks2014 at gmail.com<mailto:jhicks2014 at gmail.com>> wrote:

Jeff,

This seems to work. Both of the files are gridded 1 degree, so I'm surprised they didn't work without this function.

-Justin

On Thu, Jul 7, 2016 at 4:09 PM, Justin Hicks <jhicks2014 at gmail.com<mailto:jhicks2014 at gmail.com>> wrote:
Jeff,

Thanks, I'll try the lterp function. I tried changing the xdef and ydef before but I still had the same issue.

-Justin

On Thu, Jul 7, 2016 at 4:03 PM, Jeff Duda <jeffduda319 at gmail.com<mailto:jeffduda319 at gmail.com>> wrote:
Justin,
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.

Jeff Duda

On Thu, Jul 7, 2016 at 2:38 PM, Justin Hicks <jhicks2014 at gmail.com<mailto:jhicks2014 at gmail.com>> wrote:
GrADS users,

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:

ga-> run EXAMPLE_MASK_SCRIPT
Error in gagchk: axis sizes are not the same
Operation error:  Incompatable grids
  Dimension = 0
  1st grid range = -179 181   2nd = 1 360
Operation Error:  Error from maskout function
Operation Error:  Error from aave function
  Error ocurred at column 1
DISPLAY error:  Invalid expression
  Expression = aave(maskout(prectot.2,mask.1(time=00:30z01feb1980)),lon=-179.5,lon=179.5,lat=-89.5,lat=89.5)


I tried to fix x and y grid points using the following command, but it did not work:

aave(maskout(prectot.2(x=1,y=1),mask.1(x=1,y=1,time=00:30z01feb1980)),lon=-179.5,lon=179.5,lat=-89.5,lat=89.5)





The result of 'q dims' of the mask file is:

Default file number is: 1
X is fixed     Lon = 0  X = 180.5
Y is fixed     Lat = -90  Y = 0.5
Z is fixed     Lev = 0  Z = 1
T is fixed     Time = 00:30Z01DEC1991  T = 143
E is fixed     Ens = 1  E = 1

The result of 'q dims' of the MERRA2 file is:

Default file number is: 2
X is fixed     Lon = 0  X = 1
Y is fixed     Lat = -90  Y = 1
Z is fixed     Lev = 0  Z = 1
T is fixed     Time = 00:30Z01DEC1991  T = 143
E is fixed     Ens = 1  E = 1


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.

-Justin
[https://ssl.gstatic.com/ui/v1/icons/mail/images/cleardot.gif]

_______________________________________________
gradsusr mailing list
gradsusr at gradsusr.org<mailto:gradsusr at gradsusr.org>
http://gradsusr.org/mailman/listinfo/gradsusr




--
Jeff Duda
Post-doctoral research associate
University of Oklahoma School of Meteorology

_______________________________________________
gradsusr mailing list
gradsusr at gradsusr.org<mailto:gradsusr at gradsusr.org>
http://gradsusr.org/mailman/listinfo/gradsusr



_______________________________________________
gradsusr mailing list
gradsusr at gradsusr.org<mailto:gradsusr at gradsusr.org>
http://gradsusr.org/mailman/listinfo/gradsusr

--
Jennifer Miletta Adams
Center for Ocean-Land-Atmosphere Studies (COLA)
George Mason University



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20160708/dba048b8/attachment.html 


More information about the gradsusr mailing list