Re: Scope question (gfortran odd-man out)
- From: Paul van Delst <Paul.vanDelst@xxxxxxxx>
- Date: Mon, 02 Jul 2007 19:10:51 -0400
awgreynolds@xxxxxxxxxxxxx wrote:
Finally, here's the code that gfortran has problems with:
program main
call something
end
subroutine something
! integer i !correct results from gfortran depend on this statement
character lit*1,line*100
lit(i)=line(i:i)
i=1; n=5; line='PZ0R1'
if (internal(4)) stop
write(*,*) i
contains
logical function internal(j)
intent(in) j
do i=j,n
k=index('RE',lit(i)); if (k==0) cycle
if (i+1==n) exit
enddo
internal=k==0
end function
end
lnx:scratch : gfortran blah.f90
lnx:scratch : a.out
4
lnx:scratch :
what do you see when you run your example? What do you expect to see?
FWIW:
lnx:scratch : g95 blah.f90
lnx:scratch : a.out
4
lnx:scratch : lf95 blah.f90
Encountered 0 errors, 0 warnings in file blah.f90.
lnx:scratch : a.out
4
lnx:scratch : pgf90 blah.f90
lnx:scratch : a.out
4
cheers,
paulv
p.s. I assume the lit(i)=line(i:i) is an oversight since i isn't set yet?
--
Paul van Delst Ride lots.
CIMSS @ NOAA/NCEP/EMC Eddy Merckx
.
- Follow-Ups:
- Re: Scope question (gfortran odd-man out)
- From: James Giles
- Re: Scope question (gfortran odd-man out)
- From: awgreynolds
- Re: Scope question (gfortran odd-man out)
- References:
- Scope question (gfortran odd-man out)
- From: awgreynolds
- Re: Scope question (gfortran odd-man out)
- From: Steven G. Kargl
- Re: Scope question (gfortran odd-man out)
- From: awgreynolds
- Re: Scope question (gfortran odd-man out)
- From: glen herrmannsfeldt
- Re: Scope question (gfortran odd-man out)
- From: awgreynolds
- Scope question (gfortran odd-man out)
- Prev by Date: Re: Please help me understand my code
- Next by Date: Re: Scope question (gfortran odd-man out)
- Previous by thread: Re: Scope question (gfortran odd-man out)
- Next by thread: Re: Scope question (gfortran odd-man out)
- Index(es):
Relevant Pages
|