FLASH-X
Doxygen Generated Documentation From Interface Source Code
nameValueLL_getAll.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!!
37
38
39subroutine nameValueLL_getAllReal(context, num, names, values, changed)
40
41 use nameValueLL_data !, ONLY: context_type, nameValueLL_find, &
42 ! & name_invalid, name_real, name_int, name_str, name_log, &
43 ! & real_list_type, int_list_type, str_list_type, log_list_type
44
45 implicit none
46#include "constants.h"
47
48 type (context_type),intent(in) :: context
49 integer, intent(INOUT) :: num
50 character(len=MAX_STRING_LENGTH), intent(OUT) :: names(num)
51 real, intent(OUT) :: values(num)
52 logical, intent(OUT) :: changed(num)
53 type(real_list_type), pointer :: node
54 integer :: i,max_return,num_returned
55
56 max_return = num
57 i = 1
58 num_returned = 0
59 node => context%real_list
60 do while (associated(node).and.(num_returned < max_return))
61 names(i) = node%name
62 values(i) = node%value
63 if ( node%value .eq. node%initValue ) then
64 changed(i) = .false.
65 else
66 changed(i) = .true.
67 endif
68 i = i + 1
69 num_returned = num_returned + 1
70 node => node%next
71 enddo
72 num = num_returned
73end subroutine nameValueLL_getAllReal
74
75
76subroutine nameValueLL_getAllInt(context, num, names, values, changed)
77
78 use nameValueLL_data !, ONLY: context_type, nameValueLL_find, &
79 ! & name_invalid, name_real, name_int, name_str, name_log, &
80 ! & real_list_type, int_list_type, str_list_type, log_list_type
81
82 implicit none
83#include "constants.h"
84
85 type (context_type),intent(in) :: context
86 integer, intent(INOUT) :: num
87 character(len=MAX_STRING_LENGTH), intent(INOUT) :: names(num)
88 integer, intent(INOUT) :: values(num)
89 logical, intent(OUT) :: changed(num)
90 type(int_list_type), pointer :: node
91 integer :: i, max_return, num_returned
92
93 max_return = num
94 i = 1
95 num_returned = 0
96 node => context%int_list
97 do while (associated(node).and.(num_returned < max_return))
98 names(i) = node%name
99 values(i) = node%value
100 if ( node%value .eq. node%initValue ) then
101 changed(i) = .false.
102 else
103 changed(i) = .true.
104 endif
105 i = i + 1
106 num_returned = num_returned + 1
107 node => node%next
108 enddo
109
110 num = num_returned
111
112
113end subroutine nameValueLL_getAllInt
114
115subroutine nameValueLL_getAllStr(context, num, names, values, changed)
116
117 use nameValueLL_data !, ONLY: context_type, nameValueLL_find, &
118 ! & name_invalid, name_real, name_int, name_str, name_log, &
119 ! & real_list_type, int_list_type, str_list_type, log_list_type
120
121 implicit none
122#include "constants.h"
123
124 type (context_type),intent(in) :: context
125 integer, intent(INOUT) :: num
126 character(len=MAX_STRING_LENGTH), intent(OUT) :: names(num)
127 character(len=MAX_STRING_LENGTH), intent(OUT) :: values(num)
128 logical, intent(OUT) :: changed(num)
129 type(str_list_type), pointer :: node
130 integer :: i,max_return,num_returned
131
132 max_return = num
133 i = 1
134 num_returned = 0
135 node => context%str_list
136 do while (associated(node).and.(num_returned < max_return))
137 names(i) = node%name
138 values(i) = node%value
139 if ( node%value .eq. node%initValue ) then
140 changed(i) = .false.
141 else
142 changed(i) = .true.
143 endif
144 i = i + 1
145 num_returned = num_returned + 1
146 node => node%next
147 enddo
148 num = num_returned
149end subroutine nameValueLL_getAllStr
150
151subroutine nameValueLL_getAllLog (context, num, names, values, changed)
152
153 use nameValueLL_data !, ONLY: context_type, nameValueLL_find, &
154 ! & name_invalid, name_real, name_int, name_str, name_log, &
155 ! & real_list_type, int_list_type, str_list_type, log_list_type
156
157implicit none
158#include "constants.h"
159
160 type (context_type),intent(in) :: context
161 integer, intent(INOUT) :: num
162 character(len=MAX_STRING_LENGTH), intent(OUT) :: names(num)
163 logical, intent(OUT) :: values(num)
164 logical, intent(OUT) :: changed(num)
165 type(log_list_type), pointer :: node
166 integer :: i,max_return,num_returned
167
168 max_return = num
169 i = 1
170 num_returned = 0
171 node => context%log_list
172 do while (associated(node).and.(num_returned < max_return))
173 names(i) = node%name
174 values(i) = node%value
175!! some compilers (cube) doesn't like checking for equality of logical values
176!! so we work around it
177 if ( node%value .and. node%initValue ) then
178 changed(i) = .false.
179 else if ( node%value .or. node%initValue ) then
180 changed(i) = .true.
181 else
182 changed(i) = .false.
183 endif
184 i = i + 1
185 num_returned = num_returned + 1
186 node => node%next
187 enddo
188 num = num_returned
189end subroutine nameValueLL_getAllLog
190
subroutine nameValueLL_getAllLog(context, num, names, values, changed)
subroutine nameValueLL_getAllReal(context, num, names, values, changed)
subroutine nameValueLL_getAllStr(context, num, names, values, changed)
subroutine nameValueLL_getAllInt(context, num, names, values, changed)