Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code files should all have .f90 (or .F90) extension instead of .f #151

Closed
edwardhartnett opened this issue Oct 4, 2021 · 4 comments · Fixed by #200
Closed

Code files should all have .f90 (or .F90) extension instead of .f #151

edwardhartnett opened this issue Oct 4, 2021 · 4 comments · Fixed by #200
Assignees
Labels
build Building software can be complicated

Comments

@edwardhartnett
Copy link
Contributor

All the code files have a .f extension. Yet they use F90 features.

The compilers are mostly OK with this because they just ignore the extension. But it is confusing and also confuses doxygen.

The simplest answer would be to rename each file to a .f90 extension.

@Hang-Lei-NOAA @BrianCurtis-NOAA @kgerheiser any objections to this?

@edwardhartnett edwardhartnett added the build Building software can be complicated label Oct 4, 2021
@edwardhartnett edwardhartnett self-assigned this Oct 4, 2021
@edwardhartnett edwardhartnett changed the title Code files should all have .f90 extension instead of .f Code files should all have .f90 (or .F90) extension instead of .f Oct 4, 2021
@Hang-Lei-NOAA
Copy link
Contributor

Hang-Lei-NOAA commented Oct 4, 2021 via email

@edwardhartnett
Copy link
Contributor Author

F77 is valid F90, but F90 is not valid F77.

So we can rename all the files to .F90, or leave the F77 ones .f.

@kgerheiser
Copy link
Contributor

kgerheiser commented Oct 4, 2021

It's not a matter of whether they use Fortran 90/77 features. It's fixed formatting vs. free-formatting. You couldn't just re-name them without changing the formatting or adding a compiler option.

@edwardhartnett
Copy link
Contributor Author

The only thing I seem to have to change are the line continuations.

Fixed format likes the continuation line on the second line, like this:

      integer :: mappds(ipdstmplen), intbmap(ngrdpts),
     $     mapdrs(idrstmplen)

Whereas F90 likes it at the end of the first line:

      integer :: mappds(ipdstmplen), intbmap(ngrdpts), &
           mapdrs(idrstmplen)

Once I changed all the continuation lines, addfield.f becomes addfield.F90, and compiles and passes all tests.

I'll put up a PR with just that one file change. If we all agree it looks good, I will change the continuation characters in the rest of the codebase and we will convert everything to free-format F90 files.

Perhaps we can convert all our F77 code before the 50th anniversary of F77!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Building software can be complicated
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants