For instance, consider a module with the following general structure:
module test
implicit none
contains
function f(x)
...
end function f
subroutine sub()
...
y = f(x)
...
end subroutine
end module test
As such this is incorrect, as is doing something similar inside a program
(internal procedures can not reference each other). When I tested it in an module, I still get the same error. Presently I am putting f
outside the module, and it works. The reason I am not satisfied with that is I want f
to be available to programs that use test; now it is available only to the procedures that are defined inside this module file.