source: difang.f@ 6650a56

Last change on this file since 6650a56 was bd2278d, checked in by baerbaer <baerbaer@…>, 16 years ago

Reformatting comments and continuation marks.

Fortran 90 and higher use ! to mark comments no matter where they are in the
code. The only valid continuation marker is &.
I also added the SMMP.kdevelop.filelist to the repository to make it easier
to use kdevelop.

git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/smmp/trunk@12 26dc1dd8-5c4e-0410-9ffe-d298b4865968

  • Property mode set to 100644
File size: 1.5 KB
Line 
1! **************************************************************
2!
3! This file contains the subroutines: difang,addang
4!
5! Copyright 2003 Frank Eisenmenger, U.H.E. Hansmann,
6! Shura Hayryan, Chin-Ku
7! Copyright 2007 Frank Eisenmenger, U.H.E. Hansmann,
8! Jan H. Meinke, Sandipan Mohanty
9!
10! **************************************************************
11
12 real*8 function difang(a1,a2)
13
14! ......................................................
15! PURPOSE: difang = a2 - a1 with: -pi < difang <= pi
16!
17! INPUT: a1,a2-two angles [rad.]
18!
19! CALLS: none
20!
21! ......................................................
22
23 implicit real*8 (a-h,o-z)
24
25 parameter (pi=3.141592653589793d0,
26 & pi2=2.d0*pi)
27
28 d=mod((a2-a1),pi2)
29 if (abs(d).le.pi) then
30 difang=d
31 else
32 difang=d-sign(pi2,d)
33 endif
34
35 return
36 end
37! *********************************
38 real*8 function addang(a1,a2)
39
40! ......................................................
41! PURPOSE: addang = a1 + a2 with: -pi < addang <= pi
42!
43! INPUT: a1,a2-two angles [rad.]
44!
45! CALLS: none
46!
47! ......................................................
48
49 implicit real*8 (a-h,o-z)
50
51 parameter (pi=3.141592653589793d0,
52 & pi2=2.d0*pi)
53
54 d=mod((a1+a2),pi2)
55 if (abs(d).le.pi) then
56 addang=d
57 else
58 addang=d-sign(pi2,d)
59 endif
60
61 return
62 end
63
Note: See TracBrowser for help on using the repository browser.