[Date Prev] [Date Next] [Thread Prev] [Thread Next] Date Index Thread Index Search archive:
Date:3 Jan 2005 18:56:09 -0000 
Subject:Re: another fortran-related problem in pop11 
From:Aaron Sloman 
Volume-ID: 

John Duncan wrote:

>             Are these Sun's at the University 64 bit ? From my reading
>             on the subject Fortran 77 employs hardware floats and this
>             might have side effects. To test this compile something like
>             this in Fotrtran 77 on both systems.

I don't use suns much any more, and I've never used fortran, but I
presume that the Suns at Sussex University used by David for his
popvision program are 64 bit sparcs. However poplog on Sparc has not yet
been converted to use the 64 bit architecture (whereas poplog on Dec
alpha did -- as there was no other option!).

Thanks for the test program.

>             program prog
>
>             implicit none
>
>
>             integer i
>             real r
>             double precision d
>             logical j
>
>             write(6,*)  ' integers are ',kind(i)
>             write(6,*)  ' reals are ',kind(r)
>             write(6,*)  ' double precision are ',kind(d)
>             write(6,*)  ' logicals are ',kind(j)
>
>
>             end

I know nothing about fortran so I blindly put this in a file jd.f
and tried to compile it using g77 on my linux PC

Nothing I could think of doing enabled it to compile. I always got
this sort of output:

    jd.f: In program `prog':
    jd.f:11: warning:
               write(6,*)  ' integers are ',kind(i)
                                            ^
    Reference to unimplemented intrinsic `KIND' at (^) (assumed EXTERNAL)
    jd.f:11:
               write(6,*)  ' integers are ',kind(i)
                                            ^
    Invalid declaration of or reference to symbol `kind' at (^) [initially
    seen at (^)]

I tried finding documentation on 'kind' in fortran but there was nothing
that matched this use of it. There were only declarations using 'kind='.

However, we already know that pop11 on linux interfaces properly with
fortran when it passes arrays of single or double floats and asks
fortran to perform operations on the contents of the arrays.

The contents are found to be changed exactly as expected.

The problem arises only with fortran procedures that return single float
results. Integer results and double float results come back to pop11 as
expected. I suspect there's some quirk in the code that converst a
single float in fortran to a pop11 single float that needs to be
changed.

I am beginning to wonder if this is also a problem with C.

I had thought not, because all David's other programs seem to work fine.
But I have not checked whether any of the ones I,ve tested return single
float results. I know that many of them operate on arrays just fine.

I'll investigate.

Aaron