23 character(len=*),
intent(in) :: component
24 character(len=*),
intent(in),
optional :: subcomponent
25 character(len=*),
intent(in),
optional :: context
26 character(len=LENMEMPATH) :: memory_path
30 if (
present(subcomponent))
then
34 if (
present(context))
then
38 memory_path = trim(component)
40 if (
present(subcomponent))
then
44 if (
present(context))
then
57 character(len=*),
intent(in) :: mem_path
58 character(len=*),
intent(in) :: var_name
59 character(len=LENMEMADDRESS) :: mem_address
71 character(len=*),
intent(in) :: mem_address
72 character(len=LENMEMPATH),
intent(out) :: mem_path
73 character(len=LENVARNAME),
intent(out) :: var_name
74 logical(LGP),
intent(out) :: success
82 if (idx < 1 .or. idx == len(mem_address))
then
88 mem_path = mem_address(:idx - 1)
89 var_name = mem_address(idx + 1:)
108 character(len=*),
intent(in) :: mem_path
109 character(len=LENCOMPONENTNAME),
intent(out) :: component
110 character(len=LENCOMPONENTNAME),
intent(out) :: subcomponent
112 character(len=LENMEMPATH) :: local_mem_path
120 if (idx == len_trim(local_mem_path))
then
121 write (
errmsg,
'(*(G0))') &
122 'Fatal error in Memory Manager, cannot split invalid memory path: ', &
131 component = local_mem_path(:idx - 1)
132 subcomponent = local_mem_path(idx + 1:)
147 character(len=*),
intent(in) :: mem_path
148 character(len=LENMEMPATH) :: res
155 if (mem_path(1:2) ==
'__')
then
169 character(len=*),
intent(in) :: mem_path
170 character(len=LENMEMPATH),
intent(inout) :: mem_path_no_context
173 character(len=LENMEMPATH) :: context
176 mem_path_no_context = mem_path
180 if (len_trim(context) > 0)
then
181 idx = len_trim(context)
182 mem_path_no_context = mem_path(idx + 1:)
199 character(len=*),
intent(in) :: name
200 integer(I4B),
intent(in) :: max_length
201 character(len=*),
intent(in) :: description
203 if (len(trim(name)) > max_length)
then
204 write (
errmsg,
'(*(G0))') &
205 'Fatal error in Memory Manager, length of ', description,
' must be ', &
206 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