/*sumcon sums L and Q for net incident continuum */ #include "cddefines.h" #include "physconst.h" #include "rfield.h" #include "sumcon.h" void sumcon(long int il, long int ih, float *q, float *p, float *panu) { long int i, iupper; /* used as upper limit to the sum */ # ifdef DEBUG_FUN fputs( "<+>sumcon()\n", debug_fp ); # endif *q = 0.; *p = 0.; *panu = 0.; /* soft continua may not go as high as the requested bin */ iupper = MIN2(rfield.nflux,ih); /* n.b. - in F77 loop IS NOT executed when IUPPER < IL */ for( i=il-1; i < iupper; i++ ) { /* sum photon number */ *q += rfield.flux[i]; /* en1ryd is needed to stop overflow */ /* sum flux */ *p += (float)(rfield.flux[i]*(rfield.anu[i]*EN1RYD)); /* this sum needed for means */ *panu += (float)(rfield.flux[i]*(rfield.anu2[i]*EN1RYD)); } # ifdef DEBUG_FUN fputs( " <->sumcon()\n", debug_fp ); # endif return; }