Quantcast
Channel: Intel® Fortran Compiler
Viewing all articles
Browse latest Browse all 3270

Passing Scalar to Array and Vice Versa

$
0
0

Hi - I have some old code that passes scalars to functions with arrays for the dummy arguments (other parts of the code pass arrays to arrays).

For example:

real a,b
a = 3
call FUNC([a],[b],1)

real FUNC (x,y,z)
real x(z), y(z)
y(i)=x(i)+3


Thanks to the forum, I was able to get the code to compile by adding brackets to the real arguments.  However, the value that the function return (b in the example) is always zero.

Any ideas?  Is there an equivalent to the brackets that turns the array of one into a scalar?

Thanks,

Andre


Viewing all articles
Browse latest Browse all 3270

Trending Articles