Hi to everybody. I have a question about stack overflow. Im vorking with Compaq Visual fortran. I'm using fortran 77. when the run of my code get to this subroutine:
SUBROUTINE reconstructionWcar
!
implicit none
INCLUDE 'PRICE2D.DIM'
!
integer i,j,jj,K,L,N,ste,M,Nok
REAL*8 Ax(MAXVAR,MAXVAR),Ay(MAXVAR,MAXVAR),An(MAXVAR,MAXVAR,3)
REAL*8 EIG(MAXVAR,MAXVAR,3),INV(MAXVAR,MAXVAR),OIokENO(0:3),
& NOTO(ne),Akl(ne,LL),DOG(LL,MAXVAR,7),CSmed(MAXVAR),
& EIGinv(MAXVAR,MAXVAR),BUTTA(MAXVAR),DOGcar(MAXVAR,LL,7,0:3),
& DOGENO(MAXVAR,7,0:3),OIweno(7),OIwenoRIGHE,SUMalphaW,
& alphaW(7),OIok(7),DOGcarWENO(MAXVAR,LL),omegaW(7),OIeno(0:3)
& ,OIenoRIGHE,MAXIM ,
& DOGok(MAXVAR,LL,MAXELE)
RETURN
END
MAXVAR is a parameter(=10000), LL and Ne are 2 common variables,all of them declared in the included 'PRICE2D.DIM' file, as well the COMMON declaration are all in that file. I deleted everything, i left just the declaration and it gives me a stack overflow error when it arrives at the last line of declaration( variable DOGok(MAXVAR,LL,MAXELE)). if i cancel the variable DOGok it works. In Project -> Settings => Link -> Project Options I tried to set /stack:2000000 or even up to /stack:2000000000 but i still have the error. So at the end i thought i have really the maximum allowed stack . But at the end i tried to declare DOGok(MAXVAR,MAXLL,MAXELE) instead of DOGok(MAXVAR,LL,MAXELE) where MAXLL is a parameter(=40) and i got rid of the error! i don't understand why!!!!! in fact LL in my particular runs is 3!!!!and at maximum it can be 40, but now it is just three!and when debugging i checked his value out and it is 3!!!! why with a parameter = 40 works and with a variable =3 does not?
thanks so muck
venexiano
SUBROUTINE reconstructionWcar
!
implicit none
INCLUDE 'PRICE2D.DIM'
!
integer i,j,jj,K,L,N,ste,M,Nok
REAL*8 Ax(MAXVAR,MAXVAR),Ay(MAXVAR,MAXVAR),An(MAXVAR,MAXVAR,3)
REAL*8 EIG(MAXVAR,MAXVAR,3),INV(MAXVAR,MAXVAR),OIokENO(0:3),
& NOTO(ne),Akl(ne,LL),DOG(LL,MAXVAR,7),CSmed(MAXVAR),
& EIGinv(MAXVAR,MAXVAR),BUTTA(MAXVAR),DOGcar(MAXVAR,LL,7,0:3),
& DOGENO(MAXVAR,7,0:3),OIweno(7),OIwenoRIGHE,SUMalphaW,
& alphaW(7),OIok(7),DOGcarWENO(MAXVAR,LL),omegaW(7),OIeno(0:3)
& ,OIenoRIGHE,MAXIM ,
& DOGok(MAXVAR,LL,MAXELE)
RETURN
END
MAXVAR is a parameter(=10000), LL and Ne are 2 common variables,all of them declared in the included 'PRICE2D.DIM' file, as well the COMMON declaration are all in that file. I deleted everything, i left just the declaration and it gives me a stack overflow error when it arrives at the last line of declaration( variable DOGok(MAXVAR,LL,MAXELE)). if i cancel the variable DOGok it works. In Project -> Settings => Link -> Project Options I tried to set /stack:2000000 or even up to /stack:2000000000 but i still have the error. So at the end i thought i have really the maximum allowed stack . But at the end i tried to declare DOGok(MAXVAR,MAXLL,MAXELE) instead of DOGok(MAXVAR,LL,MAXELE) where MAXLL is a parameter(=40) and i got rid of the error! i don't understand why!!!!! in fact LL in my particular runs is 3!!!!and at maximum it can be 40, but now it is just three!and when debugging i checked his value out and it is 3!!!! why with a parameter = 40 works and with a variable =3 does not?
thanks so muck
venexiano