FLASH-X
Doxygen Generated Documentation From Interface Source Code
nameValueLL_rules.F90
Go to the documentation of this file.
1!! NOTICE
2!! Copyright 2022 UChicago Argonne, LLC and contributors
3!!
4!! Licensed under the Apache License, Version 2.0 (the "License");
5!! you may not use this file except in compliance with the License.
6!!
7!! Unless required by applicable law or agreed to in writing, software
8!! distributed under the License is distributed on an "AS IS" BASIS,
9!! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10!! See the License for the specific language governing permissions and
11!! limitations under the License.
12!!
26
27subroutine nameValueLL_rulesInt ( context, name, numValues, minValues, maxValues)
28
29 use nameValueLL_data !, ONLY: context_type, nameValueLL_findInt, &
30 ! & name_invalid, name_real, name_int, name_str, name_log, &
31 ! & real_list_type, int_list_type, str_list_type, log_list_type
33
34 implicit none
35
36 type (context_type), intent(inout) :: context
37 character(len=*), intent(in) :: name
38 integer, intent(in) :: numValues
39 integer,dimension(numValues),intent(in):: minValues,maxValues
40 type (int_list_type), pointer :: node
41 integer :: istat
42
43 call nameValueLL_findInt(context,name,node)
44
45 if (.not. associated(node)) then
46 call Driver_abort("rules: add parameter and then the rules")
47 endif
48
49 node%numValues = 0
50 nullify(node%maxValues)
51 nullify(node%minValues)
52 allocate(node%minValues(numValues),stat=istat)
53 if (istat /= 0) then
54 call Driver_abort("rules: unable to allocate")
55 endif
56 allocate(node%maxValues(numValues),stat=istat)
57 if (istat /= 0) then
58 call Driver_abort("rules: unable to allocate")
59 endif
60 node%minValues = minValues
61 node%maxValues = maxValues
62 node%numValues = numValues
63
64end subroutine nameValueLL_rulesInt
65
66!!
77
78subroutine nameValueLL_rulesReal ( context, name, numValues, minValues, maxValues)
79
80 use nameValueLL_data !, ONLY: context_type, nameValueLL_findReal, &
81 ! & name_invalid, name_real, name_int, name_str, name_log, &
82 ! & real_list_type, int_list_type, str_list_type, log_list_type
84
85 implicit none
86
87 type (context_type), intent(inout) :: context
88 character(len=*), intent(in) :: name
89 integer,intent(in) :: numValues
90 real,dimension(numValues),intent(in):: minValues,maxValues
91 type (real_list_type), pointer :: node
92 integer :: istat
93
94 call nameValueLL_findReal(context,name,node)
95
96 if (.not. associated(node)) then
97 call Driver_abort("rules: add parameter and then the rules")
98 endif
99
100 node%numValues = 0
101 nullify(node%minValues)
102 nullify(node%maxValues)
103 allocate(node%minValues(numValues),stat=istat)
104 if (istat /= 0) then
105 call Driver_abort("rules: unable to allocate")
106 endif
107 allocate(node%maxValues(numValues),stat=istat)
108 if (istat /= 0) then
109 call Driver_abort("rules: unable to allocate")
110 endif
111 node%minValues = minValues
112 node%maxValues = maxValues
113 node%numValues = numValues
114
115end subroutine nameValueLL_rulesReal
116
117!!
128
129subroutine nameValueLL_rulesStr ( context, name, numValues, validValues)
130
131 use nameValueLL_data !, ONLY: context_type, nameValueLL_findStr, &
132 ! & name_invalid, name_real, name_int, name_str, name_log, &
133 ! & real_list_type, int_list_type, str_list_type, log_list_type
135
136 implicit none
137
138 type (context_type), intent(inout) :: context
139 character(len=*), intent(in) :: name
140 integer,intent(in) :: numValues
141 character(len=*),dimension(numValues),intent(in):: validValues
142 type (str_list_type), pointer :: node
143 integer :: istat
144
145 call nameValueLL_findStr(context,name,node)
146
147 if (.not. associated(node)) then
148 call Driver_abort("rules: add parameter and then the rules")
149 endif
150
151 node%numValues = 0
152 nullify(node%validValues)
153 allocate(node%validValues(numValues),stat=istat)
154 if (istat /= 0) then
155 call Driver_abort("rules: unable to allocate")
156 endif
157 node%validValues = validValues
158 node%numValues = numValues
159 do istat = 1 , numValues
160 call makeLowercase(node%validValues(istat))
161 enddo
162
163end subroutine nameValueLL_rulesStr
164
subroutine makeLowercase(str)
subroutine nameValueLL_rulesReal(context, name, numValues, minValues, maxValues)
subroutine nameValueLL_rulesStr(context, name, numValues, validValues)
subroutine nameValueLL_rulesInt(context, name, numValues, minValues, maxValues)
subroutine nameValueLL_findInt(context, name, result)
subroutine nameValueLL_findStr(context, name, result)
subroutine nameValueLL_findReal(context, name, result)