comp.lang.idl-pvwave archive - RDF feed
type: channel
description: Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
items: Array subscript for ARRAY must have same size as source expression
items: Re: Array subscript for ARRAY must have same size as source expression

Array subscript for ARRAY must have same size as source expression
type: item
description: Hello I have the following code: ArrayNEW = ArrayDATA FOR i=0, n-1 do begin A1[i,*,*] = A1_tmp A2[i,*,*] = A2_tmp ArrayNEW[i,*,*] = calculate(A1_tmp,A2_tmp,ArrayDATA[i,*,*]) endfor The dimensions of the arrays are as follow: A1_tmp FLOAT = Array[120, 4, 4] A2_tmp FLOAT = Array[120, 4, 4] ArrayDATA FLOAT = Array[120, 216, 216] ArrayNEW FLOAT = Array[120, 216, 216] calculate - it's a function which takes those arguments and interpolate the A1_tmp,A2_tmp to have the same dimensions as ArrayDATA. As I send these arguments to the function why they should have the same dimensions?
creator: g.nacarts
date: 2015-03-27T11:36:36-00:00

Re: Array subscript for ARRAY must have same size as source expression
type: item
description: You don't say at which line the error is occurring, or at which line you are displaying the data sizes. Certainly one suspicious place is > A1[i,*,*] = A1_tmp where A1_tmp FLOAT = Array[120, 4, 4] So you are trying to assign all 3 dimensions of A1_tmp into the last two dimensions of A1. Maybe you wanted subscripts for A1_tmp ? --Wayne On Friday, March 27, 2015 at 7:36:41 AM UTC-4, g.na...@gmail.com wrote: > Hello > > I have the following code: > > ArrayNEW = ArrayDATA > > FOR i=0, n-1 do begin > A1[i,*,*] = A1_tmp > A2[i,*,*] = A2_tmp > ArrayNEW[i,*,*] = calculate(A1_tmp,A2_tmp,ArrayDATA[i,*,*]) > endfor > > The dimensions of the arrays are as follow: > A1_tmp FLOAT = Array[120, 4, 4] > A2_tmp FLOAT = Array[120, 4, 4] > ArrayDATA FLOAT = Array[120, 216, 216] > ArrayNEW FLOAT = Array[120, 216, 216] > > calculate - it's a function which takes those arguments and interpolate the A1_tmp,A2_tmp to have the same dimensions as ArrayDATA. > > As I send these arguments to the function why they should have the same dimensions?
creator: wlandsman
date: 2015-03-27T12:59:29-00:00

Re: Array subscript for ARRAY must have same size as source expression
type: item
description: Yeah, you are right. No the error is occurring in this line ArrayNEW[i,*,*] = calculate(A1_tmp,A2_tmp,ArrayDATA[i,*,*])
creator: g.nacarts
date: 2015-03-27T13:24:06-00:00

Re: Array subscript for ARRAY must have same size as source expression
type: item
description: On Friday, March 27, 2015 at 9:24:07 AM UTC-4, g.na...@gmail.com wrote: > Yeah, you are right. No the error is occurring in this line > > ArrayNEW[i,*,*] = calculate(A1_tmp,A2_tmp,ArrayDATA[i,*,*]) Have you checked that the calculate() function is doing what you think it is doing?, i.e. after the program crashes, help, calculate(A1_tmp,A2_tmp,ArrayDATA[i,*,*])
creator: wlandsman
date: 2015-03-27T15:56:27-00:00