Failure of implicit real*8

Steve Kargl sgk@troutmask.apl.washington.edu
Sun Feb 20 03:04:00 GMT 2011


On Sun, Feb 20, 2011 at 02:48:59AM +0000, Michael D. Berger wrote:
> On Sat, 19 Feb 2011 18:22:57 -0800, Steve Kargl wrote:
> 
> > On Sun, Feb 20, 2011 at 02:13:35AM +0000, Michael D. Berger wrote:
> [...]
> > Are you serious?  There is too little information here to even guess at
> > an answer.  Show us the actual code.
> > 
> > Well, I do have guess, but you won't care for it. Don't use
> > -fdefault-real-8, because this option may not do what you think it does.
> 
> Yes, I am serious.  If there is such a bug, I would think someone
> would know it from what I said.

I highly doubt it as I already wrote that there is
too little information!

> The subroutine is just a few lines
> rearranging the elements of mx using tmp as a buffer.  If there
> is a problem in the code, you would need more than this trivial
> subroutine to find it.  The code cannot be posted for various
> reasons.
> 
> I will half follow your advice, both using the option AND explicitly 
> declaring the real*8.  BTW, doing that did not change anything.
> 

Sigh, we need the entire specification portion of the
actual code.  You showed us

   subroutine orderRows(mx, idxSort, nrows, ncols)
   dimension idxSort(nrows),mx(nrows,ncols),tmp(nrows,ncols)
   ...

Well, in the above mx has the type INTEGER from the implicit
typing rules.

and

   subroutine orderRows(mx, idxSort, nrows, ncols)
   dimension idxSort(nrows)
   real mx(nrows,ncols),tmp(nrows,ncols)

Here, you have type REAL, which can be promoted by the
option.

PS:  I'm the person that got -fdefault-real-8 working
(others fixed a few minor bugs).  One should think 
long and hard before using it.

-- 
Steve



More information about the Fortran mailing list