- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello everybody
I have a problem with my Fortran simple program.
I am working on Compaq Visual Fortran, using Frotran 77 codes.
The program structure must be in this form , a main and subroutine because it is a part of a big program related to finite element method.
I have to enter the numbers of NHELE & NVELE as you can see in first statment.
The numbers must be 10000 & 10000 !!!
When I run the program stops and shows me the following messege:
forrt1: server <170>: program Exception - stack overflow
So I changed the required number much smaller till I reach 507 & 507 !!! , And it runs OK !!
but when I change it in to 508 & 508 >>> It stops again !! with the same messege.
I think the problem is about the Subroutine (NIGTEE) , because when i rearrange the program without it, every thing works fine.
I increased the stack size to maximum by project>>settings>>link>>output>>reserve & commit
but it didn't work also !!
how can I solve this problem ??
I will appreciate any help
My program ::
PARAMETER(NHELE=508,NVELE=508)
PARAMETER(NHNODE=NHELE+1,NVNODE=NVELE+1)
PARAMETER(NTOTALELE=NHELE*NVELE)
DIMENSION MELE(NTOTALELE,4)
CALL NIGTEE(NHELE,NVELE,NHNODE,NVNODE,NTOTALELE,MELE)
OPEN(UNIT=7,FILE='MeshNO For Rectangular.TXT',STATUS='UNKNOWN')
WRITE(7,500) ((MELE(I,J),J=1,4),I=1,NTOTALELE)
500FORMAT(4I20)
STOP
END
SUBROUTINE NIGTEE(NHELE,NVELE,NHNODE,NVNODE,NTOTALELE,MELE)
DIMENSION NM(NVNODE,NHNODE),NODE(4)
DIMENSION MELE(NTOTALELE,4)
KK=0
DO 20 I=1,NVNODE
DO 20 J=1,NHNODE
KK=KK+1
NM(I,J)=KK
20CONTINUE
KK=0
DO 30 I=1,NVELE
DO 30 J=1,NHELE
NODE(1)=NM(I,J)
NODE(2)=NM(I,J+1)
NODE(3)=NM(I+1,J+1)
NODE(4)=NM(I+1,J)
KK=KK+1
DO 50 II=1,4
50MELE(KK,II)=NODE(II)
30CONTINUE
RETURN
END
Thanks in Advance all
Ghazooo
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello everybody
I have a problem with my Fortran simple program.
I am working on Compaq Visual Fortran, using Frotran 77 codes.
The program structure must be in this form , a main and subroutine because it is a part of a big program related to finite element method.
I have to enter the numbers of NHELE & NVELE as you can see in first statment.
The numbers must be 10000 & 10000 !!!
When I run the program stops and shows me the following messege:
forrt1: server <170>: program Exception - stack overflow
So I changed the required number much smaller till I reach 507 & 507 !!! , And it runs OK !!
but when I change it in to 508 & 508 >>> It stops again !! with the same messege.
I think the problem is about the Subroutine (NIGTEE) , because when i rearrange the program without it, every thing works fine.
I increased the stack size to maximum by project>>settings>>link>>output>>reserve & commit
but it didn't work also !!
how can I solve this problem ??
I will appreciate any help
My program ::
PARAMETER(NHELE=508,NVELE=508)
PARAMETER(NHNODE=NHELE+1,NVNODE=NVELE+1)
PARAMETER(NTOTALELE=NHELE*NVELE)
DIMENSION MELE(NTOTALELE,4)
CALL NIGTEE(NHELE,NVELE,NHNODE,NVNODE,NTOTALELE,MELE)
OPEN(UNIT=7,FILE='MeshNO For Rectangular.TXT',STATUS='UNKNOWN')
WRITE(7,500) ((MELE(I,J),J=1,4),I=1,NTOTALELE)
500FORMAT(4I20)
STOP
END
SUBROUTINE NIGTEE(NHELE,NVELE,NHNODE,NVNODE,NTOTALELE,MELE)
DIMENSION NM(NVNODE,NHNODE),NODE(4)
DIMENSION MELE(NTOTALELE,4)
KK=0
DO 20 I=1,NVNODE
DO 20 J=1,NHNODE
KK=KK+1
NM(I,J)=KK
20CONTINUE
KK=0
DO 30 I=1,NVELE
DO 30 J=1,NHELE
NODE(1)=NM(I,J)
NODE(2)=NM(I,J+1)
NODE(3)=NM(I+1,J+1)
NODE(4)=NM(I+1,J)
KK=KK+1
DO 50 II=1,4
50MELE(KK,II)=NODE(II)
30CONTINUE
RETURN
END
Thanks in Advance all
Ghazooo
Hi.
I hope I can help.
Maybe the problem is in the precision You chose.
Your NM is an array with 507x507 elements and also MELE is a vector fo 507*507 elemnts: maybe You should declare them with higher precision.
Hope this helps, best regards
Herger
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There are other methods as well, these are the most common. Let me know if you need more help, but first try creating an interface block in the main program for the subroutine nigtee.
ron
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi ..
Don't worry about my loops .. It works fine :))
cosider my problem is only with this simple program.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi.
I hope I can help.
Maybe the problem is in the precision You chose.
Your NM is an array with 507x507 elements and also MELE is a vector fo 507*507 elemnts: maybe You should declare them with higher precision.
Hope this helps, best regards
Herger
Hi ..
I tryed that before but didn't solve the problem.
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There are other methods as well, these are the most common. Let me know if you need more help, but first try creating an interface block in the main program for the subroutine nigtee.
ron
Hello Sir ;
Thank you for your answer ... I think I've diagnosed the problem as you did .
The problem is with th subroutine NIGTEE.
Honestly , I don't know how to create the INTERFACE structure !! and Iam working with Fortran 77.
I will be very happy if you help me with that ..
Than you very much

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page