Hi guys,
I'd like to split up my fortran program into several functions but I need to be able to pass arrays to these functions.
Right now I've got this:
I realise this isn't right but I don't know what I'm supposed to be doing with functions - I was told that Fortran deals with memory and arrays very differently to C which I'm used to.
x, y and z are arrays of a certain length which need to be acted upon in the function.
Can anyone help?
I'd like to split up my fortran program into several functions but I need to be able to pass arrays to these functions.
Right now I've got this:
Code:
PROGRAM test1
IMPLICIT NONE
...
real x(maxpoints), y(maxpoints), z(maxpoints)
...
END PROGRAM test1
FUNCTION distance(x, y, z)
write(*,*) 'Hello'
END FUNCTION distance
I realise this isn't right but I don't know what I'm supposed to be doing with functions - I was told that Fortran deals with memory and arrays very differently to C which I'm used to.
x, y and z are arrays of a certain length which need to be acted upon in the function.
Can anyone help?