The following programs run a genetic algorithm (GA) inversion. Both examples are for a volcanic source inversions. Three c programs are necessary for the GA - inversion.c, fit.c, ran1.c. Inversion.c contains the main genetic algorithm; fit.c will contain the forward model to which you want to fit the data; ran1.c is a random number generator. In the header to inversion.c you must set the number of parameters, the population size, and the mutation and crossover rates. In fit.c you set the number of generations, the number of each type of data point, and the number of each type of volcanic source you want to invert for. Two examples of forward model applications are given here. In both cases, fit.c compares the actual data (contained in motion.in, fit1. in, and error.in) to those values computed by the model and computes a fitness. In the first example, fit_c.tgz, fit.c itself computes the modeled values. In the second, fit_grav.tgz, fit.c uses a system call to invoke a separate executable, gravw1, originally written as a fortran program. Again, the data files motion.in, fit1.in, and error.in should be included in the same directory as the GA. motion.in contains a listing of the measured data; error.in contains a listing of the standard deviations for each data point as listed in motion.in; and fit1.in contains, on the first line, the number of each type of data and the location of each data point, again in the same order as in motion.in and error.in. The last file that must be in the same directory is gadata.txt. This contains the range of possible values, in pairs of maximum and minimum, for the parameters to be inverted for, in the same order as they are listed in the main program. For example, in the elastic-gravitational model there are 6 parameters - x and y location, depth, pressure, radius, and mass. The example fit_c.tgz works as follows: Unpack fit_c.tgz in a separate directory. Set the parameters in inversion.c and fit.c Compile the main program as follows: gcc -o inversion -lm inversion.c Make sure the input files are in the same directory. Call inversion with a negative seed, as discussed below. The example fit_grav.zip works slightly differently: Unpack fit_grav.zip in another directory (many of the file names are the same, do not overwrite the other example!!!) The fortran program, Gravw1.f, runs the forward model for the gravity data. Compile the fortran program as follows: f77 -o gravw1 Gravw1.f Again, compile the main program as follows: gcc -o inversion -lm inversion.c Output, in both cases, is generated in galog.txt. It outputs the best fitness, the average and standard deviation for each generation. You can change output format in the report subroutine. To run the program, you need a random negative seed. Call it using inversion "seed" Again, seed must be a negative number! A longer description of the genetic algorithm, complete with flow chart, is contained in the following references: Tiampo, K.F., Rundle, J.B., Fernandez, J., and Langbein, J.O. Spherical and ellipsoidal volcanic sources at Long Valley caldera, California, using a genetic algorithm technique, J. Volc. and Geotherm. Res., 102, 2000. Tiampo, K.F., Fernández, J., Charco, M. Jentzsch, G., and Rundle, J.B. New results at Mayon, Philippines, from a joint inversion of gravity and deformation measurements, PAGEOPH, 61, 2004. Good luck, Kristy (ktiampo@uwo.ca)