F90 Model : NAMELIST I/O

Fortran 90 adds NAMELIST as a part of the standard; however, with I/O syntax that varies from that used by the existing Fortran 77 compilers. This isn't a major catastrophe since many of the Fortran 77 compilers had subtle differences between them since NAMELIST was not part of the Fortran 77 standard.

NAMELIST provides an excellent way to add annotated input. Ignoring much of the difficulties of precise spacing and precision specifications needed for standard formatted READs. NAMELIST usually shines as a superior method for input, and is hardly used for output, except for checking what is acceptable NAMELIST input. It uses a syntax similar to keyword argument parsing. The order of the keywords is unimportant within the NAMELIST block. However, the order of NAMELIST blocks is important for READs. Some implementations will skip over NAMELIST blocks until the expected one is reached. If no REWIND is performed, you can have multiple NAMELIST blocks of the same name and differing data and read them in as needed.

Code examples

Slide 12