22 character(len=*),
intent(in) :: component
23 character(len=*),
intent(in),
optional :: subcomponent
24 character(len=*),
intent(in),
optional :: context
25 character(len=LENMEMPATH) :: memory_path
31 memory_path = trim(component)
33 if (
present(subcomponent))
then
37 if (
present(context))
then
50 character(len=*),
intent(in) :: mem_path
51 character(len=*),
intent(in) :: var_name
52 character(len=LENMEMADDRESS) :: mem_address
64 character(len=*),
intent(in) :: mem_address
65 character(len=LENMEMPATH),
intent(out) :: mem_path
66 character(len=LENVARNAME),
intent(out) :: var_name
67 logical(LGP),
intent(out) :: success
75 if (idx < 1 .or. idx == len(mem_address))
then
81 mem_path = mem_address(:idx - 1)
82 var_name = mem_address(idx + 1:)
101 character(len=*),
intent(in) :: mem_path
102 character(len=LENCOMPONENTNAME),
intent(out) :: component
103 character(len=LENCOMPONENTNAME),
intent(out) :: subcomponent
105 character(len=LENMEMPATH) :: local_mem_path
113 if (idx == len_trim(local_mem_path))
then
114 write (
errmsg,
'(*(G0))') &
115 'Fatal error in Memory Manager, cannot split invalid memory path: ', &
124 component = local_mem_path(:idx - 1)
125 subcomponent = local_mem_path(idx + 1:)
140 character(len=*),
intent(in) :: mem_path
141 character(len=LENMEMPATH) :: res
148 if (mem_path(1:2) ==
'__')
then
162 character(len=*),
intent(in) :: mem_path
163 character(len=LENMEMPATH),
intent(inout) :: mem_path_no_context
166 character(len=LENMEMPATH) :: context
169 mem_path_no_context = mem_path
173 if (len_trim(context) > 0)
then
174 idx = len_trim(context)
175 mem_path_no_context = mem_path(idx + 1:)
192 character(len=*),
intent(in) :: name
193 integer(I4B),
intent(in) :: max_length
194 character(len=*),
intent(in) :: description
196 if (len(trim(name)) > max_length)
then
197 write (
errmsg,
'(*(G0))') &
198 'Fatal error in Memory Manager, length of ', description,
' must be ', &
199 max_length,
' characters or less: ', name,
'(len=', len(trim(name)),
')'
This module contains simulation constants.
integer(i4b), parameter lencomponentname
maximum length of a component name
integer(i4b), parameter lenmemaddress
maximum length of the full memory address, including variable name
integer(i4b), parameter lenmemseparator
maximum length of the memory path separator used, currently a '/'
integer(i4b), parameter lenvarname
maximum length of a variable name
integer(i4b), parameter lencontextname
maximum length of a memory manager context
integer(i4b), parameter lenmempath
maximum length of the memory path
This module defines variable data types.
character(len=lenmemseparator), parameter mempathseparator
used to build up the memory address for the stored variables
character(len=lenmempath) function get_mem_path_context(mem_path)
Return the context from the memory path.
subroutine split_mem_address(mem_address, mem_path, var_name, success)
Split a memory address string into memory path and variable name.
subroutine mem_check_length(name, max_length, description)
Generic routine to check the length of (parts of) the memory address.
subroutine strip_context_mem_path(mem_path, mem_path_no_context)
Remove the context from the memory path.
character(len=lenmemaddress) function create_mem_address(mem_path, var_name)
returns the address string of the memory object
character(len=lenmempath) function create_mem_path(component, subcomponent, context)
returns the path to the memory object
subroutine split_mem_path(mem_path, component, subcomponent)
Split the memory path into component(s)
This module contains simulation methods.
subroutine, public store_error(msg, terminate)
Store an error message.
This module contains simulation variables.
character(len=maxcharlen) errmsg
error message string