comp.lang.ada
 help / color / mirror / Atom feed
From: Dan Nagle <dnagle@erols.com>
To: comp.lang.ada@ada.eu.org, joanna.chambers@bae.co.uk
Subject: Re: Passing complex structures between ADA and FORTRAN
Date: Fri, 14 Sep 2001 11:37:33 -0400
Date: 2001-09-14T11:37:33-04:00	[thread overview]
Message-ID: <mailman.1000481892.1779.comp.lang.ada@ada.eu.org> (raw)
In-Reply-To: <mailman.1000467672.29280.comp.lang.ada@ada.eu.org>

Hi,

One possibility is that your Fortran compiler is choosing
to pad your derived type somehow.  The fact that your results
change when switching real kinds reinforces the likelihood
of this guess.

Advice:  use a standard Fortran derived type with the
sequence keyword within the derived type definition.
This causes the Fortran compiler to align components
of the derived type as if for a common block (so you
may need to use explicit padding components somewhere).
(The dot notation makes me think you might be using
VAX structures, use standard Fortran derived types
and standard Fortran % notation on the Fortran side.)

type :: foo_t
   sequence
   <put something here>
end type foo_t

Good Luck!

-- 
Cheers!

Dan Nagle
Purple Sage Computing Solutions, Inc.

On Fri, 14 Sep 2001 11:57:25 +0100, in comp.lang.ada you wrote:

>I am trying to pass structures, which in some places are 4 deep
>across from ada to Fortran and vice versa.  The integers are all
>single precision, but the real values are all double precision.
>However, the boundaries appear to be mixed up, and data is being lost
>and slipping to the next item in the structure when passed.  Changing
>the real values back to single precision helps a little, but it all
>goes pear shaped again, when it gets to a part of the structure which
>is a vector structure, eg
>Structure1.Structure2(n).Structure3.Item
>
>Can anyone advise on the best way to handle this.  I am afraid I
>don't have ready access to the newsgroup, so could you forward your
>replies to me at joanna.chambers@bae.co.uk
>
>
>
>
>
>********************************************************************
>This email and any attachments are confidential to the intended
>recipient and may also be privileged. If you are not the intended
>recipient please delete it from your system and notify the sender.
>You should not copy it or use it for any purpose nor disclose or
>distribute its contents to any other person.
>********************************************************************




      parent reply	other threads:[~2001-09-14 15:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.1000467672.29280.comp.lang.ada@ada.eu.org>
2001-09-14 14:08 ` Passing complex structures between ADA and FORTRAN Ted Dennison
2001-09-14 15:37 ` Dan Nagle [this message]
replies disabled

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