From: Andrew R. <and...@us...> - 2008-08-02 08:51:51
|
On Fri, Aug 01, 2008 at 04:18:30PM -0700, Alan Irwin wrote: > > I tested the fortran 95 results against the corresponding C results using > > software@raven> (for LIST in `ls x??f95.psc |sed 's?f95.psc??'`; do echo > $LIST; diff ${LIST}c.psc ${LIST}f95.psc; done) |less > > Most examples agreed exactly. The exceptions were x06, x07, x20 and x21 > here is the start of the diff from example 6. > > software@raven> diff x06f95.psc x06c.psc |head -20 > 6c6 > < %%CreationDate: Fri Aug 1 15:37:27 2008 > --- > >%%CreationDate: Fri Aug 1 15:37:48 2008 > 217c217 > < -1.000 ( 0) SW > --- > >-1.000 (0) SW > 219c219 > < ( 0) show > --- > >(0) show > 253c253 > < -1.000 ( 10) SW > --- > >-1.000 (10) SW > 255c255 > < ( 10) show > --- > >(10) show > > Why does the Fortran 95 version have leading blanks for the numbers? If we > could solve that formatting issue, it appears both example 6 and 7 for > Fortran 95 would be identical to the corresponding C examples. In contrast > the differences for examples 20 and 21 are numerical rather than format > issues. Those examples may just require some reprogramming to identically > follow the C template. > The difference is just to do with the way fortran formats integers. The f77 version of example 6 and 7 already had a workaround. I've added this to the f95 versions as well. Results are now identical to C. I've not had a chance to look at example 20 or 21 yet. Andrew |