C interfacing with Fortran
glenn at suphys.physics.su.OZ.AU
glenn at suphys.physics.su.OZ.AU
Tue Aug 28 08:08:28 AEST 1990
Hi,
I'm trying to write a program which uses a 2-d array of structs to
represent a matrix of complex numbers: struct complex {double r; double i}.
The array is dynamically allocated as it can become rather large. I don't
want to do complex arithmetic in C (we don't have C++ :-)) so I thought I'd
use Fortran.
Problem: How does one pass a 2-d C array of structs to a Fortran subroutine?
I've managed to do it with a 1-d array, but our Manuals (SUN OS 4.1) say
nothing about 2-d arrays; that part seems to just be a copy (with minor changes)
of the version 7 UNIX manual.
Any example programs or pointers to good cross language references would be much
appreciated.
BTW I'm using f77 and cc (standard SUN C compiler).
Thanks in advance,
Glenn
glenn at qed.physics.su.oz.au
--
Glenn Geers | "So when it's over, we're back to people.
Department of Theoretical Physics | Just to prove that human touch can have
The University of Sydney | no equal."
Sydney NSW 2006 Australia | - Basia Trzetrzelewska, 'Prime Time TV'
More information about the Comp.lang.c
mailing list