3 #include "ScaleSTL/FortranTestMacros.h"
13 type(origen_state) :: state
14 type(origen_concentrations) :: concs
15 type(origen_nuclideset) :: nuclide_set
16 integer(C_INT),
allocatable :: ids(:)
17 real(C_DOUBLE),
allocatable :: vals(:)
20 integer(C_INT) :: units
21 logical :: loaded,status
22 integer(C_SIZE_T) :: i,j
25 call state_set % initialize()
26 loaded = ff % StateSet_random1(state_set,333)
27 if( .not. loaded )stop 1
30 call state % initialize()
31 call concs % initialize()
32 call nuclide_set % initialize()
34 expect_eq(44,state_set%states_size())
35 do i=1,state_set % states_size()
38 call state_set % get_states_at(state,i)
41 call state % get_concs(concs)
42 units = concs % units()
43 call concs % get_vals(vals)
46 call concs % get_nuclide_set(nuclide_set)
47 call nuclide_set % get_ids(ids)
51 expect_eq(nuclide_set%total_nuclides(),
size(ids,1))
52 expect_eq(nuclide_set%total_nuclides(),
size(vals,1))
55 expect_eq(ids(j) ,nuclide_set%ids_at(j))
56 expect_eq(vals(j) ,concs%vals_at(j))
61 call nuclide_set % destroy()
62 call concs % destroy()
63 call state % destroy()
68 write(*,
'(a40,a10)')
'method',
'time(ms)'
73 write(*,
'(a40,f10.3)')
"ScaleSTL_Vec",1000*(tout-tin)/(repeat)
78 write(*,
'(a40,f10.3)')
"ScaleSTL_Vec*",1000*(tout-tin)/(repeat)
83 write(*,
'(a40,f10.3)')
"ScaleSTL_Vec_at",1000*(tout-tin)/(repeat)
88 write(*,
'(a40,f10.3)')
"Fortran Native Arrays",1000*(tout-tin)/(repeat)
91 write(*,*)
'note: repeat=',repeat
94 call state_set % destroy()
99 integer,
intent(in) :: repeat
101 type(origen_state) :: state
102 type(origen_concentrations) :: concs
103 type(origen_nuclideset) :: nuclide_set
104 type(scalestl_vec_int) :: ids
105 type(scalestl_vec_dbl) :: vals
106 integer(C_INT) :: units
107 integer(C_SIZE_T) :: i,j
109 integer(C_INT) :: isum
110 real(C_DOUBLE) :: dsum
112 call ids % initialize()
113 call nuclide_set % initialize()
114 call vals % initialize()
115 call concs % initialize()
116 call state % initialize()
121 do i=1,state_set % states_size()
123 call state_set % get_states_at(state,i)
126 call state % get_concs(concs)
129 units = concs % units()
130 call concs % get_vals_vec(vals)
133 call concs % get_nuclide_set(nuclide_set)
134 call nuclide_set % get_ids_vec(ids)
145 call nuclide_set % destroy()
146 call vals % destroy()
147 call concs % destroy()
148 call state % destroy()
153 integer,
intent(in) :: repeat
155 type(origen_state) :: state
156 type(origen_concentrations) :: concs
157 type(origen_nuclideset) :: nuclide_set
158 type(scalestl_vec_int) :: ids
159 type(scalestl_vec_dbl) :: vals
160 integer(C_INT) :: units
161 integer(C_SIZE_T) :: i,j
163 integer(C_INT) :: isum
164 real(C_DOUBLE) :: dsum
169 do i=1,state_set % states_size()
171 call state_set % getptr_states_at(state,i)
174 call state % getptr_concs(concs)
177 units = concs % units()
178 call concs % getptr_vals_vec(vals)
181 call concs % getptr_nuclide_set(nuclide_set)
182 call nuclide_set % getptr_ids_vec(ids)
195 integer,
intent(in) :: repeat
197 type(origen_state) :: state
198 type(origen_concentrations) :: concs
199 type(origen_nuclideset) :: nuclide_set
200 integer(C_INT) :: units
201 integer(C_SIZE_T) :: i,j
203 integer(C_INT) :: isum
204 real(C_DOUBLE) :: dsum
206 call nuclide_set % initialize()
207 call concs % initialize()
208 call state % initialize()
213 do i=1,state_set % states_size()
215 call state_set % get_states_at(state,i)
218 call state % get_concs(concs)
221 units = concs % units()
224 call concs % get_nuclide_set(nuclide_set)
226 do j=1,nuclide_set%total_nuclides()
227 isum=isum+nuclide_set%ids_at(j)
228 dsum=dsum+concs%vals_at(j)
234 call nuclide_set % destroy()
235 call concs % destroy()
236 call state % destroy()
242 integer,
intent(in) :: repeat
244 type(origen_state) :: state
245 type(origen_concentrations) :: concs
246 type(origen_nuclideset) :: nuclide_set
247 integer(C_INT),
allocatable :: ids(:)
248 real(C_DOUBLE),
allocatable :: vals(:)
249 integer(C_INT) :: units
250 integer(C_SIZE_T) :: i,j
252 integer(C_INT) :: isum
253 real(C_DOUBLE) :: dsum
255 call nuclide_set % initialize()
256 call concs % initialize()
257 call state % initialize()
262 do i=1,state_set % states_size()
264 call state_set % get_states_at(state,i)
267 call state % get_concs(concs)
270 units = concs % units()
271 call concs % get_vals(vals)
274 call concs % get_nuclide_set(nuclide_set)
275 call nuclide_set % get_ids(ids)
285 call nuclide_set % destroy()
286 call concs % destroy()
287 call state % destroy()