CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

f77-g77

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 4, 2004, 16:50
Default f77-g77
  #1
subhra
Guest
 
Posts: n/a
I found that the f77 and g77 compilers values differing in precison from 8th digit..any idea why?
  Reply With Quote

Old   May 5, 2004, 05:46
Default Re: f77-g77
  #2
Steve
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
  Reply With Quote

Old   May 6, 2004, 14:28
Default Re: f77-g77
  #3
jason
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
  Reply With Quote

Old   May 7, 2004, 19:27
Default f77-g77
  #4
dattsub
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..
  Reply With Quote

Old   May 8, 2004, 14:29
Default Re: f77-g77
  #5
jasond
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
  Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 14:11.