common lena,np,nps
np=2;nps=3; lena=0
i=1;i1=0 ; call jkz(i,i1)
end
recursive subroutine jkz(i9,ir)
common lena,np,nps
print*,"i9",i9," ir",ir
if (i9<nps+1) then ; if (i9<nps) then ; if (i9<nps-1) then ; do ii=0,min(np,2*np-ir)
m1=i9+1;m2=ir+ii;call jkz(m1,m2) ; enddo; else ; do ii=max(0,np-ir),min(np,2*np-ir)
m1=i9+1;m2=ir+ii;call jkz(m1,m2) ; enddo; endif ; else
if (nps<4) then ; lena=lena+1; print*,"lena",lena
endif ; endif ; endif ; end
Now this works ok but if just put add to both common statements ii that is
common lena,np,nps,ii
in both places
then it goes into an endless loop which ofcourse it should not because that should have NO effect whatsoever. Get the same compiling error when use the equivalent as a module with NO common statements. Is anyone else having this same error from the gfortran compiler ? i even tried after the common statement in the subroutine
; save ii
then get the ridicuolus bogus error message from the compiler: COMMON attribute confllicts with save in 'ii'
What about any other compilers anyone is using ? like Intel etc. I trust they don't have this error ?
np=2;nps=3; lena=0
i=1;i1=0 ; call jkz(i,i1)
end
recursive subroutine jkz(i9,ir)
common lena,np,nps
print*,"i9",i9," ir",ir
if (i9<nps+1) then ; if (i9<nps) then ; if (i9<nps-1) then ; do ii=0,min(np,2*np-ir)
m1=i9+1;m2=ir+ii;call jkz(m1,m2) ; enddo; else ; do ii=max(0,np-ir),min(np,2*np-ir)
m1=i9+1;m2=ir+ii;call jkz(m1,m2) ; enddo; endif ; else
if (nps<4) then ; lena=lena+1; print*,"lena",lena
endif ; endif ; endif ; end
Now this works ok but if just put add to both common statements ii that is
common lena,np,nps,ii
in both places
then it goes into an endless loop which ofcourse it should not because that should have NO effect whatsoever. Get the same compiling error when use the equivalent as a module with NO common statements. Is anyone else having this same error from the gfortran compiler ? i even tried after the common statement in the subroutine
; save ii
then get the ridicuolus bogus error message from the compiler: COMMON attribute confllicts with save in 'ii'
What about any other compilers anyone is using ? like Intel etc. I trust they don't have this error ?