1!--------------------------------------------------------------------------------------------------!
2!  DFTB+: general package for performing fast atomistic simulations                                !
3!  Copyright (C) 2006 - 2019  DFTB+ developers group                                               !
4!                                                                                                  !
5!  See the LICENSE file for terms of usage and distribution.                                       !
6!--------------------------------------------------------------------------------------------------!
7
8#:include 'common.fypp'
9
10!> Contains types and functions and subroutines for manipulating linked lists.  Every list must be
11!> initialized with init, and destroyed with destroy.
12module dftbp_linkedlist
13  use dftbp_assert
14  use dftbp_accuracy
15  use dftbp_linkedlisti0
16  use dftbp_linkedlisti1
17  use dftbp_linkedlistr0
18  use dftbp_linkedlistr1
19  use dftbp_linkedlistr2
20  use dftbp_linkedlistmc0
21  use dftbp_linkedlistlc0
22  use dftbp_linkedlists0
23  implicit none
24  private
25
26
27  !> Expose the used linked list content
28  public :: listReal, listRealR1, listRealR2, listCharMc, listCharLc, listInt, listIntR1
29  public :: listString
30  public :: init, destruct, append, len, find, hasElement, elemShape, isUnishaped
31  public :: get, set, asArray, asVector, intoArray
32  public :: charMc, charLc
33
34contains
35
36
37  !> string of up to mc characters extraction from character array
38  function charMc(string)
39
40    !> full string
41    character(*), intent(in) :: string
42
43    !> resulting characters
44    character(mc) :: charMC
45
46    charMc = string(1:min(mc, len(string)))
47
48  end function charMc
49
50
51  !> string of up to lc characters extraction from character array
52  function charLc(string)
53
54    !> full string
55    character(*), intent(in) :: string
56
57    !> resulting characters
58    character(lc) :: charLc
59
60    charLc = string(1:min(lc, len(string)))
61
62  end function charLc
63
64end module dftbp_linkedlist
65