61 for(
long i=0; i <
LineSave.nsum; i++ )
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 );
218 const char *chComment,
256 if ( ipnt <=
rfield.nflux && chInfo ==
't' )
261 xInten*
rt.fracin , xInten*(1.-
rt.fracin) , ipnt );
272 ASSERT( (chInfo ==
'c') || (chInfo ==
'h') || (chInfo ==
'i') || (chInfo ==
'r' ) || (chInfo ==
't') );
280 ASSERT( strlen( chLab )<5 );
322 const char *chComment )
327 const long int ipnt = LONG_MAX;
337 double emissivity_in ,
339 double emissivity_out ,
344 double emergent_in , emergent_out;
345 long int i = ipCont-1;
364 emergent_in = emissivity_in*
opac.E2TauAbsFace[i];
365 emergent_out = emissivity_out;
374 emergent_in = emissivity_in *
opac.E2TauAbsFace[i] *
opac.E2TauAbsTotal[i];
377 emergent_out = emissivity_out *
opac.E2TauAbsOut[i];
384 double reflected = emissivity_out *
opac.albedo[i] * (1.-
opac.E2TauAbsOut[i]);
386 emergent_in = (emissivity_in + reflected) *
opac.E2TauAbsFace[i];
388 emergent_out = (emissivity_out - reflected) *
opac.E2TauAbsOut[i];
392 return( emergent_in + emergent_out );
396void outline_base(
double dampXvel,
double damp,
bool lgTransStackLine,
long int ip,
double phots,
realnum inwd,
397 double nonScatteredFraction)
401 static const bool DO_PROFILE =
false;
403 if( !DO_PROFILE || !
rfield.lgDoLineTrans )
408 double LineWidth = dampXvel/damp;
413 ASSERT( ip3SigmaBlue >= ip3SigmaRed );
414 long numBins = ip3SigmaBlue - ip3SigmaRed + 1;
420 valarray<realnum> x(numBins);
421 valarray<realnum> profile(numBins);
423 for(
long ipBin=ip3SigmaRed; ipBin<=ip3SigmaBlue; ipBin++ )
428 for(
long ipBin=ip3SigmaRed; ipBin<=ip3SigmaBlue; ipBin++ )
429 outline_base_bin(lgTransStackLine, ipBin, phots*profile[ipBin-ip3SigmaRed], inwd, nonScatteredFraction);
436 double nonScatteredFraction)
440 if (lgTransStackLine)
442 rfield.DiffuseLineEmission[ip] +=
482 const char *chComment )
487 ASSERT( !lgOutToo || chInfo!=
'i' );
495 if (lgOutToo && xInten > 0.)
503 const bool lgTransStackLine =
false;
504 const long int ip = ipnt - 1;
505 const double phots = xInten/(
rfield.anu[ipnt-1]*
EN1RYD);
507 const double nonScatteredFraction = 1.;
531 const char *chComment )
536 ASSERT( !lgOutToo || chInfo!=
'i' );
544 if (lgOutToo && xInten > 0.)
552 const bool lgTransStackLine =
false;
553 const long int ip = ipnt - 1;
554 const double phots = xInten/(
rfield.anu[ipnt-1]*
EN1RYD);
556 const double nonScatteredFraction = 1.;
558 outline_base(dampXvel, damp, lgTransStackLine, ip, phots, inwd, nonScatteredFraction);
573 const char *chComment )
578 lgOutToo, chComment );
597 const int MAXFORLIN = 1000;
598 static long int ipForLin[MAXFORLIN]={0};
601 static long int nForLin;
619 *ipnt = ipForLin[nForLin];
624 if( nForLin >= MAXFORLIN )
626 fprintf(
ioQQQ,
"PROBLEM %5ld lines is too many for PntForLine.\n",
628 fprintf(
ioQQQ,
" Increase the value of maxForLine everywhere in the code.\n" );
634 ipForLin[nForLin] =
ipLineEnergy(EnergyRyd,chLabel , 0);
635 *ipnt = ipForLin[nForLin];
658 cs = rate * gHi /
dense.cdsqte;
669 double CollisionStrength;
673 ASSERT( CrsSectCM2 >= 0. );
675 ASSERT( E_ProjectileRyd >= 0. );
676 ASSERT( reduced_mass_grams >= 0. );
685 ASSERT( CollisionStrength >= 0. );
686 return CollisionStrength;
707 if( (chInfo !=
'i' && chInfo !=
'r') && chInfo !=
'c' )
709 fprintf(
ioQQQ,
" TOTLIN does not understand chInfo=%c\n",
719 if(
LineSv[i].chSumTyp == chInfo )
721 totlin_v +=
LineSv[i].SumLine[0];
742 if(
TauLines[i].Coll().heat() > Strong )
756 if(
TauLine2[i].Coll().heat() > Strong )
769 if(
HFLines[i].Coll().heat() > Strong )
773 Strong =
HFLines[i].Coll().heat();
778 for (
int ipSpecies=0; ipSpecies <
nSpecies; ++ipSpecies)
781 em !=
dBaseTrans[ipSpecies].Emis().end(); ++em)
784 if( (*em).Tran().Coll().heat() > Strong )
#define DEBUG_ENTRY(funcname)
EmissionProxy::iterator iterator
double & xIntensity() const
realnum & dampXvel() const
CollisionProxy Coll() const
EmissionList::reference Emis() const
long ipoint(double energy_ryd)
long ipLineEnergy(double energy, const char *chLabel, long ipIonEnergy)
struct t_tag_LineSv LinSv
const TransitionProxy FndLineHt(long int *level)
void linadd(double xInten, realnum wavelength, const char *chLab, char chInfo, const char *chComment)
void outline_base(double dampXvel, double damp, bool lgTransStackLine, long int ip, double phots, realnum inwd, double nonScatteredFraction)
void PntForLine(double wavelength, const char *chLabel, long int *ipnt)
void lindst(double xInten, realnum wavelength, const char *chLab, long int ipnt, char chInfo, bool lgOutToo, const char *chComment)
double RefIndex(double EnergyWN)
double eina(double gf, double enercm, double gup)
double ConvRate2CS(realnum gHi, realnum rate)
double abscf(double gf, double enercm, double gl)
void outline_base_bin(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 GetGF(double trans_prob, double enercm, double gup)
double totlin(int chInfo)
realnum WavlenErrorGet(realnum wavelength)
double emergent_line(double emissivity_in, double emissivity_out, long int ipCont)
STATIC void lincom(double xInten, realnum wavelength, const char *chLab, long int ipnt, char chInfo, const char *chComment, bool lgAdd)
static realnum * wavelength
UNUSED const double TRANS_PROB_CONST
UNUSED const double BOHR_RADIUS_CM
UNUSED const double SPEEDLIGHT
UNUSED const double ELECTRON_MASS
UNUSED const double EN1RYD
UNUSED const double RYDLAM
TransitionList TauLine2("TauLine2", &AnonStates)
vector< TransitionList > dBaseTrans
TransitionList HFLines("HFLines", &AnonStates)
TransitionList TauLines("TauLines", &AnonStates)
void VoigtU(realnum a, const realnum v[], realnum y[], int n)