View previous topic :: View next topic |
Author |
Message |
louwee
Joined: 01 Mar 2006 Posts: 4
|
Posted: Wed Mar 01, 2006 12:30 pm Post subject: floating number out of range |
|
|
I am using FTN95 to compile my F77 codes. A strange thing happened:
a val defined as REAL*8 which is supposed to have a range of about +/- 1E+308. but in fact as far as the val is given a value larger than 1E+38, the compiler complains: " error 635 floating number out of range".
what happened to FTN95 here? It is supposed to support REAL*10, is it?
thank you. |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7927 Location: Salford, UK
|
Posted: Thu Mar 02, 2006 1:03 am Post subject: floating number out of range |
|
|
It is possible that the actual value is not what you think and is out of range.
Try stepping through the code with the debugger and look at the values used at the point where the error occurs.
Alternatively, if you can reproduce the problem in a few lines of code, you can post the code here.
|
|
Back to top |
|
|
louwee
Joined: 01 Mar 2006 Posts: 4
|
Posted: Thu Mar 02, 2006 12:20 pm Post subject: floating number out of range |
|
|
Thanks I found it is my mistake. Ever after I replaced 1.E+80 with 1.D+80, the problem is resolved. Sorry I am not quite familiar with Fortran yet. However, there comes another problem: it says "call to missing routine: _HOSTNM ..." when I run the executable. I noticed it did give a warning message when building it. What is this _HOSTNM routine?
Thank u once again. |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7927 Location: Salford, UK
|
Posted: Thu Mar 02, 2006 1:27 pm Post subject: floating number out of range |
|
|
You should search through your code for HOSTNM.
It might be a spelling mistake or, as it says, a routine that you have used but not defined.
|
|
Back to top |
|
|
louwee
Joined: 01 Mar 2006 Posts: 4
|
Posted: Thu Mar 02, 2006 3:39 pm Post subject: floating number out of range |
|
|
thanks, sorry I did not make it clear. i know what "hostnm" is. the code compiles fine under linux, but it seems like the routines like hostnm, getlog etc are not supported in the window version, are they? Or do you have corresponding routine to replace them in windows in FTN95?
thank you. |
|
Back to top |
|
|
JohnH
Joined: 26 Sep 2005 Posts: 13
|
Posted: Fri Mar 03, 2006 1:19 am Post subject: floating number out of range |
|
|
hostnm, getlog are not supported because they are not part of the Fortran 95 standard, nor were they part of the Fortran 77 standard either ! They would have been vendor "extensions" to the standard by your Linux compiler. It is always dangerous to include non standard source code, since the program then becomes unportable as you have found here. However with FTN95 you can use calls like getenv@ to get values of environmental variables, for instance using getenv@ to get the value of COMPUTERNAME might be able to replace your call to hostnm. |
|
Back to top |
|
|
louwee
Joined: 01 Mar 2006 Posts: 4
|
Posted: Fri Mar 03, 2006 10:21 am Post subject: floating number out of range |
|
|
it helps. thank you very much for information. |
|
Back to top |
|
|
|