63 for(
long j =0; j<4; ++j )
79 fprintf(
ioQQQ,
"%7ld lines printed in main line array\n",
110 ASSERT( trans_prob > 0. );
130 ASSERT(gl > 0. && enercm > 0. && gf > 0. );
135 abscf_v = 1.4974e-6*(gf/gl)*(1e4/enercm);
153 WaveMic = 1.e4/EnergyWN;
160 xl = 1.0/WaveMic/WaveMic;
164 xn = 255.4/(41. - xl);
165 xn += 29498.1/(146. - xl);
167 RefIndex_v = xn/1.e6 + 1.;
173 ASSERT( RefIndex_v >= 1. );
174 return( RefIndex_v );
191 if( wavelength > 0. )
194 a = log10( wavelength+FLT_EPSILON);
218 const char *chComment,
234 if (lgAdd || xInten > 0.)
277 ASSERT( (chInfo ==
'c') || (chInfo ==
'h') || (chInfo ==
'i') || (chInfo ==
'r' ) );
285 ASSERT( strlen( chLab )<5 );
327 const char *chComment )
332 const long int ipnt = LONG_MAX;
334 lincom( xInten, wavelength, chLab, ipnt, chInfo, chComment,
true );
342 double emissivity_in ,
344 double emissivity_out ,
349 double emergent_in , emergent_out;
350 long int i = ipCont-1;
370 emergent_out = emissivity_out;
397 return( emergent_in + emergent_out );
401 void outline_base(
double dampXvel,
double damp,
bool lgTransStackLine,
long int ip,
double phots,
realnum inwd,
402 double nonScatteredFraction)
406 static const bool DO_PROFILE =
false;
413 double LineWidth = dampXvel/damp;
418 ASSERT( ip3SigmaBlue >= ip3SigmaRed );
419 long numBins = ip3SigmaBlue - ip3SigmaRed + 1;
425 valarray<realnum> x(numBins);
426 valarray<realnum> profile(numBins);
428 for(
long ipBin=ip3SigmaRed; ipBin<=ip3SigmaBlue; ipBin++ )
433 for(
long ipBin=ip3SigmaRed; ipBin<=ip3SigmaBlue; ipBin++ )
434 outline_base_bin(lgTransStackLine, ipBin, phots*profile[ipBin-ip3SigmaRed], inwd, nonScatteredFraction);
441 double nonScatteredFraction)
445 if (lgTransStackLine)
487 const char *chComment )
492 ASSERT( !lgOutToo || chInfo!=
'i' );
494 lincom(xInten, wavelength, chLab, ipnt, chInfo, chComment,
false );
500 if (lgOutToo && xInten > 0.)
508 const bool lgTransStackLine =
false;
509 const long int ip = ipnt - 1;
512 const double nonScatteredFraction = 1.;
536 const char *chComment )
541 ASSERT( !lgOutToo || chInfo!=
'i' );
543 lincom(xInten, wavelength, chLab, ipnt, chInfo, chComment,
false );
549 if (lgOutToo && xInten > 0.)
557 const bool lgTransStackLine =
false;
558 const long int ip = ipnt - 1;
561 const double nonScatteredFraction = 1.;
563 outline_base(dampXvel, damp, lgTransStackLine, ip, phots, inwd, nonScatteredFraction);
578 const char *chComment )
583 lgOutToo, chComment );
602 const int MAXFORLIN = 1000;
603 static long int ipForLin[MAXFORLIN]={0};
606 static long int nForLin;
611 ASSERT( wavelength >= 0. );
613 if( wavelength == 0. )
624 *ipnt = ipForLin[nForLin];
629 if( nForLin >= MAXFORLIN )
631 fprintf(
ioQQQ,
"PROBLEM %5ld lines is too many for PntForLine.\n",
633 fprintf(
ioQQQ,
" Increase the value of maxForLine everywhere in the code.\n" );
639 ipForLin[nForLin] =
ipLineEnergy(EnergyRyd,chLabel , 0);
640 *ipnt = ipForLin[nForLin];
674 double CollisionStrength;
678 ASSERT( CrsSectCM2 >= 0. );
680 ASSERT( E_ProjectileRyd >= 0. );
681 ASSERT( reduced_mass_grams >= 0. );
690 ASSERT( CollisionStrength >= 0. );
691 return CollisionStrength;
712 if( (chInfo !=
'i' && chInfo !=
'r') && chInfo !=
'c' )
714 fprintf(
ioQQQ,
" TOTLIN does not understand chInfo=%c\n",
724 if(
LineSv[i].chSumTyp == chInfo )
747 if(
TauLines[i].Coll().heat() > Strong )
761 if(
TauLine2[i].Coll().heat() > Strong )
774 if(
HFLines[i].Coll().heat() > Strong )
778 Strong =
HFLines[i].Coll().heat();
783 for (
int ipSpecies=0; ipSpecies <
nSpecies; ++ipSpecies)
786 em !=
dBaseTrans[ipSpecies].Emis().end(); ++em)
789 if( (*em).Tran().Coll().heat() > Strong )
void lindst(double xInten, realnum wavelength, const char *chLab, long int ipnt, char chInfo, bool lgOutToo, const char *chComment)
realnum * DiffuseLineEmission
double abscf(double gf, double enercm, double gl)
double eina(double gf, double enercm, double gup)
static realnum * wavelength
TransitionList HFLines("HFLines",&AnonStates)
double RefIndex(double EnergyWN)
TransitionList TauLine2("TauLine2",&AnonStates)
void PntForLine(double wavelength, const char *chLabel, long int *ipnt)
void outline_base_bin(bool lgTransStackLine, long int ip, double phots, realnum inwd, double nonScatteredFraction)
long ipoint(double energy_ryd)
const double TRANS_PROB_CONST
double ConvRate2CS(realnum gHi, realnum rate)
realnum & dampXvel() const
double & xIntensity() const
EmissionList::reference Emis() const
long ipLineEnergy(double energy, const char *chLabel, long ipIonEnergy)
const TransitionProxy FndLineHt(long int *level)
void LineStackCreate(void)
double totlin(int chInfo)
struct t_tag_LineSv LinSv
const double BOHR_RADIUS_CM
double GetGF(double trans_prob, double enercm, double gup)
TransitionList TauLines("TauLines",&AnonStates)
void VoigtU(realnum a, const realnum v[], realnum y[], int n)
CollisionProxy Coll() const
#define DEBUG_ENTRY(funcname)
const double ELECTRON_MASS
void outline_base(double dampXvel, double damp, bool lgTransStackLine, long int ip, double phots, realnum inwd, double nonScatteredFraction)
double ConvCrossSect2CollStr(double CrsSectCM2, double gLo, double E_ProjectileRyd, double reduced_mass_grams)
double emergent_line(double emissivity_in, double emissivity_out, long int ipCont)
void linadd(double xInten, realnum wavelength, const char *chLab, char chInfo, const char *chComment)
vector< TransitionList > dBaseTrans
realnum WavlenErrorGet(realnum wavelength)
STATIC void lincom(double xInten, realnum wavelength, const char *chLab, long int ipnt, char chInfo, const char *chComment, bool lgAdd)