Fortran Warning Fixes, master branch (2022.03.22.)
Made sure that all DO
-loops would end in a CONTINUE
statement, and that nested DO
-loops would not share the same CONTINUE
statement. Which apparently are both removed as a possibility from Fortran 2018.
Note that there are a number of places in the code that used to look like the following:
DO 10 I=1,10
DO 10 J=1,10
...
IF (<SOMETHING>) GOTO 10
...
10 CONTINUE
I have no idea how this should be fixed.
DO 10 I=1,10
DO 20 J=1,10
...
IF (<SOMETHING>) GOTO 10
...
20 CONTINUE
10 CONTINUE
or
DO 10 I=1,10
DO 20 J=1,10
...
IF (<SOMETHING>) GOTO 20
...
20 CONTINUE
10 CONTINUE
??? I went with the latter one in this MR. But somebody more versed in Fortran should really speak up...
This is meant as a replacement for !51454 (closed), fixing/addressing AGENE-2140 and ATLINFR-4464.
Pinging @fwinkl as well, just for good measure.
Merge request reports
Activity
added review-pending-expert label
This merge request affects 1 package:
- Generators/Hijing_i
This merge request affects 6 files:
- Generators/Hijing_i/src/Hijing_modified/aran9.f
- Generators/Hijing_i/src/Hijing_modified/attrad.f
- Generators/Hijing_i/src/Hijing_modified/hijfrg.f
- Generators/Hijing_i/src/Hijing_modified/hijing.f
- Generators/Hijing_i/src/Hijing_modified/quench.f
- Generators/Hijing_i/src/Hijing_modified/vegas.f
added Generators master review-pending-level-1 labels and removed review-pending-expert label
added review-pending-expert label and removed review-pending-level-1 label
So... I actually went ahead, and wrote this little test:
PROGRAM do_test IMPLICIT NONE INTEGER I,J DO 10 I=1,5 DO 10 J=1,5 IF ((I.GT.2).AND.(J.GT.2)) GOTO 10 WRITE (*,*) "I=",I,"J=",J 10 CONTINUE STOP END
It produces the following output:
[bash][atspot01]:AGENE-2140 > gfortran test.F [bash][atspot01]:AGENE-2140 > ./a.out I= 1 J= 1 I= 1 J= 2 I= 1 J= 3 I= 1 J= 4 I= 1 J= 5 I= 2 J= 1 I= 2 J= 2 I= 2 J= 3 I= 2 J= 4 I= 2 J= 5 I= 3 J= 1 I= 3 J= 2 I= 4 J= 1 I= 4 J= 2 I= 5 J= 1 I= 5 J= 2 [bash][atspot01]:AGENE-2140 >
So logically the goto statement jumps at the end of the "inner loop" in this setup. Which is not necessarily what I would've thought...
- Resolved by Attila Krasznahorkay
CI Result SUCCESS (hash b1fcdaea)Athena AthSimulation AthGeneration AnalysisBase AthAnalysis DetCommon externals cmake make required tests optional tests Full details available on this CI monitor view. Check the JIRA CI status board for known problems
Athena: number of compilation errors 0, warnings 0
AthSimulation: number of compilation errors 0, warnings 0
AthGeneration: number of compilation errors 0, warnings 0
AnalysisBase: number of compilation errors 0, warnings 0
AthAnalysis: number of compilation errors 0, warnings 0
DetCommon: number of compilation errors 0, warnings 0
For experts only: Jenkins output [CI-MERGE-REQUEST-CC7 48917]Since my Fortran knowledge goes to zero I am going with the MR that increases the entropy (number of changed lines) by the least amount. So this one here wins over !51454 (closed).
mentioned in commit c14034cf
added sweep:ignore label