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
29 if (
present(subcomponent))
then
33 if (
present(context))
then
37 memory_path = trim(component)
39 if (
present(subcomponent))
then
43 if (
present(context))
then
56 character(len=*),
intent(in) :: mem_path
57 character(len=*),
intent(in) :: var_name
58 character(len=LENMEMADDRESS) :: mem_address
70 character(len=*),
intent(in) :: mem_address
71 character(len=LENMEMPATH),
intent(out) :: mem_path
72 character(len=LENVARNAME),
intent(out) :: var_name
73 logical(LGP),
intent(out) :: success
81 if (idx < 1 .or. idx == len(mem_address))
then
87 mem_path = mem_address(:idx - 1)
88 var_name = mem_address(idx + 1:)
107 character(len=*),
intent(in) :: mem_path
108 character(len=LENCOMPONENTNAME),
intent(out) :: component
109 character(len=LENCOMPONENTNAME),
intent(out) :: subcomponent
111 character(len=LENMEMPATH) :: local_mem_path
119 if (idx == len_trim(local_mem_path))
then
120 write (
errmsg,
'(*(G0))') &
121 'Fatal error in Memory Manager, cannot split invalid memory path: ', &
130 component = local_mem_path(:idx - 1)
131 subcomponent = local_mem_path(idx + 1:)
146 character(len=*),
intent(in) :: mem_path
147 character(len=LENMEMPATH) :: res
154 if (mem_path(1:2) ==
'__')
then
168 character(len=*),
intent(in) :: mem_path
169 character(len=LENMEMPATH),
intent(inout) :: mem_path_no_context
172 character(len=LENMEMPATH) :: context
175 mem_path_no_context = mem_path
179 if (len_trim(context) > 0)
then
180 idx = len_trim(context)
181 mem_path_no_context = mem_path(idx + 1:)
198 character(len=*),
intent(in) :: name
199 integer(I4B),
intent(in) :: max_length
200 character(len=*),
intent(in) :: description
202 if (len(trim(name)) > max_length)
then
203 write (
errmsg,
'(*(G0))') &
204 'Fatal error in Memory Manager, length of ', description,
' must be ', &
205 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