diff --git a/include/openmc/tallies/filter.h b/include/openmc/tallies/filter.h index 7920191aa1..bf31e65009 100644 --- a/include/openmc/tallies/filter.h +++ b/include/openmc/tallies/filter.h @@ -12,19 +12,6 @@ namespace openmc { -//============================================================================== -// Global variables -//============================================================================== - -extern "C" int32_t n_filters; - -class FilterMatch; -extern std::vector filter_matches; -#pragma omp threadprivate(filter_matches) - -class Filter; -extern std::vector tally_filters; - //============================================================================== //! Stores bins and weights for filtered tally events. //============================================================================== @@ -36,6 +23,10 @@ public: std::vector weights_; }; +// Without an explicit instantiation of vector, the Intel compiler +// will complain about the threadprivate directive on filter_matches +template class std::vector; + //============================================================================== //! Modifies tally score events. //============================================================================== @@ -76,6 +67,17 @@ public: int n_bins_; }; +//============================================================================== +// Global variables +//============================================================================== + +extern "C" int32_t n_filters; + +extern std::vector filter_matches; +#pragma omp threadprivate(filter_matches) + +extern std::vector tally_filters; + //============================================================================== extern "C" void free_memory_tally_c(); diff --git a/src/mesh.cpp b/src/mesh.cpp index a9b716ecd5..bfdb370bb0 100644 --- a/src/mesh.cpp +++ b/src/mesh.cpp @@ -476,7 +476,7 @@ void RegularMesh::bins_crossed(const Particle* p, std::vector& bins, // The track exits this cell. Determine the distance to the closest mesh // surface. xt::xtensor d = xt::zeros({n}); - for (int j = 0; j < n; ++j) { + for (j = 0; j < n; ++j) { if (std::fabs(u[j]) < FP_PRECISION) { d(j) = INFTY; } else if (u[j] > 0) { diff --git a/src/mesh_header.F90 b/src/mesh_header.F90 index d7e26fc6b8..a0c14077a8 100644 --- a/src/mesh_header.F90 +++ b/src/mesh_header.F90 @@ -140,21 +140,21 @@ module mesh_header pure function mesh_get_bin(ptr, xyz) result(bin) bind(C) import C_PTR, C_DOUBLE, C_INT - type(C_PTR), value :: ptr + type(C_PTR), intent(in), value :: ptr real(C_DOUBLE), intent(in) :: xyz(*) integer(C_INT) :: bin end function pure function mesh_get_bin_from_indices(ptr, ijk) result(bin) bind(C) import C_PTR, C_INT - type(C_PTR), value :: ptr + type(C_PTR), intent(in), value :: ptr integer(C_INT), intent(in) :: ijk(*) integer(C_INT) :: bin end function pure subroutine mesh_get_indices(ptr, xyz, ijk, in_mesh) bind(C) import C_PTR, C_DOUBLE, C_INT, C_BOOL - type(C_PTR), value :: ptr + type(C_PTR), intent(in), value :: ptr real(C_DOUBLE), intent(in) :: xyz(*) integer(C_INT), intent(out) :: ijk(*) logical(C_BOOL), intent(out) :: in_mesh @@ -162,8 +162,8 @@ module mesh_header pure subroutine mesh_get_indices_from_bin(ptr, bin, ijk) bind(C) import C_PTR, C_INT - type(C_PTR), value :: ptr - integer(C_INT), value :: bin + type(C_PTR), intent(in), value :: ptr + integer(C_INT), intent(in), value :: bin integer(C_INT), intent(out) :: ijk(*) end subroutine diff --git a/src/reaction_header.F90 b/src/reaction_header.F90 index 9d6add0f0a..0762846efc 100644 --- a/src/reaction_header.F90 +++ b/src/reaction_header.F90 @@ -74,22 +74,22 @@ module reaction_header pure function reaction_product_decay_rate(ptr, product) result(rate) bind(C) import C_PTR, C_INT, C_DOUBLE - type(C_PTR), value :: ptr - integer(C_INT), value :: product + type(C_PTR), intent(in), value :: ptr + integer(C_INT), intent(in), value :: product real(C_DOUBLE) :: rate end function pure function reaction_product_emission_mode(ptr, product) result(m) bind(C) import C_PTR, C_INT - type(C_PTR), value :: ptr - integer(C_INT), value :: product + type(C_PTR), intent(in), value :: ptr + integer(C_INT), intent(in), value :: product integer(C_INT) :: m end function pure function reaction_product_particle(ptr, product) result(particle) bind(C) import C_PTR, C_INT - type(C_PTR), value :: ptr - integer(C_INT), value :: product + type(C_PTR), intent(in), value :: ptr + integer(C_INT), intent(in), value :: product integer(C_INT) :: particle end function @@ -104,15 +104,15 @@ module reaction_header pure function reaction_product_yield(ptr, product, E) result(val) bind(C) import C_PTR, C_INT, C_DOUBLE - type(C_PTR), value :: ptr - integer(C_INT), value :: product - real(C_DOUBLE), value :: E + type(C_PTR), intent(in), value :: ptr + integer(C_INT), intent(in), value :: product + real(C_DOUBLE), intent(in), value :: E real(C_DOUBLE) :: val end function pure function reaction_products_size(ptr) result(sz) bind(C) import C_PTR, C_INT - type(C_PTR), value :: ptr + type(C_PTR), intent(in), value :: ptr integer(C_INT) :: sz end function