|
[Sponsors] |
May 4, 2004, 16:50 |
f77-g77
|
#1 |
Guest
Posts: n/a
|
I found that the f77 and g77 compilers values differing in precison from 8th digit..any idea why?
|
|
May 5, 2004, 05:46 |
Re: f77-g77
|
#2 |
Guest
Posts: n/a
|
From your question, my assumptions are:
1) You are using Linux. 2) You have a choice between 2 compilers, one of which is a proprietary FORTRAN compiler (e.g. from Absoft). The other is the native g77. If this is the case, you are bound to get different results, since g77 is a wrapper around f2c and as such, isn't really a FORTRAN compiler at all. One thing you'll find when using f2c to convert/compile FORTRAN code is that the order of evaluation changes. This can affect precision. Also in expressions like: IF(A .and. B) expression B will always be evaluated with a FORTRAN compiler, but only if A is true if you use f2c. - Steve |
|
May 6, 2004, 14:28 |
Re: f77-g77
|
#3 |
Guest
Posts: n/a
|
Your information on g77 is old. It is a front-end to gcc:
http://gcc.gnu.org/onlinedocs/g77/Wh...-Fortran-.html This does not mean that the f2c stuff is totally gone, but g77 is *not* just a wrapper around f2c. jason |
|
May 7, 2004, 19:27 |
f77-g77
|
#4 |
Guest
Posts: n/a
|
Thanks for comments to both of you...I had run 1000s of iterations of my research code using g77...Perhaphs, I could have done better with a proprietery compiler....but I will broach another apparantly significant observation in the next message..it's not only the compiler..
|
|
May 8, 2004, 14:29 |
Re: f77-g77
|
#5 |
Guest
Posts: n/a
|
Since I did not originally say anything about your issue, I'll do that now. Different compilers do different things with the precision of constants - for example, if I want a double precision value for pi I could do something like:
pi=acos(-1.0) This will probably give different results using different compilers (proprietary or not). It probably shouldn't, but it does (and I am not sure what the standard says about this). There are usually switches that control what exactly is done with the "1.0" as an argument (is it a double or a single?). G77 is somewhat vulenerable to this issue, but it is not the worst I have seen. jason |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
fortran error for g77 compiler | vishwas | Main CFD Forum | 10 | January 30, 2006 18:16 |
Mixing Cup...F77 Code | Robin K | Main CFD Forum | 0 | July 9, 2005 18:39 |
g77 compiling option | Dario | Main CFD Forum | 1 | November 25, 2004 10:02 |
F77 Compile. | CFD User. | Main CFD Forum | 9 | November 19, 2004 15:58 |
How to use F77 compiler in Star-cd. | Jun Shen | Siemens | 1 | December 31, 2000 05:47 |