http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55022
Dominique d'Humieres <dominiq at lps dot ens.fr> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|WAITING |NEW
--- Comment #11 from Dominique d'Humieres <dominiq at lps dot ens.fr>
2013-02-07 14:57:40 UTC ---
I have reduced botwall.f90 to
!*==BOTWALL.spg processed by SPAG 6.55Dc at 09:26 on 23 Sep 2005
!
SUBROUTINE BOTWALL(Spx,Epx,Apy,Mxpx,U1,U2,U3,U4,Iv)
IMPLICIT REAL*8(A-H,O-Z)
PARAMETER (NX=150,NY=150)
DIMENSION U(NX,NY) , V(NX,NY) , RHO(NX,NY) , T(NX,NY) , E(NX,NY)
DIMENSION AS1(NX) , AS2(NX) , AS3(NY) , AS4(NY) , NX1(NX) , &
& NY1(NX)
DIMENSION NX2(NX) , NY2(NX) , SIG(NX) , P(NX,NY)
DIMENSION U1(NX,NY) , U2(NX,NY) , U3(NX,NY) , U4(NX,NY)
INTEGER Spx , Epx , Apy
REAL*8 NX1 , NX2 , NY1 , NY2 , MINlet(NY)
COMMON /BNDRY / U , V , P , RHO , T , E , AS1 , AS2 , AS3 , AS4 , &
& NX1 , NY1 , NX2 , NY2 , SIG , GMA , S0 , T0 , P0 ,&
& PE , HOO , RR , MINlet
!
TWX_0 = 272.77
E_0 = RR*TWX_0/(GMA-1.)
R_0 = 1.0/(TWX_0*RR)
A_0 = DSQRT(GMA*TWX_0*RR)
DO i = Spx , Epx
!
! BOTTOM WALL CONDITIONS FOR SUBSONIC FLOW
!
vn1 = U(i,Apy)*NX1(i) + V(i,Apy)*NY1(i)
P(i,Apy) = P(i,Apy)/DEXP(GMA*vn1/AS1(i))
U(i,Apy) = 0.0
V(i,Apy) = 0.0
T(i,Apy) = TWX_0
RHO(i,Apy) = P(i,Apy)*R_0
AS1(i) = A_0
E(i,Apy) = E_0
U1(i,Apy) = RHO(i,Apy)
U2(i,Apy) = 0.0
U3(i,Apy) = 0.0
U4(i,Apy) = RHO(i,Apy)*E_0
ENDDO
! print *, U1(Spx:Epx,Apy)
! print *, U2(Spx:Epx,Apy)
! print *, U3(Spx:Epx,Apy)
! print *, U4(Spx:Epx,Apy)
print *, U1(Spx:Spx+4,Apy)
print *, U2(Spx:Spx+4,Apy)
print *, U3(Spx:Spx+4,Apy)
print *, U4(Spx:Spx+4,Apy)
stop
CONTINUE
END
With the following compilation (gfc: gcc 4.8 r195848, gfortran: 4.7.2)
gfc -c -O2 -fgraphite-identity air_main.f90
gfortran -c -O2 -fgraphite-identity topwall.f90
gfortran -c -O2 -fgraphite-identity botwall_db.f90
gfc air_main.o botwall_db.o topwall.o
I get
1.2901579736800930 1.2901579736800932 1.2901579736800932
1.2901579736800932 1.2901579736800932
0.0000000000000000 0.0000000000000000 0.0000000000000000
0.0000000000000000 0.0000000000000000
0.0000000000000000 0.0000000000000000 0.0000000000000000
0.0000000000000000 0.0000000000000000
252499.99999999997 252500.00000000003 252500.00000000003
252500.00000000003 252500.00000000003
If I use
gfc -c -O2 -fgraphite-identity botwall_db.f90
gfc air_main.o botwall_db.o topwall.o
I get
1.2901579217165384 1.2000000476837158 1.2000000476837158
1.2000000476837158 1.2000000476837158
0.0000000000000000 6.5847860013093756E-016 -2.6339144005237502E-015
0.0000000000000000 7.7354314600658297E-015
0.0000000000000000 2.3705229604713751E-014 2.3705229604713751E-014
2.3705229604713751E-014 2.6300466964223820E-014
252500.00000000000 252500.00000000009 252500.00000000009
252500.00000000009 252500.00000000009
(In reply to comment #9)
> I'm sorry, but the reporter is going to have to reduce this significantly
> before we can debug this. This is a huge mess of spaghetti code with tons of
> global and common variables scattered throughout, as well as state being
> passed
> around in files.
>
> Dominique, please reduce this to the smallest amount of reproducible code, so
> we can attack this. Avoid reading and writing to files (as I see, these have
> only a minimal amount of data anyhow), and global variables if at all
> possible.
Well, I am only the reporter. The code is not mine and this makes the task to
reduce it while keeping the wrong code quite difficult (and cumbersome).
> Please only keep the code that is relevant to reproduce the problem.
I'll try to provide a self contained test, but not before the week-end.