Fortran Main with C I/O
Jerry Berkman
jerry at violet.berkeley.edu
Sun Sep 23 11:31:15 AEST 1990
In article <1990Sep21.132232.11305 at DRD.Com> mike at DRD.Com (Mike Rovak) writes:
>bill%biomel at cs.dal.ca wrote:
> In article <1044 at helens.Stanford.EDU> joe at hanauma.Stanford.EDU (Joe Dellinger) writes:
> >
> >... Now we are told "if you want to be able to use C I/O
> >you'll have to have your mains in C"! This means rewriting a LOT of software.
> >
>Not a problem, guys. Make a C main function whose sole purpose is to call
>the Fortran routine. Change the word "PROGRAM" in each Fortran routine
>to "SUBROUTINE" and your job is done.
>-- Mike
There's also the question of whether you want to run in the C environment
or the Fortran environment. If you want to do I/O in Fortran, you
may need to call the Fortran environment initialization routine; it's
called "f_init()" in BSD VAX UNIX. It initializes units 0, 5, and 6
to standard error, standard input and standard output and line-buffers
standard error. It also sets up to catch interrupts so that all your
Fortran file buffers are flushed on error termination, and so
that you get semi-inteligent messages.
- Jerry Berkman, U.C.Berkeley, (415)642-4804
jerry at violet.berkeley.edu
disclaimer: opinions are my own, not my employers, etc.
More information about the Comp.lang.c
mailing list