"Dimension sizes of left hand and right hand side of assignment do not match"

From: Shaw, Michael <MICHAEL.SHAW_at_nyahnyahspammersnyahnyah>
Date: Thu Mar 11 2010 - 10:58:11 MST

Hello.

 

I'm using ncl 5.1.1. In a do loop that updates file names ("file" here) and reads from those files, I am trying to

 

vars = asciiread(file,-1,"string")

var_of_interest=stringtofloat(str_get_cols(vars,beg_col,end_col))

 

However, I get the "Dimension sizes of left hand and right hand side of assignment do not match" at the line number for the "vars=asciiread..." after the first do loop iteration. It looks like this kind of thing is a pretty common problem to stumble upon (via googling for this), but when I try and implement the suggested fixes, they don't seem to work (e.g., deleting used arrays after they've been used, i.e., after the "var_of_interest=..." line, trying to do different things with the dimensioning/sizing of the vars, etc.).

 

Any suggestions?

 

Sample code:

 

"do i=0,9-1

 

ii=i+1

ic=new((/1/),string)

ic=ii

 

file="/home/"+ic

vars = asciiread(file,-1,"string")

var_of_interest = stringtofloat(str_get_cols(vars,28,30))

print(var_of_interest)

;delete(vars)

;delete(var_of_interest)

end do"

 

And it might be working on ascii files like one called "1" looking like:

 

"Bogus ascii file

blahblahblah 123

blahblahblah 321"

 

There might be 9 of these files, called "1" through "9".

 

Thanks!

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Mar 11 10:58:23 2010

This archive was generated by hypermail 2.1.8 : Thu Mar 11 2010 - 11:17:07 MST