This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

bug in g77



Hello:

I am trying to run some fortran codes requiring very large arrays (~ 1
gbyte).  When trying to compile a fortran code with a declared single
precision floating point array having a length of more than 134217727
using the command:

g77 test.f

I get the error message:
************************
test.f: In program `MAIN__':
test.f:21: 
         real testm(134217728)
              ^
Array `testm' at (^) is too large to handle
************************

where testm is the large array.  I am using redhat 7.0 with all redhat
updated rpms applied on a pentium III system with 2 gbytes of memory and
using the stock 2.2.16-22enterprise supplied with redhat 7.0.  g77 -v
yields

g77 version 2.96 20000731 (Red Hat Linux 7.0) (from FSF-g77 version 0.5.26
20000731 (Red Hat Linux 7.0))
Driving: g77 -v -c -xf77-version /dev/null -xnone
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs
gcc version 2.96 20000731 (Red Hat Linux 7.0)
 /usr/lib/gcc-lib/i386-redhat-linux/2.96/tradcpp0 -lang-fortran -v
-D__GNUC__=2 -D__GNUC_MINOR__=96 -D__GNUC_PATCHLEVEL__=0 -D__ELF__ -Dunix
-Dlinux -D__ELF__ -D__unix__ -D__linux__ -D__unix -D__linux
-Asystem(posix) -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__
-D__tune_i386__ /dev/null /dev/null
GNU traditional CPP version 2.96 20000731 (Red Hat Linux 7.0)
 /usr/lib/gcc-lib/i386-redhat-linux/2.96/f771 -fnull-version -quiet
-dumpbase g77-version.f -version -fversion -o /tmp/cctLM9TW.s /dev/null
GNU F77 version 2.96 20000731 (Red Hat Linux
7.0) (i386-redhat-linux) compiled by GNU C version 2.96 20000731 (Red Hat
Linux 7.0).
GNU Fortran Front End version 0.5.26 20000731 (Red Hat Linux 7.0)
 as -V -Qy -o /tmp/ccqD1l4I.o /tmp/cctLM9TW.s
GNU assembler version 2.10.90 (i386-redhat-linux) using BFD version
2.10.0.18
 ld -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -o /tmp/ccb360gx
/tmp/ccqD1l4I.o /usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../crt1.o
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../crti.o
/usr/lib/gcc-lib/i386-redhat-linux/2.96/crtbegin.o
-L/usr/lib/gcc-lib/i386-redhat-linux/2.96
-L/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../.. -lg2c -lm -lgcc -lc
-lgcc /usr/lib/gcc-lib/i386-redhat-linux/2.96/crtend.o
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../crtn.o
 /tmp/ccb360gx
__G77_LIBF77_VERSION__: 0.5.26 20000731 (prerelease)
@(#)LIBF77 VERSION 19991115
__G77_LIBI77_VERSION__: 0.5.26 20000731 (prerelease)
@(#) LIBI77 VERSION pjw,dmg-mods 19991115
__G77_LIBU77_VERSION__: 0.5.26 20000731 (prerelease)
@(#) LIBU77 VERSION 19980709

A test code is listed below.  thank you in advance for your help.

-- 
Steve Castillo

Professor and Department Head
Klipsch School of Electrical and Computer Engineering
New Mexico State University
scastill@nmsu.edu
(505)646-3117

C
c     PROGRAM CAPEX
c
c     Program Capex finds the capacitance
c     matrix for a system of wires having
c     a geometry specified by AMP specifications.
c     The kernal is integrated analytically.
c
c     The program first solves for the charge on
c     the wires assuming some voltage distribution
c     using the method of moments.  Point basis
c     functions and point matching is used.
c
c     Programmer :  Steven P. Castillo
c     Last Mod.  :  2/28/96
c     Language   :  Fortran 77
c     Libraries  :  linpack
c
c
      real x(15000),y(15000),z(11585,11585),g(15000),pi,wk(15000)
      real testm(134217728)
      real c(40,40), char(15000)
      real mo,im,mj,cap(40,40),l(40,40),nmax
      integer count1,count2,test,ipvt(15000)
      character*12 ctime, answer
      data ctime /'the time is'/
c
      write(*,*)'enter the number of conductors (even #)'
      read(*,*)n
      write(*,*)'enter the spacing'
      read(*,*)s
      write(*,*)'enter the conductor thickness'
      read(*,*)t
      write(*,*)'enter the number of basis functions per'
      write(*,*)'side of conductor '
      read(*,*)nb
      write(*,*)'Do you want the matrix output? (yes/no)'
      read(*,1000)answer
 1000 format(a)
c
      open(unit=1,file='result',status='unknown')
      open(unit=2,file='matrix',status='unknown')
      open(unit=3,file='solution',status='unknown')
      rewind(1)
      rewind(2)
      rewind(3)
c
c
c      write(*,*)'the start time is'
c      call gettim(ihr,imin,isec,i100th)
c      write(*,'(1x,a,i2.2,1h:,i2.2,1h:,i2.2,1h.,i2.2)')
c     >ctime,ihr,imin,isec,i100th
      s=s*.0254
      t=t*.0254
      pi=3.141592654
      uo=4.*pi*1.e-7
      eo=8.85e-12
      tpi=2.*pi
      fpi=4.*pi
      n2=n*2
      n4=n*4
      nt=n4*nb
      i5=4
      tb=t/nb
c
c     Fill x,y coordinate vectors.
c
      call geom(x,y,t,s,n,n2,n4,nb)
c
c
c
      count1=1
      count2=1
      do 15 i=1,nt
        if(i.ne.1)then
           test=count2
16         test=test-2
           if(test.eq.0)then
                ep1=y(i)-tb/2.
                ep2=y(i)+tb/2.
                g1=ep2*alog(ep2**2+x(i)**2)-2.*ep2+
     +          2.*x(i)*atan2(ep2,x(i))
                g2=ep1*alog(ep1**2+x(i)**2)-2.*ep1+
     +          2.*x(i)*atan2(ep1,x(i))
                g(i)=1./fpi/eo*(g1-g2)
                go to 17
           endif
           if(test.lt.0)then
                ep1=x(i)-tb/2.
                ep2=x(i)+tb/2.
                g1=ep2*alog(ep2**2+y(i)**2)-2.*ep2+
     +          2.*y(i)*atan2(ep2,y(i))
                g2=ep1*alog(ep1**2+y(i)**2)-2.*ep1+
     +          2.*y(i)*atan2(ep1,y(i))
                g(i)=1./fpi/eo*(g1-g2)
                go to 17
           endif
           go to 16
17         continue
        else
           g(i)=tb/tpi/eo*(alog(tb/2.)-1.)
        endif
        count1=count1+1
        if(count1.gt.nb)then
           count2=count2+1
           count1=1
        endif
15    continue
c
c     Fill impedence matrix.
c
      do 30 i=1,nt
        z(1,i)=tb/eo
30    continue
c
      do 40 j=2,nt
        count1=1
        count2=1
        do 45 i=1,nt
           if(i.eq.j)then
c     self term
                z(j,i)=tb/tpi/eo*(1-alog(tb/2.))+g(i)
                go to 46
c     non-self term
           else
20              test=count2
47              test=test-2
                if(test.eq.0)then
                   ep1=y(j)-y(i)+tb/2.
                   ep2=y(j)-y(i)-tb/2.
                   arg=abs(x(j)-x(i))
                   g1=ep2*alog(ep2**2+(x(j)-x(i))**2)-2.*ep2+
     +             2.*abs(x(j)-x(i))*atan2(ep2,arg)
                   g2=ep1*alog(ep1**2+(x(j)-x(i))**2)-2.*ep1+
     +             2.*abs(x(j)-x(i))*atan2(ep1,arg)
                   z(j,i)=g(i)+1./fpi/eo*(g1-g2)
                   go to 46
                endif
                if(test.lt.0)then
                   ep1=x(j)-x(i)+tb/2.
                   ep2=x(j)-x(i)-tb/2.
                   arg=abs(y(j)-y(i))
                   g1=ep2*alog(ep2**2+(y(j)-y(i))**2)-2.*ep2+
     +             2.*abs(y(j)-y(i))*atan2(ep2,arg)
                   g2=ep1*alog(ep1**2+(y(j)-y(i))**2)-2.*ep1+
     +             2.*abs(y(j)-y(i))*atan2(ep1,arg)
                   z(j,i)=g(i)+1./fpi/eo*(g1-g2)
                   go to 46
                endif
                go to 47
           endif
46         count1=count1+1
           if(count1.gt.nb)then
                count2=count2+1
                count1=1
           endif
45      continue
40    continue
c
c     Solve the system
c
c      if(answer.eq.'yes')then
c      do 100 i=1,nt
c        do 105 j=1,nt
c           write(2,*)i,j,z(i,j)
c105     continue
c        write(2,*)i,char(i)
c100   continue
c      endif
c      call sgefa(z,15000,nt,ipvt,info)
      job=1
c      call sgedi(z,15000,nt,ipvt,det,wk,job)
c      call sgesl(z,15000,nt,ipvt,char,0)
c      do 106 i=1,nt
c         write(3,*)i,char(i)
c 106     continue
         stop
c
c     Fill the generalized capacitance matrix for
c     the system.
c
      nmax=nb*4+1
      do 60 i=1,n
        do 65 j=1,n
           c(i,j)=0.
65      continue
60    continue
      count2=1
      count3=1.
      do 70 i=1,nt
        count1=1
        count=1.
        do 75 j=1,nt
c          if(j.ne.1)then
                c(count2,count1)=c(count2,count1)+z(i,j)*tb
c          endif
           count=count+1
           if(count.eq.nmax)then
                count=1.
                count1=count1+1
           endif
75      continue
        count3=count3+1.
        if(count3.eq.nmax)then
           count3=1.
           count2=count2+1
        endif
70    continue
c
c
c
      do 80 i=1,n
        do 85 j=1,n
           write(1,*)'c(',i,',',j,')=',c(j,i)
85      continue
80    continue
c
c     Compute the transmission line capacitance
c     matrix from the generalized capacitance
c     matrix with reference to the first
c     conductor.
c
      mo=0.
      do 200 i=1,n
        do 205 j=1,n
           mo=mo+c(i,j)
205     continue
200   continue
c
      do 210 i=2,n
        do 215 j=2,n
           im=0.
           do 220 i2=1,n
                if(i2.ne.i)then
                   im=im+c(i2,j)
                endif
220        continue
c
           mj=0.
           do 225 i2=1,n
                if(i2.ne.j)then
                   mj=mj+c(i,i2)
                endif
225        continue
c
           cap(i-1,j-1)=(c(i,j)*(mo-im-mj-c(i,j))-im*mj)/mo
           write(1,*)'cap(',i,',',j,')=',cap(i-1,j-1)
c
215     continue
210   continue
c
      call sgefa(cap,40,n-1,ipvt,info)
      job=1
      call sgedi(cap,40,n-1,ipvt,det,wk,job)
c     call linv1f(cap,n-1,10,l,0,wk,ier)
      do 230 i=1,n-1
        do 235 j=1,n-1
           cap(i,j)=cap(i,j)*eo*uo
           write(1,*)'l(',i,',',j,')=',cap(i,j)
235     continue
230   continue
c
c      write(*,*)'the finish time is'
c      call gettim(ihr,imin,isec,i100th)
c      write(*,'(1x,a,i2.2,1h:,i2.2,1h:,i2.2,1h.,i2.2)')
c     >ctime,ihr,imin,isec,i100th
c
      stop
      end
c
c     SUBROUTINE GEOM
c
c     Subroutine Geom fills the x and y vectors
c     for the AMP conector problem.
c
c     Last Mod:  2/5/85
c
      subroutine geom(x,y,t,s,n,n2,n4,nb)
c
      real x(1),y(1)
c
      no2=n/2
      count1=1.
      count2=1.
      x1=0.
      y1=0.
      i1=1
c
      do 10 i=1,n4
        x(i1)=x1
        y(i1)=y1
c
        if(count1.eq.1)then
           do 15 j=1,nb-1
                x1=x1+t/(nb+1)
                i1=i1+1
                x(i1)=x1
                y(i1)=y1
15         continue
           x1=x1+t/(nb+1)
           y1=y1+t/(nb+1)
        endif
c
        if(count1.eq.2)then
           do 20 j=1,nb-1
                y1=y1+t/(nb+1)
                i1=i1+1
                x(i1)=x1
                y(i1)=y1
20         continue
           x1=x1-t/(nb+1)
           y1=y1+t/(nb+1)
        endif
c
        if(count1.eq.3)then
           do 25 j=1,nb-1
                x1=x1-t/(nb+1)
                i1=i1+1
                x(i1)=x1
                y(i1)=y1
25         continue
           x1=x1-t/(nb+1)
           y1=y1-t/(nb+1)
        endif
c
        if(count1.eq.4)then
           do 30 j=1,nb-1
                y1=y1-t/(nb+1)
                i1=i1+1
                x(i1)=x1
                y(i1)=y1
30         continue
           x1=x1+s+t/(nb+1)
           y1=y1-t/(nb+1)
           count1=0.
        endif
        count1=count1+1
        i1=i1+1
c
        if(count2.eq.n2)then
           x1=x1-no2*s
           y1=y1+s
           count2=0.
        endif
        count2=count2+1
c
10    continue
c
      return
      end


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]