- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a somewhat large source code (Steve is a bit familiar with this one!). We usually compile it with "double precision" from the compiler. But before release, I also check out Single precision.
I had a double precision parameter that was causing some problems in the single precision compile as an argument. So, I made it a "Real" and then ran my usual double precision compile and run.
Finally -- to the disturbing part. It appears that this change to a "real" parameter but compiled "double precision" causes a change in results.
Is this a compiler problem? Is it a known compiler problem?
Linda
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For instance if the visible interface declares that parameter as type A but the actual function header says Type B, there will be problems!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I agree with grg99 that mismatched types are likely the problem. Try building with the /gen-interfaces and /warn:interfaces options (in VS these are on the External Procedures and Diagnostics pages) and see if the compiler finds anything to complain about.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nope, no joy there (that is, no warnings, errors, strikes, etc).
Very hard to nail down. What is happening is that some errors/warnings are being detected in the code.... (comparisons) but I think the results are the same in both instances.
I also had another developer report to me he had found differences in using LOG (intrinsic) vs DLOG with our double precision compile (so the arguments to both functions would have been double precision).
Linda
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is it possible that a few of the calculations require double precision? I.e., might you be looking for a small number calculated as the difference between two large ones somewhere? Do you have any natural ill-conditioners like large-scale equation solution or eigensolution?
Bruce
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
But I'm using all double precision in both compiles.
Am I not making clear the problem?
Linda
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry - I didn't get it. I guess the bit about single-precision compilation was irrelevant. You compile withdouble precision default reals and you get a difference if you change a REAL(8) declaration to a REAL declaration. Right?
Bruce
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yep, that's it.
The junk about single precision compiling was irrelevant.
Linda
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Linda, your problem interests me because I, too, have to maintain single- and double-precision versions of my software, due to the existence of a couple of dusty old Crays in Houston. Consequntly, I have to do the same type of thing that you're doing, and if there's a problem somewhere, I want to know where to look.
Apparently, you modified a single variable. Is there no way to work your way in to find the exact point at which the results changed?
Bruce

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