From d75b74695be909835941b3b5465a6bcba70a3cec Mon Sep 17 00:00:00 2001 From: Charles Gannon Date: Sat, 18 May 2024 13:40:59 -0700 Subject: [PATCH] fix: floating point exception in nodePropertyExtractorSatelliteDynamicalTime Fixed floating point exception in nodePropertyExtractorSatelliteDynamicalTime. Check that both the tidal radius and tidal mass are non zero. If they are zero, return -1 to avoid divide by zero. --- .../nodes.property_extractor.satellite.dynamical_time.F90 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/nodes.property_extractor.satellite.dynamical_time.F90 b/source/nodes.property_extractor.satellite.dynamical_time.F90 index 2a976f06d9..fc144bf583 100644 --- a/source/nodes.property_extractor.satellite.dynamical_time.F90 +++ b/source/nodes.property_extractor.satellite.dynamical_time.F90 @@ -130,9 +130,11 @@ double precision function dynamicalTimeExtract(self,node,instance) type (multiCounter ), intent(inout), optional :: instance double precision :: radiusTidal, massTidal !$GLC attributes unused :: instance - + dynamicalTimeExtract =-1.0d0 radiusTidal =self%satelliteTidalStrippingRadius_%radius (node ) - massTidal =self%galacticStructure_ %massEnclosed(node,radiusTidal) + if (radiusTidal <= 0.0d0) return + massTidal =self%galacticStructure_ %massEnclosed(node,radiusTidal) + if (massTidal <= 0.0d0) return dynamicalTimeExtract =+sqrt( & & +Pi **2 & & /4.0d0 &