Update a configuration file: Difference between revisions

Content added Content deleted
Line 633: Line 633:
</pre>
</pre>


Naturally, a parameter file could contain data in whatever format desired, and might even recognise a semicolon (of all things!) as a comment starter: such a file could be read and its components extracted via suitable code then written in the NAMELIST style to a scratch file and read back for the actual internalisation of values. The point of this is that a text name of a variable is associated with the actual computer variable via the NAMELIST facility, the programmer need not slog through some endless CASE statement on the names of the variables. This process would be reversed for output.
Naturally, a parameter file could contain data in whatever format was desired, and it might even employ a semicolon (of all things!) as a comment starter: such a file could be read and its components extracted via suitable code then written in the NAMELIST style to a scratch file and read back for the actual internalisation of values. The point of this is that a text name of a variable is associated with the actual computer variable via the NAMELIST facility, the programmer need not slog through some endless CASE statement on the names of the variables nor recognise the different data formats such as for complex numbers. This process would be reversed for output.


But given that the NAMELIST protocol is available without difficulty, why would a hard-core fortranner bother for a Fortran programme?
But given that the NAMELIST protocol is available without difficulty, why would a hard-core fortranner bother for a Fortran programme?