From 34136cbbba42360317d205c7527b05c1abb5cb5d Mon Sep 17 00:00:00 2001 From: Bortolotti Date: Fri, 24 Jul 2020 13:57:12 -0600 Subject: [PATCH] atan2 instead of atan --- modules/aerodyn/src/AeroAcoustics/AeroAcoustics.f90 | 8 ++++---- modules/aerodyn/src/AeroAcoustics/AeroAcoustics_IO.f90 | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/aerodyn/src/AeroAcoustics/AeroAcoustics.f90 b/modules/aerodyn/src/AeroAcoustics/AeroAcoustics.f90 index f5086ab9da..91919aafeb 100644 --- a/modules/aerodyn/src/AeroAcoustics/AeroAcoustics.f90 +++ b/modules/aerodyn/src/AeroAcoustics/AeroAcoustics.f90 @@ -876,19 +876,19 @@ SUBROUTINE CalcObserve(t,p,m,u,xd,errStat,errMsg) ! z ---> y_e ! Compute spanwise directivity angle phi for the trailing edge - phi_e = ATAN (RTEObserve(1)/RTEObserve(3)) + phi_e = ATAN2 (RTEObserve(1) , RTEObserve(3)) m%SpanAngleTE(K,J,I) = phi_e * R2D ! Compute chordwise directivity angle theta for the trailing edge - theta_e = ATAN ((RTEObserve(3) * COS (phi_e) + RTEObserve(1) * SIN (phi_e) ) / RTEObserve(2)) + theta_e = ATAN2 ((RTEObserve(3) * COS (phi_e) + RTEObserve(1) * SIN (phi_e) ) , RTEObserve(2)) m%ChordAngleTE(K,J,I) = theta_e * R2D ! Compute spanwise directivity angle phi for the leading edge (it's the same angle for the trailing edge) - phi_e = ATAN (RLEObserve(1)/RLEObserve(3)) + phi_e = ATAN2 (RLEObserve(1) , RLEObserve(3)) m%SpanAngleLE(K,J,I) = phi_e * R2D ! Compute chordwise directivity angle theta for the leading edge - theta_e = ATAN ((RLEObserve(3) * COS (phi_e) + RLEObserve(1) * SIN (phi_e) ) / RLEObserve(2)) + theta_e = ATAN2 ((RLEObserve(3) * COS (phi_e) + RLEObserve(1) * SIN (phi_e) ) , RLEObserve(2)) m%ChordAngleLE(K,J,I) = theta_e * R2D ENDDO !K, observers diff --git a/modules/aerodyn/src/AeroAcoustics/AeroAcoustics_IO.f90 b/modules/aerodyn/src/AeroAcoustics/AeroAcoustics_IO.f90 index 3ce1d2b01f..eecf034354 100644 --- a/modules/aerodyn/src/AeroAcoustics/AeroAcoustics_IO.f90 +++ b/modules/aerodyn/src/AeroAcoustics/AeroAcoustics_IO.f90 @@ -209,7 +209,7 @@ SUBROUTINE ReadPrimaryFile( InputFile, InputFileData, AABlFile, Default_DT, Out READ( Line, *, IOSTAT=IOS) InputFileData%DT_AA CALL CheckIOS ( IOS, InputFile, 'DT_AA', NumType, ErrStat2, ErrMsg2 ); call check - IF (mod(InputFileData%DT_AA, Default_DT) .gt. 1E-10) THEN + IF (abs(InputFileData%DT_AA / Default_DT - NINT(InputFileData%DT_AA / Default_DT)) .gt. 1E-10) THEN CALL SetErrStat(ErrID_Fatal,"The Aeroacoustics input DT_AA must be a multiple of DTAero.", ErrStat, ErrMsg, RoutineName) return END IF