From 7911291903b28a1e72d724d927c3ebc9caa40a43 Mon Sep 17 00:00:00 2001 From: Bryan Herman Date: Tue, 10 Jan 2012 12:09:14 -0500 Subject: [PATCH] fixed bug when allocating core map, added new global var to detect cmfd_only runs --- src/cmfd_execute.F90 | 2 +- src/cmfd_utils.F90 | 9 +++++---- src/global.F90 | 3 +++ src/main.F90 | 3 +++ 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/cmfd_execute.F90 b/src/cmfd_execute.F90 index ca7ae70a5c..04b767855d 100644 --- a/src/cmfd_execute.F90 +++ b/src/cmfd_execute.F90 @@ -52,7 +52,7 @@ contains write(108,*) cmfd % dhat ! write cmfd object to hdf5 file - call write_hdf5() +! call write_hdf5() ! solve diffusion equation call cmfd_solver() diff --git a/src/cmfd_utils.F90 b/src/cmfd_utils.F90 index 4cc9b2b6ca..370bc62bff 100644 --- a/src/cmfd_utils.F90 +++ b/src/cmfd_utils.F90 @@ -59,6 +59,9 @@ contains cmfd % coremap = reshape(mesh_ % map,(cmfd % indices(1:3))) end if + ! check for core map activation by printing note + if (allocated(cmfd % coremap)) print *,"Core Map Overlay Activated" + ! create tally objects call create_cmfd_tally() @@ -103,7 +106,7 @@ contains if (.not. allocated(cmfd % current)) allocate(cmfd % current(12,ng,nx,ny,nz)) ! allocate for coremap - if (.not. allocated(cmfd % coremap)) allocate(cmfd % coremap(nx,ny,nz)) + if (cmfd_only) allocate(cmfd % coremap(nx,ny,nz)) end subroutine allocate_cmfd @@ -130,7 +133,7 @@ contains if (allocated(cmfd % coremap)) then ! get idx from core map - nidx = ng*(cmfd % coremap(i,j,k)) + (ng - g) + nidx = ng*(cmfd % coremap(i,j,k)) - (ng - g) else @@ -465,8 +468,6 @@ contains ! close file close(UNIT=UNIT_CMFD) - STOP - end subroutine neutron_balance !=============================================================================== diff --git a/src/global.F90 b/src/global.F90 index 698c6ea96f..78845e292a 100644 --- a/src/global.F90 +++ b/src/global.F90 @@ -191,6 +191,9 @@ module global type(Timer) :: time_mat ! timer for mat building type(Timer) :: time_power ! timer for power iteration + ! Flag for CMFD only + logical :: cmfd_only = .FALSE. + ! Trace for single particle logical :: trace integer :: trace_cycle diff --git a/src/main.F90 b/src/main.F90 index 45ab739c6c..e3b6e50253 100644 --- a/src/main.F90 +++ b/src/main.F90 @@ -43,6 +43,9 @@ program main ! only perform diffusion case('--cmfd_only') + ! set CMFD only to true + cmfd_only = .TRUE. + ! read in HDF5 file call read_hdf5()