#include "geostat.h" #include #include #include /* GENERATION OF A GAUSSIAN WHITE NOISE VECTOR */ /*input: */ /* seed: seed */ /* n: number of components in the vector */ /*output: */ /* realization: structure defining the realization*/ void generate(long* seed, int n, struct realization_mod* realization, int cores) { int i; long idum2 = 123456789, iy = 0; long* iv; int iset = 0; iv = (long*)malloc(NTAB * sizeof(long)); /*negative seed*/ if (*seed > 0.0) *seed = -(*seed); /*realization definition*/ (*realization).n = n; (*realization).code = 0; /*(*realization).vector_2 = chunk_array_create("realization1.txt", n, 512); if ((*realization).vector_2 == NULL) { log_error("RESULT = failed - No memory available in generate"); exit(1); }*/ /*Gaussian white noise generation*/ /*for (i = 0; i < n; i++) { double value = gasdev(seed, &idum2, &iy, iv, cores); chunk_array_save((*realization).vector_2, i, value); } chunk_array_flush((*realization).vector_2);*/ free(iv); }