[Mesa-users] f90 modules in f77
RICHARD H D TOWNSEND
townsend at astro.wisc.edu
Fri Dec 8 13:14:28 EST 2017
I think it would be difficult to use an F90 module from an F77 program compiled with an F77 compiler.
However, we're not using any F77 compilers. The F77 program will be compiled with an F90 compiler, right? In that case, it should be no problem. Just add the "use blahblah" to the F77 program.
As an aside: thinking of a file as 'F77' or 'F90' is not quite right. You should think of .f files as 'fixed-source' files (with formatting constraints, e.g. start on the 6th column); and .f90 files are 'free-source' files (without these constraints). Both can contain valid Fortran 77/90/95/2003/etc code. In that respect, any valid fixed-source Fortran 77 file is automatically a valid fixed-source Fortran 90 file.
cheers,
Rich
> On Dec 8, 2017, at 12:05 PM, Travis Metcalfe <travis at spsci.org> wrote:
>
> Hello,
>
> I'm looking for a way to share data between some older f77 code and the MESA/GYRE modules. In f77, subroutines could share data with each other through common blocks. This appears to be replaced with modules and "use [module name]" in f90.
>
> What I have been unable to find online or in the mesa-users archive is how to use an f90 module from an f77 program. Is it possible?
>
> Thanks,
>
> Travis
More information about the Mesa-users
mailing list