PROCEDURE declarations
Janus Weil
jaydub66@googlemail.com
Mon Aug 20 16:31:00 GMT 2007
Ok, I think I need some clarification on how to interpret the Fortran
2003 standard. In section 12.3.2.1 we find:
R1206 procedure-stmt is [ MODULE ] PROCEDURE procedure-name-list
C1207 (R1206) A procedure-name shall have an explicit interface and
shall refer to an accessible procedure pointer, external procedure,
dummy procedure, or module procedure.
C1208 (R1206) If MODULE appears in a procedure-stmt, each
procedure-name in that statement shall be accessible in the current
scope as a module procedure.
So if I define a procedure in a program, I suppose the standard says
the procedure must be external, and forbids this:
program x
procedure(real):: proc
contains
real function proc
proc=3.0
end function
end program
Is that right?
Now, for a module, can I do the following, or is it also forbidden?
module x
procedure(real):: proc
contains
real function proc
proc=3.0
end function
end module
Or is the correct syntax like this:
module x
module procedure(real):: proc
contains
real function proc
proc=3.0
end function
end module
I'm just a little confused right now. Which of these three examples is
valid Fortran 2003 and which is not?
Janus
More information about the Fortran
mailing list