Index: conv_itercheck.cpp =================================================================== --- conv_itercheck.cpp (revision 2186) +++ conv_itercheck.cpp (revision 2187) @@ -52,9 +52,9 @@ if( true && EmisLines[ipISO][nelem][3][2].TauIn > 0.5 ) { /* test if Lya converged, nLyaLevel is upper level of Lya for iso seq */ - if( fabs(EmisLines[ipISO][nelem][iso.nLyaLevel[ipISO]][0].TauTot/ - (EmisLines[ipISO][nelem][iso.nLyaLevel[ipISO]][0].TauIn*rt.DoubleTau)-1.) > - conv.autocv ) + if( fabs(EmisLines[ipISO][nelem][iso.nLyaLevel[ipISO]][0].TauTot - + EmisLines[ipISO][nelem][iso.nLyaLevel[ipISO]][0].TauIn*rt.DoubleTau) > + conv.autocv*fabs(EmisLines[ipISO][nelem][iso.nLyaLevel[ipISO]][0].TauIn*rt.DoubleTau) ) { /* not converged to within AUTOCV, normally 15 percent */ lgConverged = false; @@ -91,8 +91,9 @@ /* fails when niso increased, add more transitions */ TotalInsanity(); - if( fabs(EmisLines[ipISO][nelem][ipHi][ipLo].TauTot/ - (EmisLines[ipISO][nelem][ipHi][ipLo].TauIn*rt.DoubleTau)-1.) > conv.autocv ) + if( fabs(EmisLines[ipISO][nelem][ipHi][ipLo].TauTot - + EmisLines[ipISO][nelem][ipHi][ipLo].TauIn*rt.DoubleTau) > + conv.autocv*fabs(EmisLines[ipISO][nelem][ipHi][ipLo].TauIn*rt.DoubleTau) ) { /* not converged to within AUTOCV, normally 15 percent */ lgConverged = false; @@ -119,12 +120,10 @@ /* check on changes in major column densities */ for( i=0; i 1e-5) && - (differ > conv.autocv) ) + if( colden.colden[i]/colden.colden[ipCOL_HTOT] > 1e-5 && + fabs(colden.colden_old[i]-colden.colden[i]) > conv.autocv*colden.colden[i] ) { /* not converged to within conv.autocv, normally 20 percent */ lgConverged = false; @@ -148,15 +147,12 @@ /* check on changes in major column densities */ for( i=0; in_nuclei == 1) continue; /* was the species abundance and changing? */ - differ = fabs(COmole[i]->hevcol_old-COmole[i]->hevcol) / - SDIV(COmole[i]->hevcol); - if( (COmole[i]->hevcol/colden.colden[ipCOL_HTOT] > 1e-5) && - (differ > conv.autocv) ) + if( COmole[i]->hevcol/colden.colden[ipCOL_HTOT] > 1e-5 && + fabs(COmole[i]->hevcol_old-COmole[i]->hevcol) > conv.autocv*COmole[i]->hevcol ) { /* not converged to within conv.autocv, normally 20 percent */ lgConverged = false; @@ -179,11 +175,9 @@ /* check on dynamical convergence in wind model with negative velocity */ if( dynamics.lgAdvection ) { - double error1 = dynamics.convergence_error / SDIV(dynamics.error_scale2); - double error2 = dynamics.discretization_error / SDIV(dynamics.error_scale2); /* >>chng 02 nov 29, as per Will Henney email */ - if( MAX2(error1/dynamics.convergence_tolerance, error2 ) > conv.autocv ) - /*if( MAX2(error1, error2 ) > conv.autocv )*/ + if( dynamics.convergence_error > conv.autocv*dynamics.error_scale2*dynamics.convergence_tolerance || + dynamics.discretization_error > conv.autocv*dynamics.error_scale2 ) { lgConverged = false; /* for iterate to convergence, print reason why it was not converged