OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
gser.c
Go to the documentation of this file.
1 #include <math.h>
2 #define ITMAX 100
3 #define EPS 3.0e-7
4 
5 void gser(float *gamser, float a, float x, float *gln) {
6  float gammln(float xx);
7  void nrerror(char error_text[]);
8  int n;
9  float sum, del, ap;
10 
11  *gln = gammln(a);
12  if (x <= 0.0) {
13  if (x < 0.0) nrerror("x less than 0 in routine gser");
14  *gamser = 0.0;
15  return;
16  } else {
17  ap = a;
18  del = sum = 1.0 / a;
19  for (n = 1; n <= ITMAX; n++) {
20  ++ap;
21  del *= x / ap;
22  sum += del;
23  if (fabs(del) < fabs(sum) * EPS) {
24  *gamser = sum * exp(-x + a * log(x)-(*gln));
25  return;
26  }
27  }
28  nrerror("a too large, ITMAX too small in routine gser");
29  return;
30  }
31 }
32 #undef ITMAX
33 #undef EPS
function gammln(xx)
Definition: ocn.f:1270
#define ITMAX
Definition: gser.c:2
void nrerror(char error_text[])
Definition: nrutil.c:7
void gser(float *gamser, float a, float x, float *gln)
Definition: gser.c:5
#define fabs(a)
Definition: misc.h:93
#define EPS
Definition: gser.c:3
PGE01 indicating that PGE02 PGE01 V6 for and PGE01 V2 for MOD03 were used to produce the granule By convention adopted in all MODIS Terra PGE02 code versions are The fourth digit of the PGE02 version denotes the LUT version used to produce the granule The source of the metadata environment variable ProcessingCenter was changed from a QA LUT value to the Process Configuration A sign used in error in the second order term was changed to a
Definition: HISTORY.txt:424