Richard Maine wrote:
> I won't say that the compiler couldn't have an error, but you simply
> have not shown enough for anyone to draw such a conclusion. It
> shouldn't take more than a few extra lines to show a complete,
> compilable and runable sample if the problem is simple.
Hello,
this is a simple program that I wrote and tested on different machine and compiler:
--------------------
program my_test
implicit none
integer, parameter :: my_real = selected_real_kind(13)
real(my_real), parameter :: epsilon_para = epsilon(1._my_real)
real(my_real):: epsilon_val
intrinsic epsilon
epsilon_val = epsilon(1._my_real)
write(*,*) 'epsilon_para = ', epsilon_para
write(*,*) 'epsilon_val = ', epsilon_val
end program my_test
--------------------
On a Linux machine with an Intel (ifort V8.0 demo version), I obtain the bad result as follow:
[LinuxIntel] >ifort -o pgme_essai pgme_essai.f90
[LinuxIntel] >./pgme_essai
epsilon_para = 1.797693134862316E+308
epsilon_val = 2.220446049250313E-016
When trying any of the following options (just to see because they must not have any
effect on this code): -r8, -r16, -real_size 32, -real_size 64, -real_size 128
I obtain exactly the same results ..
On the same Linux machine but with a pgf90 V 4.1-2 (Portland Group), with default options:
epsilon_para = 2.2204460492503131E-016
epsilon_val = 2.2204460492503131E-016
(although this compiler as a problem with the reshape function in a parameter initialization,
it seems not to have a problem with the use of the epsilon function in a parameter initialisation ...)
On a Sun computer with Forte f95 v6.2, with default options:
epsilon_para = 2.220446049250313E-16
epsilon_val = 2.220446049250313E-16
So is this kind of initialisation ANSI/ISO compliant or is the ifort v8.0 unable to deal with it ?
Thanks
Guylaine
|