47 static long int nhit = 0,
50 static double TeEvalCS = 0., TeEvalCS_21cm=0.;
51 static double TeUsedBrems=-1.f;
52 static int nzoneUsedBrems=-1;
54 static double electron_rate_21cm,
67 static double oltcool=0.,
85 fprintf(
ioQQQ,
" COOLR TE:%.4e zone %li %li Cool:%.4e Heat:%.4e eden:%.4e edenTrue:%.4e\n",
267 rothi = pow(10.,-19.24 + 0.474*x - 1.247*x*x);
280 rotlow = pow(10.,-22.90 - 0.553*x - 1.148*x*x)*qn;
295 enum {DEBUG_LOC=
false};
298 fprintf(
ioQQQ,
"h2coolbug\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\n",
346 enum {DEBUG_LOC=
false};
349 fprintf(
ioQQQ,
"CoolEvaluate debuggg\t%.2f\t%.5e\t%.5e\t%.5e\t%.5e\t%.5e\n",
383 for( nelem=ipISO; nelem <
LIMELM; nelem++ )
401 nzone!=nzoneUsedBrems )
403 double BremsThisEnergy;
409 nzoneUsedBrems =
nzone;
422 long int ion_lo , ion_hi;
474 for(ion=1; ion<=
LIMELM; ++ion )
492 while( sumion[ion_lo]==0 && ion_lo<
LIMELM-1 )
495 while( sumion[ion_hi]==0 && ion_hi>0 )
503 BremsThisEnergy = 0.;
504 for(ion=ion_lo; ion<=ion_hi; ++ion )
506 BremsThisEnergy += sumion[ion]*
rfield.
gff[ion][i];
515 enum {DEBUG_LOC=
false};
516 if( DEBUG_LOC &&
nzone>60 )
518 double sumfield = 0., sumtot=0., sum1=0., sum2=0.;
526 fprintf(
ioQQQ,
"DEBUG brems heat\t%.2f\t%.3e\t%.3e\t%.3e\t%e\t%.3e\t%.3e\n",
529 sumtot/
SDIV(sumfield) ,
586 for( ion=limit_lo; ion<=limit_hi; ++ion )
678 enum {DEBUG_LOC=
false};
683 double teval[
N21CM_TE]={2.,5.,10.,20.,50.,100.,200.,500.,1000.,
684 2000.,3000.,5000.,7000.,10000.,15000.,20000.};
688 ioQQQ,
"DEBUG 21 cm deex Te=\t%.2e\tH0=\t%.2e\tp=\t%.2e\te=\t%.2e\n",
741 if( save<=0. )
continue;
744 dense.
xIonDense[HFLines[i].Hi->nelem-1][HFLines[i].Hi->IonStg-1] *=
751 dense.
xIonDense[HFLines[i].Hi->nelem-1][HFLines[i].Hi->IonStg-1] = save;
869 fprintf(
ioQQQ,
" COOLR; cooling is <=0, this is impossible.\n" );
877 fprintf(
ioQQQ,
" COOLR; cooling slope <=0, this is impossible.\n" );
880 fprintf(
ioQQQ,
" Probably due to very low density.\n" );
896 " NOTE Negative cooling, zone %4ld, =%10.2e coola=%10.2e CHION=%10.2e Te=%10.2e\n",
913 deriv = (oltcool - *tot)/(oldtemp -
phycon.
te);
920 if(
nzone != nzSave )
950 fprintf(
ioQQQ,
" negative line=%s %.2f fraction of heating=%.3f\n",
957 fprintf(
ioQQQ,
" heating line=%s %.2f fraction of heating=%.3f\n",
996 " fndstr cool: TE=%10.4e Ne=%10.4e C=%10.3e dC/dT=%10.2e ABS(%s %.1f)=%.2e nz=%ld\n",
1028 " All coolant heat greater than%6.2f%% of the total will be printed.\n",
1035 if( fabs(ratio) >=
EPS )