[ncl-talk] Error: dimension sizes of left and right hand side do not match

Toni Klemm toni-klemm at tamu.edu
Wed Oct 23 13:03:08 MDT 2019


Hello NCL Community,

I am perplexed by what seems to be a very simple error in my script (attached). I am analyzing gridded data for the U.S. Great Plains region and have divided the region into 6 parts, Northern, Central, and Southern Plains as well as each of them into east and west. 

After analyzing the data I am assembling everything to save in an output file, but for some reason this line in my code

ncdf->lat_2 = lat_2

gets this error message and the program crashes:

Dimension sizes of left hand side do not match right hand side

“lat_2” is the latitude dimension associated with the Central Plains data.

“lat_1” three lines above it does not get an error, but when I comment lat_2 out, then lat_3, three lines down, gets the same error.

I looked very carefully and changed the script in a number of ways, but I cannot find the reason for this error. lat_1 is longer than lat_2 and lat_3 (see below), but that shouldn’t be the reason.

I did a printVarSummary on all three, but it didn’t give me any clues:

Variable: lat_1
Type: float
Total Size: 676 bytes
            169 values
Number of Dimensions: 1
Dimensions and sizes:	[lat | 169]
Coordinates: 
            lat: [42..49]
Number Of Attributes: 2
  long_name :	latitude
  units :	degrees_north

Variable: lat_2
Type: float
Total Size: 580 bytes
            145 values
Number of Dimensions: 1
Dimensions and sizes:	[lat | 145]
Coordinates: 
            lat: [36..42]
Number Of Attributes: 2
  long_name :	latitude
  units :	degrees_north

Variable: lat_3
Type: float
Total Size: 580 bytes
            145 values
Number of Dimensions: 1
Dimensions and sizes:	[lat | 145]
Coordinates: 
            lat: [30..36]
Number Of Attributes: 2
  long_name :	latitude
  units :	degrees_north

Does anyone have a suggestion? I appreciate your help!

Tank you very much,
Toni


Toni Klemm, Ph.D.
Postdoctoral Research Associate
Department of Ecosystem Science and Management
College of Agriculture and Life Sciences
Texas A&M University, College Station, TX
www.toni-klemm.de <http://www.toni-klemm.de/> | @toniklemm <http://www.twitter.com/toniklemm>
Editorial Board member, Early Career Climate Forum <http://www.eccforum.org/>







-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20191023/4e931d82/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: NPP_future_extreme_frequency_intensity_2041_2065.ncl
Type: application/octet-stream
Size: 21583 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20191023/4e931d82/attachment.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20191023/4e931d82/attachment-0001.html>


More information about the ncl-talk mailing list