On Fri, 14 Oct 2005, Michael E. Burke wrote:
> The snippet now reads:
>
> MODULE Triangle_Operations
> IMPLICIT NONE
> CONTAINS
> FUNCTION Area(x,y,z)
> REAL :: Area ! function type
> REAL, INTENT( IN ) :: x, y, z
> REAL :: theta, height
> theta = ACOS((x**2+y**2-z**2)/(2.0*x*y))
> height = x*SIN(theta); Area = 0.5*y*height
> END FUNCTION Area
> END MODULE Triangle_Operations
>
> PROGRAM Triangle
> USE Triangle_Operations
> IMPLICIT NONE
> REAL :: a, b, c
> PRINT *, 'Welcome, please enter the&
> &lengths of the 3 sides.'
> READ *, a, b, c
> PRINT *, "Triangle's area: ", Area(a,b,c)
> END PROGRAM Triangle
>
> And the error message I get is:
>
> In ASIN(x) or ACOS(x), ABS(x).gt.1.0 (x=-0.220000005e+01).
> Error occurs at or near line 8 of _triangle_operations@_area_
> Called from or near line 20 of _MAIN__
This is strange. On my Linux system it compiles and runs well
using the NAG f95, the Intel f95 or the GNU g95 compiler.
Roland
+----------------------------------------------------------------------+
| Roland Schilling Home-Office: +49(89)32929-670 |
| Max-Planck-Institut für Gravitationsphysik |
| -- Albert-Einstein-Institut -- |
| D-85748 Garching E-mail: [log in to unmask] |
| Germany http://www.geo600.uni-hannover.de |
+----------------------------------------------------------------------+
|