CFD Online Discussion Forums

CFD Online Discussion Forums (
-   Main CFD Forum (
-   -   A strange thing on Compaq Visual Fortran (

archdevil May 15, 2012 16:57

A strange thing on Compaq Visual Fortran
I have met a strange thing today by using CVF. First, I compiled the code by using Debug successfully, and program worked fine. Second I compiled the code by using release in order to earn a faster program, and the code was compiled successfully too, however, when I ran the program, it was hinted that "stack overflow", What is the difference between Debug and Release? Why the same code can be run under Debug but fail under Release? Did anyone know the similar problem? Thanks in advance.

mb.pejvak May 15, 2012 20:36

I had problem with "stack overflow" but I don't know what "release " means in fortran. but if you want to fix this problem you should increase amount of memory that fortran uses.
for that, follow this:
Project tab -> setting -> link -> set category to output -> on stack allocation set a number that it shows the volume of pc's memory that fortran uses.
in default fortran uses 300 mb, and you can increase it up 4gb.
I hope it is useful

cdegroot May 15, 2012 21:47

A lot of times a code won't crash when compiled in "debug" mode, I believe because it doesn't send a kill signal to the code so that if you are running in a debugger you can find the source of the error without the code dying on you. That is my interpretation anyways. I have noticed this many times with divide by zero errors. Under normal conditions the code will stop running but in debug more it just carries on with the NaN.

archdevil May 16, 2012 08:26

Dear mb.pejvak, Thank you for your reply. I followed your advice and increase number up to 4gb, but it didn't work. I don't know whether it is related to my operation system or not, what I used is CVF 6.7 with win7 system.

archdevil May 16, 2012 08:35

Dear cdegroot, Thank you for your reply. In fact I have run the same code in Unix system and compiled by ifort, it works fine and the results of debug and ifort are the same. I think ifort is very strict compiler and so I doubt there is something wrong with the setting of CVF.

FMDenaro May 16, 2012 11:00

Is a lot of time I didn't use CVF (is an old compiler now...), this error happened to me for memory reasons in the linker. You should increase the option of the linker.
Furthermore, what other options did you set in the compiler?

mb.pejvak May 16, 2012 20:06

unfortunately fortran has a lot of problem with Win 7 and vista. somebody instal some software (such as virtual machine or ....) in this OS that create a virtual win XP and then instal fortran on this virtual win. any way i found a good site that help me alot to fix my problem in fortran you can see it, maybe your problem will fix.

archdevil May 17, 2012 06:38

Dear mb.pejvak, Thank you very much, the website is wonderful.

All times are GMT -4. The time now is 22:07.