#include #include "geostat.h" /*computes the size of the grid for FFTs*/ /*input: */ /*variogram: structure defining the variogram model*/ /*grid: structure defining the actual grid */ /*output: */ /*n: vector with the number of cells along the */ /* X, Y and Z axes for the underlying grid */ /* i = [0 1 2] */ void cgrid(struct vario_mod variogram, struct grid_mod grid, int n[3]) { int i,N; double D; if (n == NULL || n[0] == 0 || n[1] == 0 || n[2] == 0) { for (i = 0; i<3; i++) { switch (i) { case 0: N = grid.NX; D = grid.DX; break; case 1: N = grid.NY; D = grid.DY; break; case 2: N = grid.NZ; D = grid.DZ; break; } n[i] = length(N,i,variogram.scf,variogram.ap,D,variogram.Nvario); } } else { if ((n[0]