63 double save_he2rec_dest;
104 enum {DEBUG_LOC=
false};
108 fprintf(
ioQQQ,
"DEBUG HeII Bowen nzone %li bwnfac:%.2e bwnfac esc:%.2e ots660 %.2e\n",
153 for( nelem=ipISO; nelem <
LIMELM; nelem++ )
169 for( ipLo=0; ipLo < ipHi; ipLo++ )
174 if(
Transitions[ipISO][nelem][ipHi][ipLo].ipCont < 1 ||
201 enum {DEBUG_LOC=
false};
206 if( ipISO==0 && nelem==0 &&
nzone>500 )
211 fprintf(
ioQQQ,
"DEBUG hlyaots\t%.2f\tEdenTrue\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\n",
239 ASSERT( cont_phot_destroyed >= 0. );
246 enum {DEBUG_LOC=
false};
248 if( DEBUG_LOC &&
nzone > 400 && nelem==0 && n==2 )
251 fprintf(
ioQQQ,
"hotsdebugg\t%.3f\t%li\th con ots\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\n",
271 enum {DEBUG_LOC=
false};
276 fprintf(
ioQQQ,
"hotsdebugg %li \t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\n",
302 fprintf(
ioQQQ,
" RT_OTS Pdest %.2e ots rate %.2e in otslinNew %.2e con opac %.2e\n",
311 for( nelem=NISO; nelem <
LIMELM; nelem++ )
316 for( ion=0; ion < nelem+1-
NISO; ion++ )
330 ots = difflya*
MAX2(0.f,1.f-esc);
348 ots = difflya*
MAX2(0.f,1.f-esc);
443 enum {DEBUG_LOC=
false};
445 if( DEBUG_LOC && ip== 2363 )
447 fprintf(
ioQQQ,
"DEBUG ots, opc, otsr %.3e\t%.3e\t%.3e\t",
451 fprintf(
ioQQQ,
"iteration %li type %i %i %i \n",
505 bool lgReturn =
false;
526 fprintf(
ioQQQ,
"DEBUG lya ots %.2f %.3e\n",
544 static bool lgNeedSpace=
true;
545 static double *old_OTS_line_x_opac , *old_OTS_cont_x_opac;
552 FacBig = (
realnum)(1. + BigFrac);
558 old_OTS_line_x_opac = (
double*)
MALLOC((
size_t)((unsigned)
rfield.
nupper*
sizeof(
double)) );
559 old_OTS_cont_x_opac = (
double*)
MALLOC((
size_t)((unsigned)
rfield.
nupper*
sizeof(
double)) );
594 if( OTS_line_x_opac > old_OTS_line_x_opac[i]*FacBig )
598 else if( OTS_line_x_opac < old_OTS_line_x_opac[i]*FacSml )
608 if( OTS_cont_x_opac > old_OTS_cont_x_opac[i]*FacBig )
612 else if( OTS_cont_x_opac < old_OTS_cont_x_opac[i]*FacSml )
726 if( OTSNew > OTSOld )
728 chng = fabs(1. - OTSOld/
SDIV(OTSNew) );
732 chng = fabs(1. - OTSNew/
SDIV(OTSOld) );
743 FracOld = (1. - BigFrac / chng);
745 FracOld =
MIN2( 0.25 , FracOld );
750 FracNew = 1. - FracOld;
751 fprintf(
ioQQQ,
" DEBUG FracNew\t%.2e\n", FracNew);
801 enum {DEBUG_LOC=
false};
803 if( DEBUG_LOC && (
nzone==378) )
807 fprintf(
ioQQQ,
"rtotsbugggg\t%li\t%.3e\t%.3e\t%.3e\t%.3e\n",
876 enum {DEBUG_LOC=
false};
878 if( DEBUG_LOC && (
nzone>0) )
894 " sumcontinuunots zone %li SumOTS %.2e %.2eRyd opc:%.2e OTS%.2e lin%.2e con:%.2e %s %s cell%i FracNew %.2f \n",
956 static long int nInsane=0;
959 # define LIM_INSAME_PRT 30
983 fprintf(
ioQQQ,
" PROBLEM RT_OTS_ChkSum insane SummedDif at energy %.5e error= %.2e i=%4ld\n",
985 fprintf(
ioQQQ,
" SummedDif, sum are%11.4e%11.4e\n",
987 fprintf(
ioQQQ,
" otscon otslin ConInterOut outlin are%11.4e%11.4e%11.4e%11.4e\n",
990 fprintf(
ioQQQ,
" line continuum here are %4.4s %4.4s\n",
1008 fprintf(
ioQQQ,
" PROBLEM RT_OTS_ChkSum %3ld, insane SummedCon at energy %.5e error=%.2e i=%ld\n",
1010 fprintf(
ioQQQ,
" SummedCon, sum are %.4e %.4e\n",
1012 fprintf(
ioQQQ,
" otscon otslin ConInterOut outlin flux are%.4e %.4e %.4e %.4e %.4e\n",
1015 fprintf(
ioQQQ,
" line continuum here are %s %s\n",
1025 fprintf(
ioQQQ,
" PROBLEM RT_OTS_ChkSum too much insanity to continue.\n");
1046 ASSERT( chFlag==
'l' || chFlag==
'c' || chFlag==
'b' );
1060 if( chFlag ==
'c' || chFlag ==
'b' )
1062 fprintf(
ioQQQ,
" DEBUG OTSCON array, anu, otscon, opac, OTS*opac limit:%.2e zone:%.2f IonConv?%c\n",
1069 fprintf(
ioQQQ,
" %4ld%12.4e%12.4e%12.4e%12.4e %s \n",
1084 if( chFlag ==
'l' || chFlag ==
'b' )
1086 fprintf(
ioQQQ,
" DEBUG OTSLIN array, anu, otslin, opac, OTS*opac Lab nLine limit:%.2e zone:%.2f IonConv?%c\n",
1093 fprintf(
ioQQQ,
" %4ld%12.4e%12.4e%12.4e%12.4e %s %3li\n",