From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1b05a32aaf1089ed X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-09-14 08:39:02 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!newsfeeds.belnet.be!news.belnet.be!cleanfeed.casema.net!leda.casema.net!isdnet!enst!enst.fr!not-for-mail From: Dan Nagle Newsgroups: comp.lang.ada Subject: Re: Passing complex structures between ADA and FORTRAN Date: Fri, 14 Sep 2001 11:37:33 -0400 Organization: Purple Sage Computing Solutions, Inc. Sender: comp.lang.ada-admin@ada.eu.org Message-ID: References: Reply-To: comp.lang.ada@ada.eu.org NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: avanie.enst.fr 1000481940 46925 137.194.161.2 (14 Sep 2001 15:39:00 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Fri, 14 Sep 2001 15:39:00 +0000 (UTC) To: comp.lang.ada@ada.eu.org, joanna.chambers@bae.co.uk Return-Path: In-Reply-To: X-Mailer: Forte Agent 1.8/32.553 Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.0.4 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: comp.lang.ada mail<->news gateway List-Unsubscribe: , List-Archive: Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org Xref: archiver1.google.com comp.lang.ada:13079 Date: 2001-09-14T11:37:33-04:00 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 end type foo_t Good Luck! --=20 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. >********************************************************************