1 #include "ScaleDBCF/DBCF.h"
7 #include "ScaleSTL/FortranTestMacros.h"
16 integer,
intent(in) :: n
17 integer :: i,last_reaction
19 do i=1,this%get_itot()
20 if( this%non0(i) > n )
then
24 if( i>this%get_itot() )
then
25 write(error_unit,*)
'error finding this daughter'
37 integer :: idaughter,adiff,z
38 logical :: was_alpha_decay,was_fp_decay
39 real(C_DOUBLE) :: myfsum,mydsum,mycsum,factor
40 real(C_DOUBLE) :: afy,libc,libd,libf
42 integer,
allocatable :: nucl(:), mt(:),loc(:),typ(:)
43 real(C_DOUBLE),
allocatable :: a(:),fiss(:),tocap(:)
44 real,
allocatable :: dis(:)
46 ilite=this%get_ilite()
48 call this%get_nucl(nucl)
49 call this%get_loc(loc)
50 call this%get_typ_nuc(typ)
52 call this%get_fiss(fiss)
53 call this%get_tocap(tocap)
54 call this%get_dis(dis)
61 if( loc(i)==parent_id )
then
68 was_alpha_decay=.false.
73 z=floor(nucl(idaughter)/10000.d0)
74 if( z==1 .OR. z==2 )
then
78 myfsum=myfsum+a(i)*factor
80 else if ( mt(i)==-1 )
then
81 adiff=nucl(loc(i))-nucl(idaughter)
83 if( nucl(idaughter)==20040 .OR. adiff==20040 )
then
84 was_alpha_decay=.true.
89 mydsum=mydsum+factor*a(i)
93 case(16,17,28,37,51,102,103,111); factor = 1; mycsum=mycsum+a(i)*factor
94 case(22,24,25,32,33,34,104,105,106,107,112); factor = 1.d0/2.d0; mycsum=mycsum+a(i)*factor
95 case(29,108); factor = 1.d0/3.d0; mycsum=mycsum+a(i)*factor
97 write(error_unit,*)
'error in reaction handling with unknown mt=',mt(i)
107 libc=tocap(parent_id)-fiss(parent_id-ilite)
108 libf=fiss(parent_id-ilite)
109 afy=myfsum/(0.5d0*fiss(parent_id-ilite))
121 expect_near(libd, mydsum, 1.0d-4)
122 expect_near(libc, mycsum, 1.0d-5)
123 expect_near(libf, myfsum, 1.0d-5)
124 expect_near(2.d0, afy, 1.d-5)
134 use origen_testpaths_m
140 #include "ScaleSTL/FortranTestMacros.h"
144 use nemesis_comm
, only: build_types, initialize, finalize, node
150 character(256) :: rbuffer(256)
153 integer :: itot,ilite,iact,ifp,nmd
154 integer,
allocatable :: myids(:)
156 integer,
allocatable :: mt_set(:)
159 integer,
allocatable :: nucl(:), typ(:),mt(:),loc(:),kd(:),non0(:),kd_(:),non0_(:)
160 real(C_DOUBLE),
allocatable :: tocap(:),fiss(:),a(:)
161 real,
allocatable :: dis(:)
163 integer :: i,j,decay_start,decay_end,reaction_start,reaction_end,u235
164 real(C_DOUBLE) :: myfis,xs1,xs2,xs3
165 integer,
allocatable :: parents(:),daughters(:),mts_p(:),mts_d(:),tinds_p(:),tinds_d(:)
167 integer,
allocatable :: mymts(:)
168 real(C_DOUBLE),
allocatable :: myxs(:)
169 type(integer2dlist) :: tinds_2d
177 if ( node() /= 0 )
call finalize
179 call lib%initialize(pwrlib_filepath)
182 call lib%find_all_mts(mt_set)
188 insist(mt_set(1)==16,
'present: Direct (n,2n) cross section MT=16')
189 insist(mt_set(2)==17,
'present: (n,3n) cross section MT=17')
190 insist(mt_set(3)==18,
'present: Total fission cross section (MT=18, sum of MT = 19, 20, 21, 38)')
191 insist(mt_set(4)==22,
"present: (n,n'ALPHA) cross section MT=22")
192 insist(mt_set(5)==23,
"present: (n,2n'ALPHA) cross section MT=23")
193 insist(mt_set(6)==24,
"present: (n,2n'ALPHA) cross section MT=24")
194 insist(mt_set(7)==25,
"present: (n,3n'ALPHA) cross section MT=25")
195 insist(mt_set(8)==28,
"present: (n,n'p) cross section MT=28")
196 insist(mt_set(9)==29,
"present: (n,nN2'ALPHA) cross section MT=29")
197 insist(mt_set(10)==32,
"present: (n,n'd) cross section MT=32")
198 insist(mt_set(11)==33,
"present: (n,n't) cross section MT=33")
199 insist(mt_set(12)==34,
"present: (n,n'He-3) MT=34")
200 insist(mt_set(13)==37,
"present: (n,4n) cross section MT=37")
201 insist(mt_set(14)==51,
"present: (n,n') to the 1st excited state MT=51")
202 insist(mt_set(15)==102,
"present: (n,GAMMA) radiative capture cross section MT=102")
203 insist(mt_set(16)==103,
"present: (n,p) cross section MT=103")
204 insist(mt_set(17)==104,
"present: (n,d) cross section MT=104")
205 insist(mt_set(18)==105,
"present: (n,t) cross section MT=105")
206 insist(mt_set(19)==106,
"present: (n,He-3) cross section MT=106")
207 insist(mt_set(20)==107,
"present: (n,ALPHA) cross section MT=107")
208 insist(mt_set(21)==108,
"present: (n,2ALPHA) cross section MT=108")
209 insist(mt_set(22)==111,
"present: (n,2p) cross section MT=111")
210 insist(mt_set(23)==112,
"present: (n,pALPHA) cross section MT=112")
214 myids(1) = lib%find_nuclide_guess(922350)
215 myids(2) = lib%find_nuclide_guess(922380)
218 call lib%get_nucl(nucl)
219 call lib%get_typ_nuc(typ)
220 call lib%get_fiss(fiss)
221 call lib%get_tocap(tocap)
222 call lib%get_dis(dis)
224 call lib%get_non0(non0)
225 call lib%get_non0_(non0_)
226 call lib%get_kd_(kd_)
228 call lib%get_loc(loc)
230 ilite=lib%get_ilite()
238 if( i>=(1+ilite) .AND. i<=(ilite+iact) )
then
239 if( typ(i)/=origen_sublib_2ac )
then
240 write(error_unit,*)
'index i=',i,
' should have been an actinide?'
248 decay_start=kd(i)-kd_(i)+1
250 reaction_start=kd(i)+1
253 expect_eq(decay_start, lib%first_transition(i))
254 expect_eq(decay_end, lib%last_transition(i,0.0d0))
255 expect_eq(reaction_end, lib%last_transition(i,1.0d0))
257 expect_eq(reaction_end-decay_start+1, non0_(i))
264 nmd = lib%num_massive_daughters(51);
270 expect_near(31.250144958496094_c_double, lib%get_xs(u235,18), 1d-5)
271 expect_near(7.8026990890502930_c_double, lib%get_xs(u235,102), 1.0d-5)
272 expect_near(7.8109970092773438_c_double, lib%get_xs(u235,101), 1.0d-5)
273 expect_near(39.061141967773438_c_double, lib%get_xs(u235,27), 1.0d-5)
275 call lib%set_xs(u235,102,10.d0)
276 expect_eq(10.d0, lib%get_xs(u235,102))
278 call lib%set_xs(u235,18,60.d0)
279 expect_eq(60.d0, lib%get_xs(u235,18))
280 expect_near(70.008297920227051_c_double, lib%get_xs(u235,27), 1d-5)
282 call lib%find_parents(u235,parents,mts_p,tinds_p)
283 call lib%find_daughters(u235,daughters,mts_d,tinds_d)
289 call tinds_2d%initialize()
290 call lib%setup_fast_transition_access(myids,mymts,tinds_2d)
296 call lib%fast_set_xs(myids,mymts,tinds_2d,myxs)
298 deallocate(parents,mts_p,tinds_p,daughters,mts_d,tinds_d)