In the code shown below, there is an erroneous declaration for three variables that are already in scope through USE association. The compiler flags only one of the three variables in its error message. If that variable is removed and the compiler is run again, the next re-declared variable is flagged. When such an error occurs while refactoring a large program, it would be more convenient for the compiler to flag all the re-declared variables the first time.
module par_C
double precision :: alpha = 0.139d0, eta = 0.008d0, tau, rhodh, dis
end module par_C
program pfinag
use par_C
integer neqn,i,j,n
double precision work, y, beta, rhop, dif, hd, t, tend
double precision rtol(1), atol(1), h
double precision tau, rhodh, dis ! ERROR, all are declared in module par_C
parameter (neqn=400)
dimension y(neqn),work(7*neqn)
integer iwork(12),idid
external finag
data beta /2.54d0/, rhop /0.3d0/, dif/0.010d0/
n=neqn
hd=200
dis=(hd*dif)**2
tau=-eta*beta
rhodh=rhop/(hd*dif)
iwork(1)=1
iwork(2)=1
iwork(3)=0
iwork(4)=0
y(1:n)=0.d0
t=0.0d0
tend=400.d0
rtol(1)=1d-6
atol(1)=rtol(1)
h=1d-4
write(6,*) 'Integration of the Finag problem'
call rock4(neqn,t,tend,h,y,finag,atol,rtol,work,iwork,idid)
write (8,'(es15.7)') (y(j), j=1,400,7)
end
The error message:
ERROR S:\LANG\ftn95\finag.F90 10: TAU has already been declared in MODULE PAR_C
I am requesting that similar error messages be issued for RHODH and DIS in a sigle run of the compiler. Thanks.