[ncl-talk] Dimension size, for dimension number 0, of operands does not match

Vanúcia Schumacher vanucia-schumacher at hotmail.com
Mon May 11 12:29:31 MDT 2015


NCL users,

I need to calculate the correlation between two variables with different lat and lon. But when I try to calculate the significance test this correlation appears this error:
Dimension size, for dimension number 0, of operands does not match, can't continue

I understand that the error is due to DOF1 and dof2 have different sizes of lat and lon, but how could I solve it in this case?
My code:
....
 r   = escorc( t, t1 )   ; correlationcor= r(:,:,0,0)copy_VarCoords(t,cor)
; Calculate degrees of freedom for each time series pair; This estimates the dof in autocorrelated series.     siglvl = 0.05  dof1   = equiv_sample_size (t, siglvl,0)  dof2   = equiv_sample_size (t1, siglvl,0)
 ; For each grid point time series pair, choose the lesser abs value   dof  = where(abs(dof1).le.abs(dof2), dof1, dof2)   error line
  copy_VarCoords(cor,dof)
  rsig = rtest( cor, round(dof,3), 0)    ; r test NCL...

Variable: tType: floatTotal Size: 1944000 bytes            486000 valuesNumber of Dimensions: 3Dimensions and sizes:	[lat | 90] x [lon | 180] x [time | 30]
Variable: t1Type: floatTotal Size: 7920 bytes            1980 valuesNumber of Dimensions: 3Dimensions and sizes:	[lat | 6] x [lon | 11] x [time | 30]Coordinates: 
  Variable: rType: floatTotal Size: 4276800 bytes            1069200 valuesNumber of Dimensions: 4Dimensions and sizes:	[90] x [180] x [6] x [11]Coordinates: Number Of Attributes: 1
Variable: corType: floatTotal Size: 64800 bytes            16200 valuesNumber of Dimensions: 2Dimensions and sizes:	[lat | 90] x [lon | 180]

Variable: dof1Type: integerTotal Size: 64800 bytes            16200 valuesNumber of Dimensions: 2Dimensions and sizes:	[90] x [180]Coordinates: 
Variable: dof2Type: integerTotal Size: 264 bytes            66 valuesNumber of Dimensions: 2Dimensions and sizes:	[6] x [11]

 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150511/262572d1/attachment.html 


More information about the ncl-talk mailing list