-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathorder-parameter.f
74 lines (56 loc) · 3.19 KB
/
order-parameter.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
********************************************************************************
** FICHE F.25. ROUTINE TO CALCULATE TRANSLATIONAL ORDER PARAMETER **
** This FORTRAN code is intended to illustrate points made in the text. **
** To our knowledge it works correctly. However it is the responsibility of **
** the user to test it, if it is to be used in a research application. **
********************************************************************************
SUBROUTINE ORDER ( KLATX, KLATY, KLATZ, PARAM )
COMMON / BLOCK1 / RX, RY, RZ, VX, VY, VZ, FX, FY, FZ
C *******************************************************************
C ** CALCULATION OF TRANSLATIONAL ORDER PARAMETER (MELTING FACTOR).**
C ** **
C ** CLASSICALLY, THE ORDER PARAMETER IS A NORMALIZED SUM OF **
C ** COSINE TERMS WHICH SHOULD BE UNITY IN THE PERFECT LATTICE **
C ** AND FLUCTUATE AROUND ZERO FOR A DISORDERED SYSTEM. **
C ** HOWEVER, THIS IS NOT ORIGIN-INDEPENDENT: WITH AN UNSUITABLE **
C ** CHOICE OF ORIGIN IT COULD VANISH EVEN IN A PERFECT LATTICE. **
C ** ACCORDINGLY, WE CALCULATE HERE A QUANTITY THAT IS INDEPENDENT **
C ** OF THE ORIGIN OF COORDINATES. **
C ** IT SHOULD BE UNITY IN A LATTICE FOR WHICH A RECIPROCAL VECTOR **
C ** (KLATX,KLATY,KLATZ) IS SUPPLIED. **
C ** IT SHOULD BE POSITIVE BUT SMALL, OF ORDER SQRT(N) IN A **
C ** DISORDERED SYSTEM. **
C ** **
C ** PRINCIPAL VARIABLES: **
C ** **
C ** INTEGER N NUMBER OF MOLECULES **
C ** REAL RX(N),RY(N),RZ(N) MOLECULAR COORDINATES **
C ** REAL VX(N),VY(N),VZ(N) MOLECULAR VELOCITIES (NOT USED) **
C ** REAL FX(N),FY(N),FZ(N) MOLECULAR FORCES (NOT USED) **
C ** REAL KLATX,KLATY,KLATZ RECIPROC. VECTOR OF INITIAL LATTICE **
C ** REAL PARAM RESULT: ORDER PARAMETER **
C *******************************************************************
INTEGER N
PARAMETER ( N = 108 )
REAL KLATX, KLATY, KLATZ, PARAM
REAL RX(N), RY(N), RZ(N)
REAL VX(N), VY(N), VZ(N)
REAL FX(N), FY(N), FZ(N)
INTEGER I
REAL SINSUM, COSSUM
C *******************************************************************
SINSUM = 0.0
COSSUM = 0.0
DO 100 I = 1, N
COSSUM = COSSUM + COS ( KLATX * RX(I)
: + KLATY * RY(I)
: + KLATZ * RZ(I) )
SINSUM = SINSUM + SIN ( KLATX * RX(I)
: + KLATY * RY(I)
: + KLATZ * RZ(I) )
100 CONTINUE
COSSUM = COSSUM / REAL ( N )
SINSUM = SINSUM / REAL ( N )
PARAM = SQRT ( COSSUM ** 2 + SINSUM ** 2 )
RETURN
END