From d83a420f0517d7fc47aeb288a6a0cf4891784fcc Mon Sep 17 00:00:00 2001 From: Christoph Berg Date: Mon, 22 Jun 2026 12:03:44 +0200 Subject: New upstream version 3.0.2+dfsg --- map65/libm65/getdphi.f90 | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) (limited to 'map65/libm65/getdphi.f90') diff --git a/map65/libm65/getdphi.f90 b/map65/libm65/getdphi.f90 index e55d7120..73439142 100644 --- a/map65/libm65/getdphi.f90 +++ b/map65/libm65/getdphi.f90 @@ -1,18 +1,30 @@ +module getdphi_mod + implicit none +contains + subroutine getdphi(qphi) + implicit none + + ! Arguments + real, intent(in) :: qphi(12) - real qphi(12) + ! Locals + real :: c, dphi, s, th + integer :: i - s=0. - c=0. - do i=1,12 - th=i*30/57.2957795 - s=s+qphi(i)*sin(th) - c=c+qphi(i)*cos(th) - enddo + s = 0.0 + c = 0.0 - dphi=57.2957795*atan2(s,c) + do i = 1, 12 + th = i * 30.0 / 57.2957795 ! convert degrees to radians + s = s + qphi(i) * sin(th) + c = c + qphi(i) * cos(th) + end do + + dphi = 57.2957795 * atan2(s, c) write(*,1010) nint(dphi) -1010 format('!Best-fit Dphi =',i4,' deg') +1010 format('!Best-fit Dphi =', i4, ' deg') + +end subroutine getdphi - return - end +end module getdphi_mod -- cgit v1.2.3