[J3] [EXTERNAL] [BULK] Is this conforming?
Clune, Thomas L. (GSFC-6101)
thomas.l.clune at nasa.gov
Tue Jun 3 19:07:47 UTC 2025
Hi Daniel,
Your LHS is a slice of i1, but i1 has not been allocated yet …
* Tom
[signature_2763519993]<https://www.nasa.gov/>
Thomas Clune
Lead, Software Infrastructure
Global Modeling and Assimilation Office
NASA Goddard Space Flight Center
MS 610.1
8800 Greenbelt RD, Greenbelt, MD 20771
Thomas.L.Clune at nasa.gov<mailto:Thomas.L.Clune at nasa.gov>
From: J3 <j3-bounces at mailman.j3-fortran.org> on behalf of Daniel Chen via J3 <j3 at mailman.j3-fortran.org>
Date: Tuesday, June 3, 2025 at 3:02 PM
To: General J3 interest list <j3 at mailman.j3-fortran.org>
Cc: Daniel Chen <cdchen at ca.ibm.com>
Subject: [EXTERNAL] [BULK] [J3] Is this conforming?
CAUTION: This email originated from outside of NASA. Please take care when clicking links or opening attachments. Use the "Report Message" button to report suspicious messages to the NASA SOC.
Hello,
Is the following code conforming?
```
module m
contains
integer function newLB (i1)
integer, allocatable :: i1(:)
allocatable newLB
i1 = [(i, i=1,5)]
newLB = ubound(i1,1) -2
end function
end module
use m
integer, allocatable :: i1(:)
i1(newLB(i1): newLB(i1)+2) = [1,2,3]
end
```
It seems OK to me as the standard requires the evaluation of all the `expr` within the `variable` to be done before any part of the `variable` is defined. But most of the compilers that I have access to segfault on this.
Thanks,
Daniel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20250603/54a01781/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 25179 bytes
Desc: image001.png
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20250603/54a01781/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 275 bytes
Desc: image002.png
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20250603/54a01781/attachment-0001.png>
More information about the J3
mailing list