View previous topic :: View next topic |
Author |
Message |
PPPO
Joined: 04 Nov 2012 Posts: 6
|
Posted: Fri Dec 14, 2012 6:50 am Post subject: FORTRAN ERROR |
|
|
Hi
"Access violation"
Anyone seen this error?
It occurs when trying to call subroutine:
 |
|
Back to top |
|
 |
khoshravan
Joined: 03 Dec 2012 Posts: 31
|
Posted: Fri Dec 21, 2012 11:07 am Post subject: Re: FORTRAN ERROR |
|
|
PPPO wrote: | Hi
"Access violation"
Anyone seen this error?
It occurs when trying to call subroutine:
 |
I have no idea what is the answer to this question is, but want to learn more from this question.
Is it possible to call subroutines only with their name without specifying their parameters? |
|
Back to top |
|
 |
IanLambley
Joined: 17 Dec 2006 Posts: 506 Location: Sunderland
|
Posted: Fri Dec 21, 2012 1:24 pm Post subject: |
|
|
Yes it is.
If the subroutine has no parameters, i.e. all data is passed to and from it by other means, such as comon, modules or files. If there are no parameters, you do not need the open and close brackets in the subroutine definition or in the call statement.
For functions with no parameters, you do need the open and close brackets in both the function definition and the statement which references the function.
Examples: Code: |
program test
real*8 a, john
call fred
a = john()
end
subroutine fred
print *, 'Executing subroutine FRED'
end
real*8 function john()
john = atan(0.7071d0)
end |
|
|
Back to top |
|
 |
|