On Tuesday, August 10, 2004 11:55 AM +0200 Guylaine prat
<[log in to unmask]> wrote:
> I initialise some parameters with the intrinsic function epsilon, such as:
> in one module, I create:
> integer, parameter, public :: my_real = selected_real_kind(13)
>
> elsewhere, I initailise:
> real(my_real), parameter :: epsilon_machine = epsilon(1._my_real)
>
> By writing the value epsilon_machine, I obtain:
> 1.797693134862316E+308
>
> When I write directly in the code the value epsilon(1._my_real), I obtain
> the right result: 2.220446049250313E-016
>
> So, if someone can tell me if this code is ANSI compliant,
Errors such as this are typically caused by:
1. exceeding the bounds of an array;
2. exceeding the length of a string (i.e. substring errors);
3. incorrect passing of arguments to dummy arguments
(old method, and/or lack of explicit interfaces);
4. Uninitialized variables, and
5. Mis-spelled variables (do you have IMPLICIT NONE everywhere?)
You need to ensure that all interfaces are explicit (CONTAINS often helps),
and you need to enable all compiler checks (including checks for
inininitialized variables)
|