C
C       Metropolis Monte Carlo update of the Ising model.
C      (Metropolis et al., J. Chem. Phys. 21 (1953) 1087).
C
C    Based on the code in the book "Statistical Field Theory", 
C    G. Parisi, (Addison-Wesley, 1988).
C
C       Paul Coddington, August 1992
C

	PROGRAM metropolis
	INCLUDE "common.h"
	INTEGER i,seed,start

C ----  Initialize some Express stuff.
	CALL KXINIT

C ----  Read in the parameters.
	CALL input(seed,start)

C ----  Do domain decomposition of the lattice over the nodes.
	CALL decompose
 
C ----  Initialize the random number generator.
	CALL rand_init(seed)
 
C ----  Initialize the spins.
	CALL init_spins(start)
 
C ----  Initialize the data.
	CALL init_measure

C ----  Thermalize.
	CALL metupdate(therm_sweeps)

C ----  Do the update, with a measurement every 'sweeps' iterations.
	DO i=1,measurements
	  CALL metupdate(sweeps)
	  CALL measure
	ENDDO
 
C ----  Print out the results.
	CALL output

	STOP
	END

