Michael M. Tung wrote:
Arjen Markus [arjen.markus@wldelft.nl] wrote:
  
Hi Michael,

I will look into the matter of the EQUIVALENCE statements
(real life, as they say, may get in the way of a quick and
clean solution ...)
But in the meantime, could you try and work around this by
using, say, g77 for only the FORTRAN 77 bindings?
Just to make sure that that would be working for you?

Regards,

Arjen
    

Dear Arjen,

the FORTRAN 77 bindings compile and work without any
problems. Thanks for looking at the problem. No hurry,
and a quick and dirty solution is also helpful.  :-)

  
The quick and dirty solution (probably useful for the final one
too) is to:
- Remove the equivalence statements in sfstubs.h
- Use the transfer() function like this:

The current implementation reads:

      subroutine plsetopt(opt, optarg)

      implicit none
      character*(*) opt, optarg

      include 'sfstubs.h'

      call plstrf2c(opt, string1, maxlen)
      call plstrf2c(optarg, string2, maxlen)
      call plsetopt7(s1, s2)

      end subroutine

Replace the call to plsetopt7 by:

     s1 = transfer(string1,s1)
     s2 = transfer(string2.s2)
     call plsetopt7(s1,s2)

And likewise for all other uses of s1, ...., s9

(The effect is that the contents of the strings are copied byte-for-byte
to the integer arrays s1, etc. Slightly more work than the EQUIVALENCE
case, but quite standard)

Regards,

Arjen