comp.lang.ada
 help / color / mirror / Atom feed
* Interface Ada95 => Fortran90
@ 2001-11-21 13:31 Jean Claude Berges
  2001-11-22  9:44 ` Claude SIMON
  0 siblings, 1 reply; 4+ messages in thread
From: Jean Claude Berges @ 2001-11-21 13:31 UTC (permalink / raw)
  To: comp.lang.ada; +Cc: Jean-Claude.Berges


Hello all ,

Can someone point me to tutorials, websites covering the topic of
"Interface Ada95 ==> Fortran90" (call Fortran90 subroutines or
functions from Ada95), like the work of Duncan Sands (see:
 http://topo.math.u-psud.fr/~sands/BLAS/) but for Fortran90 types,
not only basic Fortran77 types.

In particular, examples about the "Import" of Fortran90 derived
type, the use of Fortran90 optional statement  for dummy
arguments, ...

Thanks in advance.

     Jean Claude BERGES
     French Space Center ( DTS/MPI/MS/MN)
     18,Av. Edouard Belin
     31401 TOULOUSE Cedex 04 - FRANCE

     E-mail : Jean-Claude.Berges@cnes.fr





^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Interface Ada95 => Fortran90
  2001-11-21 13:31 Interface Ada95 => Fortran90 Jean Claude Berges
@ 2001-11-22  9:44 ` Claude SIMON
  2001-11-22 13:52   ` Dan Nagle
  0 siblings, 1 reply; 4+ messages in thread
From: Claude SIMON @ 2001-11-22  9:44 UTC (permalink / raw)


I think problems come from arrays, fortran derived types and pointers.

With arrays the problem come with assumed-shape array, array pointer and
allocatable array.
With fortran derived type the problem come from array component of the
above type.
Each fortran compiler has his own representation of pointer.

One way to avoid the problem is to code wrapper to translate from
fortran 90 to fortran 77
when arrays and pointers are involved.

Claude Simon

Jean Claude Berges a �crit :

> Hello all ,
>
> Can someone point me to tutorials, websites covering the topic of
> "Interface Ada95 ==> Fortran90" (call Fortran90 subroutines or
> functions from Ada95), like the work of Duncan Sands (see:
>  http://topo.math.u-psud.fr/~sands/BLAS/) but for Fortran90 types,
> not only basic Fortran77 types.
>
> In particular, examples about the "Import" of Fortran90 derived
> type, the use of Fortran90 optional statement  for dummy
> arguments, ...
>
> Thanks in advance.
>
>      Jean Claude BERGES
>      French Space Center ( DTS/MPI/MS/MN)
>      18,Av. Edouard Belin
>      31401 TOULOUSE Cedex 04 - FRANCE
>
>      E-mail : Jean-Claude.Berges@cnes.fr




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Interface Ada95 => Fortran90
  2001-11-22  9:44 ` Claude SIMON
@ 2001-11-22 13:52   ` Dan Nagle
  2001-11-22 18:25     ` Claude SIMON
  0 siblings, 1 reply; 4+ messages in thread
From: Dan Nagle @ 2001-11-22 13:52 UTC (permalink / raw)


Hello,

Most modern Fortran compilers document their pointer & allocatable
structure, so RTFM for your target compiler.

Try using the "sequence" keyword in the derived type definition
on the Fortran side, if you can.  It causes the compiler to lay out
in memory the derived type in the same order as the components are
declared.  Otherwise, the Fortran compiler is free to reorder
for alignment or other purposes.

Check for f90/95 compilers which support the Fortran 2000
C Interoperability features.  (Judging from traffic in the Fortran
newsgroups & mailing lists, this is one of the most requested
features so it may be one of the first to be implemented.)
I know of none which are available now, but some vendors
have been hinting RSN.

I'm told by some members of the Fortran C Interoperability
subcommittee (of J3) that if the Fortran definition specify
that the derived type (or procedure) is to interoperate with C,
and the other language also specifies that its objects are to
interoperate with C, that there's a high probability of both
non-C languages being able to meet in the middle.  The most
important parameter here is both compilers targeting the same
C compiler.

-- 
Cheers!

Dan Nagle
Purple Sage Computing Solutions, Inc.

On Thu, 22 Nov 2001 10:44:34 +0100, Claude SIMON
<claude.simon@setra.fr> wrote:

>I think problems come from arrays, fortran derived types and pointers.
>
>With arrays the problem come with assumed-shape array, array pointer and
>allocatable array.
>With fortran derived type the problem come from array component of the
>above type.
>Each fortran compiler has his own representation of pointer.
>
>One way to avoid the problem is to code wrapper to translate from
>fortran 90 to fortran 77
>when arrays and pointers are involved.
>
>Claude Simon
>
>Jean Claude Berges a �crit :
>
>> Hello all ,
>>
>> Can someone point me to tutorials, websites covering the topic of
>> "Interface Ada95 ==> Fortran90" (call Fortran90 subroutines or
>> functions from Ada95), like the work of Duncan Sands (see:
>>  http://topo.math.u-psud.fr/~sands/BLAS/) but for Fortran90 types,
>> not only basic Fortran77 types.
>>
>> In particular, examples about the "Import" of Fortran90 derived
>> type, the use of Fortran90 optional statement  for dummy
>> arguments, ...
>>
>> Thanks in advance.
>>
>>      Jean Claude BERGES
>>      French Space Center ( DTS/MPI/MS/MN)
>>      18,Av. Edouard Belin
>>      31401 TOULOUSE Cedex 04 - FRANCE
>>
>>      E-mail : Jean-Claude.Berges@cnes.fr




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Interface Ada95 => Fortran90
  2001-11-22 13:52   ` Dan Nagle
@ 2001-11-22 18:25     ` Claude SIMON
  0 siblings, 0 replies; 4+ messages in thread
From: Claude SIMON @ 2001-11-22 18:25 UTC (permalink / raw)


You have two solutions :

 - first you try to map all your data types from Fortran90 to Ada.
    For this work you need the data representation from each compiler. It is
not
    allways possible to do because some types are not compatibles, for
example :
    Ada discrimated types have no Fortran equivalent.
   You must end with a thick binding to map Ada types to Fortran 90 types.
   The result is not portable and you must redo the binding for each couple
of
   compilers.

 - second you make a thick binding to map Ada types to Fortran 77 types
   on one side and Fortran 77 to Fortran 90 on the other side.
   You must have a to side binding but it is more portable.

With Fortran 2000 the binding will be between a two side binding with an
intermediate C maping. Not so far the second solution.

We have the same problem at work with mixing Fortran 77, Fortran 90, Ada and
C.

Claude Simon


Dan Nagle a �crit :

> Hello,
>
> Most modern Fortran compilers document their pointer & allocatable
> structure, so RTFM for your target compiler.
>
> Try using the "sequence" keyword in the derived type definition
> on the Fortran side, if you can.  It causes the compiler to lay out
> in memory the derived type in the same order as the components are
> declared.  Otherwise, the Fortran compiler is free to reorder
> for alignment or other purposes.
>
> Check for f90/95 compilers which support the Fortran 2000
> C Interoperability features.  (Judging from traffic in the Fortran
> newsgroups & mailing lists, this is one of the most requested
> features so it may be one of the first to be implemented.)
> I know of none which are available now, but some vendors
> have been hinting RSN.
>
> I'm told by some members of the Fortran C Interoperability
> subcommittee (of J3) that if the Fortran definition specify
> that the derived type (or procedure) is to interoperate with C,
> and the other language also specifies that its objects are to
> interoperate with C, that there's a high probability of both
> non-C languages being able to meet in the middle.  The most
> important parameter here is both compilers targeting the same
> C compiler.
>
> --
> Cheers!
>
> Dan Nagle
> Purple Sage Computing Solutions, Inc.
>
> On Thu, 22 Nov 2001 10:44:34 +0100, Claude SIMON
> <claude.simon@setra.fr> wrote:
>
> >I think problems come from arrays, fortran derived types and pointers.
> >
> >With arrays the problem come with assumed-shape array, array pointer and
> >allocatable array.
> >With fortran derived type the problem come from array component of the
> >above type.
> >Each fortran compiler has his own representation of pointer.
> >
> >One way to avoid the problem is to code wrapper to translate from
> >fortran 90 to fortran 77
> >when arrays and pointers are involved.
> >
> >Claude Simon
> >
> >Jean Claude Berges a �crit :
> >
> >> Hello all ,
> >>
> >> Can someone point me to tutorials, websites covering the topic of
> >> "Interface Ada95 ==> Fortran90" (call Fortran90 subroutines or
> >> functions from Ada95), like the work of Duncan Sands (see:
> >>  http://topo.math.u-psud.fr/~sands/BLAS/) but for Fortran90 types,
> >> not only basic Fortran77 types.
> >>
> >> In particular, examples about the "Import" of Fortran90 derived
> >> type, the use of Fortran90 optional statement  for dummy
> >> arguments, ...
> >>
> >> Thanks in advance.
> >>
> >>      Jean Claude BERGES
> >>      French Space Center ( DTS/MPI/MS/MN)
> >>      18,Av. Edouard Belin
> >>      31401 TOULOUSE Cedex 04 - FRANCE
> >>
> >>      E-mail : Jean-Claude.Berges@cnes.fr




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2001-11-22 18:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-11-21 13:31 Interface Ada95 => Fortran90 Jean Claude Berges
2001-11-22  9:44 ` Claude SIMON
2001-11-22 13:52   ` Dan Nagle
2001-11-22 18:25     ` Claude SIMON

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox