[gradsusr] Error: Axis sizes not the same

Jeff Duda jeffduda319 at gmail.com
Tue Jul 12 15:34:02 EDT 2016


Justin,
The time value in your definition (in the lterp function) is somehow
outside the bounds of the time intervals set in your control file. That's
where the T = 0 0 part of the error message is coming into play. Check
your dimension environment before defining and displaying the field.

Jeff

On Tue, Jul 12, 2016 at 2:00 PM, Justin Hicks <jhicks2014 at gmail.com> wrote:

> Jennifer,
>
> Thank you, that makes sense! Your example was also successful.
>
> If I wanted to find the maximum value of this masked, linear interpolated
> areal average, how would I go about doing this?
>
> I tried sticking in 'amax' before the aave, but an error prompted that it
> was not a variable or function name. Sticking in a 'max' before the aave
> yielded an error that said I had too many or too few arguments (I put in
> starting and ending dimensions as well, but to no avail).
>
> I also tried to use the 'amax' function without the aave since it already
> accounts for the area:
>
> define maximum=amax((maskout(prectot,lterp(mask.1(time=00:30z01feb1980),
> prectot)),lon=-179.5,lon=179.5,lat=-89.5,lat=89.5)
>
> 'd maximum'
>
> However, I received this error:
> Data Request Warning:  Request is completely outside file limits
>   Entire grid contents are set to missing data
>   Grid limits of file:     X = 1 361  Y = 1 180  Z = 1 1  T = 1 143  E = 1
> 1
>   Grid limits of request:  X = -179 181  Y = 1 181  Z = 1 1  T = 0 0  E =
> 1 1
>   Warning issued for variable = prectot.2
>
> I'm not too sure where I went wrong.
>
> -Justin
>
>
> On Fri, Jul 8, 2016 at 9:42 AM, Jennifer M Adams <jadams21 at gmu.edu> wrote:
>
>> 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> 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>
>> 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> 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>
>>>> 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
>>>>>
>>>>> _______________________________________________
>>>>> gradsusr mailing list
>>>>> 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
>>>> http://gradsusr.org/mailman/listinfo/gradsusr
>>>>
>>>>
>>>
>> _______________________________________________
>> gradsusr mailing list
>> gradsusr at gradsusr.org
>> http://gradsusr.org/mailman/listinfo/gradsusr
>>
>>
>> --
>> Jennifer Miletta Adams
>> Center for Ocean-Land-Atmosphere Studies (COLA)
>> George Mason University
>>
>>
>>
>>
>> _______________________________________________
>> gradsusr mailing list
>> gradsusr at gradsusr.org
>> http://gradsusr.org/mailman/listinfo/gradsusr
>>
>>
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>


-- 
Jeff Duda
Post-doctoral research associate
University of Oklahoma School of Meteorology
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20160712/a088d318/attachment-0001.html 


More information about the gradsusr mailing list