[Mesa-users] f90 modules in f77

Rob Farmer r.j.farmer at uva.nl
Fri Dec 8 13:18:21 EST 2017


>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.

As an example look at the code in $MESA_DIR/net/test/src These are .f files
but have use module statements, some are modules themselves

Rob

On 8 December 2017 at 19:14, RICHARD H D TOWNSEND via Mesa-users <
mesa-users at lists.mesastar.org> wrote:

> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.mesastar.org/pipermail/mesa-users/attachments/20171208/b0c62548/attachment.html>


More information about the Mesa-users mailing list