From 4437677e1e08eefa2ac4591b624e4dba31c85ead Mon Sep 17 00:00:00 2001 From: David A Minton Date: Thu, 23 Feb 2023 14:09:59 -0500 Subject: [PATCH 1/2] Updated testing environment to include debug flags --- cmake/Modules/SetFortranFlags.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmake/Modules/SetFortranFlags.cmake b/cmake/Modules/SetFortranFlags.cmake index 836747fd3..891a878f4 100644 --- a/cmake/Modules/SetFortranFlags.cmake +++ b/cmake/Modules/SetFortranFlags.cmake @@ -218,9 +218,9 @@ SET_COMPILE_FLAG(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG}" ##################### # Optimizations -SET_COMPILE_FLAG(CMAKE_Fortran_FLAGS_TESTING "${CMAKE_Fortran_FLAGS_TESTING}" - Fortran REQUIRED "-O2" # All compilers not on Windows - "/O2" # Intel Windows +SET_COMPILE_FLAG(CMAKE_Fortran_FLAGS_TESTING "${CMAKE_Fortran_FLAGS_DEBUG}" + Fortran REQUIRED "-O3" # All compilers not on Windows + "/O3" # Intel Windows ) ##################### From b55d70333533ff9d48124d9ede2982b3a5544c65 Mon Sep 17 00:00:00 2001 From: David A Minton Date: Thu, 23 Feb 2023 14:10:37 -0500 Subject: [PATCH 2/2] Fixed bug that caused a failure to braket the SFD slope when it is negative --- src/fraggle/fraggle_util.f90 | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/fraggle/fraggle_util.f90 b/src/fraggle/fraggle_util.f90 index 4daef8d40..23c0a1a21 100644 --- a/src/fraggle/fraggle_util.f90 +++ b/src/fraggle/fraggle_util.f90 @@ -81,6 +81,7 @@ module subroutine fraggle_util_set_mass_dist(self, param) !! Sets the mass of fragments based on the mass distribution returned by the regime calculation. !! This subroutine must be run after the the setup routine has been run on the fragments !! + use, intrinsic :: ieee_exceptions implicit none ! Arguments class(collision_fraggle), intent(inout) :: self !! Fraggle collision system object @@ -101,6 +102,10 @@ module subroutine fraggle_util_set_mass_dist(self, param) integer(I4B), dimension(:), allocatable :: ind integer(I4B), parameter :: MAXLOOP = 20 logical :: flipper + logical, dimension(size(IEEE_ALL)) :: fpe_halting_modes + + call ieee_get_halting_mode(IEEE_ALL,fpe_halting_modes) ! Save the current halting modes so we can turn them off temporarily + call ieee_set_halting_mode(IEEE_ALL,.false.) associate(impactors => self%impactors, min_mfrag => self%min_mfrag) ! Get mass weighted mean of Ip and density @@ -146,6 +151,7 @@ module subroutine fraggle_util_set_mass_dist(self, param) fragments%density(1) = impactors%mass_dist(1) / volume(jtarg) if (param%lrotation) fragments%Ip(:, 1) = impactors%Ip(:,1) end associate + call ieee_set_halting_mode(IEEE_ALL,fpe_halting_modes) return case default write(*,*) "fraggle_util_set_mass_dist_fragments error: Unrecognized regime code",impactors%regime @@ -176,8 +182,8 @@ module subroutine fraggle_util_set_mass_dist(self, param) y1 = y1 - (i-1)**(-x1/3.0_DP) end do if (y0*y1 < 0.0_DP) exit - x1 = x1 * 1.6_DP - x0 = x0 / 1.6_DP + x1 = x1 * 1.1_DP + x0 = x0 * 1.1_DP end do ! Find the mass scaling factor with bisection @@ -276,6 +282,7 @@ module subroutine fraggle_util_set_mass_dist(self, param) end associate + call ieee_set_halting_mode(IEEE_ALL,fpe_halting_modes) return end subroutine fraggle_util_set_mass_dist