older-version
|
a.tgz,
f.00,
f.1,
f.10,
f.11,
f.12,
f.13,
f.14,
f.15,
f.16,
f.17,
f.18,
f.19,
f.2,
f.20,
f.21,
f.22,
f.23,
f.24,
f.25,
f.26,
f.27,
f.28,
f.29,
f.3,
f.30,
f.31,
f.32,
f.33,
f.34,
f.35,
f.36,
f.37,
f.4,
f.5,
f.6,
f.7,
f.8,
f.9
|
|
|
C *******************************************************************
C ** THIS FORTRAN CODE IS INTENDED TO ILLUSTRATE POINTS MADE IN **
C ** THE TEXT. TO OUR KNOWLEDGE IT WORKS CORRECTLY. HOWEVER IT IS **
C ** THE RESPONSIBILITY OF THE USER TO TEST IT, IF IT IS USED IN A **
C ** RESEARCH APPLICATION. **
C *******************************************************************
C *******************************************************************
C ** FICHE F.26 **
C ** SUBROUTINE TO FOLD TRAJECTORIES IN PERIODIC BOUNDARIES. **
C *******************************************************************
SUBROUTINE FOLD ( N, RX, RY, RZ )
C *******************************************************************
C ** SUBROUTINE TO FOLD TRAJECTORIES IN PERIODIC BOUNDARIES. **
C ** **
C ** THE FOLDING ROUTINE IS SIMPLY THE USUAL APPLICATION OF **
C ** BOUNDARY CONDITIONS. WE TAKE THE UNIT CUBE AS AN EXAMPLE. **
C ** **
C ** PRINCIPAL VARIABLES: **
C ** **
C ** INTEGER N NUMBER OF MOLECULES **
C ** REAL RX(N),RY(N),RZ(N) MOLECULAR POSITIONS **
C ** **
C ** USAGE: **
C ** **
C ** THE ROUTINE IS CALLED FOR EVERY CONFIGURATION GENERATED IN A **
C ** SIMULATION. **
C *******************************************************************
INTEGER N
REAL RX(N), RY(N), RZ(N)
INTEGER I
C *******************************************************************
DO 100 I = 1, N
RX(I) = RX(I) - ANINT ( RX(I) )
RY(I) = RY(I) - ANINT ( RY(I) )
RZ(I) = RZ(I) - ANINT ( RZ(I) )
100 CONTINUE
RETURN
END
SUBROUTINE UNFOLD ( N, RX, RY, RZ, RX0, RY0, RZ0 )
C *******************************************************************
C ** SUBROUTINE TO FOLD TRAJECTORIES IN PERIODIC BOUNDARIES. **
C ** **
C ** THE UNFOLDING ROUTINE UNDOES THE EFFECT OF FOLDING. **
C ** AGAIN WE TAKE THE UNIT CUBE AS AN EXAMPLE. **
C ** THIS ROUTINE REQUIRES THAT COORDINATES FROM SUCCESSIVE STEPS **
C ** BE SUPPLIED AND ASSUMES THAT NATURAL MOVEMENT ACROSS HALF A **
C ** BOX LENGTH IN ONE STEP WILL NEVER OCCUR. **
C ** THE RESULTING COORDINATES WOULD BE SUITABLE, FOR EXAMPLE, TO **
C ** CALCULATE THE DIFFUSION COEFFICIENT BY EINSTEIN'S RELATION. **
C ** **
C ** PRINCIPAL VARIABLES: **
C ** **
C ** INTEGER N NUMBER OF MOLECULES **
C ** REAL RX(N),RY(N),RZ(N) MOLECULAR POSITIONS AT TIME T **
C ** REAL RX0(N),RY0(N),RY0(N) MOLECULAR POSITIONS AT TIME T-DT **
C ** **
C ** USAGE: **
C ** **
C ** (1) READ INITIAL COORDINATES INTO RX0,RY0,RZ0 **
C ** (2) WRITE RX0,RY0,RZ0 TO OUTPUT FILE (OR USE IMMEDIATELY) **
C ** (3) READ NEXT STEP COORDINATES INTO RX,RY,RZ **
C ** (4) CALL UNFOLD ( N, RX, RY, RZ, RX0, RY0, RZ0 ) **
C ** (5) WRITE RX,RY,RZ TO OUTPUT FILE (OR USE IMMEDIATELY) **
C ** (6) SET RX0(I)=RX(I), RY0(I)=RY(I), RZ0(I)=RZ(I), I = 1,N **
C ** (7) UNLESS DATA EXHAUSTED, GO TO (3) **
C *******************************************************************
INTEGER N
REAL RX(N), RY(N), RZ(N), RX0(N), RY0(N), RZ0(N)
INTEGER I
REAL DX, DY, DZ
C *******************************************************************
DO 100 I = 1, N
DX = RX(I) - RX0(I)
DY = RY(I) - RY0(I)
DZ = RZ(I) - RZ0(I)
DX = DX - ANINT ( DX )
DY = DY - ANINT ( DY )
DZ = DZ - ANINT ( DZ )
RX(I) = RX0(I) + DX
RY(I) = RY0(I) + DY
RZ(I) = RZ0(I) + DZ
100 CONTINUE
RETURN
END
|