If C is the desired target, I'd do it this way.
Each module would become a single C file. For instance, foo.mod would
become foo.c. Private module variables would be static variables
in the C file. Private module functions would likewise be static.
Public module variables would be placed in a .h file, foo.h in this
case. foo.h would also contain function prototypes for the
module's public functions.
Code that currently USEs module FOO would instead #include "foo.h".
One big difference is that USE has procedure scope whereas
#include has file scope. So there is a potential for namespace
conflicts using this method.
-P.
On Wed, 28 Jun 2006, 2:53pm +0100, [log in to unmask] wrote:
> Have you thought about c++ as an option or
> Does it have to be c?
>
> -----Original Message-----
> From: Fortran 90 List [mailto:[log in to unmask]] On Behalf Of
> Bertrand Meltz
> Sent: 26 June 2006 09:54
> To: [log in to unmask]
> Subject: Porting f90 to C
>
> I have a F90 code, with most of the variables in modules. I am looking for a
> way to port the compute core to C. Any idea how to do it in a clean and
> modern way? IŽd like to avoid writing a call with an enormous list of
> arguments.
>
> My main target is a variety of Intel machines, both IA-32 and IA-64, with
> Intel compilers.
>
> Thanks
>
> Bertrand
>
> --
>
> Bertrand Meltz
> Commissariat a lŽEnergie Atomique | e-mail : [log in to unmask]
> CEA / DIF , BP 12 | Tel : (33) [0] 1 69 26 57 83
> 91680 Bruyeres-le-Chatel , FRANCE | Fax : (33) [0] 1 69 26 70 93
>
--
Peter S. Shenkin Schrodinger, Inc.
VP, Software Development 120 W. 45th St., 29th Floor
646 366 9555 x111 Tel New York, NY 10036
646 366 9550 FAX USERID: shenkin
http://www.schrodinger.com DOMAIN: schrodinger DOT com
Conf. calls: 650 429 3300 or 866 469 3239 (toll-free); code 36695555#
|