Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Replaced all occurrences of atan() with atan2()
  • Loading branch information
Austin Blevins committed Jan 24, 2023
1 parent 7ca58d7 commit c9d22e3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ejecta/ejecta_emplace.f90
Original file line number Diff line number Diff line change
Expand Up @@ -225,13 +225,13 @@ subroutine ejecta_emplace(user,surf,crater,domain,ejb,ejtble,deltaMtot,age,age_r
lrange = lrad - erad

baseline = ((i * crater%xslp) + (j * crater%yslp)) * user%pix
craterslope = atan(baseline / lrad)
craterslope = atan2(baseline,lrad)
if ((n == 1) .and. abs(craterslope) < epsilon(1._DP)) exit
if (craterslope > maxslp) maxslp = craterslope

ejheight = erad * sin(craterslope) + crater%melev

landslope = atan((surf(xpi,ypi)%dem - ejheight) / lrange)
landslope = atan2((surf(xpi,ypi)%dem - ejheight),lrange)

! Calculate corrected landing velocity for this location
vsq = (lrange * user%gaccel * cos(craterslope)) / &
Expand Down

0 comments on commit c9d22e3

Please sign in to comment.