Skip to content

urbanjost/M_list

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

list

Name

M_list(3f) and M_list__oop(3f) - maintain a sorted intrinsic type array in Fortran

Description

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.

Building the Module Using make(1) gmake

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.

Build and Test with fpm fpm

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"}

(registered at the fpm(1) registry )

Documentation docs

User

Developer

Demo Programsdemos

There are demo programs extracted from the man pages in the example/ directory

About

maintain a small array as a list

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published