To close this question I want to add that it is not exactly a problem of range (you can use numbers larger than 400**3 with real 32b), but a problem of discontinuity in the number representation. By step of one I reached the limit of 2**24 and adding one was not enough to change the exponent so...
After a few minutes it appears to me that the previous test was not relevant.
In fact, REAL 4 are coded on 32bits, 1 for the sign, 8 for the exponent and 23 for the fraction.
The maximum value given by my code is 16777216 = 2**24 => this explain the results.
Thanks for helping.
Thanks for the suggestions.
I want to say first that the objective is not to run this piece of code.
This is only a test code reproducing a behaviour that generates a problem in a larger one.
I'm testing a lot of hypothesis around this problem and the number of correct digits has been one...
Completely right.
I've deleted so many lines to look for the core of the problem that the initialisation line disappeared.
PROGRAM MODIF_GEOM3D
IMPLICIT NONE
INTEGER :: NX,NY,NZ,I
REAL(KIND=4) :: IVF1,IVF2
...
I've extracted from a larger code the following code where the DO loop is the cause of a bug:
PROGRAM MODIF_GEOM3D
IMPLICIT NONE
INTEGER :: NX,NY,NZ,I
REAL(KIND=4) :: IVF1,IVF2
! REAL(KIND=8)...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.