diff --git a/src/api.F90 b/src/api.F90 index 0941e60fee8..d45360d2842 100644 --- a/src/api.F90 +++ b/src/api.F90 @@ -169,7 +169,7 @@ function openmc_cell_set_temperature(index, T, instance) result(err) bind(C) end if end associate - ! assign error codes for outside of temperature bounds provided the + ! Assign error codes for outside of temperature bounds provided the ! temperature was changed correctly. This needs to be done after ! changing the temperature based on the logical structure above. if (err == 0) then @@ -627,7 +627,7 @@ function openmc_material_set_densities(index, n, name, density) result(err) bind real(C_DOUBLE), intent(in) :: density(n) integer(C_INT) :: err - integer :: i, j, k + integer :: i character(C_CHAR), pointer :: string(:) character(len=:, kind=C_CHAR), allocatable :: name_ @@ -868,6 +868,11 @@ function openmc_tally_set_nuclides(index, n, nuclides) result(err) bind(C) end if end function openmc_tally_set_nuclides +!=============================================================================== +! TO_F_STRING takes a null-terminated array of C chars and turns it into a +! deferred-length character string. Yay Fortran 2003! +!=============================================================================== + function to_f_string(c_string) result(f_string) character(kind=C_CHAR), intent(in) :: c_string(*) character(:), allocatable :: f_string diff --git a/src/simulation.F90 b/src/simulation.F90 index b406679ceb4..7427443bbed 100644 --- a/src/simulation.F90 +++ b/src/simulation.F90 @@ -394,9 +394,9 @@ end subroutine initialize_simulation subroutine finalize_simulation() - integer :: i ! loop index for tallies - integer :: n ! size of arrays #ifdef MPI + integer :: i ! loop index for tallies + integer :: n ! size of arrays integer :: mpi_err ! MPI error code integer(8) :: temp real(8) :: tempr(3) ! temporary array for communication