MODFLOW 6 version 6.9.0.dev0
USGS Modular Hydrologic Model
Loading...
Searching...
No Matches
stlstackintmodule Module Reference

Data Types

type  stlstackint
 A derived type representing a stack of integers. More...

Functions/Subroutines

subroutine init (this, capacity)
subroutine push (this, newvalue)
subroutine pop (this)
integer(i4b) function top (this)
integer(i4b) function size (this)
subroutine destroy (this)

Function/Subroutine Documentation

◆ destroy()

subroutine stlstackintmodule::destroy ( class(stlstackint), intent(inout) this)
private

Definition at line 79 of file STLStackInt.f90.

80 class(STLStackInt), intent(inout) :: this
81
82 call this%stack%destroy()
83

◆ init()

subroutine stlstackintmodule::init ( class(stlstackint), intent(inout) this,
integer(i4b), intent(in), optional capacity )

Definition at line 27 of file STLStackInt.f90.

28 class(STLStackInt), intent(inout) :: this
29 integer(I4B), intent(in), optional :: capacity ! the initial capacity, when given
30
31 ! init the vector
32 if (present(capacity)) then
33 call this%stack%init(capacity)
34 else
35 call this%stack%init()
36 end if
37

◆ pop()

subroutine stlstackintmodule::pop ( class(stlstackint), intent(inout) this)
private

Definition at line 48 of file STLStackInt.f90.

49 class(STLStackInt), intent(inout) :: this
50
51 if (this%stack%size == 0) then
52 write (*, *) 'STLStackInt exception: cannot pop an empty stack'
53 call ustop()
54 end if
55 this%stack%size = this%stack%size - 1
56
Here is the call graph for this function:

◆ push()

subroutine stlstackintmodule::push ( class(stlstackint), intent(inout) this,
integer(i4b) newvalue )
private

Definition at line 40 of file STLStackInt.f90.

41 class(STLStackInt), intent(inout) :: this
42 integer(I4B) :: newValue
43
44 call this%stack%push_back(newvalue)
45

◆ size()

integer(i4b) function stlstackintmodule::size ( class(stlstackint), intent(in) this)
private

Definition at line 71 of file STLStackInt.f90.

72 class(STLStackInt), intent(in) :: this
73 integer(I4B) :: size_value
74
75 size_value = this%stack%size
76

◆ top()

integer(i4b) function stlstackintmodule::top ( class(stlstackint), intent(in) this)
private

Definition at line 59 of file STLStackInt.f90.

60 class(STLStackInt), intent(in) :: this
61 integer(I4B) :: top_value
62
63 if (this%stack%size == 0) then
64 write (*, *) 'STLStackInt exception: cannot get top of an empty stack'
65 call ustop()
66 end if
67 top_value = this%stack%at(this%stack%size)
68
Here is the call graph for this function: