Skip to content

Commit

Permalink
fix: floating point exception in nodePropertyExtractorSatelliteDynami…
Browse files Browse the repository at this point in the history
…calTime

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.
  • Loading branch information
cgannonucm committed May 18, 2024
1 parent 1e63a6f commit d75b746
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions source/nodes.property_extractor.satellite.dynamical_time.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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 &
Expand Down

0 comments on commit d75b746

Please sign in to comment.