Fortran 中是否应避免使用名单?如果是,推荐的替代方法是什么?

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

我经常使用 namelist 功能来灵活输入 FORTRAN 程序的参数列表,但前几天搜索时提醒自己使用它们 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.

我只是想知道

  1. 如果这是普遍持有的观点?
  2. 如果是,为什么会这样?
  3. 建议的参数输入替代方案是什么? (我当然是用netcdf做网格化数据文件输入,这里想到的是运行-时间参数设置)

在 Metcalf 等人的经典著作:Modern Fortran Explained 中没有提到名单效率低下和设计不佳的问题。 https://books.google.com/books?id=V7UVDAAAQBAJ&lpg=PP1&pg=PA197#v=onepage&q=namelist%20I/O&f=false 相反,我相信名单——尤其是在 Fortran 2003 和 2008 中增加的增强功能——是非常有用和灵活的数据方法I/O。