iargc replacement in Fortran apps. #188
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is for the replacement of the use of iargc in NCtools Fortran programs to allow for compiling with certain modern
compilers on ARM. Certain compiler do not (or no longer) support iargc, and even some compilers that currently support it now recommend the use of function command_argument_count() instead . E.g. the GNU Fortran manual states :
" This (iargc) intrinsic routine is provided for backwards compatibility with GNU Fortran 77. In new code, programmers should consider the use of the COMMAND_ARGUMENT_COUNT intrinsic defined by the Fortran 2003 standard."
The issue was discoverer compiling with recent NVidia compilers on Raspberry Pi. The changed was tested with NVidia, GNU, and Intel compilers on linux.
There is a related PR (#183) targeting changes that allow compiling on ARM Mac.
Also, note. This is a replacement of PR 187, which would have inadvertently added an extra commit.