63 double save_he2rec_dest;
71 for(
long i=0; i <
rfield.nflux; i++ )
84 if(
dense.lgElmtOn[nelem] )
109 enum {DEBUG_LOC=
false};
112 fprintf(
ioQQQ,
"DEBUG HeII Bowen nzone %li bwnfac:%.2e bwnfac esc:%.2e ots660 %.2e\n",
149 for( nelem=ipISO; nelem <
LIMELM; nelem++ )
157 if( (
dense.IonHigh[nelem] >= nelem+1-ipISO ) )
163 for( ipHi=1; ipHi <
iso_sp[ipISO][nelem].numLevels_local; ipHi++ )
165 for( ipLo=0; ipLo < ipHi; ipLo++ )
170 if(
iso_sp[ipISO][nelem].trans(ipHi,ipLo).ipCont() < 1 ||
171 iso_sp[ipISO][nelem].trans(ipHi,ipLo).Emis().Pdest()<=
DEST0 )
175 iso_sp[ipISO][nelem].trans(ipHi,ipLo).Emis().ots() =
176 iso_sp[ipISO][nelem].trans(ipHi,ipLo).Emis().Aul()*
177 iso_sp[ipISO][nelem].st[ipHi].Pop()*
178 iso_sp[ipISO][nelem].trans(ipHi,ipLo).Emis().Pdest();
180 ASSERT(
iso_sp[ipISO][nelem].trans(ipHi,ipLo).Emis().ots() >= 0. );
190 iso_sp[ipISO][nelem].trans(ipHi,ipLo).ipCont() );
197 enum {DEBUG_LOC=
false};
202 if( ipISO==0 && nelem==0 &&
nzone>500 )
206 ip =
iso_sp[ipISO][nelem].trans(ipHi,ipLo).ipCont();
207 fprintf(
ioQQQ,
"DEBUG hlyaots\t%.2f\tEdenTrue\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\n",
210 iso_sp[ipISO][nelem].trans(ipHi,ipLo).Emis().ots(),
211 opac.opacity_abs[ip-1],
212 iso_sp[ipISO][nelem].st[ipHi].Pop(),
213 dense.xIonDense[nelem][nelem+1-ipISO],
214 iso_sp[ipISO][nelem].trans(ipHi,ipLo).Emis().Pdest(),
228 for( n=0; n <
iso_sp[ipISO][nelem].numLevels_local; n++ )
232 dense.xIonDense[nelem][nelem+1-ipISO]);
233 ASSERT( cont_phot_destroyed >= 0. );
240 enum {DEBUG_LOC=
false};
242 if( DEBUG_LOC &&
nzone > 400 && nelem==0 && n==2 )
244 long ip =
iso_sp[ipISO][nelem].fb[n].ipIsoLevNIonCon-1;
245 fprintf(
ioQQQ,
"hotsdebugg\t%.3f\t%li\th con ots\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\n",
248 iso_sp[ipISO][nelem].st[n].Pop(),
250 cont_phot_destroyed/
opac.opacity_abs[ip],
252 opac.opacity_abs[ip] ,
254 hmi.HMinus_photo_rate);
263 enum {DEBUG_LOC=
false};
267 fprintf(
ioQQQ,
"hotsdebugg %li \t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\n",
285 if(
dense.lgElmtOn[nelem] && bwnfac > 0. )
293 fprintf(
ioQQQ,
" RT_OTS Pdest %.2e ots rate %.2e in otslin %.2e con opac %.2e\n",
308 for( ion=0; ion < nelem+1-
NISO; ion++ )
310 if(
dense.xIonDense[nelem][ion+1] > 0. )
315 ipla =
Heavy.ipLyHeavy[nelem][ion];
317 esc =
opac.ExpmTau[ipla-1];
319 difflya =
Heavy.xLyaHeavy[nelem][ion]*
dense.xIonDense[nelem][ion+1];
322 ots = difflya*
MAX2(0.f,1.f-esc);
334 ipla =
Heavy.ipBalHeavy[nelem][ion];
335 esc =
opac.ExpmTau[ipla-1];
337 difflya =
Heavy.xLyaHeavy[nelem][ion]*
dense.xIonDense[nelem][ion+1];
340 ots = difflya*
MAX2(0.f,1.f-esc);
376 for(
long ipSpecies=0; ipSpecies<
nSpecies; ipSpecies++ )
383 int ipHi = (*tr).ipHi();
384 if (ipHi >=
dBaseSpecies[ipSpecies].numLevels_local || (*tr).ipCont() <= 0)
386 (*tr).Emis().ots() = (*(*tr).Hi()).Pop() * (*tr).Emis().Aul() * (*tr).Emis().Pdest();
395 (*diatom)->H2_RT_OTS();
497 if(
rfield.lgKillOTSLine )
499 for( i=0; i <
rfield.nflux; i++ )
509 for(
long nelem=ipISO; nelem <
LIMELM; nelem++ )
511 if(
dense.IonHigh[nelem] >= nelem+1-ipISO )
515 for( vector<two_photon>::iterator tnu = sp->
TwoNu.begin(); tnu != sp->
TwoNu.end(); ++tnu )
518 for(
long nu=0; nu < tnu->ipTwoPhoE; nu++ )
520 rfield.ConOTS_local_photons[nu] += tnu->local_emis[nu] * (1.f -
opac.ExpmTau[nu]);
530 for( i=0; i <
rfield.nflux; ++i )
536 rfield.ConOTS_local_OTS_rate[i] = (
realnum)((
double)
rfield.ConOTS_local_photons[i]*CurrentInverseOpacity);
543 rfield.ConOTS_local_OTS_rate[i];
552 for( i=1; i <
rfield.nflux; i++ )
563 for( i=0; i <
rfield.ipPlasma-1; i++ )
566 rfield.ConOTS_local_OTS_rate[i] = 0.;
567 rfield.ConOTS_local_photons[i] = 0.;
570 rfield.OccNumbBremsCont[i] = 0.;
573 rfield.ConInterOut[i] = 0.;
577 if(
rfield.ipEnergyBremsThin > 0 )
633 static long int nInsane=0;
636 const int LIM_INSAME_PRT = 30;
643 for( i=
rfield.ipEnergyBremsThin; i <
rfield.nflux; i++ )
648 rfield.ConOTS_local_OTS_rate[i];
651 if( phisig > 0. &&
rfield.SummedDif[i]> 0.)
653 if( fabs(
rfield.SummedDif[i]/phisig-1.) > 1e-3 )
658 if( nInsane < LIM_INSAME_PRT )
660 fprintf(
ioQQQ,
" PROBLEM RT_OTS_ChkSum insane SummedDif at energy %.5e error= %.2e i=%4ld\n",
662 fprintf(
ioQQQ,
" SummedDif, sum are%11.4e%11.4e\n",
663 rfield.SummedDif[i], phisig );
664 fprintf(
ioQQQ,
" otscon otslin ConInterOut outlin are%11.4e%11.4e%11.4e%11.4e\n",
667 fprintf(
ioQQQ,
" line continuum here are %4.4s %4.4s\n",
673 phisig +=
rfield.flux[0][i];
676 if( phisig > 0. &&
rfield.SummedDif[i]> 0. )
678 if( fabs(
rfield.SummedCon[i]/phisig-1.) > 1e-3 )
683 if( nInsane < LIM_INSAME_PRT )
685 fprintf(
ioQQQ,
" PROBLEM RT_OTS_ChkSum %3ld, insane SummedCon at energy %.5e error=%.2e i=%ld\n",
686 ipPnt,
rfield.anu[i],
rfield.SummedCon[i]/phisig - 1., i );
687 fprintf(
ioQQQ,
" SummedCon, sum are %.4e %.4e\n",
688 rfield.SummedCon[i], phisig );
689 fprintf(
ioQQQ,
" otscon otslin ConInterOut outlin flux are%.4e %.4e %.4e %.4e %.4e\n",
692 fprintf(
ioQQQ,
" line continuum here are %s %s\n",
702 fprintf(
ioQQQ,
" PROBLEM RT_OTS_ChkSum too much insanity to continue.\n");