mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 14:15:42 -04:00
Changed variable names to not override intrinsics.
This commit is contained in:
parent
1c4c072826
commit
b78676e7c8
10 changed files with 150 additions and 170 deletions
|
|
@ -39,7 +39,7 @@ contains
|
|||
|
||||
integer :: i ! index in materials array
|
||||
integer :: j ! index over nuclides in material
|
||||
integer :: index ! index in xs_listings array
|
||||
integer :: index_list ! index in xs_listings array
|
||||
integer :: index_nuclides ! index in nuclides
|
||||
integer :: index_sab ! index in sab_tables
|
||||
character(10) :: name ! name of isotope, e.g. 92235.03c
|
||||
|
|
@ -76,9 +76,9 @@ contains
|
|||
|
||||
! Find index in xs_listing and set the name and alias according to the
|
||||
! listing
|
||||
index = dict_get_key(xs_listing_dict, name)
|
||||
name = xs_listings(index) % name
|
||||
alias = xs_listings(index) % alias
|
||||
index_list = dict_get_key(xs_listing_dict, name)
|
||||
name = xs_listings(index_list) % name
|
||||
alias = xs_listings(index_list) % alias
|
||||
|
||||
! If this nuclide hasn't been encountered yet, we need to add its name
|
||||
! and alias to the nuclide_dict
|
||||
|
|
@ -107,9 +107,9 @@ contains
|
|||
|
||||
! Find index in xs_listing and set the name and alias according to the
|
||||
! listing
|
||||
index = dict_get_key(xs_listing_dict, name)
|
||||
name = xs_listings(index) % name
|
||||
alias = xs_listings(index) % alias
|
||||
index_list = dict_get_key(xs_listing_dict, name)
|
||||
name = xs_listings(index_list) % name
|
||||
alias = xs_listings(index_list) % alias
|
||||
|
||||
! If this S(a,b) table hasn't been encountered yet, we need to add its
|
||||
! name and alias to the sab_dict
|
||||
|
|
@ -146,12 +146,12 @@ contains
|
|||
name = mat % names(j)
|
||||
|
||||
if (.not. dict_has_key(already_read, name)) then
|
||||
index = dict_get_key(xs_listing_dict, name)
|
||||
index_list = dict_get_key(xs_listing_dict, name)
|
||||
index_nuclides = dict_get_key(nuclide_dict, name)
|
||||
name = xs_listings(index) % name
|
||||
alias = xs_listings(index) % alias
|
||||
name = xs_listings(index_list) % name
|
||||
alias = xs_listings(index_list) % alias
|
||||
|
||||
call read_ace_table(index_nuclides, index)
|
||||
call read_ace_table(index_nuclides, index_list)
|
||||
|
||||
call dict_add_key(already_read, name, 0)
|
||||
call dict_add_key(already_read, alias, 0)
|
||||
|
|
@ -162,10 +162,10 @@ contains
|
|||
name = mat % sab_name
|
||||
|
||||
if (.not. dict_has_key(already_read, name)) then
|
||||
index = dict_get_key(xs_listing_dict, name)
|
||||
index_sab = dict_get_key(sab_dict, name)
|
||||
index_list = dict_get_key(xs_listing_dict, name)
|
||||
index_sab = dict_get_key(sab_dict, name)
|
||||
|
||||
call read_ace_table(index_sab, index)
|
||||
call read_ace_table(index_sab, index_list)
|
||||
|
||||
call dict_add_key(already_read, name, 0)
|
||||
end if
|
||||
|
|
|
|||
|
|
@ -22,8 +22,7 @@ contains
|
|||
|
||||
integer :: i ! index in materials array
|
||||
integer :: j ! index over nuclides in material
|
||||
integer :: index ! index in xs_listings array
|
||||
integer :: index_nuclides ! index in nuclides
|
||||
integer :: index_list ! index in xs_listings array
|
||||
character(10) :: name ! name of isotope, e.g. 92235.03c
|
||||
character(10) :: alias ! alias of nuclide, e.g. U-235.03c
|
||||
type(ListReal), pointer :: list => null()
|
||||
|
|
@ -51,10 +50,9 @@ contains
|
|||
call add_grid_points(list, nuc % energy)
|
||||
|
||||
! determine name and alias from xs_listings
|
||||
index = dict_get_key(xs_listing_dict, name)
|
||||
index_nuclides = dict_get_key(nuclide_dict, name)
|
||||
name = xs_listings(index) % name
|
||||
alias = xs_listings(index) % alias
|
||||
index_list = dict_get_key(xs_listing_dict, name)
|
||||
name = xs_listings(index_list) % name
|
||||
alias = xs_listings(index_list) % alias
|
||||
|
||||
! add name and alias to dictionary
|
||||
call dict_add_key(already_added, name, 0)
|
||||
|
|
@ -88,7 +86,7 @@ contains
|
|||
type(ListReal), pointer :: list
|
||||
real(8), intent(in) :: energy(:)
|
||||
|
||||
integer :: index
|
||||
integer :: i
|
||||
integer :: n
|
||||
real(8) :: E
|
||||
type(ListReal), pointer :: current => null()
|
||||
|
|
@ -96,7 +94,7 @@ contains
|
|||
type(ListReal), pointer :: head => null()
|
||||
type(ListReal), pointer :: tmp => null()
|
||||
|
||||
index = 1
|
||||
i = 1
|
||||
n = size(energy)
|
||||
|
||||
! if the original list is empty, we need to allocate the first element and
|
||||
|
|
@ -104,9 +102,9 @@ contains
|
|||
if (list_size(list) == 0) then
|
||||
allocate(list)
|
||||
current => list
|
||||
do index = 1, n
|
||||
current % data = energy(index)
|
||||
if (index == n) then
|
||||
do i = 1, n
|
||||
current % data = energy(i)
|
||||
if (i == n) then
|
||||
current % next => null()
|
||||
return
|
||||
end if
|
||||
|
|
@ -118,19 +116,19 @@ contains
|
|||
current => list
|
||||
head => list
|
||||
|
||||
do while (index <= n)
|
||||
E = energy(index)
|
||||
do while (i <= n)
|
||||
E = energy(i)
|
||||
|
||||
! If we've reached the end of the grid energy list, add the remaining
|
||||
! energy points to the end
|
||||
if (.not. associated(current)) then
|
||||
! finish remaining energies
|
||||
do while (index <= n)
|
||||
do while (i <= n)
|
||||
allocate(previous % next)
|
||||
current => previous % next
|
||||
current % data = energy(index)
|
||||
current % data = energy(i)
|
||||
previous => current
|
||||
index = index + 1
|
||||
i = i + 1
|
||||
end do
|
||||
current%next => null()
|
||||
exit
|
||||
|
|
@ -151,12 +149,12 @@ contains
|
|||
nullify(tmp)
|
||||
|
||||
! advance index
|
||||
index = index + 1
|
||||
i = i + 1
|
||||
|
||||
elseif (E == current % data) then
|
||||
! found the exact same energy, no need to store duplicates so just
|
||||
! skip and move to next index
|
||||
index = index + 1
|
||||
i = i + 1
|
||||
else
|
||||
previous => current
|
||||
current => current % next
|
||||
|
|
@ -178,7 +176,7 @@ contains
|
|||
|
||||
integer :: i
|
||||
integer :: j
|
||||
integer :: index
|
||||
integer :: index_e
|
||||
integer :: n_grid_nuclide
|
||||
real(8) :: union_energy
|
||||
real(8) :: energy
|
||||
|
|
@ -189,16 +187,16 @@ contains
|
|||
n_grid_nuclide = size(nuc % energy)
|
||||
allocate(nuc % grid_index(n_grid))
|
||||
|
||||
index = 1
|
||||
energy = nuc % energy(index)
|
||||
index_e = 1
|
||||
energy = nuc % energy(index_e)
|
||||
|
||||
do j = 1, n_grid
|
||||
union_energy = e_grid(j)
|
||||
if (union_energy >= energy .and. index < n_grid_nuclide) then
|
||||
index = index + 1
|
||||
energy = nuc % energy(index)
|
||||
if (union_energy >= energy .and. index_e < n_grid_nuclide) then
|
||||
index_e = index_e + 1
|
||||
energy = nuc % energy(index_e)
|
||||
end if
|
||||
nuc % grid_index(j) = index-1
|
||||
nuc % grid_index(j) = index_e - 1
|
||||
end do
|
||||
end do
|
||||
|
||||
|
|
|
|||
|
|
@ -37,9 +37,9 @@ contains
|
|||
|
||||
character(MAX_LINE_LEN) :: line ! single line
|
||||
character(MAX_WORD_LEN) :: local_words(MAX_WORDS) ! words on one line
|
||||
integer :: index ! index of words
|
||||
integer :: index_word ! index of words
|
||||
|
||||
index = 0
|
||||
index_word = 0
|
||||
do
|
||||
! read line from file
|
||||
read(UNIT=unit, FMT='(A100)', IOSTAT=ioError) line
|
||||
|
|
@ -55,17 +55,17 @@ contains
|
|||
|
||||
! Check whether there is a continuation line
|
||||
if (local_words(n) == '&') then
|
||||
words(index+1:index+n-1) = local_words(1:n-1)
|
||||
index = index + n - 1
|
||||
words(index_word+1:index_word+n-1) = local_words(1:n-1)
|
||||
index_word = index_word + n - 1
|
||||
else
|
||||
words(index+1:index+n) = local_words(1:n)
|
||||
index = index + n
|
||||
words(index_word+1:index_word+n) = local_words(1:n)
|
||||
index_word = index_word + n
|
||||
exit
|
||||
end if
|
||||
end do
|
||||
|
||||
! set total number of words
|
||||
n = index
|
||||
n = index_word
|
||||
|
||||
end subroutine get_next_line
|
||||
|
||||
|
|
|
|||
|
|
@ -1129,7 +1129,7 @@ contains
|
|||
|
||||
integer :: i ! index in cells/surfaces array
|
||||
integer :: j ! index of surface in cell
|
||||
integer :: index ! index in count arrays
|
||||
integer :: i_surface ! index in count arrays
|
||||
integer, allocatable :: count_positive(:) ! # of cells on positive side
|
||||
integer, allocatable :: count_negative(:) ! # of cells on negative side
|
||||
logical :: positive ! positive side specified in surface list
|
||||
|
|
@ -1149,13 +1149,13 @@ contains
|
|||
|
||||
! loop over each surface specification
|
||||
do j = 1, c % n_surfaces
|
||||
index = c % surfaces(j)
|
||||
positive = (index > 0)
|
||||
index = abs(index)
|
||||
i_surface = c % surfaces(j)
|
||||
positive = (i_surface > 0)
|
||||
i_surface = abs(i_surface)
|
||||
if (positive) then
|
||||
count_positive(index) = count_positive(index) + 1
|
||||
count_positive(i_surface) = count_positive(i_surface) + 1
|
||||
else
|
||||
count_negative(index) = count_negative(index) + 1
|
||||
count_negative(i_surface) = count_negative(i_surface) + 1
|
||||
end if
|
||||
end do
|
||||
end do
|
||||
|
|
@ -1180,17 +1180,17 @@ contains
|
|||
|
||||
! loop over each surface specification
|
||||
do j = 1, c % n_surfaces
|
||||
index = c % surfaces(j)
|
||||
positive = (index > 0)
|
||||
index = abs(index)
|
||||
i_surface = c % surfaces(j)
|
||||
positive = (i_surface > 0)
|
||||
i_surface = abs(i_surface)
|
||||
|
||||
surf => surfaces(index)
|
||||
surf => surfaces(i_surface)
|
||||
if (positive) then
|
||||
count_positive(index) = count_positive(index) + 1
|
||||
surf%neighbor_pos(count_positive(index)) = i
|
||||
count_positive(i_surface) = count_positive(i_surface) + 1
|
||||
surf%neighbor_pos(count_positive(i_surface)) = i
|
||||
else
|
||||
count_negative(index) = count_negative(index) + 1
|
||||
surf%neighbor_neg(count_negative(index)) = i
|
||||
count_negative(i_surface) = count_negative(i_surface) + 1
|
||||
surf%neighbor_neg(count_negative(i_surface)) = i
|
||||
end if
|
||||
end do
|
||||
end do
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@ contains
|
|||
integer :: n
|
||||
integer :: n_x, n_y
|
||||
integer :: universe_num
|
||||
integer :: count
|
||||
integer :: n_cells_in_univ
|
||||
integer :: coeffs_reqd
|
||||
logical :: file_exists
|
||||
character(MAX_LINE_LEN) :: filename
|
||||
|
|
@ -228,12 +228,12 @@ contains
|
|||
universe_num = cell_(i) % universe
|
||||
if (.not. dict_has_key(cells_in_univ_dict, universe_num)) then
|
||||
n_universes = n_universes + 1
|
||||
count = 1
|
||||
n_cells_in_univ = 1
|
||||
call dict_add_key(universe_dict, universe_num, n_universes)
|
||||
else
|
||||
count = 1 + dict_get_key(cells_in_univ_dict, universe_num)
|
||||
n_cells_in_univ = 1 + dict_get_key(cells_in_univ_dict, universe_num)
|
||||
end if
|
||||
call dict_add_key(cells_in_univ_dict, universe_num, count)
|
||||
call dict_add_key(cells_in_univ_dict, universe_num, n_cells_in_univ)
|
||||
|
||||
end do
|
||||
|
||||
|
|
@ -575,7 +575,7 @@ contains
|
|||
integer :: i ! loop over user-specified tallies
|
||||
integer :: j ! loop over words
|
||||
integer :: id ! user-specified identifier
|
||||
integer :: index ! index in meshes array
|
||||
integer :: i_mesh ! index in meshes array
|
||||
integer :: n ! size of arrays in mesh specification
|
||||
integer :: n_words ! number of words read
|
||||
logical :: file_exists ! does tallies.xml file exist?
|
||||
|
|
@ -753,8 +753,8 @@ contains
|
|||
! Determine index in mesh array for this bin
|
||||
id = t % mesh
|
||||
if (dict_has_key(mesh_dict, id)) then
|
||||
index = dict_get_key(mesh_dict, id)
|
||||
m => meshes(index)
|
||||
i_mesh = dict_get_key(mesh_dict, id)
|
||||
m => meshes(i_mesh)
|
||||
else
|
||||
message = "Could not find mesh " // trim(int_to_str(id)) // &
|
||||
" specified on tally " // trim(int_to_str(t % id))
|
||||
|
|
@ -876,8 +876,8 @@ contains
|
|||
|
||||
! Get pointer to mesh
|
||||
id = t % mesh
|
||||
index = dict_get_key(mesh_dict, id)
|
||||
m => meshes(index)
|
||||
i_mesh = dict_get_key(mesh_dict, id)
|
||||
m => meshes(i_mesh)
|
||||
|
||||
! We need to increase the dimension by one since we also need
|
||||
! currents coming into and out of the boundary mesh cells.
|
||||
|
|
|
|||
|
|
@ -111,8 +111,7 @@ contains
|
|||
integer(8) :: start ! starting index in local fission bank
|
||||
integer(8) :: finish ! ending index in local fission bank
|
||||
integer(8) :: total ! total sites in global fission bank
|
||||
integer(8) :: count ! index for source bank
|
||||
integer(8) :: index ! index for id -- accounts for all nodes
|
||||
integer(8) :: index_local ! index for source bank
|
||||
integer :: send_to_left ! # of bank sites to send/recv to or from left
|
||||
integer :: send_to_right ! # of bank sites to send/recv to or from right
|
||||
integer(8) :: sites_needed ! # of sites to be sampled
|
||||
|
|
@ -168,8 +167,7 @@ contains
|
|||
call prn_skip(start)
|
||||
|
||||
allocate(temp_sites(2*work))
|
||||
count = 0_8 ! Index for local source_bank
|
||||
index = 0_8 ! Index for global source id -- must account for all nodes
|
||||
index_local = 0_8 ! Index for local source_bank
|
||||
|
||||
if (total < n_particles) then
|
||||
sites_needed = mod(n_particles,total)
|
||||
|
|
@ -192,15 +190,15 @@ contains
|
|||
if (total < n_particles) then
|
||||
do j = 1,int(n_particles/total)
|
||||
! If index is within this node's range, add site to source
|
||||
count = count + 1
|
||||
temp_sites(count) = fission_bank(i)
|
||||
index_local = index_local + 1
|
||||
temp_sites(index_local) = fission_bank(i)
|
||||
end do
|
||||
end if
|
||||
|
||||
! Randomly sample sites needed
|
||||
if (prn() < p_sample) then
|
||||
count = count + 1
|
||||
temp_sites(count) = fission_bank(i)
|
||||
index_local = index_local + 1
|
||||
temp_sites(index_local) = fission_bank(i)
|
||||
end if
|
||||
end do
|
||||
|
||||
|
|
@ -208,16 +206,16 @@ contains
|
|||
! the source bank
|
||||
#ifdef MPI
|
||||
start = 0_8
|
||||
call MPI_EXSCAN(count, start, 1, MPI_INTEGER8, MPI_SUM, &
|
||||
call MPI_EXSCAN(index_local, start, 1, MPI_INTEGER8, MPI_SUM, &
|
||||
& MPI_COMM_WORLD, ierr)
|
||||
finish = start + count
|
||||
finish = start + index_local
|
||||
total = finish
|
||||
call MPI_BCAST(total, 1, MPI_INTEGER8, n_procs - 1, &
|
||||
& MPI_COMM_WORLD, ierr)
|
||||
#else
|
||||
start = 0_8
|
||||
finish = count
|
||||
total = count
|
||||
finish = index_local
|
||||
total = index_local
|
||||
#endif
|
||||
|
||||
! Determine how many sites to send to adjacent nodes
|
||||
|
|
@ -229,7 +227,7 @@ contains
|
|||
! If we have extra sites sampled, we will simply discard the extra
|
||||
! ones on the last processor
|
||||
if (rank == n_procs - 1) then
|
||||
count = count - send_to_right
|
||||
index_local = index_local - send_to_right
|
||||
end if
|
||||
|
||||
elseif (total < n_particles) then
|
||||
|
|
@ -237,8 +235,8 @@ contains
|
|||
! fission bank
|
||||
sites_needed = n_particles - total
|
||||
do i = 1, int(sites_needed,4)
|
||||
count = count + 1
|
||||
temp_sites(count) = fission_bank(n_bank - sites_needed + i)
|
||||
index_local = index_local + 1
|
||||
temp_sites(index_local) = fission_bank(n_bank - sites_needed + i)
|
||||
end do
|
||||
end if
|
||||
|
||||
|
|
@ -259,7 +257,7 @@ contains
|
|||
allocate(right_bank(abs(send_to_right)))
|
||||
|
||||
if (send_to_right > 0) then
|
||||
i = count - send_to_right + 1
|
||||
i = index_local - send_to_right + 1
|
||||
call MPI_ISEND(temp_sites(i), send_to_right, MPI_BANK, rank+1, 0, &
|
||||
& MPI_COMM_WORLD, request, ierr)
|
||||
else if (send_to_right < 0) then
|
||||
|
|
@ -285,27 +283,27 @@ contains
|
|||
! ==========================================================================
|
||||
! RECONSTRUCT SOURCE BANK
|
||||
if (send_to_left < 0 .and. send_to_right >= 0) then
|
||||
i = -send_to_left ! size of first block
|
||||
j = int(count,4) - send_to_right ! size of second block
|
||||
i = -send_to_left ! size of first block
|
||||
j = int(index_local,4) - send_to_right ! size of second block
|
||||
call copy_from_bank(temp_sites, i+1, j)
|
||||
#ifdef MPI
|
||||
call MPI_WAIT(request_left, status, ierr)
|
||||
#endif
|
||||
call copy_from_bank(left_bank, 1, i)
|
||||
else if (send_to_left >= 0 .and. send_to_right < 0) then
|
||||
i = int(count,4) - send_to_left ! size of first block
|
||||
j = -send_to_right ! size of second block
|
||||
i = int(index_local,4) - send_to_left ! size of first block
|
||||
j = -send_to_right ! size of second block
|
||||
call copy_from_bank(temp_sites(1+send_to_left), 1, i)
|
||||
#ifdef MPI
|
||||
call MPI_WAIT(request_right, status, ierr)
|
||||
#endif
|
||||
call copy_from_bank(right_bank, i+1, j)
|
||||
else if (send_to_left >= 0 .and. send_to_right >= 0) then
|
||||
i = int(count,4) - send_to_left - send_to_right
|
||||
i = int(index_local,4) - send_to_left - send_to_right
|
||||
call copy_from_bank(temp_sites(1+send_to_left), 1, i)
|
||||
else if (send_to_left < 0 .and. send_to_right < 0) then
|
||||
i = -send_to_left
|
||||
j = int(count,4)
|
||||
j = int(index_local,4)
|
||||
k = -send_to_right
|
||||
call copy_from_bank(temp_sites, i+1, j)
|
||||
#ifdef MPI
|
||||
|
|
@ -336,19 +334,19 @@ contains
|
|||
! COPY_FROM_BANK
|
||||
!===============================================================================
|
||||
|
||||
subroutine copy_from_bank(temp_bank, index, n_sites)
|
||||
subroutine copy_from_bank(temp_bank, i_start, n_sites)
|
||||
|
||||
integer, intent(in) :: n_sites ! # of bank sites to copy
|
||||
type(Bank), intent(in) :: temp_bank(n_sites)
|
||||
integer, intent(in) :: index ! starting index in source_bank
|
||||
integer, intent(in) :: i_start ! starting index in source_bank
|
||||
|
||||
integer :: i ! index in temp_bank
|
||||
integer :: index_source ! index in source_bank
|
||||
integer :: i ! index in temp_bank
|
||||
integer :: i_source ! index in source_bank
|
||||
type(Particle), pointer :: p
|
||||
|
||||
do i = 1, n_sites
|
||||
index_source = index + i - 1
|
||||
p => source_bank(index_source)
|
||||
i_source = i_start + i - 1
|
||||
p => source_bank(i_source)
|
||||
|
||||
p % xyz = temp_bank(i) % xyz
|
||||
p % xyz_local = temp_bank(i) % xyz
|
||||
|
|
@ -374,7 +372,7 @@ contains
|
|||
integer :: i
|
||||
integer :: n
|
||||
integer :: m
|
||||
integer :: count
|
||||
integer :: n_bins
|
||||
integer :: ierr
|
||||
real(8), allocatable :: tally_temp(:,:)
|
||||
type(TallyObject), pointer :: t
|
||||
|
|
@ -384,7 +382,7 @@ contains
|
|||
|
||||
n = t % n_total_bins
|
||||
m = t % n_macro_bins
|
||||
count = n*m
|
||||
n_bins = n*m
|
||||
|
||||
allocate(tally_temp(n,m))
|
||||
|
||||
|
|
@ -392,14 +390,14 @@ contains
|
|||
|
||||
if (master) then
|
||||
! Description of MPI_IN_PLANE
|
||||
call MPI_REDUCE(MPI_IN_PLACE, tally_temp, count, MPI_REAL8, MPI_SUM, &
|
||||
call MPI_REDUCE(MPI_IN_PLACE, tally_temp, n_bins, MPI_REAL8, MPI_SUM, &
|
||||
0, MPI_COMM_WORLD, ierr)
|
||||
|
||||
! Transfer values to val_history on master
|
||||
t % scores(:,:) % val_history = tally_temp
|
||||
else
|
||||
! Receive buffer not significant at other processors
|
||||
call MPI_REDUCE(tally_temp, tally_temp, count, MPI_REAL8, MPI_SUM, &
|
||||
call MPI_REDUCE(tally_temp, tally_temp, n_bins, MPI_REAL8, MPI_SUM, &
|
||||
0, MPI_COMM_WORLD, ierr)
|
||||
|
||||
! Reset val_history on other processors
|
||||
|
|
|
|||
|
|
@ -27,8 +27,8 @@ contains
|
|||
|
||||
subroutine title()
|
||||
|
||||
character(10) :: date
|
||||
character(8) :: time
|
||||
character(10) :: today_date
|
||||
character(8) :: today_time
|
||||
|
||||
write(ou,*)
|
||||
write(ou,*) ' .d88888b. 888b d888 .d8888b.'
|
||||
|
|
@ -51,8 +51,8 @@ contains
|
|||
100 format (6X,"Version:",9X,I1,".",I1,".",I1)
|
||||
|
||||
! Write the date and time
|
||||
call get_today(date, time)
|
||||
write(ou,101) trim(date), trim(time)
|
||||
call get_today(today_date, today_time)
|
||||
write(ou,101) trim(today_date), trim(today_time)
|
||||
101 format (6X,"Date/Time:",7X,A,1X,A)
|
||||
write(ou,*)
|
||||
|
||||
|
|
@ -187,11 +187,11 @@ contains
|
|||
character(8), intent(out) :: today_time
|
||||
|
||||
integer :: val(8)
|
||||
character(8) :: date
|
||||
character(10) :: time
|
||||
character(8) :: date_
|
||||
character(10) :: time_
|
||||
character(5) :: zone
|
||||
|
||||
call date_and_time(date, time, zone, val)
|
||||
call date_and_time(date_, time_, zone, val)
|
||||
! val(1) = year (YYYY)
|
||||
! val(2) = month (MM)
|
||||
! val(3) = day (DD)
|
||||
|
|
@ -203,18 +203,18 @@ contains
|
|||
|
||||
if (val(2) < 10) then
|
||||
if (val(3) < 10) then
|
||||
today_date = date(6:6) // "/" // date(8:8) // "/" // date(1:4)
|
||||
today_date = date_(6:6) // "/" // date_(8:8) // "/" // date_(1:4)
|
||||
else
|
||||
today_date = date(6:6) // "/" // date(7:8) // "/" // date(1:4)
|
||||
today_date = date_(6:6) // "/" // date_(7:8) // "/" // date_(1:4)
|
||||
end if
|
||||
else
|
||||
if (val(3) < 10) then
|
||||
today_date = date(5:6) // "/" // date(8:8) // "/" // date(1:4)
|
||||
today_date = date_(5:6) // "/" // date_(8:8) // "/" // date_(1:4)
|
||||
else
|
||||
today_date = date(5:6) // "/" // date(7:8) // "/" // date(1:4)
|
||||
today_date = date_(5:6) // "/" // date_(7:8) // "/" // date_(1:4)
|
||||
end if
|
||||
end if
|
||||
today_time = time(1:2) // ":" // time(3:4) // ":" // time(5:6)
|
||||
today_time = time_(1:2) // ":" // time_(3:4) // ":" // time_(5:6)
|
||||
|
||||
end subroutine get_today
|
||||
|
||||
|
|
|
|||
|
|
@ -11,12 +11,12 @@ contains
|
|||
! value lies in the array. This is used extensively for energy grid searching
|
||||
!===============================================================================
|
||||
|
||||
function binary_search(array, n, val) result(index)
|
||||
function binary_search(array, n, val) result(array_index)
|
||||
|
||||
integer, intent(in) :: n
|
||||
real(8), intent(in) :: array(n)
|
||||
real(8), intent(in) :: val
|
||||
integer :: index
|
||||
integer :: array_index
|
||||
|
||||
integer :: L
|
||||
integer :: R
|
||||
|
|
@ -34,41 +34,25 @@ contains
|
|||
|
||||
! Check boundaries
|
||||
if (val > array(L) .and. val < array(L+1)) then
|
||||
index = L
|
||||
array_index = L
|
||||
return
|
||||
elseif (val > array(R-1) .and. val < array(R)) then
|
||||
index = R-1
|
||||
array_index = R - 1
|
||||
return
|
||||
end if
|
||||
|
||||
! Find values at midpoint
|
||||
index = L + (R - L)/2
|
||||
testval = array(index)
|
||||
array_index = L + (R - L)/2
|
||||
testval = array(array_index)
|
||||
if (val > testval) then
|
||||
L = index
|
||||
L = array_index
|
||||
elseif (val < testval) then
|
||||
R = index
|
||||
R = array_index
|
||||
end if
|
||||
end do
|
||||
|
||||
index = L
|
||||
array_index = L
|
||||
|
||||
end function binary_search
|
||||
|
||||
!===============================================================================
|
||||
! INTERPOLATE
|
||||
!===============================================================================
|
||||
|
||||
function interpolate(array, n, index, f) result(val)
|
||||
|
||||
integer, intent(in) :: n
|
||||
real(8), intent(in) :: array(n)
|
||||
integer, intent(in) :: index
|
||||
real(8), intent(in) :: f
|
||||
real(8) :: val
|
||||
|
||||
val = (ONE-f) * array(index) + f * array(index+1)
|
||||
|
||||
end function interpolate
|
||||
|
||||
end module search
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ contains
|
|||
character(*), intent(out) :: words(MAX_WORDS)
|
||||
integer, intent(out) :: n
|
||||
|
||||
character(1) :: char ! current character
|
||||
character(1) :: chr ! current character
|
||||
integer :: i ! current index
|
||||
integer :: i_start ! starting index of word
|
||||
integer :: i_end ! ending index of word
|
||||
|
|
@ -37,14 +37,14 @@ contains
|
|||
i_end = 0
|
||||
n = 0
|
||||
do i = 1, len_trim(string)
|
||||
char = string(i:i)
|
||||
chr = string(i:i)
|
||||
|
||||
! Note that ACHAR(9) is a horizontal tab
|
||||
if ((i_start == 0) .and. (char /= ' ') .and. (char /= achar(9))) then
|
||||
if ((i_start == 0) .and. (chr /= ' ') .and. (chr /= achar(9))) then
|
||||
i_start = i
|
||||
end if
|
||||
if (i_start > 0) then
|
||||
if ((char == ' ') .or. (char == achar(9))) i_end = i - 1
|
||||
if ((chr == ' ') .or. (chr == achar(9))) i_end = i - 1
|
||||
if (i == len_trim(string)) i_end = i
|
||||
if (i_end > 0) then
|
||||
n = n + 1
|
||||
|
|
@ -80,7 +80,7 @@ contains
|
|||
character(*), intent(out) :: words(MAX_WORDS)
|
||||
integer, intent(out) :: n
|
||||
|
||||
character(1) :: char ! current character
|
||||
character(1) :: chr ! current character
|
||||
integer :: i ! current index
|
||||
integer :: i_start ! starting index of word
|
||||
integer :: i_end ! ending index of word
|
||||
|
|
@ -89,27 +89,27 @@ contains
|
|||
i_end = 0
|
||||
n = 0
|
||||
do i = 1, len_trim(string)
|
||||
char = string(i:i)
|
||||
chr = string(i:i)
|
||||
|
||||
! Check for special characters
|
||||
if (index('():#', char) > 0) then
|
||||
if (index('():#', chr) > 0) then
|
||||
if (i_start > 0) then
|
||||
i_end = i - 1
|
||||
n = n + 1
|
||||
words(n) = string(i_start:i_end)
|
||||
end if
|
||||
n = n + 1
|
||||
words(n) = char
|
||||
words(n) = chr
|
||||
i_start = 0
|
||||
i_end = 0
|
||||
cycle
|
||||
end if
|
||||
|
||||
if ((i_start == 0) .and. (char /= ' ')) then
|
||||
if ((i_start == 0) .and. (chr /= ' ')) then
|
||||
i_start = i
|
||||
end if
|
||||
if (i_start > 0) then
|
||||
if (char == ' ') i_end = i - 1
|
||||
if (chr == ' ') i_end = i - 1
|
||||
if (i == len_trim(string)) i_end = i
|
||||
if (i_end > 0) then
|
||||
n = n + 1
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ contains
|
|||
|
||||
integer :: i ! loop index for tallies
|
||||
integer :: j ! loop index for filter arrays
|
||||
integer :: index ! filter bin entries
|
||||
integer :: i_item ! filter bin entries
|
||||
integer :: n ! number of bins
|
||||
integer :: filter_bins ! running total of number of filter bins
|
||||
integer :: score_bins ! number of scoring bins
|
||||
|
|
@ -193,8 +193,8 @@ contains
|
|||
t % stride(T_SURFACE) = filter_bins
|
||||
if (n > 0) then
|
||||
do j = 1, n
|
||||
index = t % surface_bins(j) % scalar
|
||||
call add_map_element(tally_maps(T_SURFACE) % items(index), i, j)
|
||||
i_item = t % surface_bins(j) % scalar
|
||||
call add_map_element(tally_maps(T_SURFACE) % items(i_item), i, j)
|
||||
end do
|
||||
filter_bins = filter_bins * n
|
||||
end if
|
||||
|
|
@ -204,8 +204,8 @@ contains
|
|||
t % stride(T_CELLBORN) = filter_bins
|
||||
if (n > 0) then
|
||||
do j = 1, n
|
||||
index = t % cellborn_bins(j) % scalar
|
||||
call add_map_element(tally_maps(T_CELLBORN) % items(index), i, j)
|
||||
i_item = t % cellborn_bins(j) % scalar
|
||||
call add_map_element(tally_maps(T_CELLBORN) % items(i_item), i, j)
|
||||
end do
|
||||
filter_bins = filter_bins * n
|
||||
end if
|
||||
|
|
@ -215,8 +215,8 @@ contains
|
|||
t % stride(T_CELL) = filter_bins
|
||||
if (n > 0) then
|
||||
do j = 1, n
|
||||
index = t % cell_bins(j) % scalar
|
||||
call add_map_element(tally_maps(T_CELL) % items(index), i, j)
|
||||
i_item = t % cell_bins(j) % scalar
|
||||
call add_map_element(tally_maps(T_CELL) % items(i_item), i, j)
|
||||
end do
|
||||
filter_bins = filter_bins * n
|
||||
end if
|
||||
|
|
@ -226,8 +226,8 @@ contains
|
|||
t % stride(T_MATERIAL) = filter_bins
|
||||
if (n > 0) then
|
||||
do j = 1, n
|
||||
index = t % material_bins(j) % scalar
|
||||
call add_map_element(tally_maps(T_MATERIAL) % items(index), i, j)
|
||||
i_item = t % material_bins(j) % scalar
|
||||
call add_map_element(tally_maps(T_MATERIAL) % items(i_item), i, j)
|
||||
end do
|
||||
filter_bins = filter_bins * n
|
||||
end if
|
||||
|
|
@ -237,8 +237,8 @@ contains
|
|||
t % stride(T_UNIVERSE) = filter_bins
|
||||
if (n > 0) then
|
||||
do j = 1, n
|
||||
index = t % universe_bins(j) % scalar
|
||||
call add_map_element(tally_maps(T_UNIVERSE) % items(index), i, j)
|
||||
i_item = t % universe_bins(j) % scalar
|
||||
call add_map_element(tally_maps(T_UNIVERSE) % items(i_item), i, j)
|
||||
end do
|
||||
filter_bins = filter_bins * n
|
||||
end if
|
||||
|
|
@ -1303,7 +1303,7 @@ contains
|
|||
integer, intent(in) :: bin ! bin in filter array
|
||||
character(30) :: label ! user-specified identifier
|
||||
|
||||
integer :: index ! index in cells/surfaces/etc array
|
||||
integer :: i ! index in cells/surfaces/etc array
|
||||
integer, allocatable :: ijk(:) ! indices in mesh
|
||||
real(8) :: E0 ! lower bound for energy bin
|
||||
real(8) :: E1 ! upper bound for energy bin
|
||||
|
|
@ -1311,20 +1311,20 @@ contains
|
|||
|
||||
select case(filter_type)
|
||||
case (T_UNIVERSE)
|
||||
index = t % universe_bins(bin) % scalar
|
||||
label = int_to_str(universes(index) % id)
|
||||
i = t % universe_bins(bin) % scalar
|
||||
label = int_to_str(universes(i) % id)
|
||||
case (T_MATERIAL)
|
||||
index = t % material_bins(bin) % scalar
|
||||
label = int_to_str(materials(index) % id)
|
||||
i = t % material_bins(bin) % scalar
|
||||
label = int_to_str(materials(i) % id)
|
||||
case (T_CELL)
|
||||
index = t % cell_bins(bin) % scalar
|
||||
label = int_to_str(cells(index) % id)
|
||||
i = t % cell_bins(bin) % scalar
|
||||
label = int_to_str(cells(i) % id)
|
||||
case (T_CELLBORN)
|
||||
index = t % cellborn_bins(bin) % scalar
|
||||
label = int_to_str(cells(index) % id)
|
||||
i = t % cellborn_bins(bin) % scalar
|
||||
label = int_to_str(cells(i) % id)
|
||||
case (T_SURFACE)
|
||||
index = t % surface_bins(bin) % scalar
|
||||
label = int_to_str(surfaces(index) % id)
|
||||
i = t % surface_bins(bin) % scalar
|
||||
label = int_to_str(surfaces(i) % id)
|
||||
case (T_MESH)
|
||||
m => meshes(t % mesh)
|
||||
allocate(ijk(m % n_dimension))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue