Generating spatially correlated fields with a genetic algorithm