I have a FORTRAN 77 program code. I am using Fortran Power Station 4.0 on Windows. It is a very long Finite element method code.
The code is the following :
1 Main Program starts with
PARAMETER (HLENGTH=600.0,VLENGTH=600.0,NHELE=6,NVELE=6,NTYPE=1)
PARAMETER (DENSITY=2.78E-6,POISON=0.34,THICK=1.0,EMODULE=6.87E4)
PARAMETER (NTOTALNODE=(NHELE+1)*(NVELE+1))
PARAMETER (NHNODE=NHELE+1,NVNODE=NVELE+1)
PARAMETER (MK=(NTOTALNODE-2*NHNODE-2*(NVNODE-2))*5)
PARAMETER (DELTAH=(HLENGTH+0.0)/(NHELE+0.0))
PARAMETER (DELTAV=(VLENGTH+0.0)/(NVELE+0.0))
DIMENSION NODEMATRIX(NTOTALELE,4)
REAL*8 STIFFMATRIX(20,20),MASSMATRIX(20,20)
REAL*8 STIFFMATR开发者_如何学GoIXS(20,20),MASSMATRIXS(20,20)
DIMENSION NODEROWT(4),NODEROWT2(20)
DIMENSION NM(NVNODE,NHNODE)
REAL*8 GSM(NTOTALNODE*5,NTOTALNODE*5),NCARRIER(MK),
&GMM(NTOTALNODE*5,NTOTALNODE*5),AA(MK,MK),BB(MK,MK)
CALL STIFFMAT(STIFFMATRIX,DELTAV,DELTAH,THICK,EMODULE)
CALL MASSMAT(MASSMATRIX,DELTAV,DELTAH,THICK,DENSITY)
CALL STIFFMATS(STIFFMATRIXS,DELTAV,DELTAH)
CALL MASSMATS(MASSMATRIXS,DELTAV,DELTAH,DENSITY)
.
.
.
. etc
2 - The Subroutins are starts as following:
SUBROUTINE STIFFMAT(STIFFMATRIX,DELTAV,DELTAH,THICK,EMODULE)
REAL*8 STIFFMATRIX(20,20),B(6,20),BT(20,6),D(6,6)
REAL*8 CC(5),ZETAM(5),ETAM(5),CA,CB,ZETA,ETA,SUM,SUM2,SUM3
.
.
.etc
SUBROUTINE MASSMAT(MASSMATRIX,DELTAV,DELTAH,THICK,DENSITY)
REAL*8 MASSMATRIX(20,20),B(5,20),BT(20,5),D(5,5)
REAL*8 CC(5),ZETAM(5),ETAM(5),CA,CB,ZETA,ETA,SUM,SUM2,SUM3
.
.
.etc
SUBROUTINE MASSMATS(MASSMATRIXS,DELTAV,DELTAH,DENSITY)
REAL*8 MASSMATRIXS(20,20),B(5,20),BT(20,5),D(5,5),IS,JS,AS
REAL*8 CC(5),ZETAM(5),CA,ZETA,ETA,SUM,SUM2,SUM3
.
.
.etc
SUBROUTINE STIFFMATS(STIFFMATRIXS,DELTAV,DELTAH)
REAL*8 STIFFMATRIXS(20,20),B(3,20),BT(20,3),D(3,3)
REAL*8 CC(5),ZETAM(5),CA,ZETA,ETA,SUM,SUM2,SUM3
.
.
.etc
When I press the compile command it shows me the following message :
fatal error F1002: compiler is out of heap space in pass 2
I Googled the problem, and found the following solutions
But I did not understand the solution!
I do not know how to change the Zi
option, where I can find it?
I think my code is good and clear. Does any one have any suggestions to solve this problem?
If the project workspace is placed in nested folders resulting in large path, then powerstation compiler shows this error. The solution for this, is to reduce the path of the project workspace by placing it closer to c drive , for example in my documents folder.
There is only so much help that can be given over the internet. And only so much that can be done with an outdated product (MS Fortran Power Station) for which you lack the documentation. I have several suggestions. Get a modern compiler. With your computer experience, and since you are using MS Windows, you would probably do best with a commercial product such as Intel Visual Fortran Compiler for Windows.
There may be an educational discount. There is probably a trial download (timed demo). If you still have difficulties (installing, compiling your program, etc.), offer some money to a undergraduate who is good with computers to help you for a couple of hours. I also suggest learning Fortran 95. You can gradually switch from FORTRAN 77 to Fortran 95 since the languages are compatible. Fortran 95 is a more capable language. It also has features that better allow compilers to find programmer mistakes, speeding the development process.
From the link you provided:
There are three different ways to resolve these problems:
Reorder the structure. Putting small items first often eliminates both errors. -or-
Use one-character-long member names. -or-
Recompile without -Zi.
If you're compiling with the -Zi parameter, take the parameter off.
If that doesn't work, reorder the structure. That means putting the smaller individual INTEGER, FLOAT, etc. elements towards the front of the program, followed by the Array declarations.
If that doesn't work, your program is too large for Fortran power station.
I have a similar problem when I make the "Project Workspace" name too long. Use short "Project Workspace" name.
精彩评论