Re: Error: Dimensions sizes of left hand and right hand

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Tue Aug 27 2013 - 12:28:32 MDT

The error is indicating that you have a variable that already exists, maybe "work" or "U850", and are trying to write a new array into that variable that is not the same size.

For example, if you try to do this:

x = (/1,2,3/)
x = (/1,2/)

You will get the error:

fatal:Dimension sizes of left hand side and right hand side of assignment do not match
fatal:["Execute.c":8504]:Execute: Error occurred at or near line 1

Note that "line 1" actually refers to the second line, because NCL line numbering starts at line 0.

I don't know whether "work" is the issue or "U850", but you can try three different things:

  1) Use a different variable name
 
   work2 = f->uwnd(iStrt:iLast,{plev850},{latS:latN},:)

  2) Delete the variable before you reassign it

  delete(work)
  work = f->uwnd(iStrt:iLast,{plev850},{latS:latN},:)

  3) Use ":=" if you have NCL version 6.1.2

    work := f->uwnd(iStrt:iLast,{plev850},{latS:latN},:)

I used "work" as the example but it may be "U850" that's the problem, so apply the same reasoning.

--Mary

On Aug 27, 2013, at 10:49 AM, marilia.gregorio@cptec.inpe.br wrote:

> When I use the mjoclivar_14.ncl script the following message appears:
>
> fatal:Dimension sizes of left hand side and right hand side of
> assignment do not match
> fatal:["Execute.c":8128]:Execute: Error occurred at or near line 69 in
> file mjoclivar_14.ncl
>
> the line 69 is:
>
> work = f->uwnd(iStrt:iLast,{plev850},{latS:latN},:)
> U850 = dim_avg_Wrap(work(time|:,lon|:,lat|:))
>
> printVarSummary(uwnd)
> Variable: uwnd
> Type: float
> Total Size: 789712560 bytes
> 197428140 values
> Number of Dimensions: 4
> Dimensions and sizes: [time | 12053] x [level | 1] x [lat | 91] x [lon | 180]
> Coordinates:
> time: [1569072..1858320]
> level: [850..850]
> lat: [90..-90]
> lon: [ 0..358]
> Number Of Attributes: 16
> standard_name : eastward_wind
> long_name : Daily U-wind on Pressure Levels
> units : m/s
> _FillValue_original : -32767
> _FillValue : -32767
> cell_methods : time: mean (of each 6-hourly interval) mean (of 4
> 6-hourly means)
> unpacked_valid_range : ( -280, 350 )
> actual_range : ( -107.25, 138.925 )
> precision : 2
> GRIB_id : 131
> GRIB_name : UGRD
> var_desc : u-wind
> dataset : NOAA-CIRES 20th Century Reanalysis version 2 Daily Averages
> level_desc : Pressure Levels
> statistic : Ensemble Mean
> parent_stat : Individual Obs
>
>
> Someone can help me?
> thanks
>
> marilia
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Aug 27 12:28:42 2013

This archive was generated by hypermail 2.1.8 : Fri Aug 30 2013 - 14:04:57 MDT