Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should namelists be avoided in Fortran and if so what is the recommended alternative?

I often use the namelist feature for flexible input of parameter lists to FORTRAN programmes, but the other day when searching to remind myself of their use I came across this statement:

It (namelist language extension to f77) has now been included in the Fortran 90 language. However, NAMELIST is a poorly designed feature and should be avoided whenever possible.

I was just wondering

  1. if this is a generally held view?
  2. if yes, why is this the case?
  3. what the suggested alternative is for parameter input? (I of course use netcdf for gridded data file input, I'm thinking of run-time parameter settings here).
like image 329
Adrian Tompkins Avatar asked Jun 21 '17 12:06

Adrian Tompkins


1 Answers

There is no mention of namelist inefficiency and poor design whatsoever in the canonical book of Metcalf et al.: Modern Fortran Explained. https://books.google.com/books?id=V7UVDAAAQBAJ&lpg=PP1&pg=PA197#v=onepage&q=namelist%20I/O&f=false To the contrary, I believe namelists -- especially with the added enhancements in Fortran 2003 and 2008 -- are quite useful and flexible method of data I/O.

like image 59
Scientist Avatar answered Oct 15 '22 15:10

Scientist