moved cmfd%hxyz setting out of loops, time in compute_xs dropped by 2 orders of magnitude

This commit is contained in:
Bryan Herman 2012-02-10 08:24:55 -08:00
parent f66923284e
commit 74a3db18aa
2 changed files with 14 additions and 13 deletions

View file

@ -25,12 +25,9 @@ contains
call set_coremap()
end if
call timer_reset(time_cmfd)
call timer_start(time_cmfd)
! calculate all cross sections based on reaction rates from last batch
call compute_xs()
call timer_stop(time_cmfd)
print *,'Time is:',time_cmfd%elapsed
! write out the neutron balance file
call neutron_balance()
@ -86,6 +83,15 @@ contains
! set flux object to all zeros
cmfd % flux = 0.0_8
! associate tallies and mesh
t => tallies(1)
m => meshes(t % mesh)
! set mesh widths
cmfd % hxyz(1,:,:,:) = m % width(1) ! set x width
cmfd % hxyz(2,:,:,:) = m % width(2) ! set y width
cmfd % hxyz(3,:,:,:) = m % width(3) ! set z width
! begin loop around tallies
TAL: do ital = 1,3
@ -113,11 +119,6 @@ contains
! start tally 1
TALLY: if (ital == 1) then
! set mesh widths
cmfd % hxyz(1,:,:,:) = m % width(1) ! set x width
cmfd % hxyz(2,:,:,:) = m % width(2) ! set y width
cmfd % hxyz(3,:,:,:) = m % width(3) ! set z width
! reset all bins to 1
bins = 1

View file

@ -41,19 +41,19 @@ contains
if (master) then
! begin timer
! call timer_start(time_cmfd)
call timer_start(time_cmfd)
! set up cmfd
if(.not. cmfd_only) call set_up_cmfd()
! call timer_start(time_cmfd)
#ifdef PETSC
! execute snes solver
call cmfd_snes_execute()
#endif
! stop timer
! call timer_stop(time_cmfd)
! print *,'Time was:',time_cmfd%elapsed
call timer_stop(time_cmfd)
! write vtk file
!if(.not. cmfd_only) call write_cmfd_vtk()