A serde library for Fortran namelist inputs.
Namelists are a Fortran 90 feature for input and output of groups of variables in a key-value assignment format.
&particle
timestep = 0,
mass = 1.0
position = 1.0, 1.0, 1.0,
velocity = -1.0, 0.0, 0.0
/
This namelist group assignes an integer variable timestep, a floating
point/real variable masss and two arrays of reals position and
velocity.
Further data types supported by the namelist input format are bool/logical
values (assinged with .TRUE. or .FALSE.) and strings (denoted by either
single quotes 'hello', or double quotes "hello")
Usage
Namelist Groups
To serialize a Rust struct as a namelist group, you can:
use ;
Multiple Namelist Groups
Supported Namelist Syntax
Supported:
- All basic data types, integer, logical, string, real
- Arrays: Both Assigning sequences and individual elements using subscripts
- Derived types
Not Supported:
- Anything involving the slice operator
:, for example:var(1:3) = 1, 2, 3, - Assignments of sequences to subscripted variables, i.e.
var(1) = 1, 2, 3