forked from JackS9/phatpsy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
order.f
94 lines (93 loc) · 2.11 KB
/
order.f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
SUBROUTINE ORDER(MM,M1,M2,LL,L1,L2,QREORD)
IMPLICIT REAL*8(A-H,O,P,R-Z),LOGICAL*1(Q)
C-----------------------------------------------------------------------
C
C ORDER...
C
C THIS ROUTINE PERMUTES THE INDICES OF A C-G COEFFICIENT (WITH
C POSSIBLE CHANGE IN SIGN) TO AN EQUIVALENT ORDER SUCH THAT
C LL GE L1 GE L2, THAT MM GE M1 FOR LL=L1 AND THAT M1 GE M2 FOR
C L1=L2. FOR CONSISTENCY MM IS ALWAYS CHOSEN TO BE POSITIVE.
C THE FOLLOWING EQUALITIES MAKE THIS POSSIBLE:
C
C C(MM,M1,M2;LL,L1,L2) = C(MM,M2,M1;LL,L2,L1)
C = C(M1,MM,-M2;L1,LL,L2)
C = C(-MM,-M1,-M2;LL,L1,L2)
C
C ENTRY: REORDR...
C
C THIS ENTRY POINT RESTORES THE ORIGINAL ORDER OF THE INDICES
C IF THEY HAVE BEEN REORDERED PREVIOUSLY (QREORD=.TRUE.).
C
C-----------------------------------------------------------------------
SAVE MMSAV,M1SAV,M2SAV,LLSAV,L1SAV,L2SAV
MMSAV=MM
M1SAV=M1
M2SAV=M2
LLSAV=LL
L1SAV=L1
L2SAV=L2
QREORD=.FALSE.
IF (L1.LT.L2) GO TO 10
GO TO 20
10 L1TEMP=L1
L1=L2
L2=L1TEMP
M1TEMP=M1
M1=M2
M2=M1TEMP
QREORD=.TRUE.
20 IF (LL.LT.L1) GO TO 30
GO TO 40
30 LLTEMP=LL
LL=L1
L1=LLTEMP
MMTEMP=MM
MM=M1
M1=MMTEMP
M2=-M2
QREORD=.TRUE.
IF (L1.GE.L2) GO TO 40
L1TEMP=L1
L1=L2
L2=L1TEMP
M1TEMP=M1
M1=M2
M2=M1TEMP
40 IF (MM.LT.0) GO TO 50
GO TO 60
50 MM=-MM
M1=-M1
M2=-M2
QREORD=.TRUE.
60 IF ((L1.EQ.L2).AND.(M1.LT.M2)) GO TO 70
GO TO 80
70 M1TEMP=M1
M1=M2
M2=M1TEMP
QREORD=.TRUE.
80 IF ((LL.EQ.L1).AND.(MM.LT.M1)) GO TO 90
RETURN
90 MMTEMP=MM
MM=M1
M1=MMTEMP
M2=-M2
QREORD=.TRUE.
IF ((L1.EQ.L2).AND.(M1.LT.M2)) GO TO 100
RETURN
100 M1TEMP=M1
M1=M2
M2=M1TEMP
QREORD=.TRUE.
RETURN
C
C -->
ENTRY REORDR(MM,M1,M2,LL,L1,L2)
MM=MMSAV
M1=M1SAV
M2=M2SAV
LL=LLSAV
L1=L1SAV
L2=L2SAV
RETURN
END