A Python module and command line tool for working with Fortran namelists
![](https://www.deeplearningdaily.com/wp-content/uploads/2021/05/a-python-module-and-command-line-tool-for-working-with-fortran-namelists_60aec7ddcc7d2-375x210.png)
f90nml
A Python module and command line tool for parsing Fortran namelist files.
f90nml
is a Python module and command line tool that provides a simple interface for the reading, writing, and modifying Fortran namelist files.
A namelist file is parsed and converted into an Namelist
object, which behaves like a standard Python dict
. Values are converted from Fortran data types to equivalent primitive Python types.
The command line tool f90nml
can be used to modify individual values inside of a shell environment. It can also be used to convert the data between namelists and other configuration formats. JSON and YAML formats are currently supported.
Quick usage guide
To read a namelist file sample.nml
which contains the following namelists:
&config_nml
input = 'wind.nc'
steps = 864
layout =