Module dc_trace

module dc_trace

        ! Uses
    use dc_types, only: TOKEN, STRING

        ! Variables
    logical, private, save :: lfirst = .true.
    integer, public, save :: dbg = -1
    integer, private, save :: level = 0
    integer, private, parameter :: trace_stack_size = 128
    character (len=TOKEN), private, save, dimension (trace_stack_size) :: table
    character (len=STRING), private, save, allocatable, dimension (:) :: called_subname
    character (len=STRING), private, save, allocatable, dimension (:) :: called_subname_tmp
    character, private, parameter :: head = '#'
    character (len=2), private, parameter :: indent = '| '
    character (len=2), private, parameter :: meshead = '|-'

        ! Interfaces
    public interface DataDump

        ! Subroutines and functions
    public integer function SubLevel ()
    public subroutine Dbg_Scratch (on)
    public subroutine SetDebug (debug)
    public logical function Debug ()
    private subroutine initialize ()
    public subroutine BeginSub (name, fmt, i, r, d, L, s, n, c1, c2, c3, ca, version)
    public subroutine EndSub (name, fmt, i, r, d, L, s, n, c1, c2, c3, ca)
    public subroutine DbgMessage (fmt, i, r, d, L, s, n, c1, c2, c3, ca)
    private subroutine DataD1Dump (header, d, strlen, multi)
    private subroutine DataD2Dump (header, d, strlen, multi)
    private subroutine DataD3Dump (header, d, strlen, multi)
    private subroutine append (unit, ucur, val, stat, strlen)

end module dc_trace

Description of Variables

lfirst

logical, private, save :: lfirst = .true.

dbg

integer, public, save :: dbg = -1

level

integer, private, save :: level = 0

trace_stack_size

integer, private, parameter :: trace_stack_size = 128

table

character (len=TOKEN), private, save, dimension (trace_stack_size) :: table

called_subname

character (len=STRING), private, save, allocatable, dimension (:) :: called_subname

called_subname_tmp

character (len=STRING), private, save, allocatable, dimension (:) :: called_subname_tmp

head

character, private, parameter :: head = '#'

indent

character (len=2), private, parameter :: indent = '| '

meshead

character (len=2), private, parameter :: meshead = '|-'

Description of Interfaces

DataDump

public interface DataDump
    module procedure DataD1Dump
    module procedure DataD2Dump
    module procedure DataD3Dump
end interface DataDump

Description of Subroutines and Functions

SubLevel

public function SubLevel () result (result)
    integer :: result
end function SubLevel

Dbg_Scratch

public subroutine Dbg_Scratch (on)
    logical, intent(in) :: on
end subroutine Dbg_Scratch

SetDebug

public subroutine SetDebug (debug)
    integer, optional, intent(in) :: debug
end subroutine SetDebug

Debug

public function Debug () result (result)
    logical :: result
end function Debug

initialize

private subroutine initialize ()
end subroutine initialize

BeginSub

public subroutine BeginSub (name, fmt, i, r, d, L, s, n, c1, c2, c3, ca, version)
    character (len=*), intent(in) :: name
    character (len=*), optional, intent(in) :: fmt
    integer, optional, intent(in), dimension (:) :: i
    real, optional, intent(in), dimension (:) :: r
    real (kind=DP), optional, intent(in), dimension (:) :: d
    logical, optional, intent(in), dimension (:) :: L
    type (VSTRING), optional, intent(in), dimension (:) :: s
    integer, optional, intent(in), dimension (:) :: n
    character (len=*), optional, intent(in) :: c1
    character (len=*), optional, intent(in) :: c2
    character (len=*), optional, intent(in) :: c3
    character (len=*), optional, intent(in), dimension (:) :: ca
    character (len=*), optional, intent(in) :: version
    ! Calls: initialize
end subroutine BeginSub

EndSub

public subroutine EndSub (name, fmt, i, r, d, L, s, n, c1, c2, c3, ca)
    character (len=*), intent(in) :: name
    character (len=*), optional, intent(in) :: fmt
    integer, optional, intent(in), dimension (:) :: i
    real, optional, intent(in), dimension (:) :: r
    real (kind=DP), optional, intent(in), dimension (:) :: d
    logical, optional, intent(in), dimension (:) :: L
    type (VSTRING), optional, intent(in), dimension (:) :: s
    integer, optional, intent(in), dimension (:) :: n
    character (len=*), optional, intent(in) :: c1
    character (len=*), optional, intent(in) :: c2
    character (len=*), optional, intent(in) :: c3
    character (len=*), optional, intent(in), dimension (:) :: ca
    ! Calls: initialize
end subroutine EndSub

DbgMessage

public subroutine DbgMessage (fmt, i, r, d, L, s, n, c1, c2, c3, ca)
    character (len=*), intent(in) :: fmt
    integer, optional, intent(in), dimension (:) :: i
    real, optional, intent(in), dimension (:) :: r
    real (kind=DP), optional, intent(in), dimension (:) :: d
    logical, optional, intent(in), dimension (:) :: L
    type (VSTRING), optional, intent(in), dimension (:) :: s
    integer, optional, intent(in), dimension (:) :: n
    character (len=*), optional, intent(in) :: c1
    character (len=*), optional, intent(in) :: c2
    character (len=*), optional, intent(in) :: c3
    character (len=*), optional, intent(in), dimension (:) :: ca
end subroutine DbgMessage

DataD1Dump

private subroutine DataD1Dump (header, d, strlen, multi)
    character (len=*), intent(in) :: header
    real (kind=DP), intent(in), dimension (:) :: d
    integer, optional, intent(in) :: strlen
    integer, optional, intent(in), dimension (:) :: multi
    ! Calls: append
end subroutine DataD1Dump

DataD2Dump

private subroutine DataD2Dump (header, d, strlen, multi)
    character (len=*), intent(in) :: header
    real (kind=DP), intent(in), dimension (:,:) :: d
    integer, optional, intent(in) :: strlen
    integer, optional, intent(in), dimension (:) :: multi
    ! Calls: DataDump
end subroutine DataD2Dump

DataD3Dump

private subroutine DataD3Dump (header, d, strlen, multi)
    character (len=*), intent(in) :: header
    real (kind=DP), intent(in), dimension (:,:,:) :: d
    integer, optional, intent(in) :: strlen
    integer, optional, intent(in), dimension (:) :: multi
    ! Calls: DataDump
end subroutine DataD3Dump

append

private subroutine append (unit, ucur, val, stat, strlen)
    character (len=*), intent(inout) :: unit
    integer, intent(inout) :: ucur
    character (len=*), intent(in) :: val
    integer, intent(out) :: stat
    integer, optional, intent(in) :: strlen
end subroutine append