There are Fortran routines available implementing the cluster-update
routines as described in this document. There are also a few test
programs that may be useful as examples of how to use the routines. As
they currently stand, these routines are written for use in either
-bit or
-bit processors. The files described in what follows,
containing the source code, are freely available in a compressed tar file
at the URL:
There are files with the definition of the necessary data structures, as
well as the initialization routines and the cluster-update routines
themselves. These modules are meant to be integrated into larger programs
at a source-code level. The files containing the data structures are
include files, meant to be included in the modules that need access to
the data structures they contain. All interchange of data among modules
is made by means of common blocks. Each initialization routine defines
the data in the common block in the corresponding include file. These
initialization routines should be called once at the beginning of the
program, one for each common block that is used in the program.
Read the Makefile, the README file and the source code in the
src/ subdirectory in order to see which modules depend on which
data structures. All the code is fairly well documented with internal
comments. Here are short explanations of the nature of each source-code
file. First the files with the data structures:
- fp_def.f:
- an include file with the basic parameters defining
the run; this is needed by all modules.
- fp_cal.f:
- an include file with other parameters, which are
calculated using the basic ones; this is needed by most modules.
- cb_param.f:
- an include file with a common block containing
additional initial and calculated parameters.
- cb_flags.f:
- an include file with a common block containing
the dimensionality flags.
- cb_index.f:
- an include file with a common block containing
the data structures related to the indexing of neighbors.
- cb_exsrc.f:
- an include file with a common block containing
the data structures related to the external sources.
- cb_field.f:
- an include file with a common block containing
the data structures related to the field.
- cb_fdbck.f:
- an include file with a common block containing
variables related to feedback and monitoring functions.
The files containing the main routines, including the initialization
routines and the cluster-update routines themselves:
- init_param.f:
- a subroutine that initializes the common block
in cb_param.f.
- init_flags.f:
- a subroutine that initializes the common block
in cb_flags.f.
- init_index.f:
- a subroutine that initializes the common block
in cb_index.f.
- init_exsrc.f:
- a subroutine that initializes the common block
in cb_exsrc.f.
- init_field.f:
- a subroutine that initializes the common block
in cb_field.f.
- cluster_no_source.f:
- a cluster routine for a periodical
lattice without any external sources.
- cluster_general_bas.f:
- a cluster routine for a periodical
lattice with an arbitrary external source over the whole lattice, without
any specific optimizations.
- cluster_general_opt.f:
- an optimized cluster routine for a
periodical lattice with an arbitrary external source over the whole
lattice.
- cluster_constant.f:
- an optimized cluster routine for a
periodical lattice with a constant external source over the whole
lattice.
- cluster_localized.f:
- an optimized cluster routine for a
periodical lattice with a constant external source over a localized
subset of the lattice, such as a single site or a straight line of sites.
Files containing the test programs and some auxiliary routines, including
a couple of C interfaces to system facilities:
- test_cluster_no_source.f:
- a program that executes in an
infinite loop the cluster routine cluster_no_source, and measures
the average cluster size and the speed of the routine.
- test_cluster_general_bas.f:
- a program that executes in an
infinite loop the cluster routine cluster_general_bas, and
measures the average cluster size, the cluster rejection rate and the
speed of the routine.
- test_cluster_general_opt.f:
- a program that executes in an
infinite loop the cluster routine cluster_general_opt, and
measures the average cluster size, the cluster rejection rate and the
speed of the routine.
- test_cluster_constant.f:
- a program that executes in an
infinite loop the cluster routine cluster_constant, and measures
the average cluster size, the cluster rejection rate and the speed of the
routine.
- test_cluster_localized.f:
- a program that executes in an
infinite loop the cluster routine cluster_localized, and measures
the average cluster size, the cluster rejection rate and the speed of the
routine.
- urandom_ctof.c:
- a Fortran-callable C interface to the system
libraries, to get a random seed from the Linux kernel.
- clock_ctof.c:
- a Fortran-callable C interface to the system
libraries, to get the CPU time of the current process from the system.
- dranr-1.f:
- the first random number generator from the authors
of the book ``Numerical Recipes''.
- dranr-2.f:
- the second random number generator from the authors
of the book ``Numerical Recipes''.