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.,
70 long int coolnum, coolcal;
87 fprintf(
ioQQQ,
" COOLR TE:%.4e zone %li %li Cool:%.4e Heat:%.4e eden:%.4e edenTrue:%.4e\n",
182 fprintf(
ioQQQ,
"DEBUG big %.2f\t%.5e\t%.2e\t%.2e\t%.2e\n",
277 rothi = pow(10.,-19.24 + 0.474*x - 1.247*x*x);
290 rotlow = pow(10.,-22.90 - 0.553*x - 1.148*x*x)*qn;
302 enum {DEBUG_LOC=
false};
305 fprintf(
ioQQQ,
"h2coolbug\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\n",
365 enum {DEBUG_LOC=
false};
368 fprintf(
ioQQQ,
"CoolEvaluate debuggg\t%.2f\t%.5e\t%.5e\t%.5e\t%.5e\t%.5e\n",
394 for(
long int nelem=ipISO; nelem <
LIMELM; nelem++ )
412 nzone != nzoneUsedBrems )
414 double BremsThisEnergy;
420 nzoneUsedBrems =
nzone;
431 double bhfac, bhMinusfac;
433 long int ion_lo , ion_hi;
484 for(
long int ion=1; ion<=
LIMELM; ++ion )
520 while( sumion[ion_lo]==0 && ion_lo<
LIMELM-1 )
523 while( sumion[ion_hi]==0 && ion_hi>0 )
531 BremsThisEnergy = 0.;
532 for(
long int ion=ion_lo; ion<=ion_hi; ++ion )
533 BremsThisEnergy += sumion[ion]*
rfield.
gff[ion][i];
543 enum {DEBUG_LOC=
false};
544 if( DEBUG_LOC &&
nzone>60 )
546 double sumfield = 0., sumtot=0., sum1=0., sum2=0.;
554 fprintf(
ioQQQ,
"DEBUG brems heat\t%.2f\t%.3e\t%.3e\t%.3e\t%e\t%.3e\t%.3e\n",
557 sumtot/
SDIV(sumfield) ,
610 for(
long int ion=limit_lo; ion<=limit_hi; ++ion )
714 enum {DEBUG_LOC=
false};
719 double teval[
N21CM_TE]={2.,5.,10.,20.,50.,100.,200.,500.,1000.,
720 2000.,3000.,5000.,7000.,10000.,15000.,20000.};
724 ioQQQ,
"DEBUG 21 cm deex Te=\t%.2e\tH0=\t%.2e\tp=\t%.2e\te=\t%.2e\n",
753 for(
long int i=1; i <
nHFLines; i++ )
772 for(
long int i=1; i <
nHFLines; i++ )
784 dense.
xIonDense[(*HFLines[i].Hi()).nelem()-1][(*HFLines[i].Hi()).IonStg()-1] *=
796 for( coolcal = coolnum; coolcal <
thermal.
ncltot; coolcal++ )
802 double xIonDenseSave[
LIMELM][LIMELM+1];
805 for(
int nelem=0; nelem <
LIMELM; nelem++ )
807 for(
int ion=0; ion<=nelem+1; ++ion )
820 for( coolcal = coolnum; coolcal <
thermal.
ncltot; coolcal++ )
828 for( coolcal = coolnum; coolcal <
thermal.
ncltot; coolcal++ )
836 for( coolcal = coolnum; coolcal <
thermal.
ncltot; coolcal++ )
847 for( coolcal = coolnum; coolcal <
thermal.
ncltot; coolcal++ )
856 for( coolcal = coolnum; coolcal <
thermal.
ncltot; coolcal++ )
862 for( coolcal = coolnum; coolcal <
thermal.
ncltot; coolcal++ )
870 for( coolcal = coolnum; coolcal <
thermal.
ncltot; coolcal++ )
878 for( coolcal = coolnum; coolcal <
thermal.
ncltot; coolcal++ )
886 for( coolcal = coolnum; coolcal <
thermal.
ncltot; coolcal++ )
892 for( coolcal = coolnum; coolcal <
thermal.
ncltot; coolcal++ )
898 for( coolcal = coolnum; coolcal <
thermal.
ncltot; coolcal++ )
904 for( coolcal = coolnum; coolcal <
thermal.
ncltot; coolcal++ )
912 for( coolcal = coolnum; coolcal <
thermal.
ncltot; coolcal++ )
918 for( coolcal = coolnum; coolcal <
thermal.
ncltot; coolcal++ )
924 for( coolcal = coolnum; coolcal <
thermal.
ncltot; coolcal++ )
930 for( coolcal = coolnum; coolcal <
thermal.
ncltot; coolcal++ )
937 for( coolcal = coolnum; coolcal <
thermal.
ncltot; coolcal++ )
945 for( coolcal = coolnum; coolcal <
thermal.
ncltot; coolcal++ )
951 for( coolcal = coolnum; coolcal <
thermal.
ncltot; coolcal++ )
960 for(
int nelem=0; nelem <
LIMELM; nelem++ )
962 for(
int ion=0; ion<=nelem+1; ++ion )
972 for(
int coolcal = coolnum; coolcal <
thermal.
ncltot; coolcal++ )
980 enum {DEBUG_LOC=
false};
984 if( lgMustPrintHeader )
986 lgMustPrintHeader =
false;
988 for(
long ipSpecies=1; ipSpecies<
nSpecies; ipSpecies++ )
993 printf(
"DEBUG Max\t%li" ,
dBaseSpecies[0].numLevels_max );
994 for(
long ipSpecies=1; ipSpecies<
nSpecies; ipSpecies++ )
996 printf(
"\t%li" ,
dBaseSpecies[ipSpecies].numLevels_max );
1000 printf(
"DEBUG Local\t%li" ,
dBaseSpecies[0].numLevels_local );
1001 for(
long ipSpecies=1; ipSpecies<
nSpecies; ipSpecies++ )
1003 printf(
"\t%li" ,
dBaseSpecies[ipSpecies].numLevels_local );
1017 fprintf(
ioQQQ,
" COOLR; cooling is <=0, this is impossible.\n" );
1025 fprintf(
ioQQQ,
" COOLR; cooling slope <=0, this is impossible.\n" );
1028 fprintf(
ioQQQ,
" Probably due to very low density.\n" );
1044 " NOTE Negative cooling, zone %4ld, =%10.2e coola=%10.2e CHION=%10.2e Te=%10.2e\n",
1061 deriv = (oltcool - *tot)/(oldtemp -
phycon.
te);
1068 if(
nzone != nzSave )
1098 fprintf(
ioQQQ,
" negative line=%s %.2f fraction of heating=%.3f\n",
1105 fprintf(
ioQQQ,
" heating line=%s %.2f fraction of heating=%.3f\n",
1144 " fndstr cool: TE=%10.4e Ne=%10.4e C=%10.3e dC/dT=%10.2e ABS(%s %.1f)=%.2e nz=%ld\n",
1176 " All coolant heat greater than%6.2f%% of the total will be printed.\n",
1183 if( fabs(ratio) >=
EPS )
void CoolAdd(const char *chLabel, realnum lambda, double cool)
t_mole_global mole_global
char chClntLab[NCOLNT][NCOLNT_LAB_LEN+1]
void coolpr(FILE *io, const char *chLabel, realnum lambda, double ratio, const char *chJOB)
long int ipEnergyBremsThin
NORETURN void TotalInsanity(void)
double H21cm_H_atom(double temp)
bool lgTimeDependentStatic
void RT_line_one(const TransitionProxy &t, bool lgShield_this_zone, realnum pestrk, realnum DopplerWidth)
TransitionList HFLines("HFLines",&AnonStates)
void CoolEvaluate(double *tot)
sys_float sexp(sys_float x)
static const bool PRT_DERIV
molezone * findspecieslocal(const char buf[])
void TempChange(double TempNew, bool lgForceUpdate)
realnum deriv_HeatH2Dexc_ELWERT
double xIonDense[LIMELM][LIMELM+1]
t_iso_sp iso_sp[NISO][LIMELM]
realnum deriv_HeatH2Dexc_TH85
double H21cm_proton(double temp)
void CoolSum(double *total)
bool lgTemperatureConstant
double heating[LIMELM][LIMELM]
bool fp_equal(sys_float x, sys_float y, int n=3)
double H21cm_electron(double temp)
bool lgBallistic(void) const
bool lgIonChiantiOn[LIMELM][LIMELM+1]
double chem_heat(void) const
void iso_cool(long ipISO, long nelem)
void PutCS(double cs, const TransitionProxy &t)
realnum deriv_HeatH2Dexc_BD96
double HyperfineCS(long i)
long int IonHigh[LIMELM+1]
valarray< class molezone > species
realnum AccelTotalOutward
vector< diatomics * > diatoms
realnum AtomicWeight[LIMELM]
diatomics h2("h2", 4100.,&hmi.H2_total, Yan_H2_CS)
realnum GetDopplerWidth(realnum massAMU)
realnum HeatCoolRelErrorAllowed
static bool lgMustPrintHeader
realnum gas_phase[LIMELM]
long int IonLow[LIMELM+1]
bool lgIonStoutOn[LIMELM][LIMELM+1]
char chH2_small_model_type
realnum deriv_HeatH2Dexc_BHT90
#define DEBUG_ENTRY(funcname)
realnum scalingDensity(void)
void atom_level2(const TransitionProxy &t)
diatomics hd("hd", 4100.,&hmi.HD_total, Yan_H2_CS)
realnum deriv_HeatH2Dexc_used
sys_float SDIV(sys_float x)
STATIC void fndstr(double tot, double dc)
double elementcool[LIMELM+1]
vector< diatomics * >::iterator diatom_iter
double ** RR_rate_coef_used