9 use nemesis_comm
, only: build_types, initialize, finalize, node
12 #include "ScaleSTL/FortranTestMacros.h"
20 integer :: itot,nsteps
21 real(C_DOUBLE),
allocatable :: times(:)
22 real(C_DOUBLE),
allocatable :: conc_buffer1(:),conc_buffer2(:,:)
23 real(C_DOUBLE),
allocatable :: fluxes(:)
24 integer,
parameter :: nnucl0=2
25 real(C_DOUBLE) :: conc0(nnucl0)
26 integer :: nucl0(nnucl0), typ0(nnucl0)
27 integer,
allocatable :: myids(:)
28 real(C_DOUBLE),
allocatable :: myxs(:)
30 logical :: mt_set(200)
32 integer,
allocatable :: all_nucl(:), all_typ(:),all_mt(:),all_loc(:)
33 real(C_DOUBLE),
allocatable :: conc(:,:),all_tocap(:),all_fiss(:)
35 integer :: i,j,ilite,iact,ifp
36 real(C_DOUBLE) :: dt,myfis
43 if( node() /= 0 )
call finalize
46 allocate(times(0:nsteps),fluxes(1:nsteps))
50 times(i)=times(i-1)+dt
57 typ0=[origen_sublib_2ac,origen_sublib_2ac]
62 call libw % initialize(pwrlib_filepath)
63 itot=libw % get_itot()
64 allocate( conc(0:nsteps,1:itot) )
65 allocate(conc_buffer1(itot))
66 allocate(myids(2),myxs(2))
67 myids(1) = libw % find_nuclide_guess(922350)
68 myids(2) = libw % find_nuclide_guess(922380)
69 myxs(1) = libw % get_xs(myids(1),18)
79 call libw % print_transitions_for(922350,18);
81 call libw % print_info();
83 call libw % library_printout(.true.,.true.,.true.);
86 call libw % get_nucl(all_nucl)
87 call libw % get_typ_nuc(all_typ)
88 call libw % get_fiss(all_fiss)
89 call libw % get_tocap(all_tocap)
98 ilite=libw % get_ilite()
99 iact=libw % get_iact()
102 if( i>=(1+ilite) .AND. i<=(ilite+iact) )
then
103 expect_eq(origen_sublib_2ac, all_typ(i))
104 myfis=all_fiss(i-ilite)
111 call libw % get_mt(all_mt)
112 call libw % get_loc(all_loc)
119 do i=1,libw % get_non()
121 mt_set(abs(all_mt(i)))=.true.
125 if(mt_set(i))
write(error_unit,*)mt_set(i)
132 call casew % initialize(libw)
133 expect_eq(itot,casew % total_nuclides())
134 call casew % set_times(times(i-1:i))
135 call casew % set_fluxes(fluxes(i:i))
141 call casew % set_initial_concentrations(nnucl0,nucl0,conc0,typ0,origen_concentrationunit_gatoms)
145 conc_buffer1=conc(i-1,1:itot)
146 call casew % set_initial_concentrations_by_vector(conc_buffer1,origen_concentrationunit_gatoms)
153 call casew % get_concentrations(conc_buffer2)
154 conc(i-1:i,1:itot)=conc_buffer2
159 call casew % destroy()
160 call libw % destroy()
170 real(C_DOUBLE),
allocatable :: times(:)
171 real(C_DOUBLE) :: times1a(0:1)
172 real(C_DOUBLE) :: times2a(1:2)
173 real(C_DOUBLE) :: times1b(0:2)
174 real(C_DOUBLE) :: times2b(1:3)
177 call casewt%initialize(libwt)
181 call casewt%set_times(times1a)
182 expect_eq(1,casewt%nsteps())
183 call casewt%get_times(times)
184 expect_eq(0.0,times(0))
185 expect_eq(1.0,times(1))
186 expect_eq(2,
size(times,1))
190 call casewt%set_times(times2a)
191 expect_eq(1,casewt%nsteps())
192 call casewt%get_times(times)
193 expect_eq(0.0,times(0))
194 expect_eq(1.0,times(1))
195 expect_eq(2,
size(times,1))
198 times1b = [0d0,1d0,2d0]
199 call casewt%set_times(times1b)
200 expect_eq(2,casewt%nsteps())
201 call casewt%get_times(times)
202 expect_eq(0.0,times(0))
203 expect_eq(1.0,times(1))
204 expect_eq(2.0,times(2))
205 expect_eq(3,
size(times,1))
208 times2b = [0d0,1d0,2d0]
209 call casewt%set_times(times2b)
210 expect_eq(2,casewt%nsteps())
211 call casewt%get_times(times)
212 expect_eq(0.0,times(0))
213 expect_eq(1.0,times(1))
214 expect_eq(2.0,times(2))
215 expect_eq(3,
size(times,1))
217 call casewt%destroy()