Changeset 2185
- Timestamp:
- 07/09/08 12:05:44 (6 months ago)
- Files:
-
- 1 modified
-
trunk/source/conv_itercheck.cpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/conv_itercheck.cpp
r2133 r2185 70 70 { 71 71 /* test if Lya converged, nLyaLevel is upper level of Lya for iso seq */ 72 if( fabs(Transitions[ipISO][nelem][iso.nLyaLevel[ipISO]][0].Emis->TauTot /73 (Transitions[ipISO][nelem][iso.nLyaLevel[ipISO]][0].Emis->TauIn*rt.DoubleTau)-1.) >74 conv.autocv)72 if( fabs(Transitions[ipISO][nelem][iso.nLyaLevel[ipISO]][0].Emis->TauTot - 73 Transitions[ipISO][nelem][iso.nLyaLevel[ipISO]][0].Emis->TauIn*rt.DoubleTau) > 74 conv.autocv*fabs(Transitions[ipISO][nelem][iso.nLyaLevel[ipISO]][0].Emis->TauIn*rt.DoubleTau) ) 75 75 { 76 76 /* not converged to within AUTOCV, normally 15 percent */ … … 93 93 } 94 94 95 if( fabs(Transitions[ipISO][nelem][ipHi][ipLo].Emis->TauTot/ 96 (Transitions[ipISO][nelem][ipHi][ipLo].Emis->TauIn*rt.DoubleTau)-1.) > conv.autocv ) 95 if( fabs(Transitions[ipISO][nelem][ipHi][ipLo].Emis->TauTot - 96 Transitions[ipISO][nelem][ipHi][ipLo].Emis->TauIn*rt.DoubleTau) > 97 conv.autocv*fabs(Transitions[ipISO][nelem][ipHi][ipLo].Emis->TauIn*rt.DoubleTau) ) 97 98 { 98 99 /* not converged to within AUTOCV, normally 15 percent */ … … 122 123 for( i=0; i<NCOLD; ++i ) 123 124 { 124 double differ = fabs(colden.colden_old[i]-colden.colden[i]) /125 SDIV(colden.colden[i]);126 125 /* was the species column density significant relative to 127 126 * the total H column density, and was its abundance changing? */ 128 if( (colden.colden[i]/colden.colden[ipCOL_HTOT] > 1e-5)&&129 (differ > conv.autocv))127 if( colden.colden[i]/colden.colden[ipCOL_HTOT] > 1e-5 && 128 fabs(colden.colden_old[i]-colden.colden[i]) > conv.autocv*colden.colden[i] ) 130 129 { 131 130 /* not converged to within conv.autocv, normally 20 percent */ … … 151 150 for( i=0; i<mole.num_comole_calc; ++i ) 152 151 { 153 double differ;154 152 if(COmole[i]->n_nuclei == 1) 155 153 continue; 156 154 157 155 /* was the species abundance and changing? */ 158 differ = (double)fabs(COmole[i]->hevcol_old-COmole[i]->hevcol) / 159 (double)SDIV(COmole[i]->hevcol); 160 if( (COmole[i]->hevcol/colden.colden[ipCOL_HTOT] > 1e-5) && 161 (differ > conv.autocv) ) 156 if( COmole[i]->hevcol/colden.colden[ipCOL_HTOT] > 1e-5 && 157 fabs(COmole[i]->hevcol_old-COmole[i]->hevcol) > conv.autocv*COmole[i]->hevcol ) 162 158 { 163 159 /* not converged to within conv.autocv, normally 20 percent */ … … 182 178 if( dynamics.lgAdvection ) 183 179 { 184 double error1 = dynamics.convergence_error / SDIV(dynamics.error_scale2);185 double error2 = dynamics.discretization_error / SDIV(dynamics.error_scale2);186 180 /* >>chng 02 nov 29, as per Will Henney email */ 187 if( MAX2(error1/dynamics.convergence_tolerance, error2 ) > conv.autocv )188 /*if( MAX2(error1, error2 ) > conv.autocv )*/181 if( dynamics.convergence_error > conv.autocv*dynamics.error_scale2*dynamics.convergence_tolerance || 182 dynamics.discretization_error > conv.autocv*dynamics.error_scale2 ) 189 183 { 190 184 lgConverged = false;
