I will tweet https://twitter.com/fortrantip about the block construct, a
neat
feature of Fortran 2008. A similar feature to discuss is the internal procedure.
I don't use internal procedures often, since with host association it is
not
clear what the inputs and outputs are, and since they don't foster
modularity when they cannot be called except from the enclosing unit.
What are the benefits of internal procedures? What are some common use
cases?
"Beliavsky" wrote in message
What are the benefits of internal procedures? What are some common use cases?A common use case for me is to perform integration of a parameterized integrand. The enclosing subprogram sets the parameters in its local variables and passes a procedure pointer to the internal function as an actual argument to the integration procedure. When that procedure
invokes the internal procedure it gets the values of the parameters via
host association. This works in parallel code as well, provided the local variables don’t have the SAVE attribute.
"Beliavsky" wrote in message news:5c3eb8e9-e3b6-41d8-81e2-b353296381f7n@googlegroups.com...
I will tweet https://twitter.com/fortrantip about the block construct, a
neat
feature of Fortran 2008. A similar feature to discuss is the internal
procedure.
I don't use internal procedures often, since with host association it is
not
clear what the inputs and outputs are, and since they don't foster
modularity when they cannot be called except from the enclosing unit.
What are the benefits of internal procedures? What are some common use
cases?
A common use case for me is to perform integration of a parameterized integrand. The enclosing subprogram sets the parameters in its local variables and passes a procedure pointer to the internal function as an actual argument to the integration procedure. When that procedure
invokes the internal procedure it gets the values of the parameters via
host association. This works in parallel code as well, provided the local variables don’t have the SAVE attribute.
What are the benefits of internal procedures? What are some common use cases?
James Van Buskirk <not_valid@comcast.net> schrieb:
A common use case for me is to perform integration of a parameterized integrand. The enclosing subprogram sets the parameters in its local variables and passes a procedure pointer to the internal function as an actual argument to the integration procedure. When that procedure
invokes the internal procedure it gets the values of the parameters via host association. This works in parallel code as well, provided the
local
variables don’t have the SAVE attribute.
One problem is that this does not work from a normal module procedure.
"Thomas Koenig" wrote in message news:svkfea$p06$1@newsreader4.netcologne.de...
James Van Buskirk <not_valid@comcast.net> schrieb:
A common use case for me is to perform integration of a parameterized
integrand. The enclosing subprogram sets the parameters in its local
variables and passes a procedure pointer to the internal function as an
actual argument to the integration procedure. When that procedure
invokes the internal procedure it gets the values of the parameters via
host association. This works in parallel code as well, provided the
local
variables don’t have the SAVE attribute.
One problem is that this does not work from a normal module procedure.
Unless you are allowed the use of thread local storage...
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 159 |
Nodes: | 16 (0 / 16) |
Uptime: | 99:57:48 |
Calls: | 3,209 |
Files: | 10,563 |
Messages: | 3,009,979 |