Catherine Moroney <[log in to unmask]> wrote:
...
>I recently saw this bit of code in a colleague's program and even though
>it's obviously a typo, I'm wondering how it even compiled in the first place
>and exactly what the compiler interpreted it as.
>
>I'm using SGI's F90 compilers, v7.2 and v7.3.
>
>real, dimension(size(ug_temp,1),size(ug_temp,2),size(ug_temp,3)) :: Z
>real, dimension(size(ug_temp,1),size(ug_temp,2),size(ug_temp+1,3)) :: radius
> ^^^^^^
Assuming that ug_temp is an array, the expression ug_temp+1
is also an array with the same shape. It will have a lower bound
in each dimension of 1 (regardless of the declared lower bound
of ug_temp). But, that's a very subtle point. It won't have any
consequences here.
--
J. Giles
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|