[J3] Is NULL(MOLD=allocatable) an allocatable variable?
Daniel C Chen
cdchen at ca.ibm.com
Thu Nov 14 21:21:49 UTC 2024
The standard describes the argument and the result of intrinsic NULL(MOLD) when MOLD is an allocatable variable as
“
Argument. …If MOLD is allocatable its allocation status may be allocated or unallocated. It need not be defined with a value.
Result Characteristics. If MOLD is present, the characteristics are the same as MOLD….
Result. The result is a disassociated pointer or an unallocated allocatable entity.
“
Does “allocatable entity” mean allocatable variable as the standard also says only variables and components can have the ALLOCATABLE attribute.
If so, it will make “ALLOCATE(NULL(MOLD))” a conforming code, which doesn’t seem right.
If not, what does “allocatable entity” mean? Can an “allocatable entity” have no ALLOCATABLE attribute?
Is the following code conforming? It really depends on the answer of the above question.
“
real, allocatable :: ra
call sub(NULL(ra))
Contains
Subroutine sub(arg)
real, allocatable :: arg
…
end subroutine
end
“
Thanks,
Daniel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20241114/a6a5ab7b/attachment.htm>
More information about the J3
mailing list