From mike.prager at noaa.gov  Mon Nov  3 17:11:03 2008
From: mike.prager at noaa.gov (Mike Prager)
Date: Mon, 03 Nov 2008 11:11:03 -0500
Subject: [Rd] gfortran optimization problems
References: <490251F3.6050301@montana.edu>
Message-ID: <cb8ug4hcngbe8ch5pl6h2s0cjqs2j0ejk7@4ax.com>

Dave Roberts <droberts at montana.edu> wrote:

> I have a routine in package labdsv that calls a FORTRAN subroutine. 
> Recently, I was informed that it sometimes gives different results on a 
> PC and Mac, and that the PC version is clearly wrong.  I tested it on 
> linux (because I don't have a PC), and I get the same (incorrect) 
> behavior as the PC.
> 
> Simply by inserting debug WRITE statements in the FORTRAN I would get 
> different, and correct, results, so I assumed it was an optimization 
> error.
> 
>[...]

Not to prejudge the case, but such sometime errors are classic
symptoms of access violations in Fortran, such as accessing a
variable whose value has not been set, exceeding array bounds,
or something similar.  The usual suggestion is to recompile the
Fortran with ALL error-checking options turned on and see if
such a bug turns up.

-- 
Mike Prager, NOAA, Beaufort, NC
* Opinions expressed are personal and not represented otherwise.
* Any use of tradenames does not constitute a NOAA endorsement.



[Rd] gfortran optimization problems
Mike Prager