[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: FORTRAN common blocks



Stuart Prescott wrote:
> Hi Rupert,
> 
> IIRC, one thing that can be a trap is that in COMMON  blocks, fortran
> sorts the variables by the byte-size of the type, whereas C++ just
> leaves them in the order they are declared. I can't remember the exact
> details (many years since I did any serious fortran like this) but I
> think fortran sorts the variables in the common blocks something along
> the lines of doubles, singles, ints etc. 
> 
> that might give you something to google for at least!
> 
> best of luck!
> 
> cheers
> Stuart
> 

Thank you very much. In fact, I've finally found the error - the fortran
code was implicitly making the arrays I was using "double" precision,
whereas the C code was "float".

Everything is now hunky-dory and does what I expect.

I should plug the rather nice tool that finally showed me what I'd done
wrong: "Understand", from www.scitools.com. It's not even remotely free,
but I was getting desperate and there's a 15 day free trial. (It does
work on debian, however :)

Phew.

I'm growing to hate fortran with a vengeance. And this is F95!

Thanks again,

Rupert

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: