As shown in the examples the M_list(3f) module contains simple routines to add, replace and delete values from an automatically sorted array, which allows for creating simple dictionaries.
The advantage of this routine over more conventional methods is that the dictionary components are simple arrays which can be easily accessed with standard routines.
Each time an entry is added or deleted the array is re-allocated. Because of the expense of reallocating the data these routines are best suited for maintaining small lists that do not change size frequently.
For more demanding needs, see linked-list methods for maintaining generic dictionaries; several examples of which are available on the Fortran Wiki.
Just download the github repository, enter the src/ directory and run make(1):
git clone https://github.com/urbanjost/M_list.git
cd M_list/src
# change Makefile if not using one of the listed compilers
# for gfortran
make clean
make F90=gfortran gfortran
# for ifort
make clean
make F90=ifort ifort
# for nvfortran
make clean
make F90=nvfortran nvfortran
# optionally
make run # run all the demo programs from the man-pages
make help # see other developer options
This will compile the M_list(3f) module.
Alternatively, download the github repository and build it with fpm ( as described at Fortran Package Manager )
git clone https://github.com/urbanjost/M_list.git
cd M_list
fpm test # run unit tests
# optionally run the example programs from the man-pages in the example/ directory
fpm run --example "*"
or just list it as a dependency in your fpm.toml project file.
[dependencies]
M_list = { git = "https://github.com/urbanjost/M_list.git" ,tag="v1.0.1"}
A single page that uses javascript to combine all the HTML descriptions of the man-pages is at BOOK_M_list.
An index to HTML versions of the man-pages
man-pages in
There are demo programs extracted from the man pages in the example/ directory