-
Notifications
You must be signed in to change notification settings - Fork 19
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
Change all code to F90 free format, with an extension of .F90 everywhere #254
Comments
I believe we all agree that all new files added should be .F90 and in Fortran free format. We can convert existing files after testing is complete. |
OK, we have agreed to do this over time, and only when testing is fully in place for the affected code. This will take a good long while... |
@jbathegit what do you think about this issue? |
I agree that this is a worthwhile goal, but just as I noted in #328, I also haven't done any further work on this, because I've been prioritizing my time towards improving the level of testing coverage. Note that for many files and routines we should be able to address both of these issues simultaneously. But that said, and for cases where changing to F90 free form may be a bit more time-consuming, I do think that #328 should be a higher overall priority because of its value in diagnosing undeclared variables that result from typos. |
The good news is that converting to F90 is pretty easy. IIRC the only things that have to be done are: At that point the file can be reformatted. I have been thinking we should get some autoformator for NCEPLIBS Fortran code, so we have similar and consistent indents etc. However, in the absence of that I've just run the emacs Fortran formatter, which does a pretty good job. Perhaps your editor has a similar capability. It's not necessary to convert all at once, some files can be .f, some .F90. When this is done, make sure you use .F90 not .f90, because we will certainly want to use the pre-processor and it's confusing to have some files f90 and some F90. I agree this is not a priority, just wanted to see what you thought of this issue. |
On other NCEPLIBS projects I have converted everything to F90 and it was surprisingly easy and surprisingly helpful.
To do it, just use git mv to change the filename, change the CMakeLists.txt, and then in the file, change the way lines are continued.
The benefit is that free-formatted code is easier to work with and looks better. Also the use of the extension "F90" everywhere also allows for pre-processor use, when and if needed. And it removes the common mistake of referencing a code file with the wrong extension, when multiple extensions are in use.
Another benefit (which is what I first noticed) is that doxygen is able to find the types of subprogram parameters automatically for F90 code, but not for F77 code.
@jack-woollen and @jbathegit please consider...
The text was updated successfully, but these errors were encountered: