This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/30029] New: variable not initialed shows non zero value
- From: "zig at fi dot infn dot it" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Nov 2006 14:22:43 -0000
- Subject: [Bug fortran/30029] New: variable not initialed shows non zero value
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following program gives a wrong number for bb
as shown in the output. This error doesn't come with
the g77 (and ifort).
It is enough to change something in the (small) program
to have the correct result (bb=0.)
c program test
real*4 ap(300,150),at(300,150),ap_x(300),at_x(300)
c
c~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ A. Initial quantities ~~~~
apr=116. !projectile mass
ata=116. !target mass, ata > apr
Ein=35. !lab. energy, (Coul subtracted?)
bin=sqrt(Ein/931.0) !initial proj. velocity,(v/c)
bcm_comp=50.*apr/(apr+ata)
write(6,*)'Ein,bin,bcm_comp',Ein,bin,bcm_comp
ds=0.2 !bin size in (fm) xand y
izmax=150
d_su=5. !@????
d_b=3. !@diffusness param?
R_pr=1.18*apr**0.33333
R_ta=1.18*ata**0.33333
ixymax=(R_ta+d_su)/ds !number of bins in x&y
ipxmax=(R_ta+2.*R_pr+d_su+d_b)/ds !@??? cos'e'??
ixmax=ixymax+ipxmax !@ cos'e'???
bmax=R_ta+R_pr+d_b !inpact parameter (dist. of closest app.)
jb_max=bmax/ds
jb_step=8
write(6,899)ixymax,izmax,ipxmax,ixmax,d_su
899 format(' ixymax,izmax,ipxmax,ixmax,d_su',4I5,f9.2)
write(6,*)bb
write(6,900)R_pr,R_ta,bb,bmax,jb_max
900 format('R_pr= ',f9.2,' R_ta=',f9.2,' bb= ',f9.2,' bmax',f9.2,I4)
C~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ B. Normalisation ~~~~~~~~~~
end
***************************************
OUTPUT:
gfortran test.f
a.out
Ein,bin,bcm_comp 35.00000 0.1938917 25.00000
ixymax,izmax,ipxmax,ixmax,d_su 53 150 126 179 5.00
-1.480721
R_pr= 5.75 R_ta= 5.75 bb= -1.48 bmax 14.51 72
***********************************************
gfortran -v
Using built-in specs.
Target: i386-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --enable-shared --enable-threads=posix
--enable-checking=release --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions
--enable-libgcj-multifile--enable-languages=c,c++,objc,obj-c++,java,fortran,ada
--enable-java-awt=gtk --disable-dssi --enable-plugin
--with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic
--host=i386-redhat-linux
Thread model: posix
gcc version 4.1.1 20061011 (Red Hat 4.1.1-30)
******************
does one need to state
--
Summary: variable not initialed shows non zero value
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: zig at fi dot infn dot it
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30029