is it a bug?

Arne Moe arnem@stud.ntnu.no
Tue May 22 02:28:00 GMT 2001


Hi,

I am having a problem with the code pasted below.

In the first loop, the line

v_old(i) = v(i)

causes the undesired effect:

ds(i-2) = v(i)

h, h_old, v, v_old and ds are properly declared, and the exchange from the
higher level routine is performed correctly. The code has been
successfully compiled on an other compiler (I'm afraid I don't know
which).

The entire program, including an input file (i.inp) and my makefile can be
found at www.stud.ntnu.no/~arnem/download/
The main program unit is called nis2.f

This error almost seems too stupid to be a compiler bug; can there be any
other explanation? (I have a fairly new Red Hat Linux distribution on a
166MHz, 98Mb ram pc; the hardware should be ok...). If it isn't a bug, I'm
sorry to trouble you!


Have a nice day!

yours sincerely
Arne Moe


*******************************************************************


      Subroutine p2a(h, h_old, v, v_old, w, ds,
     &     kappaxz, kappaxy, phi, ge)


      Implicit None
      Include 'parameter.f'
c     parameter.f contains parameter declarations, e.g. nmax.

      Logical too_fast
      Integer tail, front, i

      Real ds(nmax)
      Real h(nmax), h_old(nmax)
      Real v(nmax), v_old(nmax)

      Real vt(nmax), r(nmax)
      Real w(nmax), kappaxz(nmax), kappaxy(nmax), phi(nmax)
      Real dh_dt(nmax), dv_dt(nmax), dwhv_dx(nmax)
      Real F1(nmax), F2(nmax), F3(nmax), F4(nmax)
      Real G1(nmax), G2(nmax), G3(nmax), G4(nmax)
      Real wfunc, vterm, rho, b, m0, m1_d, m2, expn, dt
      Real time, ge(nmax)

      Common /c_too_fast/ too_fast
      Common /c_tailfront/ tail, front
      Common /c_material/ rho, b, m0, m1_d, m2, expn
      Common /c_dt/ dt,   /c_r/ r
      Common /c_vt/ vt
      Common /c_time/ time

      Intrinsic Amin1
      External dhdt, dvdt, vterm


      Do i = tail, front
         h_old(i) = h(i)
         v_old(i) = v(i)   	!also causes: ds(i-2) = v(i)
         print *,'p2a, line 77; i, ds(i), ds(10): ',i, ds(i), ds(10)
      EndDo

      Do i = tail, front
         print *,'p2a, line 81; i, ds(i): ', i, ds(i)
      EndDo
      Read *





arne moe
trettebakken 10, 0755 oslo
tlf.  99 44 37 88 (kostbare mobiltelefonen)
eller 22 02 31 68 (kontoret)
"folkeskikk er gratis"




More information about the Gcc-bugs mailing list