POINTER components and mixed-language (AKA can of worms)

FX Coudert fxcoudert@gmail.com
Sun Apr 6 13:19:00 GMT 2008


Hi Dennis,

I'm a bit short on time, and I'd give you the following few pieces of  
advice:

1. If you need generic Fortran help, go to the comp.lang.fortran  
Usenet group. As long as you show you're interested in listening and  
that you have done some work (i.e. that you are looking for advice  
and help, and not waiting for people to do your work for you), you  
will be well-treated and will receive very enlightening comments.  
Many Fortran experts hang out there, including past and current  
Fortran standard editors and committee members.

2. Read some book about C/Fortran interoperability in Fortran 2003.  
Not everything is available in current compilers, but some of the  
stuff is starting to be pretty common (and implemented in gfortran)  
and that should make your life much easier.

3. That one is a personal opinion: forget about array descriptors.  
Pass and receive the arrays as C pointers, and pass the extra  
information which you need (shape, size, etc.) as extra function  
arguments. This might seem more tedious but you can do it in a  
portable way (especially using a bit of  C/Fortran 2003  
interoperability) and in the end, I bet you really won't regret it.

I hope this helps a bit, and wish you success in your PhD,
FX

-- 
François-Xavier Coudert
http://www.homepages.ucl.ac.uk/~uccafco/



More information about the Fortran mailing list