#include #include #include #include #include #include "genlib.h" #include "simpio.h" #include "geostat.h" #include "toolsIO.h" #include "toolsFFTMA.h" /* kgeneration */ /* Z is the GWN with 0-mean and 1-variance */ /* Y1 is the realization with 0-mean and variance wanted */ /* Y is the realization with mean and variance wanted */ void kgeneration2(long seed,struct grid_mod grid,struct statistic_mod stat,struct vario_mod variogram,string filename[7],struct realization_mod *Z,struct realization_mod *Y,struct realization_mod *Y1, int n[3], int *genere, int *gwnwrite, struct realization_mod *gwnoise,int *format_file) { int i,N; int typelog; string file1,file2; /*generate Gaussian white noise*/ N = grid.NX*grid.NY*grid.NZ; n[0] = 0; n[1] = 0; n[2] = 0; printf("\n\n\n"); switch (*genere) { case 0: generate(&seed,N,Z); /*save the Gaussian white noise file*/ if (*gwnwrite == 0) { writefile(filename[0],Z); } break; case 1: (*Z).vector=(double *) malloc(N*sizeof(double)); (*Z).n = N; for (i=0;i