C Brownian Motion by Integration of Gaussian White Noise
Total Page:16
File Type:pdf, Size:1020Kb
------PROGRAM BRNMTN
C BROWNIAN MOTION BY INTEGRATION OF GAUSSIAN WHITE NOISE. C THIS PROGRAM REQUIRES A GAUSSIAN RANDOM NUMBER GENERATOR SUCH AS C GASDEV DESCRIBED IN PRESS. C YOU WILL BE PROMPTED FOR THE INPUT DATA, WHICH CONSISTS OF THE C NUMBER OF GAUSSIAN WHITE NOISE POINTS (NOT TO EXCEED 2500) AND C THE NUMBER OF BROWNIAN MOTION POINTS TO BE CALCULATED (NOT TO C EXCEED 500). THE NUMBER OF GAUSSIAN WHITE NOISE POINTS SHOULD C EXCEED THE NUMBER OF BROWNIAN MOTION POINTS BY AT LEAST A FACTOR C OF FIVE. C THE PROGRAM THEN CALCULATES THE BROWNIAN MOTION TRAJECTORY AND C PUTS THESE INTO A FILE LABELED 'OUTPUT.' THESE POINTS MAY BE C EXPORTED TO YOUR FAVORITE GRAPHICS PROGRAM. C IMPLICIT REAL*8(A-H,O-Z) DIMENSION Y(2500),Z(500) WRITE(*,20) 20 FORMAT(1X,'SELECT THE NUMBER OF GAUSSIAN WHITE NOISE POINTS AND'/, X' BROWNIAN MOTION POINTS. ',\) READ(*,*) N,NBM OPEN(3,FILE='OUTPUT', STATUS='NEW') C GENERATE GAUSSIAN WHITE NOISE POINTS IDUM = -1 DO 30 I=1,N 30 Y(I) = 0.0 DO 35 I=1,NBM 35 Z(I) = 0.0 DO 40 I=1,N 40 Y(I) = GASDEV(IDUM) C GENERATE BROWNIAN MOTION POINTS M = N/NBM MIN = 2 MAX = M DO 70 J=1,NBM DO 50 I=MIN,MAX Y(I) = Y(I-1)+Y(I) 50 Z(J) = Y(I) C START NEW SUMMATION WITH ORIGINAL Y(I-1) MIN = MIN+M MAX = MAX+M 70 CONTINUE C BROWNIAN MOTION TRAJECTORY BY SUMMATION OF THE Z POINTS ZSUM = 0.0 DO 90 I=1,NBM ZSUM = ZSUM+Z(I) WRITE(3,80) ZSUM 80 FORMAT(E14.5) 90 CONTINUE CLOSE(3) WRITE (*,100) 100 FORMAT(1X,'PRESS RETURN TO TERMINATE.') PAUSE END ------PROGRAM BRSLTR
C SOLUTION OF THE BRUSSELATOR BY THE RUNGE-KUTTA METHOD C THE EQUATIONS ARE C DX/DT = A-(B+1)*X+X^2*Y C DY/DT = B*X-X^2*Y C WHERE A,B,C ARE PARAMETERS. THE SOLUTIONS ARE ADVANCED BY A C TIME INCREMENT DT. THE PRINTOUTS OF X AND Y ARE CONTROLLED BY C THE NUMBER OF TIME INCREMENTS (NUM) BETWEEN WRITES TO THE OUTPUT C FILE. THIS IS SET BY THE VALUE OF M, WHERE M = 1/NUM*DT. C TOO LARGE A TIME INCREMENT WILL CAUSE ERRATIC BEHAVIOR OF THE C PROGRAM. AN INITIAL VALUE OF 0.01 IS RECOMMENDED. C WHEN ENTERING VALUES OF PARAMETERS, UPON SEEING THE SCREEN PROMPT, C YOU MUST LEAVE A SPACE BETWEEN NUMBERS. C THE OUTPUT FILES ARE LABELED 'XRESULT' AND 'YRESULT.' THESE C RESULTS MAY BE EXPORTED TO YOUR FAVORITE GRAPHICS PROGRAM. C IMPLICIT REAL*8(A-H,O-Z) F1(X,Y,A,B) = A-(B+1.0)*X+X*X*Y F2(X,Y,B) = B*X-X*X*Y OPEN(2,FILE='XRESULT', STATUS='NEW') OPEN(3,FILE='YRESULT', STATUS='NEW') WRITE(*,10) 10 FORMAT(1X,'SELECT THE NUMBER OF POINTS TO BE CALCULATED, THE VALUE XS OF A,B, AND THE',/1X,'INITIAL VALUES OF X AND Y. ',\) READ(*,*) N,A,B,X,Y WRITE(*,25) 25 FORMAT(1X,'SELECT THE TIME INCREMENT AND THE VALUE OF M. ',\) READ(*,*) DT, M WRITE(2,40) X WRITE(3,40) Y C NUM IS A COUNTER FOR TIME INTERVALS BETWEEN OUTPUT WRITES NUM = 0 DO 50 I=1,N AK1 = F1(X,Y,A,B)*DT AM1 = F2(X,Y,B)*DT X1 = X+AK1/2.0 Y1 = Y+AM1/2.0 AK2 = F1(X1,Y1,A,B)*DT AM2 = F2(X1,Y1,B)*DT X2 = X+AK2/2.0 Y2 = Y+AM2/2.0 AK3 = F1(X2,Y2,A,B)*DT AM3 = F2(X2,Y2,B)*DT X3 = X+AK3 Y3 = Y+AM3 AK4 = F1(X3,Y3,A,B)*DT AM4 = F2(X3,Y3,B)*DT X1 = X+(AK1+2.0*AK2+2.0*AK3+AK4)/6.0 Y1 = Y+(AM1+2.0*AM2+2.0*AM3+AM4)/6.0 X = X1 Y = Y1 IF(NUM.EQ.0) GO TO 35 IF(NUM*M*DT.EQ.1) GO TO 30 GO TO 45 30 NUM = 0 35 WRITE(2,40) X WRITE(3,40) Y 40 FORMAT(E14.5) 45 NUM = NUM + 1 50 CONTINUE CLOSE(2) CLOSE(3) WRITE(*,60) 60 FORMAT(1X,'PRESS RETURN TO TERMINATE') PAUSE END ------PROGRAM CELLAUT
C CELLULAR AUTOMATA C THIS PROGRAM CALCULATES ONE-DIMENSIONAL CELLULAR AUTO- C MATA USING THE NEIGHBOR-THREE RULES OF [WOLFRAM, 1983]. C THE INPUT CONSISTS OF THE NUMBER OF SITES C (CELLS) N IN THE CA PLUS 2 TO TAKE INTO ACCOUNT THE ENDS FOR C CYCLIC BOUNDARY CONDITIONS, THE NUMBER OF TIME VALUES (INCLUDING C TIME ZERO) NT, AND THE ORIGINAL CONFIGURATION IX(NT,N) COMPRISED C OF 1'S AND 0'S. THE VALUES OF N, NT, AND THE INITIAL C CONFIGURATION MUST BE ENTERED IN A FILE LABELED 'INPUT.' C SEE THE PROGRAM FOR THE FORMAT OF THE INPUT DATA. C THE CA RULES IN THE PROGRAM MUST BE CHANGED FOR EACH NEW CA AND C THE PROGRAM MUST BE RECOMPILED FOR EACH NEW CA. C EACH TIME N AND OR NT ARE CHANGED, THE PROGRAM MUST BE MODIFIED C AND RECOMPILED. THESE CHANGES ARE INDICATED IN THE PROGRAM C BY *****. C THE VALUE OF N MUST NOT EXCEED 100 AND THE VALUE OF NT MUST NOT C EXCEED 500. C THE CA APPEAR DIRECTLY ON THE SCREEN. C IMPLICIT REAL*8(A-H,O-V), INTEGER(I-N) DIMENSION IX(500,100) OPEN(2, FILE='INPUT',STATUS='OLD') C READ IN THE NUMBER OF CELLS (+2) AND THE NUMBER OF TIME STEPS READ(2,*) N,NT C READ IN THE INITIAL CONFIGURATION. READ(2,*) (IX(1,J), J=1,N) DO 120 I=1,NT-1 DO 118 J=2,N-1 C*****THE CA RULES MUST BE SPECIFIED BELOW. THE NEIGHBORHOODS ARE C*****LABELED. IF DESIRED, THE CA NUMBER CAN BE RECORDED IN THE C*****NEXT STATEMENT. C CELLULAR AUTOMATA RULES FOR CA 126 IF(IX(I,J).EQ.1) GO TO 108 C NEIGHBORHOOD 101 IF(IX(I,J-1).EQ.1.AND.IX(I,J+1).EQ.1) IX(I+1,J) = 1 C NEIGHBORHOOD 100 IF(IX(I,J-1).EQ.1.AND.IX(I,J+1).EQ.0) IX(I+1,J) = 1 C NEIGHBORHOOD 001 IF(IX(I,J-1).EQ.0.AND.IX(I,J+1).EQ.1) IX(I+1,J) = 1 C NEIGHBORHOOD 000 IF(IX(I,J-1).EQ.0.AND.IX(I,J+1).EQ.0) IX(I+1,J) = 0 GO TO 118 C NEIGHBORHOOD 111 108 IF(IX(I,J-1).EQ.1.AND.IX(I,J+1).EQ.1) IX(I+1,J) = 0 C NEIGHBORHOOD 110 IF(IX(I,J-1).EQ.1.AND.IX(I,J+1).EQ.0) IX(I+1,J) = 1 C NEIGHBORHOOD 011 IF(IX(I,J-1).EQ.0.AND.IX(I,J+1).EQ.1) IX(I+1,J) = 1 C NEIGHBORHOOD 010 IF(IX(I,J-1).EQ.0.AND.IX(I,J+1).EQ.0) IX(I+1,J) = 1 118 CONTINUE IX(I+1,1) = IX(I+1,N-1) IX(I+1,N) = IX(I+1,2) 120 CONTINUE DO 125 I=1,NT DO 127 J=1,N IF(IX(I,J).EQ.0) GO TO 128 WRITE(*,130) 130 FORMAT(''\) GOTO 127 128 WRITE(*,129) 129 FORMAT(' '\) 127 CONTINUE WRITE(*,126) 126 FORMAT(' ') 125 CONTINUE CLOSE(2) C SCREEN REMARK WRITE(*,160) 160 FORMAT(1X,'PRESS RETURN TO TERMINATE') PAUSE END ------PROGRAM GSSWTN
C GAUSSIAN WHITE NOISE C THIS PROGRAM CALCULATES GAUSSIAN WHITE NOISE. C THIS PROGRAM REQUIRES A GAUSSIAN RANDOM NUMBER GENERATOR SUCH AS C GASDEV DESCRIBED IN PRESS. C INPUT CONSISTS OF THE NUMBER OF WHITE NOISE POINTS (N). C THERE IS NO RESTRICTION ON THE NUMBER OF POINTS. C THE OUTPUT IS IN A FILE NAMED 'RESULT.' C C IMPLICIT REAL*8(A-H,O-Z) WRITE(*,20) 20 FORMAT(1X,'SELECT THE NUMBER OF GAUSSIAN WHITE NOISE POINTS. ',\) READ(*,*) N OPEN(3,FILE='RESULT',STATUS='NEW') IDUM = -1 DO 60 I=1,N X = GASDEV(IDUM) WRITE(3,50) X 50 FORMAT(E14.5) 60 CONTINUE CLOSE(3) WRITE(*,70) 70 FORMAT(1X,'PRESS RETURN TO TERMINATE.') PAUSE END ------PROGRAM ISING
C TWO-DIMENSIONAL ISING LATTICE BY MONTE CARLO METHOD C THIS FORTRAN PROGRAM CALCULATES THE SHORT-RANGE ORDER C PARAMETER F1 (FRACTION OF NEAREST-NEIGHBOR SITES OCCUPIED C BY AN ANTIPARALLEL PAIR OF SPINS) AND E/NJ. INPUT CONSISTS OF THE C LATTICE DIMENSION N (WHERE TOTAL NUMBER OF SITES IS N * N), C THE REDUCED COUPLING CONSTANT R, AND THE NUMBER OF ITERATIONS C NIT. THE COUNTER NCOUNT RECORDS THE NUMBER OF ITERATIONS. C EACH ITERATION CONSISTS OF THE METROPOLIS MC METHOD APPLIED C SUCCESSIVELY TO EACH OF THE NXN SITES. THE TOTAL NUMBER OF C CONFIGURATIONS USED IN THE CALCULATION OF F1 IS N * N * NIT. C A RANDOM NUMBER GENERATOR, SUCH AS RAN2 FROM PRESS, C MUST BE SUPPLIED. C THE OUTPUT ON THE SCREEN IS THE ORDER PARAMETER. IN A FILE C LABELED 'RESULT' CAN BE FOUND VALUES FOR E/NJ AFTER EACH C ITERATION. C AT THE END OF THE CALCULATION, YOU WILL BE PROMPTED AS TO WHETHER C YOU WISH TO DO ANOTHER CALCULATION. IF YOU DO, THE RESULTS FOR C EACH CALCULATION WILL BE SAVED IN THE 'RESULT' FILE. C IMPLICIT REAL*8(A-H,O-Z) CHARACTER*3 ANS DIMENSION IA(50,50),SUMF1(1000) OPEN(3,FILE='RESULT',STATUS='NEW') C DIMENSION OF LATTICES IS N; REDUCED COUPLING CONSTANT R=J/KT 1 WRITE(*,5) 5 FORMAT(1X,'PLEASE TYPE IN THE LATTICE DIMENSION, J/KT, AND NUMBER X OF ITERATIONS; LEAVE A'/' SPACE BETWEEN NUMBERS. ',\) READ(*,*) N,R,NIT WRITE(*,6) 6 FORMAT(1X,'CALCULATION IS IN PROGRESS.') NCOUNT = 0 DO 200 IJ=1,NIT NCOUNT = NCOUNT+1 IF(NCOUNT.EQ.1) GO TO 7 F1 = F1*N*N*(NCOUNT-1) GO TO 12 7 F1 = 0.0 IDUM = -1 C SET ALL SPINS EQUAL TO 1 TO BEGIN 9 DO 10 I=1,N DO 10 J=1,N 10 IA(I,J) = 1 12 K = 0 C COUNT NUMBER OF +1,+1 NEIGHBOR PAIRS 15 NPP = 0 DO 20 J=1,N IF(IA(1,J).NE.IA(N,J).OR.IA(1,J).EQ.0) GO TO 20 NPP = NPP+1 20 CONTINUE DO 30 I=1,N IF(IA(I,1).NE.IA(I,N).OR.IA(I,1).EQ.0) GO TO 30 NPP = NPP+1 30 CONTINUE DO 40 I=1,N DO 40 J=1,N-1 IF(IA(I,J).NE.IA(I,J+1).OR.IA(I,J).EQ.0) GO TO 40 NPP = NPP+1 40 CONTINUE DO 50 I=1,N-1 DO 50 J=1,N IF(IA(I,J).NE.IA(I+1,J).OR.IA(I,J).EQ.0) GO TO 50 NPP = NPP+1 50 CONTINUE C COUNT NUMBER OF +1 SPINS NP = 0 DO 60 I=1,N DO 60 J=1,N IF(IA(I,J).EQ.0) GO TO 60 NP = NP+1 60 CONTINUE SS = 4.0*NPP-8.0*NP+2.0*N*N IF(K.GT.0) GO TO 65 E1 = -R*SS GO TO 66 65 E2 = -R*SS DELE = E2-E1 GO TO 85 C REVERSE SPIN AT SITE I,J 66 L = 0 67 L = L+1 M = 0 68 M = M+1 IF(IA(L,M)) 70,70,80 70 IA(L,M) = 1 GO TO 82 80 IA(L,M) = 0 82 K = K+1 NP1 = NP NPP1 = NPP GO TO 15 85 IF(DELE) 90,90,100 90 E1 = E2 GO TO 140 C DELTA E IS GT ZERO; CHECK BOLTZMANN DISTRIBUTION 100 IDUM = IDUM-1 RN = RAN2(IDUM) BOL = DEXP(-DELE) IF(RN.LT.BOL) GO TO 130 C NON-BOLTZMANN DISTRIBUTION---RESET TO OLD VALUES IF(IA(L,M)) 110,110,120 110 IA(L,M) = 1 NP = NP1 NPP = NPP1 GO TO 140 120 IA(L,M) = 0 NP = NP1 NPP = NPP1 GO TO 140 130 E1 = E2 140 F1 = (4.0*NP-2.0*NPP)/(2.0*N*N)+F1 NP1 = NP NPP1 = NPP IF(M.NE.N) GO TO 68 IF(L.NE.N) GO TO 67 F1 = F1/(N*N*NCOUNT) SUMF1(IJ) = -2.0*(1.0 - 2.0*F1) 200 CONTINUE WRITE(3,210) (SUMF1(IJ), IJ=1,NIT) 210 FORMAT(E12.5) WRITE(*,150) F1 150 FORMAT(1X,'THE ORDER PARAMETER IS',E12.5) WRITE(*,155) 155 FORMAT(1X,'DO YOU WISH TO CONTINUE WITH A NEW CONFIGURATION? (yes XOR no) ',\) READ(*,157) ANS 157 FORMAT(A3) IF(ANS.EQ.'yes') GO TO 1 CLOSE(3) WRITE(*,160) 160 FORMAT(1X,'PRESS RETURN TO TERMINATE') PAUSE END ------PROGRAM LJMDFOR1D
C THIS PROGRAM PERFORMS AN MD SIMULATION ON A ONE-DIMENSIONAL C LENNARD-JONES FLUID MODEL. THE PROGRAM USES THE RANDOM NUMBER C GENERATOR RAN2 FROM PRESS. CARE SHOULD BE TAKEN TO CHANGE THE C FUNCTION AND ALL THE REAL VARIABLES IN IT INTO DOUBLE PRECISION. C THE VARIABLES HAVE EASY TO UNDERSTAND C NAMES. REDUCED UNITS HAVE BEEN USED. THE NTH POSITION DERIVATIVE C HAS BEEN MULTIPLIED BY (DELTA)**N/N!. NO CUTOFF CORRECTIONS HAVE C BEEN APPLIED. IMPLICIT REAL*8(A-H, O-Z) COMMON /X0F/ X0(300), F(300) COMMON /X123/ X1(300), X2(300), X3(300) COMMON /NSIDEL/ N, SIDEL, SIDEL2 COMMON /SUMS/ V2SUM, ENSUM, VISUM COMMON /ENERVIR/ ENERGY, VIRIAL OPEN( UNIT=6, FILE='MDOUT.OUT') C GIVE THE VALUES OF THE INPUT PARAMETERS. NEQUI=5000 NCALC=20 NPROD=15000 N=300 AN=N DELTA=0.005D0 DELTA2=DELTA*DELTA DELTA3=0.5D0*DELTA2 TEMP=2.10D0 DENSITY=0.4D0 SIDEL=AN/DENSITY SIDEL2=0.5D0*SIDEL DELTAX=SIDEL/(AN + 1.0D0) DO 10 I=1, N X2(I)=0.0D0 X3(I)=0.0D0 10 F(I)=0.0D0 V2SUM=0.0D0 ENSUM=0.0D0 VISUM=0.0D0 X0(1)=DELTAX C ASSIGN INITIAL POSITIONS DO 20 I=2, N 20 X0(I)=X0(I-1) + DELTAX SUMV=0.0D0 WRITE(*,25) 25 FORMAT(1X,'PLEASE TYPE IN RANDOM NUMBER SEED INTEGER. '\) C ASSIGN RANDOM VELOCITIES READ(*,*)IDUM DO 30 I=1,N XX = RAN2(IDUM) X1(I) = 2.0D0*XX-1.0D0 30 SUMV=SUMV + X1(I) SUMV2=0.0D0 DO 40 I=1, N X1(I) = X1(I) - SUMV/AN 40 SUMV2 = SUMV2 + X1(I)*X1(I) SCALE=DSQRT(AN*DELTA2*TEMP/SUMV2) C SCALE THE VELOCITIES TO GET THE GIVEN REDUCED TEMPERATURE DO 50 I=1, N 50 X1(I) = X1(I)*SCALE C START THE EQUILIBRATION PHASE CALL FORCEETC DO 60 I=1, N 60 X2(I) =F(I)*DELTA3 DO 70 NST=1, NEQUI CALL PREDCOR(DELTA3) IF(MOD(NST,NCALC).EQ.0)THEN CALL CALC(DENSITY, SQV, DELTA2, NCALC, NST) SCALE=DSQRT(AN*DELTA2*TEMP/SQV) DO 80 I=1, N 80 X1(I) = X1(I)*SCALE END IF 70 CONTINUE C START THE PRODUCTION RUN V2SUM=0.0D0 ENSUM=0.0D0 VISUM=0.0D0 DO 90 NST=1, NPROD CALL PREDCOR(DELTA3) IF(MOD(NST,NCALC).EQ.0)CALL CALC(DENSITY, SQV, 1 DELTA2, NCALC, NST) 90 CONTINUE STOP END
SUBROUTINE FORCEETC C THIS SUBROUTINE CALCULATES THE FORCES, POTENTIAL ENERGIES AND THE C VIRIAL FOR A GIVEN CONFIGURATION. IMPLICIT REAL*8(A-H, O-Z) COMMON /X0F/ X0(300), F(300) COMMON /NSIDEL/ N, SIDEL,SIDEL2 COMMON /ENERVIR/ ENERGY, VIRIAL ENERGY=0.0D0 VIRIAL=0.0D0 DO 10 I=1, N-1 R=X0(I)-X0(I+1) IF(R.GT.SIDEL2)R=R-SIDEL IF(R.LT.-SIDEL2)R=R+SIDEL R2=R*R R6=R2*R2*R2 R61=1.0D0/R6 EN=4.0D0*R61*(R61-1.0D0) FORCE=24.0D0*R61*(2.0D0*R61-1.0D0)/R F(I)=F(I)+FORCE F(I+1)=F(I+1)-FORCE ENERGY=ENERGY+EN 10 VIRIAL=VIRIAL+FORCE*R R=X0(N)-X0(1) IF(R.GT.SIDEL2)R=R-SIDEL IF(R.LT.-SIDEL2)R=R+SIDEL R2=R*R R6=R2*R2*R2 R61=1.0D0/R6 EN=4.0D0*R61*(R61-1.0D0) FORCE=24.0D0*R61*(2.0D0*R61-1.0D0)/R F(N)=F(N)+FORCE F(1)=F(1)-FORCE ENERGY=ENERGY+EN VIRIAL=VIRIAL+FORCE*R RETURN END
SUBROUTINE PREDCOR(DELTA3) C THIS SUBROUTINE APPLIES THE GEAR'S THIRD ORDER PREDICTOR CORRECTOR C ALGORITHM. IMPLICIT REAL*8(A-H, O-Z) COMMON /X0F/ X0(300), F(300) COMMON /X123/ X1(300), X2(300), X3(300) COMMON /NSIDEL/ N, SIDEL, SIDEL2 DO 10 I=1, N X0(I)=X0(I)+X1(I)+X2(I)+X3(I) X1(I)=X1(I)+2.0D0*X2(I)+3.0D0*X3(I) X2(I)=X2(I)+3.0D0*X3(I) 10 F(I)=0.0D0 CALL FORCEETC DO 20 I=1, N DIFF=DELTA3*F(I)-X2(I) X0(I)=X0(I)+DIFF/6.0D0 X1(I)=X1(I)+5.0D0*DIFF/6.0D0 X2(I)=X2(I)+DIFF X3(I)=X3(I)+DIFF/3.0D0 IF(X0(I).GT.SIDEL)X0(I)=X0(I)-SIDEL 20 IF(X0(I).LT.0.0D0)X0(I)=X0(I)+SIDEL RETURN END
SUBROUTINE CALC(DENSITY, SQV, DELTA2, NCALC, NST) C THIS SUBROUTINE CALCULATES THE PHYSICAL PROPERTIES USING THEIR C DEFINITIONS, AS NEEDED. IMPLICIT REAL*8(A-H, O-Z) COMMON /X123/ X1(300), X2(300), X3(300) COMMON /NSIDEL/ N, SIDEL, SIDEL2 COMMON /SUMS/ V2SUM, ENSUM, VISUM COMMON /ENERVIR/ ENERGY, VIRIAL SQV=0.0D0 AN=N DO 10 I=1, N 10 SQV=SQV+X1(I)*X1(I) V2SUM=V2SUM+SQV ENSUM=ENSUM+ENERGY VISUM=VISUM+VIRIAL TEMPCALC=SQV/(AN*DELTA2) PRES=DENSITY*(TEMPCALC+VIRIAL/AN) EPOT=ENERGY/AN ETOT=0.5D0*TEMPCALC +EPOT POINTS=DFLOAT(NST/NCALC) TAVE=V2SUM/(AN*POINTS*DELTA2) EAVE=ENSUM/(AN*POINTS) PAVE=DENSITY*(TAVE+VISUM/(AN*POINTS)) WRITE(6,*)'NST,TEMPCALC,TAVE,EPOT,EAVE,PRES,PAVE,ETOT' WRITE(6,*)NST,TEMPCALC,TAVE,EPOT,EAVE,PRES,PAVE,ETOT RETURN END