[J3] [EXTERNAL] Should ALLOCATED return True or False if ARRAY is zero-sized?
Reuben D. Budiardja
reubendb at ornl.gov
Mon Jul 14 13:31:40 UTC 2025
Hi Daniel,
Yes, ALLOCATED should return true even for zero-sized allocation.
Reuben
On 7/11/25 11:49, Daniel Chen via J3 wrote:
> Hello all, ``` real, allocatable :: r1(: ) allocate(r1(0)) print*,
> allocated(r1) end ``` The standard seems allowing allocating a
> zero-sized array ([9. 7. 1. 2 Execution of an ALLOCATE statement].
> Therefore, intrinsic ALLOCATED should return True
>
>
> Hello all,
>
> ```
> real, allocatable :: r1(:)
> allocate(r1(0))
> print*, allocated(r1)
> end
> ```
>
> The standard seems allowing allocating a zero-sized array ([9.7.1.2
> Execution of an ALLOCATE statement]. Therefore, intrinsic ALLOCATED
> should return True for this code.
> Is this conclusion correct?
>
> Thanks,
> Daniel
>
More information about the J3
mailing list