From 06254d1a482ce3abebd7aebc3071cce45733e2dd Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Sun, 1 Jul 2012 15:55:37 -0400 Subject: [PATCH] Removed atom_percent attribute from Material derived type. --- src/initialize.F90 | 16 +++++++--------- src/input_xml.F90 | 11 +++++------ src/material_header.F90 | 1 - 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/src/initialize.F90 b/src/initialize.F90 index 9b4fbdccfe..6de01f6153 100644 --- a/src/initialize.F90 +++ b/src/initialize.F90 @@ -608,7 +608,7 @@ contains do i = 1, n_materials mat => materials(i) - percent_in_atom = (mat % atom_percent(1) > ZERO) + percent_in_atom = (mat % atom_density(1) > ZERO) density_in_atom = (mat % density > ZERO) sum_percent = ZERO @@ -621,15 +621,15 @@ contains ! by awr. thus, when a sum is done over the values, it's actually ! sum(w/awr) if (.not. percent_in_atom) then - mat % atom_percent(j) = -mat % atom_percent(j) / awr + mat % atom_density(j) = -mat % atom_density(j) / awr end if end do ! determine normalized atom percents. if given atom percents, this is ! straightforward. if given weight percents, the value is w/awr and is ! divided by sum(w/awr) - sum_percent = sum(mat % atom_percent) - mat % atom_percent = mat % atom_percent / sum_percent + sum_percent = sum(mat % atom_density) + mat % atom_density = mat % atom_density / sum_percent ! Change density in g/cm^3 to atom/b-cm. Since all values are now in atom ! percent, the sum needs to be re-evaluated as 1/sum(x*awr) @@ -638,7 +638,7 @@ contains do j = 1, mat % n_nuclides index_list = dict_get_key(xs_listing_dict, mat % names(j)) awr = xs_listings(index_list) % awr - x = mat % atom_percent(j) + x = mat % atom_density(j) sum_percent = sum_percent + x*awr end do sum_percent = ONE / sum_percent @@ -646,10 +646,8 @@ contains / MASS_NEUTRON * sum_percent end if - ! Calculate nuclide atom densities and deallocate atom_percent array - ! since it is no longer needed past this point - mat % atom_density = mat % density * mat % atom_percent - deallocate(mat % atom_percent) + ! Calculate nuclide atom densities + mat % atom_density = mat % density * mat % atom_density end do end subroutine normalize_ao diff --git a/src/input_xml.F90 b/src/input_xml.F90 index 2b56d2fd70..c29c87b2b9 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -720,7 +720,6 @@ contains allocate(mat % names(n)) allocate(mat % nuclide(n)) allocate(mat % atom_density(n)) - allocate(mat % atom_percent(n)) do j = 1, mat % n_nuclides ! Combine nuclide identifier and cross section and copy into names @@ -777,23 +776,23 @@ contains ! Copy atom/weight percents if (nuc % ao /= ZERO) then - mat % atom_percent(j) = nuc % ao + mat % atom_density(j) = nuc % ao else - mat % atom_percent(j) = -nuc % wo + mat % atom_density(j) = -nuc % wo end if end do ! Check to make sure either all atom percents or all weight percents are ! given - if (.not. (all(mat % atom_percent > ZERO) .or. & - all(mat % atom_percent < ZERO))) then + if (.not. (all(mat % atom_density > ZERO) .or. & + all(mat % atom_density < ZERO))) then message = "Cannot mix atom and weight percents in material " // & to_str(mat % id) call fatal_error() end if ! Determine density if it is a sum value - if (sum_density) mat % density = sum(mat % atom_percent) + if (sum_density) mat % density = sum(mat % atom_density) ! ======================================================================= ! READ AND PARSE TAG FOR S(a,b) DATA diff --git a/src/material_header.F90 b/src/material_header.F90 index 822052fd8c..dc1ae4a35a 100644 --- a/src/material_header.F90 +++ b/src/material_header.F90 @@ -13,7 +13,6 @@ module material_header integer, allocatable :: nuclide(:) ! index in nuclides array real(8) :: density ! total atom density in atom/b-cm real(8), allocatable :: atom_density(:) ! nuclide atom density in atom/b-cm - real(8), allocatable :: atom_percent(:) ! atom/weight percent (negative for weight) ! S(a,b) data references logical :: has_sab_table = .false.