@@ -69,9 +69,8 @@ subroutine get_input2(self, target, name, long_name, units, default, minimum, ma
6969 integer , optional ,intent (in ) :: order
7070
7171 class (type_settings_node), pointer :: node
72- integer :: istart
7372
74- node = > self% get_node(name, treat_as_path= treat_as_path, istart = istart, order= order)
73+ node = > self% get_node(name, treat_as_path= treat_as_path, order= order)
7574 call type_input_create(node, target , long_name, units, default, minimum, maximum, description, extra_options, method_off, method_constant, method_file, pchild, display, default_method)
7675 end subroutine
7776
@@ -96,11 +95,11 @@ subroutine type_input_create(node, target, long_name, units, default, minimum, m
9695 real (rk) :: constant_value
9796 logical :: has_constant_value
9897 class (type_input_setting), pointer :: setting
99- integer :: istart
10098 class(type_yaml_node), pointer :: node2
10199 class(type_yaml_scalar), pointer :: scalar
102100 type (type_yaml_error), pointer :: yaml_error
103101 logical :: success
102+ character (len= :), allocatable :: path
104103
105104 select type (value = > node% value)
106105 class is (type_input_setting)
@@ -110,7 +109,6 @@ subroutine type_input_create(node, target, long_name, units, default, minimum, m
110109 call node% set_value(setting)
111110 end select
112111
113- istart = index (setting% path, ' /' , .true. ) + 1
114112 setting% long_name = long_name
115113 if (units /= ' ' ) setting% long_name = setting% long_name // ' [' // units // ' ]'
116114 if (present (description)) setting% description = description
@@ -129,19 +127,19 @@ subroutine type_input_create(node, target, long_name, units, default, minimum, m
129127 setting% backing_store = > yaml_node
130128 class is (type_yaml_scalar)
131129 if (target % method_constant == method_unsupported) then
132- call setting% report_error(setting% path // ' must be a dictionary (constant values are not supported).' )
130+ call setting% report_error(setting% get_path() // ' must be a dictionary (constant values are not supported).' )
133131 return
134132 end if
135133 constant_value = yaml_node% to_real(default, success)
136134 if (.not. success) then
137- call setting% report_error(setting% path // ' is set to a single value "' // trim (yaml_node% string)// ' " that cannot be interpreted as a real number.' )
135+ call setting% report_error(setting% get_path() // ' is set to a single value "' // trim (yaml_node% string)// ' " that cannot be interpreted as a real number.' )
138136 return
139137 end if
140138 has_constant_value = .true.
141139 class is (type_yaml_null)
142- call setting% report_error(setting% path // ' must be a constant or a dictionary with further information. It cannot be null.' )
140+ call setting% report_error(setting% get_path() // ' must be a constant or a dictionary with further information. It cannot be null.' )
143141 class is (type_yaml_list)
144- call setting% report_error(setting% path // ' must be a constant or a dictionary with further information. It cannot be a list.' )
142+ call setting% report_error(setting% get_path() // ' must be a constant or a dictionary with further information. It cannot be a list.' )
145143 end select
146144 end if
147145
@@ -191,7 +189,8 @@ subroutine type_input_create(node, target, long_name, units, default, minimum, m
191189 if (present (minimum)) target % minimum = minimum
192190 if (present (maximum)) target % maximum = maximum
193191 end if
194- target % name = setting% path(2 :len (setting% path))
192+ path = setting% get_path()
193+ target % name = path(2 :len (path))
195194 if (present (pchild)) pchild = > setting
196195
197196 end subroutine type_input_create
0 commit comments