- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello fundis
I am working with a model that takes many hours to run, but stops unexpectedly before the end of the simulation period. I have no idea where or why in the simulation it stops, and though I can tell from the output at what time it does so that doesn't really help me pinpoint the problem.
I would love to hear that there is a way, perhaps in some sneaky project setting, to force the code to break before it ends, whether it ends with error or not...
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am not familiar with using exceptions (my programs do not crash in that manner).
Put write(*,*) to certain palces in your program to watch where problem occurs.
Jakub
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If it is console application put PAUSE before end. Program will wait to key.
Another possibility is to run rogram like
program>logfile
and alloutput to screen will be orwarded to logfile where you can look at your debuging messages you pu to your code.
if it is win32 window application you can use pause too or MessagBox
Jakub
- 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
I am not familiar with using exceptions (my programs do not crash in that manner).
Put write(*,*) to certain palces in your program to watch where problem occurs.
Jakub
- 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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In the IDE, go to project properties/Fortran/Run-time/Generate Traceback Information and set to yes.
Then go to project properties/Fortran/Floating-Point/Floating-Point Exception Handling
and select "Underflow gives 0.0; Abort on other IEEE exceptions (/fpe:0)"
Your program should then give a traceback, which should include routine names and source line numbers, for most errors, including for floating-point exceptions which would otherwise just have generated NaNs and continued.Your programwill still exit, but at least you'd know where.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
invoke "Break all" which will tell you where the program is
at the time you invoke it. You can then have it continue
execution from that point, and invoke it again as many
times as you need it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
To close a project you have to exit VS 2008, or open another one.
Is this intentional?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
your problem.
For example, if you multiply two integer(4) quantites together, even though they are
postive, you may get a negative result, and it is not trapped. The only way to catch that
is to test invidual computations, line by line.
It's not clear to me if the INTEL instruction set has a provision for detecting it in hardware.
Maybe later processors can do that.
So, is your program strictly floating point operations? One possible workaround is
to convert the F.P. variables to real(16). The range of those is really HUGE.

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