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",
240 heat += (*diatom)->Cont_Diss_Heat_Rate();
284 rothi = pow(10.,-19.24 + 0.474*x - 1.247*x*x);
297 rotlow = pow(10.,-22.90 - 0.553*x - 1.148*x*x)*qn;
309 enum {DEBUG_LOC=
false};
312 fprintf(
ioQQQ,
"h2coolbug\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\n",
372 enum {DEBUG_LOC=
false};
375 fprintf(
ioQQQ,
"CoolEvaluate debuggg\t%.2f\t%.5e\t%.5e\t%.5e\t%.5e\t%.5e\n",
401 for(
long int nelem=ipISO; nelem <
LIMELM; nelem++ )
419 nzone != nzoneUsedBrems )
421 double BremsThisEnergy;
427 nzoneUsedBrems =
nzone;
438 double bhfac, bhMinusfac;
440 long int ion_lo , ion_hi;
491 for(
long int ion=1; ion<=
LIMELM; ++ion )
527 while( sumion[ion_lo]==0 && ion_lo<
LIMELM-1 )
530 while( sumion[ion_hi]==0 && ion_hi>0 )
538 BremsThisEnergy = 0.;
539 for(
long int ion=ion_lo; ion<=ion_hi; ++ion )
540 BremsThisEnergy += sumion[ion]*
rfield.
gff[ion][i];
550 enum {DEBUG_LOC=
false};
551 if( DEBUG_LOC &&
nzone>60 )
553 double sumfield = 0., sumtot=0., sum1=0., sum2=0.;
561 fprintf(
ioQQQ,
"DEBUG brems heat\t%.2f\t%.3e\t%.3e\t%.3e\t%e\t%.3e\t%.3e\n",
564 sumtot/
SDIV(sumfield) ,
617 for(
long int ion=limit_lo; ion<=limit_hi; ++ion )
721 enum {DEBUG_LOC=
false};
726 double teval[
N21CM_TE]={2.,5.,10.,20.,50.,100.,200.,500.,1000.,
727 2000.,3000.,5000.,7000.,10000.,15000.,20000.};
731 ioQQQ,
"DEBUG 21 cm deex Te=\t%.2e\tH0=\t%.2e\tp=\t%.2e\te=\t%.2e\n",
760 for(
long int i=1; i <
nHFLines; i++ )
779 for(
long int i=1; i <
nHFLines; i++ )
803 for( coolcal = coolnum; coolcal <
thermal.
ncltot; coolcal++ )
812 for(
int nelem=0; nelem <
LIMELM; nelem++ )
814 for(
int ion=0; ion<=nelem+1; ++ion )
827 for( coolcal = coolnum; coolcal <
thermal.
ncltot; coolcal++ )
835 for( coolcal = coolnum; coolcal <
thermal.
ncltot; coolcal++ )
843 for( coolcal = coolnum; coolcal <
thermal.
ncltot; coolcal++ )
854 for( coolcal = coolnum; coolcal <
thermal.
ncltot; coolcal++ )
863 for( coolcal = coolnum; coolcal <
thermal.
ncltot; coolcal++ )
869 for( coolcal = coolnum; coolcal <
thermal.
ncltot; coolcal++ )
877 for( coolcal = coolnum; coolcal <
thermal.
ncltot; coolcal++ )
885 for( coolcal = coolnum; coolcal <
thermal.
ncltot; coolcal++ )
893 for( coolcal = coolnum; coolcal <
thermal.
ncltot; coolcal++ )
899 for( coolcal = coolnum; coolcal <
thermal.
ncltot; coolcal++ )
905 for( coolcal = coolnum; coolcal <
thermal.
ncltot; coolcal++ )
911 for( coolcal = coolnum; coolcal <
thermal.
ncltot; coolcal++ )
919 for( coolcal = coolnum; coolcal <
thermal.
ncltot; coolcal++ )
925 for( coolcal = coolnum; coolcal <
thermal.
ncltot; coolcal++ )
931 for( coolcal = coolnum; coolcal <
thermal.
ncltot; coolcal++ )
937 for( coolcal = coolnum; coolcal <
thermal.
ncltot; coolcal++ )
944 for( coolcal = coolnum; coolcal <
thermal.
ncltot; coolcal++ )
952 for( coolcal = coolnum; coolcal <
thermal.
ncltot; coolcal++ )
958 for( coolcal = coolnum; coolcal <
thermal.
ncltot; coolcal++ )
967 for(
int nelem=0; nelem <
LIMELM; nelem++ )
969 for(
int ion=0; ion<=nelem+1; ++ion )
979 for(
int coolcal = coolnum; coolcal <
thermal.
ncltot; coolcal++ )
987 enum {DEBUG_LOC=
false};
995 for(
long ipSpecies=1; ipSpecies<
nSpecies; ipSpecies++ )
1000 printf(
"DEBUG Max\t%li" ,
dBaseSpecies[0].numLevels_max );
1001 for(
long ipSpecies=1; ipSpecies<
nSpecies; ipSpecies++ )
1003 printf(
"\t%li" ,
dBaseSpecies[ipSpecies].numLevels_max );
1007 printf(
"DEBUG Local\t%li" ,
dBaseSpecies[0].numLevels_local );
1008 for(
long ipSpecies=1; ipSpecies<
nSpecies; ipSpecies++ )
1010 printf(
"\t%li" ,
dBaseSpecies[ipSpecies].numLevels_local );
1024 fprintf(
ioQQQ,
" COOLR; cooling is <=0, this is impossible.\n" );
1032 fprintf(
ioQQQ,
" COOLR; cooling slope <=0, this is impossible.\n" );
1035 fprintf(
ioQQQ,
" Probably due to very low density.\n" );
1051 " NOTE Negative cooling, zone %4ld, =%10.2e coola=%10.2e CHION=%10.2e Te=%10.2e\n",
1068 deriv = (oltcool - *tot)/(oldtemp -
phycon.
te);
1075 if(
nzone != nzSave )
1105 fprintf(
ioQQQ,
" negative line=%s %.2f fraction of heating=%.3f\n",
1112 fprintf(
ioQQQ,
" heating line=%s %.2f fraction of heating=%.3f\n",
1151 " fndstr cool: TE=%10.4e Ne=%10.4e C=%10.3e dC/dT=%10.2e ABS(%s %.1f)=%.2e nz=%ld\n",
1183 " All coolant heat greater than%6.2f%% of the total will be printed.\n",
1190 if( fabs(ratio) >=
EPS )
double H21cm_electron(double temp)
double H21cm_H_atom(double temp)
double H21cm_proton(double temp)
double HyperfineCS(long i)
void atom_level2(const TransitionProxy &t)
sys_float sexp(sys_float x)
bool fp_equal(sys_float x, sys_float y, int n=3)
NORETURN void TotalInsanity(void)
sys_float SDIV(sys_float x)
#define DEBUG_ENTRY(funcname)
double ** RR_rate_coef_used
double chem_heat(void) const
valarray< class molezone > species
void CoolSum(double *total)
void CoolAdd(const char *chLabel, realnum lambda, double cool)
void CoolEvaluate(double *tot)
static const bool PRT_DERIV
STATIC void fndstr(double tot, double dc)
void coolpr(FILE *io, const char *chLabel, realnum lambda, double ratio, const char *chJOB)
realnum scalingDensity(void)
realnum GetDopplerWidth(realnum massAMU)
diatomics hd("hd", 4100., &hmi.HD_total, Yan_H2_CS)
vector< diatomics * > diatoms
diatomics h2("h2", 4100., &hmi.H2_total, Yan_H2_CS)
vector< diatomics * >::iterator diatom_iter
t_iso_sp iso_sp[NISO][LIMELM]
void iso_cool(long ipISO, long nelem)
t_mole_global mole_global
molezone * findspecieslocal(const char buf[])
UNUSED const double BOLTZMANN
UNUSED const double EN1RYD
void RT_line_one(const TransitionProxy &t, bool lgShield_this_zone, realnum pestrk, realnum DopplerWidth)
static bool lgMustPrintHeader
realnum AccelTotalOutward
bool lgBallistic(void) const
realnum HeatCoolRelErrorAllowed
long int IonLow[LIMELM+1]
long int IonHigh[LIMELM+1]
double xIonDense[LIMELM][LIMELM+1]
bool lgIonStoutOn[LIMELM][LIMELM+1]
realnum gas_phase[LIMELM]
realnum AtomicWeight[LIMELM]
bool lgIonChiantiOn[LIMELM][LIMELM+1]
bool lgTimeDependentStatic
realnum deriv_HeatH2Dexc_BHT90
char chH2_small_model_type
realnum deriv_HeatH2Dexc_used
realnum deriv_HeatH2Dexc_TH85
realnum deriv_HeatH2Dexc_BD96
realnum deriv_HeatH2Dexc_ELWERT
long int ipEnergyBremsThin
double heating[LIMELM][LIMELM]
char chClntLab[NCOLNT][NCOLNT_LAB_LEN+1]
bool lgTemperatureConstant
double elementcool[LIMELM+1]
TransitionList HFLines("HFLines", &AnonStates)
void TempChange(double TempNew, bool lgForceUpdate)
void PutCS(double cs, const TransitionProxy &t)