Nvfortran compile for lang 77, 2008, etc

How can I compile specifically for lang 77 or 2008?

I was expecting something like (similiar to nvc++ or other fortran compilers):
nvfortran -std=f77 helloworld.f -o helloworld

Thanks!

Hi dlee1,

Sorry, we don’t target for particular Fortran standard. We support F2003, which is inclusive of F95, F90, and F77, sans deprecated features, plus much of F2008 and some key F2018 features.

We used to ship pgf77, but given it’s now very rare to find pure F77 codes any longer and F2003 covers F77, it didn’t seem necessary.

Is there a particular reason why you want to compile F77 only? Maybe free vs fixed format?

-Mat

Hi MatColgrove,
I have some customers with F77 code and F2008 code and I am putting together hardware/software package for them and putting together a table comparison of commands for them to use.
pgf77 is not included any more. Thats ok. Is there a way to specify and use F2008 or F2018?

GNU
gfortran -std=f2008 hello.f -o hello
Intel OneAPI
ifort -std08 hello.f -o hello

Again, we don’t completely support these standards, but the portions that we do are enabled by default. No flag needed.

Hi MatColgrove,
Can you explain how free v fixed format works?

F77 style formatting, i.e. “fixed”, was designed for the old punch cards used on early systems.

The first column can be used used to indicate a comment, typically using a ‘C’
Columns 2-5 are for a numeric identifier, but often not used
Column 6, if not blank, indicates a line continuation
Columns 7-72, is the program statements. Lines can not exceed 72 columns.

With F90, the “free” format was added. Statements can start in any column and line length limit was extended to 132 columns. A “!” character indicates a comment and comments can be placed on the same line as a statement, however any characters after the ! are ignored. ‘&’ is the continuation character and must be placed at the end of the statement to be continued.

By default, a source file with a “.f” indicates fixed format, while “.f90” indicates free format. The file format can be made explicit by using the “-Mfree” or “-Mfixed” flags. Other Fortran compilers have similar flags, such as gfortran which uses “-ffree-form” and"-ffixed-form".

An upper case suffix, “.F” or “.F90”, indicates the file is to be pre-preprocessed. Though, the flag “-Mpreprocess” can be used as well.

On occasion folks with use other suffix such as “.f95” or “.f03”, to indicate the language standard but these are treated the same as “.f90”. They are just a label for the user and do not actually indicate the standard being used.

Appreciate the detailed response! Its all I need. Thanks!