43 static double HbFracOutOld=-1. , HbFracOutNew=-1.;
44 HbFracOutOld = HbFracOutNew;
46 double a, total, BeamedIn;
47 long int ipTotal =
cdLine(
"H 1" , 4861.33f , &a , &total );
48 long int ipInwd =
cdLine(
"INWD" , 4861.33f , &a , &BeamedIn );
55 HbFracOutNew = 1. - BeamedIn / total;
67 bool lgReasonGiven =
false;
70 if(
nzone>3 && ipInwd>=0 && ipTotal>=0 )
73 if( fabs(HbFracOutNew-HbFracOutOld)/HbFracOutNew>
conv.
autocv )
81 "old=%.3e new=%.3e \n",
82 HbFracOutOld , HbFracOutNew);
88 for( nelem=ipISO; nelem <
LIMELM; nelem++ )
112 if(
iso_sp[ipISO][nelem].trans(ipHi,ipLo).Emis().TauIn() > 0.5 )
128 lgReasonGiven =
true;
130 "nelem= %s iteration %li old %.3e new %.3e \n",
139 if( fabs(
iso_sp[ipISO][nelem].trans(ipHi,ipLo).Emis().TauTot() -
152 lgReasonGiven =
true;
169 for(
long ipSpecies=0; ipSpecies<
nSpecies; ipSpecies++ )
176 if( (*tr).Emis().TauIn() > 1. &&
177 fabs((*tr).Emis().TauTot() - (*tr).Emis().TauIn()*
rt.
DoubleTau) >
191 lgReasonGiven =
true;
196 (*tr).Emis().TauTot() ,
197 (*tr).Emis().TauIn());
207 realnum baddiff=0., badscale=0.;
215 tr != it->end(); ++tr)
217 if ( tr->ipCont() <= 0 )
221 if( (*tr).Emis().TauIn() > 1. && diff >
conv.
autocv*scale )
225 if ( lgTauConv || diff*badscale > scale*baddiff )
234 lgReasonGiven =
true;
236 (*it).chLabel().c_str(),
239 (*tr).Emis().TauTot() ,
250 (*badtr).system().chLabel.c_str(),
252 (*badtr).Emis().TauTot(), (*badtr).Emis().TauIn()*
rt.
DoubleTau);
258 for( i=0; i<
NCOLD; ++i )
274 lgReasonGiven =
true;
275 fprintf(
save.
ipPunConv,
" H mole col species %li iteration %li old %.2e new %.2e H col den %.2e\n",
284 double biggestDiffer = 0.;
302 if( differ > biggestDiffer )
308 biggestDiffer = differ;
313 lgReasonGiven =
true;
336 lgReasonGiven =
true;
t_mole_global mole_global
double convergence_tolerance
string chLineLbl(const TransitionProxy &t)
NORETURN void TotalInsanity(void)
char chNotConverged[INPUT_LINE_LENGTH]
realnum colden_old[NCOLD]
t_elementnames elementnames
t_iso_sp iso_sp[NISO][LIMELM]
bool lgOpticalDepthonverged
EmissionList::reference Emis() const
valarray< class molezone > species
double discretization_error
TransitionProxy trans(const long ipHi, const long ipLo)
char chElementSym[LIMELM][CHARS_ELEMENT_SYM]
long int cdLine(const char *chLabel, realnum wavelength, double *relint, double *absint)
#define DEBUG_ENTRY(funcname)
vector< species > dBaseSpecies
int fprintf(const Output &stream, const char *format,...)
vector< TransitionList > AllTransitions
vector< TransitionList > dBaseTrans