#include #include #include "kappa.h" #include "local_proto.h" void calc_kappa(void) { int i,j; int s,l; int nl; size_t ns; double *pi, *pj, *pii, p0, pC; double kp, vkp, *kpp; double obs, inter1, inter2; long total; FILE *fd; /* initialize */ s = 0; l = -1; nl = nlayers; ns = nstats; obs = 0; inter1 = inter2 = 0; p0 = pC = 0; if (output == NULL) fd = stdout; else if ((fd = fopen (output, "a")) == NULL) { fprintf (stderr, "ERROR: can't open file <%s> to write kappa and relevant parameters\n", output); return; } total = count_sum (&s,l); /* calculate the parameters of the kappa-calculation */ pi = (double *) G_calloc(ns, sizeof(double)); pj = (double *) G_calloc(ns, sizeof(double)); pii = (double *) G_calloc(ns, sizeof(double)); kpp = (double *) G_calloc(ns, sizeof(double)); for (i=0; i