Skip to content

Commit

Permalink
Removed off by one error for energy indices
Browse files Browse the repository at this point in the history
  • Loading branch information
wuppersaver committed Jul 28, 2023
1 parent 4cd7db3 commit fcc1713
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions optados/src/photo.f90
Original file line number Diff line number Diff line change
Expand Up @@ -514,13 +514,15 @@ subroutine calc_photo_optics
if (ierr /= 0) call io_error('Error: calc_photo_optics - allocation of index_energy failed')
do i = 1, number_energies
temp = (i - 1)*jdos_spacing + photo_photon_min
index_energy(i) = int(temp/jdos_spacing)
! Account for E = 0.0
index_energy(i) = int(temp/jdos_spacing) + 1
end do
else
number_energies = 1
allocate (index_energy(number_energies), stat=ierr)
if (ierr /= 0) call io_error('Error: calc_photo_optics - allocation of index_energy failed')
index_energy(number_energies) = int(photo_photon_energy/jdos_spacing)
! Account for E = 0.0
index_energy(number_energies) = int(photo_photon_energy/jdos_spacing) + 1
end if

allocate (absorp_photo(max_atoms, number_energies), stat=ierr)
Expand Down

0 comments on commit fcc1713

Please sign in to comment.