00001
00002
00003
00004
00005
00006
00007
00008 #include "cddefines.h"
00009 #include "physconst.h"
00010 #include "doppvel.h"
00011 #include "cddrive.h"
00012 #include "lines_service.h"
00013 #include "iso.h"
00014 #include "continuum.h"
00015 #include "stopcalc.h"
00016 #include "hyperfine.h"
00017 #include "dense.h"
00018 #include "grainvar.h"
00019 #include "version.h"
00020 #include "rt.h"
00021 #include "he.h"
00022 #include "ionbal.h"
00023 #include "taulines.h"
00024 #include "hydrogenic.h"
00025 #include "lines.h"
00026 #include "trace.h"
00027 #include "map.h"
00028 #include "hmi.h"
00029 #include "punch.h"
00030 #include "h2.h"
00031 #include "conv.h"
00032 #include "dynamics.h"
00033 #include "opacity.h"
00034 #include "geometry.h"
00035 #include "elementnames.h"
00036 #include "ca.h"
00037 #include "broke.h"
00038 #include "pressure.h"
00039 #include "mole.h"
00040 #include "atoms.h"
00041 #include "abund.h"
00042 #include "rfield.h"
00043 #include "colden.h"
00044 #include "phycon.h"
00045 #include "timesc.h"
00046 #include "hextra.h"
00047 #include "radius.h"
00048 #include "iterations.h"
00049 #include "fudgec.h"
00050 #include "called.h"
00051 #include "reason.h"
00052 #include "magnetic.h"
00053 #include "helike.h"
00054 #include "wind.h"
00055 #include "secondaries.h"
00056 #include "struc.h"
00057 #include "oxy.h"
00058 #include "input.h"
00059 #include "thermal.h"
00060 #include "atmdat.h"
00061 #include "warnings.h"
00062 #include "prt.h"
00063
00064
00065 static void chkCaHeps(double *totwid);
00066
00067
00068 static void prt_smooth_predictions(void);
00069
00070
00071 static void badprt(double total);
00072
00073
00074 static void outsum(double *outtot,
00075 double *outin,
00076 double *outout);
00077
00078 void PrtComment(void)
00079 {
00080 char chLbl[11],
00081 chLine[INPUT_LINE_LENGTH];
00082
00083 bool lgAbort_flag,
00084 lgThick,
00085 lgLots_of_moles;
00086
00087 long int dum1,
00088 dum2,
00089 i,
00090 imas,
00091 ipLo ,
00092 ipHi ,
00093 ipISO,
00094 nelem,
00095 isav,
00096 j,
00097 nc,
00098 nd,
00099 nline,
00100 nn,
00101 nneg,
00102 ns,
00103 nw;
00104
00105 double big_ion_jump,
00106 absint ,
00107 aj,
00108 alpha,
00109 big,
00110 bigm,
00111 sum_coolants,
00112 comfrc,
00113 flow_energy,
00114 differ,
00115 error,
00116 flur,
00117 freqn,
00118 rate,
00119 ratio,
00120 sum_recom_lines,
00121 rel,
00122 small,
00123 tauneg,
00124 ts ,
00125 HBeta,
00126 relfl ,
00127 relhm,
00128 fedest,
00129 GetHeat,
00130 SumNeg,
00131 c4363,
00132 t4363,
00133 outin,
00134 outout,
00135 totwid,
00136 outtot;
00137
00138 double VolComputed , VolExpected , ConComputed , ConExpected;
00139
00140 bool lgLotsSolids;
00141
00142 DEBUG_ENTRY( "PrtComment()" );
00143
00144 if( 0 && lgAbort )
00145 {
00146 DEBUG_EXIT( "PrtComment()" );
00147 return;
00148 }
00149
00150 if( trace.lgTrace )
00151 {
00152 fprintf( ioQQQ, " PrtComment called.\n" );
00153 }
00154
00155
00156
00157
00158
00159
00160 iterations.lgIterAgain = false;
00161
00162
00163 wcnint();
00164
00165 if( version.nBetaVer > 0 )
00166 {
00167 sprintf( chLine,
00168 " !This is beta test version%4ld and is intended for testing only.",
00169 version.nBetaVer );
00170 bangin(chLine);
00171 }
00172
00173
00174
00175
00176 if( broke.lgFixit && !version.lgRelease )
00177 {
00178 sprintf( chLine, " !The code needs to be fixed - search for fixit()." );
00179 bangin(chLine);
00180 }
00181
00182
00183
00184
00185 if( broke.lgCheckit && !version.lgRelease )
00186 {
00187 sprintf( chLine, " !New code needs to be reviewed - search for CodeReview()." );
00188 bangin(chLine);
00189 }
00190
00191
00192 if( conv.lgBadStop )
00193 {
00194
00195 sprintf( warnings.chRgcln[0], " W-Calculation stopped because %s Iteration%3ld of %ld",
00196 reason.chReason, iteration, iterations.itermx + 1 );
00197 sprintf( chLine, " W-Calculation stopped because %s",
00198 reason.chReason );
00199 warnin(chLine);
00200 sprintf( chLine, " W-This was not intended." );
00201 warnin(chLine);
00202 }
00203 else
00204 {
00205
00206 if( (conv.lgAutoIt && iteration != iterations.itermx + 1) &&
00207 iteration > 2 )
00208 {
00209 sprintf( warnings.chRgcln[0],
00210 " Calculation stopped because %s Iteration %ld of %ld, not converged due to %s",
00211 reason.chReason,
00212 iteration,
00213 iterations.itermx + 1,
00214 conv.chNotConverged );
00215 }
00216 else
00217 {
00218 sprintf( warnings.chRgcln[0],
00219 " Calculation stopped because %s Iteration %ld of %ld",
00220 reason.chReason, iteration, iterations.itermx + 1 );
00221 }
00222 }
00223
00224
00225
00226 if( (!geometry.lgZoneSet) && geometry.lgZoneTrp )
00227 {
00228 conv.lgBadStop = true;
00229 sprintf( chLine,
00230 " W-Calculation stopped because default number of zones reached. Was this intended???" );
00231 warnin(chLine);
00232 sprintf( chLine,
00233 " W-Default limit can be increased while retaining this check with the SET NEND command." );
00234 warnin(chLine);
00235 }
00236
00237
00238
00239
00240 if( radius.lgDrMinUsed || radius.lgdR2Small )
00241 {
00242 conv.lgBadStop = true;
00243 sprintf( chLine,
00244 " W-Calculation stopped zone thickness became too thin. This was not intended." );
00245 warnin(chLine);
00246 sprintf( chLine,
00247 " W-The most likely reason was an uncontrolled oscillation." );
00248 warnin(chLine);
00249 ShowMe();
00250 }
00251
00252 if( radius.lgdR2Small )
00253 {
00254 sprintf( chLine,
00255 " W-This happened because the globule scale became very small relative to the depth." );
00256 warnin(chLine);
00257 sprintf( chLine,
00258 " W-This problem is described in Hazy." );
00259 warnin(chLine);
00260 }
00261
00262
00263
00264 ASSERT( nzone < struc.nzlim );
00265
00266 if( struc.testr[nzone-1] == 0. )
00267 struc.testr[nzone-1] = struc.testr[nzone-2];
00268
00269 if( struc.ednstr[nzone-1] == 0. )
00270 struc.ednstr[nzone-1] = struc.ednstr[nzone-2];
00271
00272
00273 rel = radius.depth/radius.rinner;
00274 if( rel < 0.1 )
00275 {
00276 sprintf( warnings.chRgcln[1], " The geometry is plane-parallel." );
00277 }
00278 else if( rel >= 0.1 && rel < 3. )
00279 {
00280 sprintf( warnings.chRgcln[1], " The geometry is a thick shell." );
00281 }
00282 else
00283 {
00284 sprintf( warnings.chRgcln[1], " The geometry is spherical." );
00285 }
00286
00287
00288
00289
00290
00291
00292
00293
00294 if( broke.lgBroke )
00295 {
00296 sprintf( chLine, " W-The code is broken - search for broken()." );
00297 warnin(chLine);
00298 }
00299
00300
00301 if( dense.lgEdenBad )
00302 {
00303 if( dense.nzEdenBad == nzone )
00304 {
00305 sprintf( chLine, " C-The assumed electron density was incorrect for the last zone." );
00306 caunin(chLine);
00307 sprintf( chLine, " C-Did a temperature discontinuity occur??" );
00308 caunin(chLine);
00309 }
00310 else
00311 {
00312 sprintf( chLine, " W-The assumed electron density was incorrect during the calculation. This is bad." );
00313 warnin(chLine);
00314 ShowMe();
00315 warnin(chLine);
00316 }
00317 }
00318
00319 if( lgAbort )
00320 {
00321 sprintf( chLine, " W-The calculation aborted. Something REALLY went wrong!" );
00322 warnin(chLine);
00323 }
00324
00325
00326 if( map.lgMapDone && !map.lgMapOK )
00327 {
00328 sprintf( chLine, " !The thermal map had changes in slope - check map output." );
00329 bangin(chLine);
00330 }
00331
00332 if( fudgec.nfudge > 0 )
00333 {
00334 sprintf( chLine, " !Fudge factors in place. Why?" );
00335 bangin(chLine);
00336 }
00337
00338 if( dense.gas_phase[ipHYDROGEN] > 1.1e13 )
00339 {
00340 if( dense.gas_phase[ipHYDROGEN] > 1e15 )
00341 {
00342 sprintf( chLine, " C-Density greater than 10**15, heavy elements are very uncertain." );
00343 caunin(chLine);
00344 }
00345 else
00346 {
00347 sprintf( chLine, " C-Density greater than 10**13" );
00348 caunin(chLine);
00349 }
00350 }
00351
00352
00353 if( cdLine("Pump",4861.36f,&relfl,&absint)<=0 )
00354 {
00355 fprintf( ioQQQ, " PROBLEM Did not find Pump H-beta\n" );
00356 puts( "[Stop in PrtComment]" );
00357 ShowMe();
00358 cdEXIT(EXIT_FAILURE);
00359 }
00360
00361
00362
00363
00364 if( cdLine( "H 1",4861.36f,&HBeta,&absint)<=0 )
00365 {
00366 fprintf( ioQQQ, " PROBLEM Did not find H 1 H-beta - reset to unity\n" );
00367 HBeta = 1.;
00368 absint = 1.;
00369 }
00370
00371
00372 if( HBeta > 0. )
00373 {
00374 flur = relfl/HBeta;
00375 if( flur > 0.1 )
00376 {
00377 sprintf( chLine, " !Continuum fluorescent production of H-beta was very important." );
00378 bangin(chLine);
00379 }
00380 else if(flur > 0.01 )
00381 {
00382 sprintf( chLine, " Continuum fluorescent production of H-beta was significant." );
00383 notein(chLine);
00384 }
00385 }
00386
00387
00388 if( wind.windv0 > 0. && ((!wind.lgWindOK) || wind.windv < 1e6) )
00389 {
00390 sprintf( chLine, " C-Wind velocity below sonic point; solution is not valid." );
00391 caunin(chLine);
00392 }
00393
00394
00395 if( wind.windv0 != 0. )
00396 {
00397 rel = wind.emdot/(wind.windv*dense.gas_phase[ipHYDROGEN])/radius.r1r0sq;
00398 if( fabs(1.-rel)> 0.02 )
00399 {
00400 sprintf( chLine, " C-Wind mass flux error is %g%%",fabs(1.-rel)*100. );
00401 caunin(chLine);
00402 fprintf(ioQQQ,"DEBUG emdot\t%.3e\t%.3e\t%.3e\t%.3e\n",
00403 wind.emdot , wind.windv*dense.gas_phase[ipHYDROGEN],wind.windv,dense.gas_phase[ipHYDROGEN]);
00404 }
00405 }
00406
00407
00408 if( nzone >= struc.nzlim )
00409 {
00410 TotalInsanity();
00411 }
00412
00413
00414
00415 outsum(&outtot,&outin,&outout);
00416
00417 sum_recom_lines = totlin('r');
00418 if( sum_recom_lines == 0. )
00419 {
00420 sprintf( chLine, " !Total recombination line energy is 0." );
00421 bangin(chLine);
00422 }
00423
00424
00425 sum_coolants = totlin('c');
00426 if( sum_coolants == 0. )
00427 {
00428 sprintf( chLine, " !Total cooling is zero." );
00429 bangin(chLine);
00430 }
00431
00432 if( wind.windv < 0. )
00433 {
00434
00435
00436 flow_energy = (2.5*struc.GasPressure[0]+0.5*struc.DenMass[0]*wind.windv0*wind.windv0)
00437 *(-wind.windv0);
00438 }
00439 else
00440 {
00441 flow_energy = 0.;
00442 }
00443
00444
00445
00446 if( (sum_coolants + sum_recom_lines + flow_energy ) > continuum.TotalLumin && (!thermal.lgTSetOn) )
00447 {
00448 if( (hextra.cryden == 0.) && ((hextra.TurbHeat+DoppVel.DispScale) == 0.) && !secondaries.lgCSetOn )
00449 {
00450
00451 sprintf( chLine,
00452 " W-Radiated luminosity (cool+rec+wind=%.2e+%.2e+%.2e) is greater than that in incident radiation (TotalLumin=%8.2e). Power radiated was %8.2e",
00453 sum_coolants, sum_recom_lines, flow_energy , continuum.TotalLumin, thermal.power );
00454 warnin(chLine);
00455
00456 fprintf( ioQQQ, "\n\n DISASTER This calculation DID NOT CONSERVE ENERGY!\n" );
00457
00458
00459 if( opac.lgCaseB )
00460 fprintf( ioQQQ, "\n The CASE B command was entered - this can have unphysical effects, including non-conservation of energy.\n Why was it needed?\n\n" );
00461
00462
00463 badprt(continuum.TotalLumin);
00464
00465 sprintf( chLine, " W-Something is really wrong: the ratio of radiated to incident luminosity is %.2e.",
00466 (sum_coolants + sum_recom_lines)/continuum.TotalLumin );
00467 warnin(chLine);
00468
00469
00470 if( thermal.ConstTemp > 0. )
00471 {
00472 fprintf( ioQQQ, " This may have been caused by the FORCE TE command.\n" );
00473 fprintf( ioQQQ, " Remove it and run again.\n" );
00474 }
00475 else
00476 {
00477 ShowMe();
00478 }
00479 warnin(chLine);
00480 }
00481 }
00482
00483
00484
00485 if( hextra.cryden*magnetic.lgB > 0. )
00486 {
00487 sprintf( chLine,
00488 " !Magnetic field & cosmic rays both present. Their interactions are not treated." );
00489 bangin(chLine);
00490 }
00491
00492
00493 if( hextra.cryden== 0. && StopCalc.tend < TEND)
00494 {
00495 sprintf( chLine,
00496 " !Background cosmic rays are not included - is this physical? It affects the chemistry." );
00497 bangin(chLine);
00498 }
00499
00500
00501 if( hextra.cryden > 0. && (colden.colden[ipCOL_H0]/10. + colden.colden[ipCOL_Hp]) > 1e23 )
00502 {
00503 sprintf( chLine,
00504 " C-Model is thick to cosmic rays, which are on." );
00505 caunin(chLine);
00506 }
00507
00508
00509 if( hextra.cryden == 0. && iso.gamnc[ipH_LIKE][ipHYDROGEN][ipH1s] < 1e-17 )
00510 {
00511 sprintf( chLine,
00512 " !Ionization rate fell below background cosmic ray ionization rate. Should this be added too?" );
00513 bangin(chLine);
00514 sprintf( chLine,
00515 " ! Use the COSMIC RAY BACKGROUND command." );
00516 bangin(chLine);
00517 }
00518
00519
00520 if( lgTestCodeCalled )
00521 {
00522 sprintf( chLine, " !Test code is in place." );
00523 bangin(chLine);
00524 }
00525
00526
00527 if( rfield.lgComUndr )
00528 {
00529 sprintf( chLine,
00530 " !Compton cooling rate underflows to zero. Is this important?" );
00531 bangin(chLine);
00532 }
00533
00534
00535 if( input.lgUnderscoreFound )
00536 {
00537 sprintf( chLine,
00538 " !Some input lines contained underscores, these were changed to spaces." );
00539 bangin(chLine);
00540 }
00541
00542
00543 if( input.lgBracketFound )
00544 {
00545 sprintf( chLine,
00546 " !Some input lines contained [ or ], these were changed to spaces." );
00547 bangin(chLine);
00548 }
00549
00550
00551 if( rfield.lgHionRad )
00552 {
00553 sprintf( chLine,
00554 " !There is no hydrogen-ionizing radiation. Was this intended?" );
00555 bangin(chLine);
00556 }
00557
00558
00559 if( thermal.nUnstable > 0 )
00560 {
00561 sprintf( chLine,
00562 " Derivative of net cooling negative and so possibly thermally unstable in%4ld zones.",
00563 thermal.nUnstable );
00564 notein(chLine);
00565 }
00566
00567
00568 if( nzone > 1 &&
00569 (float)(thermal.nUnstable)/(float)(nzone) > 0.25 )
00570 {
00571 sprintf( chLine,
00572 " !A large fraction of the zones were possibly thermally unstable,%4ld out of%4ld",
00573 thermal.nUnstable, nzone );
00574 bangin(chLine);
00575 }
00576
00577
00578 if( thermal.CoolHeatMax > 0.2 )
00579 {
00580 sprintf( chLine,
00581 " !Negative cooling reached %6.1f%% of the local heating, due to %4.4s %.1f",
00582 thermal.CoolHeatMax*100., thermal.chCoolHeatMax, thermal.wlCoolHeatMax );
00583 bangin(chLine);
00584 }
00585 else if( thermal.CoolHeatMax > 0.05 )
00586 {
00587 sprintf( chLine,
00588 " Negative cooling reached %6.1f%% of the local heating, due to %4.4s %.2f",
00589 thermal.CoolHeatMax*100., thermal.chCoolHeatMax, thermal.wlCoolHeatMax );
00590 notein(chLine);
00591 }
00592
00593
00594 if( dynamics.HeatMax > 0.05 )
00595 {
00596 sprintf( chLine,
00597 " !Advection heating reached %.2f%% of the local heating.",
00598 dynamics.HeatMax*100. );
00599 bangin(chLine);
00600 }
00601 else if( dynamics.HeatMax > 0.005 )
00602 {
00603 sprintf( chLine,
00604 " Advection heating reached %.2f%% of the local heating.",
00605 dynamics.HeatMax*100. );
00606 notein(chLine);
00607 }
00608
00609
00610 if( dynamics.CoolMax > 0.05 )
00611 {
00612 sprintf( chLine,
00613 " !Advection cooling reached %.2f%% of the local cooling.",
00614 dynamics.CoolMax*100. );
00615 bangin(chLine);
00616 }
00617 else if( dynamics.CoolMax > 0.005 )
00618 {
00619 sprintf( chLine,
00620 " Advection cooling reached %.2f%% of the local heating.",
00621 dynamics.CoolMax*100. );
00622 notein(chLine);
00623 }
00624
00625
00626
00627 if( dynamics.lgStatic && dynamics.lgRecom )
00628 {
00629 if( rfield.uh > 1. )
00630 {
00631 sprintf( chLine,
00632 " W-Time dependent ionization front cannot now handle strong-R cases - the ionization parameter is too large." );
00633 warnin(chLine);
00634 }
00635 else if( rfield.uh > 0.1 )
00636 {
00637 sprintf( chLine,
00638 " C-Time dependent ionization front cannot now handle strong-R cases - the ionization parameter is too large." );
00639 caunin(chLine);
00640 }
00641 }
00642
00643
00644 if( hydro.HCollIonMax > 0.10 )
00645 {
00646 sprintf( chLine,
00647 " !Thermal collisional ionization of H reached %.2f%% of the local ionization rate.",
00648 hydro.HCollIonMax*100. );
00649 bangin(chLine);
00650 }
00651 else if( hydro.HCollIonMax > 0.005 )
00652 {
00653 sprintf( chLine,
00654 " Thermal collisional ionization of H reached %.2f%% of the local ionization rate.",
00655 hydro.HCollIonMax*100. );
00656 notein(chLine);
00657 }
00658
00659
00660 if( !atmdat.lgHCaseBOK[1][ipHYDROGEN] )
00661 {
00662 sprintf( chLine,
00663 " Te-ne bounds of Case B lookup table exceeded, H I Case B line intensities set to zero." );
00664 notein(chLine);
00665 }
00666 if( !atmdat.lgHCaseBOK[1][ipHELIUM] )
00667 {
00668 sprintf( chLine,
00669 " Te-ne bounds of Case B lookup table exceeded, He II Case B line intensities set to zero." );
00670 notein(chLine);
00671 }
00672
00673
00674 if( secondaries.SecHIonMax > 0.10 )
00675 {
00676 sprintf( chLine,
00677 " !Suprathermal collisional ionization of H reached %.2f%% of the local H ionization rate.",
00678 secondaries.SecHIonMax*100. );
00679 bangin(chLine);
00680 }
00681 else if( secondaries.SecHIonMax > 0.005 )
00682 {
00683 sprintf( chLine,
00684 " Suprathermal collisional ionization of H reached %.2f%% of the local H ionization rate.",
00685 secondaries.SecHIonMax*100. );
00686 notein(chLine);
00687 }
00688
00689
00690 if( hmi.HeatH2DexcMax > 0.05 )
00691 {
00692 sprintf( chLine,
00693 " !H2 vib deexec heating reached %.2f%% of the local heating.",
00694 hmi.HeatH2DexcMax*100. );
00695 bangin(chLine);
00696 }
00697 else if( hmi.HeatH2DexcMax > 0.005 )
00698 {
00699 sprintf( chLine,
00700 " H2 vib deexec heating reached %.2f%% of the local heating.",
00701 hmi.HeatH2DexcMax*100. );
00702 notein(chLine);
00703 }
00704
00705
00706 if( hmi.CoolH2DexcMax > 0.05 )
00707 {
00708 sprintf( chLine,
00709 " !H2 deexec cooling reached %.2f%% of the local heating.",
00710 hmi.CoolH2DexcMax*100. );
00711 bangin(chLine);
00712 }
00713 else if( hmi.CoolH2DexcMax > 0.005 )
00714 {
00715 sprintf( chLine,
00716 " H2 deexec cooling reached %.2f%% of the local heating.",
00717 hmi.CoolH2DexcMax*100. );
00718 notein(chLine);
00719 }
00720
00721
00722 if( atmdat.HIonFracMax > 0.10 )
00723 {
00724 sprintf( chLine,
00725 " !Charge transfer ionization of H reached %.1f%% of the local H ionization rate.",
00726 atmdat.HIonFracMax*100. );
00727 bangin(chLine);
00728 }
00729 else if( atmdat.HIonFracMax > 0.005 )
00730 {
00731 sprintf( chLine,
00732 " Charge transfer ionization of H reached %.2f%% of the local H ionization rate.",
00733 atmdat.HIonFracMax*100. );
00734 notein(chLine);
00735 }
00736
00737
00738 if( atmdat.HCharHeatMax > 0.05 )
00739 {
00740 sprintf( chLine,
00741 " !Charge transfer heating reached %.2f%% of the local heating.",
00742 atmdat.HCharHeatMax*100. );
00743 bangin(chLine);
00744 }
00745 else if( atmdat.HCharHeatMax > 0.005 )
00746 {
00747 sprintf( chLine,
00748 " Charge transfer heating reached %.2f%% of the local heating.",
00749 atmdat.HCharHeatMax*100. );
00750 notein(chLine);
00751 }
00752
00753 if( atmdat.HCharCoolMax > 0.05 )
00754 {
00755 sprintf( chLine,
00756 " !Charge transfer cooling reached %.2f%% of the local heating.",
00757 atmdat.HCharCoolMax*100. );
00758 bangin(chLine);
00759 }
00760 else if( atmdat.HCharCoolMax > 0.005 )
00761 {
00762 sprintf( chLine,
00763 " Charge transfer cooling reached %.2f%% of the local heating.",
00764 atmdat.HCharCoolMax*100. );
00765 notein(chLine);
00766 }
00767
00768
00769 if( atoms.xMg2Max > 0.1 )
00770 {
00771 sprintf( chLine,
00772 " !Photoionization of upper level of Mg II 2798 reached %.1f%% of the total Mg+ photo rate.",
00773 atoms.xMg2Max*100. );
00774 bangin(chLine);
00775 }
00776 else if( atoms.xMg2Max > 0.01 )
00777 {
00778 sprintf( chLine,
00779 " Photoionization of upper level of Mg II 2798 reached %.1f%% of the total Mg+ photo rate.",
00780 atoms.xMg2Max*100. );
00781 notein(chLine);
00782 }
00783
00784
00785 if( oxy.poimax > 0.1 )
00786 {
00787 sprintf( chLine,
00788 " !Photoionization of upper levels of [O I] reached %.1f%% of the total O destruction rate.",
00789 oxy.poimax*100. );
00790 bangin(chLine);
00791 }
00792 else if( oxy.poimax > 0.01 )
00793 {
00794 sprintf( chLine,
00795 " Photoionization of upper levels of [O I] reached %.1f%% of the total O destruction rate.",
00796 oxy.poimax*100. );
00797 notein(chLine);
00798 }
00799
00800
00801 if( (oxy.poiii2Max + oxy.poiii3Max) > 0.1 )
00802 {
00803 sprintf( chLine,
00804 " !Photoionization of upper levels of [O III] reached %.1f%% of the total O++ photo rate.",
00805 (oxy.poiii2Max + oxy.poiii3Max)*100. );
00806 bangin(chLine);
00807 }
00808 else if( (oxy.poiii2Max + oxy.poiii3Max) > 0.01 )
00809 {
00810 sprintf( chLine,
00811 " Photoionization of upper levels of [O III] reached %.1f%% of the total O++ photo rate.",
00812 (oxy.poiii2Max + oxy.poiii3Max)*100. );
00813 notein(chLine);
00814 }
00815
00816
00817 if( he.frac_he0dest_23S > 0.1 )
00818 {
00819 sprintf( chLine,
00820 " !Destruction of He 2TriS reached %.1f%% of the total He0 dest rate"
00821 " at zone %li, %.1f%% of that was photoionization.",
00822 he.frac_he0dest_23S*100,
00823 he.nzone,
00824 he.frac_he0dest_23S_photo*100. );
00825 bangin(chLine);
00826 }
00827 else if( he.frac_he0dest_23S > 0.01 )
00828 {
00829 sprintf( chLine,
00830 " Destruction of He 2TriS reached %.1f%% of the total He0 dest rate"
00831 " at zone %li, %.1f%% of that was photoionization.",
00832 he.frac_he0dest_23S*100,
00833 he.nzone,
00834 he.frac_he0dest_23S_photo*100. );
00835 notein(chLine);
00836 }
00837
00838 if( !helike.lgCritDensLMix && dense.lgElmtOn[ipHELIUM] )
00839 {
00840 sprintf( chLine,
00841 " Critical density for l-mixing of He I not reached. "
00842 " More resolved levels are needed for accurate He I line ratios.");
00843 notein(chLine);
00844 }
00845
00846 for( ipISO=ipH_LIKE; ipISO<NISO; ++ipISO )
00847 {
00848
00849 for( nelem=ipISO; nelem<LIMELM; ++nelem )
00850 {
00851 if( iso.lgLevelsLowered[ipISO][nelem] && dense.lgElmtOn[nelem] )
00852 {
00853 sprintf( chLine, " !Continuum was lowered into model %s-like %s due to high density. Max n is %li",
00854 elementnames.chElementSym[ipISO],
00855 elementnames.chElementNameShort[nelem],
00856 iso.n_HighestResolved_local[ipISO][nelem]+iso.nCollapsed_local[ipISO][nelem]);
00857 bangin(chLine);
00858 }
00859 else if( iso.lgLevelsEverLowered[ipISO][nelem] && dense.lgElmtOn[nelem] )
00860 {
00861 sprintf( chLine, " !Continuum was lowered into model %s-like %s due to high density at SOME point but NOT at the last zone.",
00862 elementnames.chElementSym[ipISO],
00863 elementnames.chElementNameShort[nelem]);
00864 bangin(chLine);
00865 }
00866 }
00867 }
00868
00869
00870 if( !rfield.lgMMok )
00871 {
00872 sprintf( chLine,
00873 " C-Continuum not defined in extreme infrared - Compton scat, grain heating, not treated properly?" );
00874 caunin(chLine);
00875 }
00876
00877 if( !rfield.lgHPhtOK )
00878 {
00879 sprintf( chLine,
00880 " C-Continuum not defined at photon energies which ionize excited states of H, important for H- and ff heating." );
00881 caunin(chLine);
00882 }
00883
00884 if( !rfield.lgXRayOK )
00885 {
00886 sprintf( chLine,
00887 " C-Continuum not defined at X-Ray energies - Compton scattering and Auger ionization wrong?" );
00888 caunin(chLine);
00889 }
00890
00891 if( !rfield.lgGamrOK )
00892 {
00893 sprintf( chLine,
00894 " C-Continuum not defined at gamma-ray energies - pair production and Compton scattering OK?" );
00895 caunin(chLine);
00896 }
00897
00898 if( continuum.lgCon0 )
00899 {
00900 sprintf( chLine, " C-Continuum zero at some energies." );
00901 caunin(chLine);
00902 }
00903
00904 if( continuum.lgCoStarInterpolationCaution )
00905 {
00906 sprintf( chLine , " C-CoStarInterpolate interpolated between non-adjoining tracks, this may not be valid." );
00907 caunin(chLine);
00908 }
00909
00910 if( rfield.lgOcc1Hi )
00911 {
00912 sprintf( chLine,
00913 " !The continuum occupation number at 1 Ryd is greater than unity." );
00914 bangin(chLine);
00915 }
00916
00917
00918 if( radius.lgDR2Big )
00919 {
00920 sprintf( chLine,
00921 " C-The thickness of the first zone was set larger than optimal by a SET DR command." );
00922 caunin(chLine);
00923 sprintf( chLine,
00924 " C-Consider using the STOP THICKNESS command instead." );
00925 caunin(chLine);
00926 }
00927
00928
00929 if( cdLine("TOTL",4363,&t4363,&absint)<=0 )
00930 {
00931 fprintf( ioQQQ, " PrtComment could not find total O III 4363 with cdLine.\n" );
00932 puts( "[Stop in PrtComment]" );
00933 ShowMe();
00934 cdEXIT(EXIT_FAILURE);
00935 }
00936
00937 if( cdLine("Coll",4363,&c4363,&absint)<=0 )
00938 {
00939 fprintf( ioQQQ, " PrtComment could not find collisional O III 4363 with cdLine.\n" );
00940 puts( "[Stop in PrtComment]" );
00941 ShowMe();
00942 cdEXIT(EXIT_FAILURE);
00943 }
00944
00945
00946 if( HBeta > 1e-35 )
00947 {
00948
00949 if( t4363/HBeta > 1e-5 && dense.gas_phase[ipHYDROGEN] < 1e8 )
00950 {
00951 ratio = (t4363 - c4363)/t4363;
00952 if( ratio > 0.01 )
00953 {
00954 sprintf( chLine,
00955 " !Non-collisional excitation of [O III] 4363 reached %.2f%% of the total.",
00956 ratio*100. );
00957 bangin(chLine);
00958 }
00959 else if( ratio > 0.001 )
00960 {
00961 sprintf( chLine,
00962 " Non-collisional excitation of [O III] 4363 reached %.2f%% of the total.",
00963 ratio*100. );
00964 notein(chLine);
00965 }
00966 }
00967 }
00968
00969
00970 if( rfield.lgPlasNu )
00971 {
00972 sprintf( chLine,
00973 " !The largest plasma frequency was %.2e Ryd = %.2e micron The continuum is set to 0 below this.",
00974 rfield.plsfrqmax,
00975
00976 RYDLAM/rfield.plsfrqmax/1e4);
00977 bangin(chLine);
00978 }
00979
00980 if( rfield.occmax > 0.1 )
00981 {
00982 if( rfield.occmnu > 1e-4 )
00983 {
00984 sprintf( chLine,
00985 " !The largest continuum occupation number was %.3e at %.3e Ryd.",
00986 rfield.occmax, rfield.occmnu );
00987 bangin(chLine);
00988 }
00989 else
00990 {
00991
00992
00993 sprintf( chLine,
00994 " The largest continuum occupation number was %.3e at %.3e Ryd.",
00995 rfield.occmax, rfield.occmnu );
00996 notein(chLine);
00997 }
00998 }
00999
01000 if( rfield.occmax > 1e4 && rfield.occ1nu > 0. )
01001 {
01002
01003 if( rfield.occ1nu < 0.0912 )
01004 {
01005 sprintf( chLine,
01006 " The continuum occupation number fell below 1 at %.3e microns.",
01007 0.0912/rfield.occ1nu );
01008 notein(chLine);
01009 }
01010 else if( rfield.occ1nu < 1. )
01011 {
01012 sprintf( chLine,
01013 " The continuum occupation number fell below 1 at %.3e Angstroms.",
01014 912./rfield.occ1nu );
01015 notein(chLine);
01016 }
01017 else
01018 {
01019 sprintf( chLine,
01020 " The continuum occupation number fell below 1 at %.3e Ryd.",
01021 rfield.occ1nu );
01022 notein(chLine);
01023 }
01024 }
01025
01026 if( rfield.tbrmax > 1e3 )
01027 {
01028 sprintf( chLine,
01029 " !The largest continuum brightness temperature was %.3eK at %.3e Ryd.",
01030 rfield.tbrmax, rfield.tbrmnu );
01031 bangin(chLine);
01032 }
01033
01034 if( rfield.tbrmax > 1e4 )
01035 {
01036
01037 if( rfield.tbr4nu < 0.0912 )
01038 {
01039 sprintf( chLine,
01040 " The continuum brightness temperature fell below 10,000K at %.3e microns.",
01041 0.0912/rfield.tbr4nu );
01042 notein(chLine);
01043 }
01044 else if( rfield.tbr4nu < 1. )
01045 {
01046 sprintf( chLine,
01047 " The continuum brightness temperature fell below 10,000K at %.3e Angstroms.",
01048 912./rfield.tbr4nu );
01049 notein(chLine);
01050 }
01051 else
01052 {
01053 sprintf( chLine,
01054 " The continuum brightness temperature fell below 10,000K at %.3e Ryd.",
01055 rfield.tbr4nu );
01056 notein(chLine);
01057 }
01058 }
01059
01060
01061 if( DoppVel.TurbVel > 0. && strcmp(dense.chDenseLaw,"CPRE") == 0 )
01062 {
01063 sprintf( chLine,
01064 " !Both constant pressure and turbulence makes no physical sense???" );
01065 bangin(chLine);
01066 }
01067
01068
01069 if( geometry.FillFac < 1. && strcmp(dense.chDenseLaw,"CPRE") == 0 )
01070 {
01071 sprintf( chLine,
01072 " !Both constant pressure and a filling factor makes no physical sense???" );
01073 bangin(chLine);
01074 }
01075
01076
01077 if( gv.lgDustOn && abund.lgAbnSolar )
01078 {
01079 sprintf( chLine,
01080 " !Grains are present, but the gas phase abundances were left at the solar default. This is not physical." );
01081 bangin(chLine);
01082 }
01083
01084
01085 if( abund.lgDepln && !gv.lgDustOn )
01086 {
01087 sprintf( chLine,
01088 " !Grains are not present, but the gas phase abundances were depleted. This is not physical." );
01089 bangin(chLine);
01090 }
01091
01092 if( gv.lgDustOn )
01093 {
01094 long nBin=0L,nFail=0L;
01095 for( nd=0; nd < gv.nBin; nd++ )
01096 {
01097 if( gv.bin[nd]->QHeatFailures > 0L )
01098 {
01099 ++nBin;
01100 nFail += gv.bin[nd]->QHeatFailures;
01101 }
01102 }
01103 if( nFail > 0 )
01104 {
01105 sprintf( chLine,
01106 " !The grain quantum heating treatment failed to converge %ld time(s) in %ld bin(s).", nFail, nBin );
01107 bangin(chLine);
01108 }
01109 }
01110
01111 #if 0
01112
01113
01115 if( gv.lgDustOn )
01116 {
01117 bool lgPAHsPresent_and_constant = false;
01118 for( nd=0; nd < gv.nBin; nd++ )
01119 {
01120 lgPAHsPresent_and_constant = lgPAHsPresent_and_constant ||
01121
01122 (gv.bin[nd]->lgPAHsInIonizedRegion );
01123 }
01124 if( lgPAHsPresent_and_constant )
01125 {
01126 sprintf( chLine,
01127 " C-PAH's were present in the ionized region, this has never been observed in H II regions." );
01128 caunin(chLine);
01129 }
01130 }
01131 #endif
01132
01133
01134 if( thermal.lgTSetOn && thermal.ConstTemp*1.0001 < phycon.TEnerDen )
01135 {
01136 sprintf( chLine,
01137 " C-The continuum energy density temperature (%g K)"
01138 " is greater than the electron temperature (%g K).",
01139 phycon.TEnerDen , thermal.ConstTemp);
01140 caunin(chLine);
01141 sprintf( chLine, " C-This is unphysical." );
01142 caunin(chLine);
01143 }
01144
01145
01146 if( !gv.lgDustOn && phycon.TEnerDen < 800. )
01147 {
01148 sprintf( chLine,
01149 " Grains were not present but might survive in this environment (energy density temperature was %.2eK)",
01150 phycon.TEnerDen );
01151 notein(chLine);
01152 }
01153
01154
01155 AgeCheck();
01156
01157
01158
01159 chkCaHeps(&totwid);
01160 if( totwid > 121. )
01161 {
01162 sprintf( chLine, " H-eps and Ca H overlap." );
01163 notein(chLine);
01164 }
01165
01166
01167 if( !phycon.lgPhysOK )
01168 {
01169 sprintf( chLine, " !A physical process has been disabled." );
01170 bangin(chLine);
01171 }
01172
01173
01174 if( dense.gas_phase[ipHYDROGEN] < 1e8 )
01175 {
01176 if( oxy.r5007Max > 0.0263f )
01177 {
01178 sprintf( chLine,
01179 " !Photoionization of upper level of [O III] 5007 reached %.2e%% of the radiative lifetime.",
01180 oxy.r5007Max*100. );
01181 bangin(chLine);
01182 }
01183 else if( oxy.r5007Max > 0.0263f/10.f )
01184 {
01185 sprintf( chLine,
01186 " Photoionization of upper level of [O III] 5007 reached %.2e%% of the radiative lifetime.",
01187 oxy.r5007Max*100. );
01188 notein(chLine);
01189 }
01190 if( oxy.r4363Max > 1.78f )
01191 {
01192 sprintf( chLine,
01193 " !Photoionization of upper level of [O III] 4363 reached %.2e%% of the radiative lifetime.",
01194 oxy.r4363Max*100. );
01195 bangin(chLine);
01196 }
01197 else if( oxy.r4363Max > 1.78f/10.f )
01198 {
01199 sprintf( chLine,
01200 " Photoionization of upper level of [O III] 4363 reached %.2e%% of the radiative lifetime.",
01201 oxy.r4363Max*100. );
01202 notein(chLine);
01203 }
01204 }
01205
01206
01207
01208 error = fabs(thermal.power-thermal.totcol)/((thermal.power + thermal.totcol)/2.);
01209 if( thermal.lgTSetOn )
01210 {
01211 if( error > 0.05 )
01212 {
01213 sprintf( chLine,
01214 " !Heating - cooling mismatch =%5.1f%%. Caused by constant temperature assumption. ",
01215 error*100. );
01216 bangin(chLine);
01217 }
01218 }
01219
01220 else
01221 {
01222 if( error > 0.05 && error < 0.2 )
01223 {
01224 sprintf( chLine, " C-Heating - cooling mismatch =%.1f%%. What\'s wrong?",
01225 error*100. );
01226 caunin(chLine);
01227 }
01228 else if( error >= 0.2 )
01229 {
01230 sprintf( chLine, " W-Heating - cooling mismatch =%.2e%%. What\'s wrong????",
01231 error*100. );
01232 warnin(chLine);
01233 }
01234 }
01235
01236
01237 if( ca.Ca2RmLya > 0.01 )
01238 {
01239 sprintf( chLine,
01240 " Photoionization of Ca+ 2D level by Ly-alpha reached %6.1f%% of the total rate out.",
01241 ca.Ca2RmLya*100. );
01242 notein(chLine);
01243 }
01244
01245
01246 if( hydro.nLyaHot > 0 )
01247 {
01248 if( hydro.TLyaMax/hydro.TeLyaMax > 1.05 )
01249 {
01250 sprintf( chLine,
01251 " !The excitation temp of Lya exceeded the electron temp, largest value was %.2eK (gas temp there was %.2eK, zone%4ld)",
01252 hydro.TLyaMax, hydro.TeLyaMax, hydro.nZTLaMax );
01253 bangin(chLine);
01254 }
01255 }
01256
01257
01258
01259
01260
01261 if( cdLine("Line",0,&SumNeg,&absint)<=0 )
01262 {
01263 fprintf( ioQQQ, " did not get sumneg cdLine\n" );
01264 puts( "[Stop in PrtComment]" );
01265 ShowMe();
01266 cdEXIT(EXIT_FAILURE);
01267 }
01268
01269
01270 if( cdLine("TotH",0,&GetHeat,&absint)<=0 )
01271 {
01272 fprintf( ioQQQ, " did not get GetHeat cdLine\n" );
01273 puts( "[Stop in PrtComment]" );
01274 ShowMe();
01275 cdEXIT(EXIT_FAILURE);
01276 }
01277
01278 if( GetHeat > 0. )
01279 {
01280 SumNeg /= GetHeat;
01281 if( SumNeg > 0.1 )
01282 {
01283 sprintf( chLine,
01284 " !Line absorption heating reached %.2f%% of the global heating.",
01285 SumNeg*100. );
01286 bangin(chLine);
01287 }
01288 else if( SumNeg > 0.01 )
01289 {
01290 sprintf( chLine,
01291 " Line absorption heating reached %.2f%% of the global heating.",
01292 SumNeg*100. );
01293 notein(chLine);
01294 }
01295 }
01296
01297
01298 if( input.lgSetNoBuffering )
01299 {
01300 sprintf( chLine,
01301 " !NO BUFFERING command was entered - this increases exec time by LARGE amounts.");
01302 bangin(chLine);
01303 }
01304
01305
01306 if( thermal.GBarMax > 0.1 )
01307 {
01308 ASSERT( thermal.ipMaxExtra > 0 );
01309 strcpy( chLbl, chLineLbl(&TauLine2[thermal.ipMaxExtra-1]) );
01310
01311 sprintf( chLine,
01312 " !G-bar cooling lines reached %.2f%% of the local cooling. Line=%.10s",
01313 thermal.GBarMax*100., chLbl );
01314 bangin(chLine);
01315 }
01316
01317 else if( thermal.GBarMax > 0.01 )
01318 {
01319 strcpy( chLbl, chLineLbl(&TauLine2[thermal.ipMaxExtra-1]) );
01320
01321 sprintf( chLine,
01322 " G-bar cooling lines reached %.2f%% of the local cooling. Line=%.10s",
01323 thermal.GBarMax*100., chLbl );
01324 notein(chLine);
01325 }
01326
01327
01328 if( hyperfine.cooling_max > 0.1 )
01329 {
01330 sprintf( chLine,
01331 " !Hyperfine structure line cooling reached %.2f%% of the local cooling.",
01332 hyperfine.cooling_max*100.);
01333 bangin(chLine);
01334 }
01335
01336 else if( hyperfine.cooling_max > 0.01 )
01337 {
01338 sprintf( chLine,
01339 " Hyperfine structure line cooling reached %.2f%% of the local cooling.",
01340 hyperfine.cooling_max*100. );
01341 notein(chLine);
01342 }
01343
01344
01345
01346 if( thermal.HeatLineMax > 0.1 )
01347 {
01348 if( thermal.levlmax == 1 )
01349 {
01350
01351
01352
01353
01354 strcpy( chLbl, chLineLbl(&TauLines[thermal.ipHeatlmax] ) );
01355 }
01356 else if( thermal.levlmax == 2 )
01357 {
01358
01359 strcpy( chLbl, chLineLbl(&TauLine2[thermal.ipHeatlmax]) );
01360 }
01361 else if( thermal.levlmax == 3 )
01362 {
01363
01364 strcpy( chLbl, chLineLbl(&C12O16Rotate[thermal.ipHeatlmax]) );
01365 }
01366 else if( thermal.levlmax == 4 )
01367 {
01368
01369 strcpy( chLbl, chLineLbl(&C13O16Rotate[thermal.ipHeatlmax]) );
01370 }
01371 else
01372 {
01373 fprintf( ioQQQ, " PrtComment has insane levlmax,=%5ld\n",
01374 thermal.levlmax );
01375 }
01376 sprintf( chLine,
01377 " !Line absorption heating reached %.2f%% of the local heating - largest by level%2ld line %.10s",
01378 thermal.HeatLineMax*100., thermal.levlmax, chLbl );
01379 bangin(chLine);
01380 }
01381
01382 else if( thermal.HeatLineMax > 0.01 )
01383 {
01384 sprintf( chLine,
01385 " Line absorption heating reached %.2f%% of the local heating.",
01386 thermal.HeatLineMax*100. );
01387 notein(chLine);
01388 }
01389
01390 if( ionbal.CompHeating_Max > 0.05 )
01391 {
01392 sprintf( chLine,
01393 " !Bound Compton heating reached %.2f%% of the local heating.",
01394 ionbal.CompHeating_Max*100. );
01395 bangin(chLine);
01396 }
01397 else if( ionbal.CompHeating_Max > 0.01 )
01398 {
01399 sprintf( chLine,
01400 " Bound Compton heating reached %.2f%% of the local heating.",
01401 ionbal.CompHeating_Max*100. );
01402 notein(chLine);
01403 }
01404
01405
01406 for( ipISO=ipH_LIKE; ipISO<NISO; ++ipISO )
01407 {
01408 for( nelem=ipISO; nelem<LIMELM; ++nelem )
01409 {
01410 if( dense.lgElmtOn[nelem] )
01411 {
01412
01413
01414
01415
01416 long int nmax = MIN2( iso.numLevels_local[ipISO][nelem] ,
01417 iso.nTopOff[ipISO][nelem]);
01418
01419 for( ipHi=1; ipHi < nmax; ++ipHi )
01420 {
01421 for( ipLo=0; ipLo < ipHi; ++ipLo )
01422 {
01423
01424 if( EmisLines[ipISO][nelem][ipHi][ipLo].TauIn < -0.1 )
01425 {
01426 sprintf( chLine,
01427 " !Some iso-structure lines mased: %s-like %s, line %li-%li had optical depth %.2e",
01428 elementnames.chElementSym[ipISO],
01429 elementnames.chElementNameShort[nelem],
01430 ipHi , ipLo ,
01431 EmisLines[ipISO][nelem][ipHi][ipLo].TauIn );
01432 bangin(chLine);
01433 }
01434 }
01435 }
01436 }
01437 }
01438 }
01439
01440 if( dense.gas_phase[ipHYDROGEN] < 1e7 )
01441 {
01442
01443 lgThick = false;
01444 tauneg = 0.;
01445 alpha = 0.;
01446
01447 for( i=3; i <= nLevel1; i++ )
01448 {
01449
01450 if( TauLines[i].EnergyWN < 10000. )
01451 {
01452 if( TauLines[i].TauIn > 1. )
01453 {
01454 lgThick = true;
01455 alpha = MAX2(alpha,(double)TauLines[i].TauIn);
01456 }
01457 else if( TauLines[i].TauIn < (float)tauneg )
01458 {
01459 tauneg = TauLines[i].TauIn;
01460 strcpy( chLbl, chLineLbl(&TauLines[i]) );
01461 }
01462 }
01463 }
01464
01465 if( lgThick )
01466 {
01467 sprintf( chLine,
01468 " !Some infrared fine structure lines are optically thick: largest tau was %.2e",
01469 alpha );
01470 bangin(chLine);
01471 }
01472
01473 if( tauneg < -0.01 )
01474 {
01475 sprintf( chLine,
01476 " !Some fine structure lines mased: line %s had optical depth %.2e",
01477 chLbl, tauneg );
01478 bangin(chLine);
01479 }
01480 }
01481
01482
01483 tauneg = 0.;
01484 alpha = 0.;
01485 for( i=1; i <= nLevel1; i++ )
01486 {
01487
01488 if( TauLines[i].EnergyWN >= 10000. )
01489 {
01490 if( TauLines[i].TauIn < (float)tauneg )
01491 {
01492 tauneg = TauLines[i].TauIn;
01493 strcpy( chLbl, chLineLbl(&TauLines[i]) );
01494 }
01495 }
01496 }
01497
01498
01499 if( tauneg < -0.01 )
01500 {
01501 sprintf( chLine,
01502 " !Some level1 lines mased: most negative ion and tau were: %s %.2e",
01503 chLbl, tauneg );
01504 bangin(chLine);
01505 }
01506
01507
01508
01509
01510 if( geometry.lgStatic && iterations.lgLastIt && (iteration == 1) &&
01511 !geometry.lgStaticNoIt)
01512 {
01513 sprintf( chLine, " C-I must iterate when SPHERE STATIC is set." );
01514 caunin(chLine);
01515 iterations.lgIterAgain = true;
01516 }
01517
01518
01519 if( punch.lgPunContinuum && iteration == 1 && iterations.lgLastIt)
01520 {
01521 sprintf( chLine, " C-I must iterate when punch continuum output is done." );
01522 caunin(chLine);
01523 iterations.lgIterAgain = true;
01524 }
01525
01527
01528 if( iso.TwoNu_induc_dn_max[ipH_LIKE][ipHYDROGEN] > 1. )
01529 {
01530 sprintf( chLine, " !Rate of induced H 2-photon emission reached %.2e s^-1",
01531 iso.TwoNu_induc_dn_max[ipH_LIKE][ipHYDROGEN] );
01532 bangin(chLine);
01533 }
01534
01535 else if( iso.TwoNu_induc_dn_max[ipH_LIKE][ipHYDROGEN] > 0.01 )
01536 {
01537 sprintf( chLine, " Rate of induced H 2-photon emission reached %.2e s^-1",
01538 iso.TwoNu_induc_dn_max[ipH_LIKE][ipHYDROGEN] );
01539 notein(chLine);
01540 }
01541
01542
01543 if( hydro.FracInd > 0.01 )
01544 {
01545 sprintf( chLine,
01546 " Induced recombination was %5.1f%% of the total for H level%3ld",
01547 hydro.FracInd*100., hydro.ndclev );
01548 notein(chLine);
01549 }
01550
01551 if( hydro.fbul > 0.01 )
01552 {
01553 sprintf( chLine,
01554 " Stimulated emission was%6.1f%% of the total for H transition%3ld -%3ld",
01555 hydro.fbul*100., hydro.nbul + 1, hydro.nbul );
01556 notein(chLine);
01557 }
01558
01559
01560
01561 if( cdLine("Fe 2",1216,&fedest,&absint)<=0 )
01562 {
01563 fprintf( ioQQQ, " Did not find Fe II Lya\n" );
01564 puts( "[Stop in PrtComment]" );
01565 ShowMe();
01566 cdEXIT(EXIT_FAILURE);
01567 }
01568
01569
01570 if( cdLine("TOTL",1216,&relhm,&absint)<=0 )
01571 {
01572 fprintf( ioQQQ, " Did not find Lya\n" );
01573 puts( "[Stop in PrtComment]" );
01574 ShowMe();
01575 cdEXIT(EXIT_FAILURE);
01576 }
01577
01578 if( relhm > 0. )
01579 {
01580 ratio = fedest/(fedest + relhm);
01581 if( ratio > 0.1 )
01582 {
01583 sprintf( chLine, " !Fe II destruction of Ly-a removed %.1f%% of the line.",
01584 ratio *100.);
01585 bangin(chLine);
01586 }
01587 else if( ratio > 0.01 )
01588 {
01589 sprintf( chLine, " Fe II destruction of Ly-a removed %.1f%% of the line.",
01590 ratio );
01591 notein(chLine);
01592 }
01593 }
01594
01595 if( cdLine("H-CT",6563,&relhm,&absint)<=0 )
01596 {
01597 fprintf( ioQQQ, " Comment did not find H-CT H-alpha\n" );
01598 puts( "[Stop in PrtComment]" );
01599 ShowMe();
01600 cdEXIT(EXIT_FAILURE);
01601 }
01602
01603 if( HBeta > 0. )
01604 {
01605 if( relhm/HBeta > 0.01 )
01606 {
01607 sprintf( chLine,
01608 " !Mutual neutralization production of H-alpha was significant." );
01609 bangin(chLine);
01610 }
01611 }
01612
01613
01614 if( hydro.lgHiPop2 )
01615 {
01616 sprintf( chLine,
01617 " The population of H n=2 reached %.2e relative to the ground state.",
01618 hydro.pop2mx );
01619 notein(chLine);
01620 }
01621
01622
01623 for( ipISO=ipH_LIKE; ipISO<=ipHE_LIKE; ++ipISO )
01624 {
01625 for( nelem=0; nelem < LIMELM; nelem++ )
01626 {
01627 if( iso.CaseBCheck[ipISO][nelem] > 1.5 )
01628 {
01629 sprintf( chLine,
01630 " Ratio of computed diffuse emission to case B reached %g for iso %li element %li",
01631 iso.CaseBCheck[ipISO][nelem] , ipISO , nelem+1 );
01632 notein(chLine);
01633 }
01634 }
01635 }
01636
01637
01638 if( thermal.thist > 1e9 )
01639 {
01640
01641
01642
01643 if( thermal.thist > 1.0001e10 )
01644 {
01645 sprintf( chLine, " W-Electrons were relativistic; High TE=%.2e",
01646 thermal.thist );
01647 warnin(chLine);
01648 }
01649 else
01650 {
01651 sprintf( chLine, " C-Electrons were mildly relativistic; High TE=%.2e",
01652 thermal.thist );
01653 caunin(chLine);
01654 }
01655 }
01656
01657
01658 rate = timesc.TimeErode*2e-26;
01659 if( rate > 1e-35 )
01660 {
01661
01662
01663
01664 ts = (1./rate)/3e7;
01665 if( ts < 1e3 )
01666 {
01667 sprintf( chLine, " !Timescale-photoerosion of Fe=%.2e yr",
01668 ts );
01669 bangin(chLine);
01670 }
01671 else if( ts < 1e9 )
01672 {
01673 sprintf( chLine, " Timescale-photoerosion of Fe=%.2e yr",
01674 ts );
01675 notein(chLine);
01676 }
01677 }
01678
01679
01680 comfrc = rfield.comtot/thermal.power;
01681 if( comfrc > 0.01 )
01682 {
01683 sprintf( chLine, " Compton heating was %5.1f%% of the total.",
01684 comfrc*100. );
01685 notein(chLine);
01686 }
01687
01688
01689 if( comfrc > 0.01 && rfield.cinrat > 0.05 )
01690 {
01691 sprintf( chLine,
01692 " !Induced Compton heating was %.2e of the total Compton heating.",
01693 rfield.cinrat );
01694 bangin(chLine);
01695 }
01696
01697
01698 if( timesc.tcmptn > 5e17 )
01699 {
01700 if( comfrc > 0.05 )
01701 {
01702 sprintf( chLine,
01703 " C-Compton cooling is significant and the equilibrium timescale (%.2e s) is longer than the Hubble time.",
01704 timesc.tcmptn );
01705 caunin(chLine);
01706 }
01707 else
01708 {
01709 sprintf( chLine,
01710 " Compton cooling equilibrium timescale (%.2e s) is longer than Hubble time.",
01711 timesc.tcmptn );
01712 notein(chLine);
01713 }
01714 }
01715
01716 if( timesc.time_therm_long > 5e17 )
01717 {
01718 sprintf( chLine,
01719 " C-Thermal equilibrium timescale, %.2e s, longer than Hubble time; this cloud is not time-steady.",
01720 timesc.time_therm_long );
01721 caunin(chLine);
01722 }
01723
01724
01725
01726
01727 if( log10(radius.depth) > colden.rjnmin )
01728 {
01729
01730 aj = pow(10.,colden.ajmmin - log10(SOLAR_MASS));
01731 if( strcmp(dense.chDenseLaw,"CPRE") == 0 )
01732 {
01733 sprintf( chLine,
01734 " C-Cloud thicker than smallest Jeans length=%8.2ecm; stability problems? (smallest Jeans mass=%8.2eMo)",
01735 pow(10.f,colden.rjnmin), aj );
01736 caunin(chLine);
01737 }
01738 else
01739 {
01740 sprintf( chLine,
01741 " Cloud thicker than smallest Jeans length=%8.2ecm; stability problems? (smallest Jeans mass=%8.2eMo)",
01742 pow(10.f,colden.rjnmin), aj );
01743 notein(chLine);
01744 }
01745 }
01746
01747
01748 for( nd=0; nd < gv.nBin; nd++ )
01749 {
01750 if( gv.bin[nd]->TeGrainMax > gv.bin[nd]->Tsublimat )
01751 {
01752 sprintf( chLine,
01753 " W-Maximum temperature of grain%-12.12s was %.2eK, above its sublimation temperature, %.2eK.",
01754 gv.bin[nd]->chDstLab, gv.bin[nd]->TeGrainMax,
01755 gv.bin[nd]->Tsublimat );
01756 warnin(chLine);
01757 }
01758 else if( gv.bin[nd]->TeGrainMax > gv.bin[nd]->Tsublimat* 0.9 )
01759 {
01760 sprintf( chLine,
01761 " C-Maximum temperature of grain%-12.12s was %.2eK, near its sublimation temperature, %.2eK.",
01762 gv.bin[nd]->chDstLab, gv.bin[nd]->TeGrainMax,
01763 gv.bin[nd]->Tsublimat );
01764 caunin(chLine);
01765 }
01766 }
01767
01768 if( gv.lgNegGrnDrg )
01769 {
01770 sprintf( chLine, " !Grain drag force <0." );
01771 bangin(chLine);
01772 }
01773
01774
01775 if( gv.GrnElecDonateMax > 0.05 )
01776 {
01777 sprintf( chLine,
01778 " !Grains donated %5.1f%% of the total electrons in some regions.",
01779 gv.GrnElecDonateMax*100. );
01780 bangin(chLine);
01781 }
01782 else if( gv.GrnElecDonateMax > 0.005 )
01783 {
01784 sprintf( chLine,
01785 " Grains donated %5.1f%% of the total electrons in some regions.",
01786 gv.GrnElecDonateMax*100. );
01787 notein(chLine);
01788 }
01789
01790
01791 if( gv.GrnElecHoldMax > 0.05 )
01792 {
01793 sprintf( chLine,
01794 " !Grains contained %5.1f%% of the total electrons in some regions.",
01795 gv.GrnElecHoldMax*100. );
01796 bangin(chLine);
01797 }
01798 else if( gv.GrnElecHoldMax > 0.005 )
01799 {
01800 sprintf( chLine,
01801 " Grains contained %5.1f%% of the total electrons in some regions.",
01802 gv.GrnElecHoldMax*100. );
01803 notein(chLine);
01804 }
01805
01806
01807 if( gv.dphmax > 0.5 )
01808 {
01809 sprintf( chLine,
01810 " !Local grain-gas photoelectric heating rate reached %5.1f%% of the total.",
01811 gv.dphmax*100. );
01812 bangin(chLine);
01813 }
01814 else if( gv.dphmax > 0.05 )
01815 {
01816 sprintf( chLine,
01817 " Local grain-gas photoelectric heating rate reached %5.1f%% of the total.",
01818 gv.dphmax*100. );
01819 notein(chLine);
01820 }
01821
01822 if( gv.TotalDustHeat/thermal.power > 0.01 )
01823 {
01824 sprintf( chLine,
01825 " Global grain photoelectric heating of gas was%5.1f%% of the total.",
01826 gv.TotalDustHeat/thermal.power*100. );
01827 notein(chLine);
01828 if( gv.TotalDustHeat/thermal.power > 0.25 )
01829 {
01830 sprintf( chLine,
01831 " !Grain photoelectric heating is VERY important." );
01832 bangin(chLine);
01833 }
01834 }
01835
01836
01837 if( gv.dclmax > 0.05 )
01838 {
01839 sprintf( chLine,
01840 " Local grain-gas cooling of gas rate reached %5.1f%% of the total.",
01841 gv.dclmax*100. );
01842 notein(chLine);
01843 }
01844
01845
01846 if( h2.renorm_max > 1.05 )
01847 {
01848 if( h2.renorm_max > 1.2 )
01849 {
01850 sprintf( chLine,
01851 " !The large H2 molecule - main chemistry network renormalization factor reached %.2f.",
01852 h2.renorm_max);
01853 bangin(chLine);
01854 }
01855 else
01856 {
01857 sprintf( chLine,
01858 " The large H2 molecule - main chemistry network renormalization factor reached %.2f.",
01859 h2.renorm_max);
01860 notein(chLine);
01861 }
01862 }
01863 if( h2.renorm_min < 0.95 )
01864 {
01865 if( h2.renorm_min < 0.8 )
01866 {
01867 sprintf( chLine,
01868 " !The large H2 molecule - main chemistry network renormalization factor reached %.2f.",
01869 h2.renorm_min);
01870 bangin(chLine);
01871 }
01872 else
01873 {
01874 sprintf( chLine,
01875 " The large H2 molecule - main chemistry network renormalization factor reached %.2f.",
01876 h2.renorm_min);
01877 notein(chLine);
01878 }
01879 }
01880
01881
01882 if( hmi.h2pmax > 0.10 )
01883 {
01884 sprintf( chLine,
01885 " !The local H2+ photodissociation heating rate reached %5.1f%% of the total heating.",
01886 hmi.h2pmax*100. );
01887 bangin(chLine);
01888 }
01889
01890 else if( hmi.h2pmax > 0.01 )
01891 {
01892 sprintf( chLine,
01893 " The local H2+ photodissociation heating rate reached %.1f%% of the total heating.",
01894 hmi.h2pmax*100. );
01895 notein(chLine);
01896 }
01897
01898
01899 if( hmi.h2dfrc > 0.1 )
01900 {
01901 sprintf( chLine,
01902 " !The local H2 photodissociation heating rate reached %.1f%% of the total heating.",
01903 hmi.h2dfrc*100. );
01904 bangin(chLine);
01905 }
01906 else if( hmi.h2dfrc > 0.01 )
01907 {
01908 sprintf( chLine,
01909 " The local H2 photodissociation heating rate reached %.1f%% of the total heating.",
01910 hmi.h2dfrc*100. );
01911 notein(chLine);
01912 }
01913
01914
01915 if( hmi.h2line_cool_frac > 0.1 )
01916 {
01917 sprintf( chLine,
01918 " !The local H2 cooling rate reached %.1f%% of the local cooling.",
01919 hmi.h2line_cool_frac*100. );
01920 bangin(chLine);
01921 }
01922 else if( hmi.h2line_cool_frac > 0.01 )
01923 {
01924 sprintf( chLine,
01925 " The local H2 cooling rate reached %.1f%% of the local cooling.",
01926 hmi.h2line_cool_frac*100. );
01927 notein(chLine);
01928 }
01929
01930 if( hmi.h2dtot/thermal.power > 0.01 )
01931 {
01932 sprintf( chLine,
01933 " Global H2 photodissociation heating of gas was %.1f%% of the total heating.",
01934 hmi.h2dtot/thermal.power*100. );
01935 notein(chLine);
01936 if( hmi.h2dtot/thermal.power > 0.25 )
01937 {
01938 sprintf( chLine, " H2 photodissociation heating is VERY important." );
01939 notein(chLine);
01940 }
01941 }
01942
01943
01944 if( co.codfrc > 0.25 )
01945 {
01946 sprintf( chLine,
01947 " !Local CO photodissociation heating rate reached %.1f%% of the total.",
01948 co.codfrc*100. );
01949 bangin(chLine);
01950 }
01951 else if( co.codfrc > 0.05 )
01952 {
01953 sprintf( chLine,
01954 " Local CO photodissociation heating rate reached %.1f%% of the total.",
01955 co.codfrc*100. );
01956 notein(chLine);
01957 }
01958
01959
01960 if( co.COCoolBigFrac >0.1 )
01961 {
01962 if( co.lgCOCoolCaped )
01963 {
01964
01965 sprintf( chLine,
01966 " C-Local CO cooling reached %.1f%% of the local cooling, but the CO molecule was too small.",
01967 co.COCoolBigFrac*100. );
01968 caunin(chLine);
01969 sprintf( chLine,
01970 " C-Increase size with ATOM CO LEVELS xxx command. There were %li levels.",
01971 nCORotate );
01972 caunin(chLine);
01973 }
01974 else
01975 {
01976
01977 sprintf( chLine,
01978 " Local CO rotation cooling reached %.1f%% of the local cooling.",
01979 co.COCoolBigFrac*100. );
01980 notein(chLine);
01981 }
01982 }
01983
01984 if( co.codtot/thermal.power > 0.01 )
01985 {
01986 sprintf( chLine,
01987 " Global CO photodissociation heating of gas was %.1f%% of the total.",
01988 co.codtot/thermal.power*100. );
01989 notein(chLine);
01990 if( co.codtot/thermal.power > 0.25 )
01991 {
01992 sprintf( chLine, " CO photodissociation heating is VERY important." );
01993 notein(chLine);
01994 }
01995 }
01996
01997 if( thermal.lgEdnGTcm )
01998 {
01999 sprintf( chLine,
02000 " Energy density of radiation field was greater than the Compton temperature. Is this physical?" );
02001 notein(chLine);
02002 }
02003
02004
02005 if( hydro.cintot/thermal.power > 0.01 )
02006 {
02007 sprintf( chLine, " Induced recombination cooling was %.1f%% of the total.",
02008 hydro.cintot/thermal.power*100. );
02009 notein(chLine);
02010 }
02011
02012
02013 if( thermal.FreeFreeTotHeat/thermal.power > 0.1 )
02014 {
02015 sprintf( chLine, " !Free-free heating was %.1f%% of the total.",
02016 thermal.FreeFreeTotHeat/thermal.power*100. );
02017 bangin(chLine);
02018 }
02019 else if( thermal.FreeFreeTotHeat/thermal.power > 0.01 )
02020 {
02021 sprintf( chLine, " Free-free heating was %.1f%% of the total.",
02022 thermal.FreeFreeTotHeat/thermal.power*100. );
02023 notein(chLine);
02024 }
02025
02026
02027 if( hmi.hmitot/thermal.power > 0.01 )
02028 {
02029 sprintf( chLine, " H- absorption heating was %.1f%% of the total.",
02030 hmi.hmitot/thermal.power*100. );
02031 notein(chLine);
02032 }
02033
02034
02035 if( co.lgH2Ozer )
02036 {
02037 sprintf( chLine, " Water destruction rate zero." );
02038 notein(chLine);
02039 }
02040
02041
02042 if( atoms.nNegOI > 0 )
02043 {
02044 sprintf( chLine, " C-O I negative level populations %ld times.",
02045 atoms.nNegOI );
02046 caunin(chLine);
02047 }
02048
02049
02050
02051 small = 0.;
02052 imas = 0;
02053 isav = 0;
02054 j = 0;
02055 for( nelem=0; nelem<LIMELM; ++nelem )
02056 {
02057 if( dense.lgElmtOn[nelem] )
02058 {
02059
02060 for( ipLo=ipH2p; ipLo < (iso.numLevels_local[ipH_LIKE][nelem] - 1); ipLo++ )
02061 {
02062
02063 for( ipHi=ipLo + 1; ipHi < iso.numLevels_local[ipH_LIKE][nelem]; ipHi++ )
02064 {
02065 if( EmisLines[ipH_LIKE][nelem][ipHi][ipLo].TauIn < (float)small )
02066 {
02067 small = EmisLines[ipH_LIKE][nelem][ipHi][ipLo].TauIn;
02068 imas = ipHi;
02069 j = ipLo;
02070 isav = nelem;
02071 }
02072 }
02073 }
02074 }
02075 }
02076
02077 if( small < -0.05 )
02078 {
02079 sprintf( chLine,
02080 " !Some hydrogenic lines mased, species was %2s%2ld, smallest tau was %.2e, transition %li-%li",
02081 elementnames.chElementSym[isav],
02082 isav+1,small, imas , j );
02083 bangin(chLine);
02084 }
02085
02086
02087 if( opac.lgOpacNeg )
02088 {
02089 sprintf( chLine, " !Some opacities were negative - the SET NEGOPC command will punch which ones." );
02090 bangin(chLine);
02091 }
02092
02093
02094 small = 0.;
02095 imas = 0;
02096 isav = 0;
02097 for( nelem=0; nelem<LIMELM; ++nelem )
02098 {
02099 if( dense.lgElmtOn[nelem] )
02100 {
02101
02102 for( i=0; i < iso.numLevels_local[ipH_LIKE][nelem]; i++ )
02103 {
02104 if( opac.TauAbsGeo[0][iso.ipIsoLevNIonCon[ipH_LIKE][nelem][i]-1] < -0.001 )
02105 {
02106 small = MIN2(small,(double)opac.TauAbsGeo[0][iso.ipIsoLevNIonCon[ipH_LIKE][nelem][i]-1]);
02107 imas = i;
02108 isav = nelem;
02109 }
02110 }
02111 }
02112 }
02113
02114 if( small < -0.05 )
02115 {
02116 sprintf( chLine, " !Some hydrogenic (%2s%2ld) continua optical depths were negative; smallest=%.2e level=%3ld",
02117 elementnames.chElementSym[isav],
02118 isav+1,
02119 small, imas );
02120 bangin(chLine);
02121 }
02122
02123
02124 nneg = 0;
02125 tauneg = 0.;
02126 freqn = 0.;
02127 for( i=0; i < rfield.nflux; i++ )
02128 {
02129 if( opac.TauAbsGeo[0][i] < -0.001 )
02130 {
02131 nneg += 1;
02132
02133 if( nneg == 1 )
02134 freqn = rfield.anu[i];
02135 tauneg = MIN2(tauneg,(double)opac.TauAbsGeo[0][i]);
02136 }
02137 }
02138
02139 if( nneg > 0 )
02140 {
02141 sprintf( chLine, " !Some continuous optical depths <0. The lowest freq was %.3e Ryd, and a total of%4ld",
02142 freqn, nneg );
02143 bangin(chLine);
02144 sprintf( chLine, " !The smallest optical depth was %.2e",
02145 tauneg );
02146 bangin(chLine);
02147 }
02148
02149
02150 if( opac.TauAbsGeo[0][iso.ipIsoLevNIonCon[ipH_LIKE][ipHYDROGEN][2]-1] > 0.05 )
02151 {
02152 sprintf( chLine, " The Balmer continuum optical depth was %.2e.",
02153 opac.TauAbsGeo[0][iso.ipIsoLevNIonCon[ipH_LIKE][ipHYDROGEN][2]-1] );
02154 notein(chLine);
02155 }
02156
02157
02158 if( opac.stimax[0] > 0.02 && opac.TauAbsGeo[0][iso.ipIsoLevNIonCon[ipH_LIKE][ipHYDROGEN][ipH1s]-1] > 0.2 )
02159 {
02160 sprintf( chLine, " The Lyman continuum stimulated emission correction to optical depths reached %.2e.",
02161 opac.stimax[0] );
02162 notein(chLine);
02163 }
02164 else if( opac.stimax[1] > 0.02 && opac.TauAbsGeo[0][iso.ipIsoLevNIonCon[ipH_LIKE][ipHYDROGEN][2]-1] > 0.1 )
02165 {
02166 sprintf( chLine, " The Balmer continuum stimulated emission correction to optical depths reached %.2e.",
02167 opac.stimax[1] );
02168 notein(chLine);
02169 }
02170
02171
02172 if( opac.TauAbsGeo[0][iso.ipIsoLevNIonCon[ipH_LIKE][ipHYDROGEN][3]-1] > 0.2 )
02173 {
02174 sprintf( chLine,
02175 " The Paschen continuum optical depth was %.2e.",
02176 opac.TauAbsGeo[0][iso.ipIsoLevNIonCon[ipH_LIKE][ipHYDROGEN][3]-1] );
02177 notein(chLine);
02178 }
02179
02180
02181 if( opac.TauAbsGeo[0][0] > 1. )
02182 {
02183 sprintf( chLine,
02184 " The continuum optical depth at the lowest energy considered (%.3e Ryd) was %.3e.",
02185 rfield.anu[0], opac.TauAbsGeo[0][0] );
02186 notein(chLine);
02187 }
02188
02189
02190
02191 if( colden.colden[ipCOL_H0]*7e-24 > 0.01 )
02192 {
02193 sprintf( chLine,
02194 " The optical depth to Rayleigh scattering at 1300A is %.2e",
02195 colden.colden[ipCOL_H0]*6.71e-24 );
02196 notein(chLine);
02197 }
02198
02199 if( colden.colden[ipCOL_H2p]*7e-18 > 0.1 )
02200 {
02201 sprintf( chLine,
02202 " !The optical depth to the H2+ molecular ion is %.2e",
02203 colden.colden[ipCOL_H2p]*7e-18 );
02204 bangin(chLine);
02205 }
02206 else if( colden.colden[ipCOL_H2p]*7e-18 > 0.01 )
02207 {
02208 sprintf( chLine,
02209 " The optical depth to the H2+ molecular ion is %.2e",
02210 colden.colden[ipCOL_H2p]*7e-18 );
02211 notein(chLine);
02212 }
02213
02214
02215 if( opac.thmin > 0.1 )
02216 {
02217 sprintf( chLine,
02218 " !Optical depth to negative hydrogen ion is %.2e",
02219 opac.thmin );
02220 bangin(chLine);
02221 }
02222 else if( opac.thmin > 0.01 )
02223 {
02224 sprintf( chLine,
02225 " Optical depth to negative hydrogen ion is %.2e",
02226 opac.thmin );
02227 notein(chLine);
02228 }
02229
02230
02231
02232
02233 if( ionbal.ifail > 0 && ionbal.ifail <= 10 )
02234 {
02235 sprintf( chLine,
02236 " 3 body recombination coefficient outside range %ld", ionbal.ifail );
02237 notein(chLine);
02238 }
02239 else if( ionbal.ifail > 10 )
02240 {
02241 sprintf( chLine,
02242 " C-3 body recombination coefficient outside range %ld", ionbal.ifail );
02243 caunin(chLine);
02244 }
02245
02246
02247 if( phycon.TEnerDen < 2.6 )
02248 {
02249 sprintf( chLine,
02250 " !Incident radiation field energy density is less than 2.7K. Add background with CMB command." );
02251 bangin(chLine);
02252 }
02253
02254
02255 if( !rfield.lgCMB_set )
02256 {
02257 sprintf( chLine,
02258 " !The CMB was not included. This is added with the CMB command." );
02259 bangin(chLine);
02260 }
02261
02262
02263 if( rfield.lgHabing )
02264 {
02265 sprintf( chLine,
02266 " !The intensity of the incident radiation field is less than 10 times the Habing diffuse ISM field. Is this OK?" );
02267 bangin(chLine);
02268 sprintf( chLine,
02269 " ! Consider adding diffuse ISM emission with TABLE ISM command." );
02270 bangin(chLine);
02271 }
02272
02273
02274
02275
02276 if( dense.lgElmtOn[ipOXYGEN] && dense.lgElmtOn[ipCARBON] )
02277 {
02278 if( dense.gas_phase[ipCARBON]/dense.gas_phase[ipOXYGEN] > 1. )
02279 {
02280 sprintf( chLine, " !The C/O abundance ratio, %.1f, is greater than unity. The chemistry will be carbon dominated.",
02281 dense.gas_phase[ipCARBON]/dense.gas_phase[ipOXYGEN] );
02282 bangin(chLine);
02283 }
02284 }
02285
02286
02287 if( hmi.BiggestH2 > 0.1 )
02288 {
02289 sprintf( chLine, " !The fraction of %s in %s reached %.1f%% at some point in the cloud.",
02290 "H ",
02291 "H2 ",
02292 hmi.BiggestH2*100. );
02293 bangin(chLine);
02294 }
02295 else if( hmi.BiggestH2>0.01 )
02296 {
02297 sprintf( chLine, " The fraction of %s in %s reached %.2f%% at some point in the cloud.",
02298 "H ",
02299 "H2 ",
02300 hmi.BiggestH2*100. );
02301 notein(chLine);
02302 }
02303 else if( hmi.BiggestH2 > 1e-3 )
02304 {
02305 sprintf( chLine, " The fraction of %s in %s reached %.3f%% at some point in the cloud.",
02306 "H ",
02307 "H2 ",
02308 hmi.BiggestH2*100. );
02309 notein(chLine);
02310 }
02311
02312 lgLots_of_moles = false;
02313 lgLotsSolids = false;
02314
02315 for( i=0; i<mole.num_comole_calc; ++i )
02316 {
02317 if( COmole[i]->n_nuclei <= 1)
02318 continue;
02319
02320 if( COmole[i]->xMoleFracMax > 0.1 )
02321 {
02322 sprintf( chLine, " !The fraction of %s in %s reached %.1f%% at some point in the cloud.",
02323 elementnames.chElementSym[COmole[i]->nelem_hevmol],
02324 COmole[i]->label,
02325 COmole[i]->xMoleFracMax*100. );
02326 bangin(chLine);
02327 lgLots_of_moles = true;
02328
02329 if( !COmole[i]->lgGas_Phase )
02330 lgLotsSolids = true;
02331 }
02332 else if( COmole[i]->xMoleFracMax>0.01 )
02333 {
02334 sprintf( chLine, " The fraction of %s in %s reached %.2f%% at some point in the cloud.",
02335 elementnames.chElementSym[COmole[i]->nelem_hevmol],
02336 COmole[i]->label,
02337 COmole[i]->xMoleFracMax*100. );
02338 notein(chLine);
02339 lgLots_of_moles = true;
02340
02341 if( !COmole[i]->lgGas_Phase )
02342 lgLotsSolids = true;
02343 }
02344 else if( COmole[i]->xMoleFracMax > 1e-3 )
02345 {
02346 sprintf( chLine, " The fraction of %s in %s reached %.3f%% at some point in the cloud.",
02347 elementnames.chElementSym[COmole[i]->nelem_hevmol],
02348 COmole[i]->label,
02349 COmole[i]->xMoleFracMax*100. );
02350 notein(chLine);
02351
02352 if( !COmole[i]->lgGas_Phase )
02353 lgLotsSolids = true;
02354 }
02355 }
02356
02357
02358 if( lgLots_of_moles )
02359 {
02360
02361 for(nelem=ipHYDROGEN; nelem<LIMELM; ++nelem )
02362 {
02363
02364 if( !dense.lgElmtOn[nelem] && mole.lgElem_in_chemistry[nelem] )
02365 {
02366
02367 sprintf( chLine,
02368 " C-Molecules are important, but %s, part of the chemistry network, is turned off.",
02369 elementnames.chElementName[nelem] );
02370 caunin(chLine);
02371 }
02372 # if 0
02373
02374 for( i=NUM_HEAVY_MOLEC+NUM_ELEMENTS; i<NUM_COMOLE_CALC; ++i )
02375 {
02376 if( nelem==COmole[i].nelem_hevmol )
02377 {
02378
02379 sprintf( chLine,
02380 " C-Molecules are important, but %s, part of the chemistry network, is turned off.",
02381 elementnames.chElementName[nelem] );
02382 caunin(chLine);
02383 }
02384 }
02385 }
02386 # endif
02387 }
02388 }
02389
02390
02391
02392 if( lgLotsSolids )
02393 {
02394 sprintf( chLine, " !A significant amount of molecules condensed onto grain surfaces." );
02395 bangin(chLine);
02396 sprintf( chLine, " !These are the molecular species with \"grn\" above." );
02397 bangin(chLine);
02398 }
02399
02400
02401 if( rfield.EnergyBremsThin > 0.09 )
02402 {
02403 sprintf( chLine, " !The cloud is optically thick at optical wavelengths, extending to %.3e Ryd =%.3eA",
02404 rfield.EnergyBremsThin, RYDLAM/rfield.EnergyBremsThin );
02405 bangin(chLine);
02406 }
02407 else if( rfield.EnergyBremsThin > 0.009 )
02408 {
02409 sprintf( chLine, " The continuum of the computed structure may be optically thick in the near infrared." );
02410 notein(chLine);
02411 }
02412
02413
02414 if( radius.Radius > 1e23 && radius.Radius/radius.rinner > 10. )
02415 {
02416 sprintf( chLine, " Is an outer radius of %.2e reasonable?",
02417 radius.Radius );
02418 notein(chLine);
02419 }
02420
02421
02422 if( rt.lgMaserCapHit )
02423 {
02424 sprintf( chLine, " Laser maser optical depths capped in RT_line_one_tauinc." );
02425 notein(chLine);
02426 }
02427
02428
02429 if( rt.lgMaserSetDR )
02430 {
02431 sprintf( chLine, " !Line maser set zone thickness in some zones." );
02432 bangin(chLine);
02433 }
02434
02435
02436
02437 if( (pressure.lgPradCap && (strcmp(dense.chDenseLaw,"CPRE") == 0)) &&
02438 pressure.lgPres_radiation_ON )
02439 {
02440 sprintf( chLine, " Radiation pressure kept below gas pressure on this iteration." );
02441 notein(chLine);
02442 }
02443
02444 if( pressure.RadBetaMax > 0.25 )
02445 {
02446 if( pressure.ipPradMax_line == 0 )
02447 {
02448 sprintf( chLine,
02449 " !The ratio of radiation to gas pressure reached %.2e at zone %li. Caused by Lyman alpha.",
02450 pressure.RadBetaMax,
02451 pressure.ipPradMax_nzone);
02452 bangin(chLine);
02453 }
02454 else
02455 {
02456 sprintf( chLine,
02457 " !The ratio of radiation to gas pressure reached %.2e at zone %li. "
02458 "Caused by line number %ld, label %s",
02459 pressure.RadBetaMax,
02460 pressure.ipPradMax_nzone,
02461 pressure.ipPradMax_line,
02462 pressure.chLineRadPres );
02463 bangin(chLine);
02464 }
02465 }
02466
02467 else if( pressure.RadBetaMax > 0.025 )
02468 {
02469 if( pressure.ipPradMax_line == 0 )
02470 {
02471 sprintf( chLine,
02472 " The ratio of radiation to gas pressure reached %.2e at zone %li. Caused by Lyman alpha.",
02473 pressure.RadBetaMax,
02474 pressure.ipPradMax_nzone);
02475 notein(chLine);
02476 }
02477 else
02478 {
02479 sprintf( chLine,
02480 " The ratio of radiation to gas pressure reached %.2e at zone %li. "
02481 "Caused by line number %ld, label %s",
02482 pressure.RadBetaMax,
02483 pressure.ipPradMax_nzone,
02484 pressure.ipPradMax_line,
02485 pressure.chLineRadPres );
02486 notein(chLine);
02487 }
02488 }
02489
02490 if( opac.telec >= 5. )
02491 {
02492 sprintf( chLine, " W-The model is optically thick to electron scattering; tau=%.2e",
02493 opac.telec );
02494 warnin(chLine);
02495 }
02496 else if( opac.telec > 2.0 )
02497 {
02498 sprintf( chLine, " C-The model is moderately optically thick to electron scattering; tau=%.1f",
02499 opac.telec );
02500 caunin(chLine);
02501 }
02502 else if( opac.telec > 0.1 )
02503 {
02504 sprintf( chLine, " !The model has modest optical depth to electron scattering; tau=%.2f",
02505 opac.telec );
02506 bangin(chLine);
02507 }
02508 else if( opac.telec > 0.01 )
02509 {
02510 sprintf( chLine, " The optical depth to electron scattering is %.3f",
02511 opac.telec );
02512 notein(chLine);
02513 }
02514
02515
02516 if( HFLines[0].TauIn > 0.5 )
02517 {
02518 sprintf( chLine, " !The optical depth in the H I 21 cm line is %.2e",HFLines[0].TauIn );
02519 bangin(chLine);
02520 }
02521
02522
02523 if( C12O16Rotate[0].TauIn > 0.5 )
02524 {
02525 sprintf( chLine, " !The optical depth in the 12CO J=1-0 line is %.2e",C12O16Rotate[0].TauIn );
02526 bangin(chLine);
02527 }
02528 if( C13O16Rotate[0].TauIn > 0.5 )
02529 {
02530 sprintf( chLine, " !The optical depth in the 13CO J=1-0 line is %.2e",C13O16Rotate[0].TauIn );
02531 bangin(chLine);
02532 }
02533
02534
02535
02536 if( nWindLine==0 )
02537 {
02538
02539 sprintf( chLine, " !The level2 lines are disabled. UV pumping of excited levels within ground terms is not treated." );
02540 bangin(chLine);
02541 }
02542
02543
02544 for( nelem=0; nelem < LIMELM; nelem++ )
02545 {
02546 if( dense.lgElmtOn[nelem] )
02547 {
02548 if( EmisLines[ipH_LIKE][nelem][3][ipH2p].TauIn > 0.2 )
02549 {
02550 differ = fabs(1.-EmisLines[ipH_LIKE][nelem][3][ipH2p].TauIn*
02551 rt.DoubleTau/EmisLines[ipH_LIKE][nelem][3][ipH2p].TauTot)*100.;
02552
02553
02554
02555
02556 if( ((iterations.lgLastIt && EmisLines[ipH_LIKE][nelem][3][ipH2p].TauIn > 0.8) &&
02557 differ > 20.) && wind.windv == 0. )
02558 {
02559 sprintf( chLine,
02560 " C-This is the last iteration and %2s%2ld Bal(a) optical depth"
02561 " changed by%6.1f%% (was %.2e). Try another iteration.",
02562 elementnames.chElementSym[nelem],
02563 nelem+1, differ,
02564 EmisLines[ipH_LIKE][nelem][3][ipH2p].TauTot );
02565 caunin(chLine);
02566 iterations.lgIterAgain = true;
02567 }
02568
02569
02570 if( EmisLines[ipH_LIKE][nelem][ipH2p][ipH1s].TauIn > 0. )
02571 {
02572 differ = fabs(1.-EmisLines[ipH_LIKE][nelem][ipH2p][ipH1s].TauIn*
02573 rt.DoubleTau/EmisLines[ipH_LIKE][nelem][ipH2p][ipH1s].TauTot)*100.;
02574
02575
02576
02577
02578 if( ((iterations.lgLastIt && EmisLines[ipH_LIKE][nelem][ipH2p][ipH1s].TauIn > 0.8) &&
02579 differ > 25.) && wind.windv == 0. )
02580 {
02581 sprintf( chLine,
02582 " C-This is the last iteration and %2s%2ld Ly(a) optical depth"
02583 " changed by%7.0f%% (was %.2e). Try another iteration.",
02584 elementnames.chElementSym[nelem],
02585 nelem+1,differ, EmisLines[ipH_LIKE][nelem][ipH2p][ipH1s].TauTot );
02586 caunin(chLine);
02587 iterations.lgIterAgain = true;
02588 }
02589 }
02590 }
02591 }
02592 }
02593
02594
02595 if( radius.Radius/radius.rinner > 2. && !geometry.lgSphere )
02596 {
02597 sprintf( chLine, " C-R(out)/R(in)=%.2e and SPHERE was not set.",
02598 radius.Radius/radius.rinner );
02599 caunin(chLine);
02600 }
02601
02602
02603 if( iterations.lgLastIt && !opac.lgCaseB )
02604 {
02605
02606
02607 if( rfield.nflux > iso.ipIsoLevNIonCon[ipH_LIKE][ipHYDROGEN][ipH1s] )
02608 {
02609 if( opac.TauAbsGeo[0][iso.ipIsoLevNIonCon[ipH_LIKE][ipHYDROGEN][ipH1s]-1] < 2. &&
02610 opac.TauAbsGeo[1][iso.ipIsoLevNIonCon[ipH_LIKE][ipHYDROGEN][ipH1s]-1] > 2. )
02611 {
02612 sprintf( chLine, " C-The H Lyman continuum is thin, and I assumed"
02613 " that it was thick. Try another iteration." );
02614 caunin(chLine);
02615 iterations.lgIterAgain = true;
02616 }
02617 }
02618
02619
02620 if( rfield.nflux > iso.ipIsoLevNIonCon[ipH_LIKE][ipHELIUM][ipH1s] && dense.lgElmtOn[ipHELIUM] )
02621 {
02622 if( (opac.TauAbsGeo[0][iso.ipIsoLevNIonCon[ipH_LIKE][ipHELIUM][ipH1s]-1] < 2. &&
02623 opac.TauAbsGeo[1][iso.ipIsoLevNIonCon[ipH_LIKE][ipHELIUM][ipH1s]-1] > 2.) )
02624 {
02625 sprintf( chLine,
02626 " C-The He II continuum is thin and I assumed that it was thick."
02627 " Try another iteration." );
02628 caunin(chLine);
02629 iterations.lgIterAgain = true;
02630 }
02631 }
02632
02633 if( rfield.nflux > iso.ipIsoLevNIonCon[ipHE_LIKE][ipHELIUM][0] && dense.lgElmtOn[ipHELIUM] )
02634 {
02635 if( (opac.TauAbsGeo[0][iso.ipIsoLevNIonCon[ipHE_LIKE][ipHELIUM][0]-1] < 2. &&
02636 opac.TauAbsGeo[1][iso.ipIsoLevNIonCon[ipHE_LIKE][ipHELIUM][0]-1] > 2.) )
02637 {
02638 sprintf( chLine,
02639 " C-The He I continuum is thin and I assumed that it was thick."
02640 " Try another iteration." );
02641 caunin(chLine);
02642 iterations.lgIterAgain = true;
02643 }
02644 }
02645 }
02646
02647
02648 if( iteration > 1 )
02649 {
02650 if( colden.colden_old[ipCOL_HTOT] <= 0. )
02651 {
02652 fprintf( ioQQQ, " colden_old is insane in PrtComment.\n" );
02653 ShowMe();
02654 puts( "[Stop in PrtComment]" );
02655 ShowMe();
02656 cdEXIT(EXIT_FAILURE);
02657 }
02658
02659 differ = fabs(1.-colden.colden[ipCOL_HTOT]/
02660 colden.colden_old[ipCOL_HTOT]);
02661
02662 if( differ > 0.1 && differ <= 0.3 )
02663 {
02664 sprintf( chLine,
02665 " The H column density changed by %.2e%% between this and previous iteration.",
02666 differ*100. );
02667 notein(chLine);
02668 }
02669
02670 else if( differ > 0.3 )
02671 {
02672 if( iterations.lgLastIt )
02673 {
02674 sprintf( chLine,
02675 " C-The H column density changed by %.2e%% and this is the last iteration. What happened?",
02676 differ*100. );
02677 caunin(chLine);
02678 }
02679 else
02680 {
02681 sprintf( chLine,
02682 " !The H column density changed by %.2e%% What happened?",
02683 differ*100. );
02684 bangin(chLine);
02685 }
02686 }
02687
02688
02689 if( (colden.colden[ipCOL_H2g]+colden.colden[ipCOL_H2s])/SDIV(colden.colden[ipCOL_HTOT]) > 1e-5 )
02690 {
02691 differ = fabs(1.-colden.colden[ipCOL_H2g]/
02692 SDIV(colden.colden_old[ipCOL_H2g]));
02693
02694 if( differ > 0.1 && differ <= 0.3 )
02695 {
02696 sprintf( chLine,
02697 " The H2 column density changed by %.2e%% between this and previous iteration.",
02698 differ*100. );
02699 notein(chLine);
02700 }
02701
02702 else if( differ > 0.3 )
02703 {
02704 if( iterations.lgLastIt )
02705 {
02706 sprintf( chLine,
02707 " C-The H2 column density changed by %.2e%% and this is the last iteration. What happened?",
02708 differ*100. );
02709 caunin(chLine);
02710 }
02711 else
02712 {
02713 sprintf( chLine,
02714 " !The H2 column density changed by %.2e%% What happened?",
02715 differ*100. );
02716 bangin(chLine);
02717 }
02718 }
02719 }
02720 }
02721
02722
02723 differ = fabs(1.-EmisLines[ipH_LIKE][ipHYDROGEN][ipH2p][ipH1s].TauIn/
02724 SDIV(EmisLines[ipH_LIKE][ipHYDROGEN][ipH2p][ipH1s].TauTot)*100.);
02725
02726 if( iterations.lgLastIt && (pressure.RadBetaMax > 0.1) &&
02727 (differ > 50.) && (pressure.ipPradMax_line == 1) && (pressure.lgPres_radiation_ON) &&
02728 wind.windv == 0. )
02729 {
02730 sprintf( chLine, " C-This is the last iteration, radiation pressure was significant, and the L-a optical depth changed by %7.2f%% (was %.2e)",
02731 differ, EmisLines[ipH_LIKE][ipHYDROGEN][ipH2p][ipH1s].TauTot );
02732 caunin(chLine);
02733 }
02734
02735
02736
02737 if( iterations.lgLastIt &&
02738 ( EmisLines[ipH_LIKE][ipHYDROGEN][ipH2p][ipH1s].TauTot * 1.02 -
02739 EmisLines[ipH_LIKE][ipHYDROGEN][ipH2p][ipH1s].TauIn ) < 0. )
02740 {
02741 sprintf( chLine, " C-The Lya optical depth scale was overrun and this is the last iteration - Tspin(21 cm) is not valid." );
02742 caunin(chLine);
02743 sprintf( chLine, " C-Another iteration is needed for Tspin(21 cm) to be valid." );
02744 caunin(chLine);
02745 }
02746
02747
02748 if( pressure.lgPradDen )
02749 {
02750 sprintf( chLine, " Line radiation pressure capped by thermalization length." );
02751 notein(chLine);
02752 }
02753
02754
02755 nline = MIN2(conv.nTeFail,10);
02756 if( conv.nTeFail != 0 )
02757 {
02758 long int _o;
02759 if( conv.failmx < 0.1 )
02760 {
02761 _o = sprintf( chLine, " There were %ld minor temperature failures. zones:",
02762 conv.nTeFail );
02763
02764
02765 for( i=0; i < nline; i++ )
02766 {
02767 _o += sprintf( chLine+_o, " %ld", conv.ifailz[i] );
02768 }
02769 notein(chLine);
02770 }
02771 else
02772 {
02773 _o = sprintf( chLine,
02774 " !There were %ld temperature failures, and some were large. The largest was %.1f%%. What happened?",
02775 conv.nTeFail, conv.failmx*100. );
02776 bangin(chLine);
02777
02778
02779
02780 _o = sprintf( chLine , " !The zones were" );
02781 for( i=0; i < nline; i++ )
02782 {
02783 _o += sprintf( chLine+_o, " %ld", conv.ifailz[i] );
02784 }
02785 bangin(chLine);
02786
02787 if( struc.testr[0] > 8e4 && phycon.te < 6e5 )
02788 {
02789 sprintf( chLine, " !I think they may have been caused by the change from hot to nebular gas phase. The physics of this is unclear." );
02790 bangin(chLine);
02791 }
02792 }
02793 }
02794
02795
02796 big_ion_jump = 0.;
02797 j = 0;
02798 for( i=1; i < nzone; i++ )
02799 {
02800 big = fabs(1.-struc.testr[i-1]/struc.testr[i]);
02801 if( big > big_ion_jump )
02802 {
02803 j = i;
02804 big_ion_jump = big;
02805 }
02806 }
02807
02808 if( big_ion_jump > 0.2 )
02809 {
02810
02811 if( j < 1 )
02812 {
02813 fprintf( ioQQQ, " j too small big jump check\n" );
02814 puts( "[Stop in PrtComment]" );
02815 ShowMe();
02816 cdEXIT(EXIT_FAILURE);
02817 }
02818
02819 if( big_ion_jump > 0.4 )
02820 {
02821 sprintf( chLine, " C-A temperature discontinuity occurred at zone %ld from %.2eK to %.2eK.",
02822 j, struc.testr[j-1], struc.testr[j] );
02823 caunin(chLine);
02824
02825
02826
02827
02828 if( struc.testr[j]>100. && struc.testr[j] < 1000. )
02829 {
02830 sprintf( chLine, " C-This was probably due to a thermal front." );
02831 caunin(chLine);
02832 }
02833 }
02834 else if( big_ion_jump > 0.2 )
02835 {
02836 sprintf( chLine, " !A temperature discontinuity occurred at zone %ld from %.2eK to %.2eK.",
02837 j, struc.testr[j-1], struc.testr[j] );
02838 bangin(chLine);
02839
02840
02841
02842
02843 if( struc.testr[j]>100. && struc.testr[j] < 1000. )
02844 {
02845 sprintf( chLine, " !This was probably due to a thermal front." );
02846 bangin(chLine);
02847 }
02848 }
02849 }
02850
02851
02852 if( fabs(conv.BigEdenError) > conv.EdenErrorAllowed )
02853 {
02854
02855 if( fabs(conv.BigEdenError) > conv.EdenErrorAllowed*20. && dense.nzEdenBad !=
02856 nzone )
02857 {
02858 sprintf( chLine, " W-The local error in the electron density reached %.1f%% at zone %ld",
02859 conv.BigEdenError*100, dense.nzEdenBad );
02860 warnin(chLine);
02861 }
02862 else if( fabs(conv.BigEdenError) > conv.EdenErrorAllowed*5. )
02863 {
02864 sprintf( chLine, " C-The local error in the electron density reached %.1f%% at zone %ld",
02865 conv.BigEdenError*100, dense.nzEdenBad );
02866 caunin(chLine);
02867 }
02868 else
02869 {
02870 sprintf( chLine, " The local error in the electron density reached %.1f%% at zone %ld",
02871 conv.BigEdenError*100, dense.nzEdenBad );
02872 notein(chLine);
02873 }
02874 }
02875
02876
02877 big_ion_jump = 0.;
02878 j = 0;
02879 for( i=1; i < (nzone - 1); i++ )
02880 {
02881 big = fabs( (struc.testr[i-1] - struc.testr[i])/struc.testr[i] );
02882 bigm = fabs( (struc.testr[i] - struc.testr[i+1])/struc.testr[i] );
02883
02884
02885 rel = ( (struc.testr[i-1] - struc.testr[i])/struc.testr[i])*
02886 ( (struc.testr[i] - struc.testr[i+1])/struc.testr[i] );
02887
02888 if( rel < 0. && MIN2( bigm , big ) > big_ion_jump )
02889 {
02890 j = i;
02891 big_ion_jump = MIN2( bigm , big );
02892 }
02893 }
02894
02895 if( big_ion_jump > 0.1 )
02896 {
02897
02898 if( j < 1 )
02899 {
02900 fprintf( ioQQQ, " j too small bigjump2 check\n" );
02901 puts( "[Stop in PrtComment]" );
02902 ShowMe();
02903 cdEXIT(EXIT_FAILURE);
02904 }
02905
02906 if( big_ion_jump > 0.3 )
02907 {
02908 sprintf( chLine,
02909 " C-A temperature oscillation occurred at zone%4ld by%5.0f%% from %.2e to %.2e to %.2e",
02910 j, big_ion_jump*100., struc.testr[j-1], struc.testr[j], struc.testr[j+1] );
02911 caunin(chLine);
02912 }
02913 else if( big_ion_jump > 0.1 )
02914 {
02915 sprintf( chLine,
02916 " !A temperature oscillation occurred at zone%4ld by%5.0f%% from %.2e to %.2e to %.2e",
02917 j, big_ion_jump*100., struc.testr[j-1], struc.testr[j], struc.testr[j+1] );
02918 bangin(chLine);
02919 }
02920 }
02921
02922
02923 if( strcmp(dense.chDenseLaw,"CDEN") == 0 )
02924 {
02925 j = 0;
02926 big_ion_jump = 0.;
02927 for( i=1; i < (nzone - 1); i++ )
02928 {
02929 big = (struc.ednstr[i-1] - struc.ednstr[i])/struc.ednstr[i];
02930 if( fabs(big) < conv.EdenErrorAllowed )
02931 big = 0.;
02932 bigm = (struc.ednstr[i] - struc.ednstr[i+1])/struc.ednstr[i];
02933 if( fabs(bigm) < conv.EdenErrorAllowed )
02934 bigm = 0.;
02935 if( big*bigm < 0. &&
02936 fabs(struc.ednstr[i-1]-struc.ednstr[i])/struc.ednstr[i] > big_ion_jump )
02937 {
02938 j = i;
02939 big_ion_jump = fabs(struc.ednstr[i-1]-struc.ednstr[i])/
02940 struc.ednstr[i];
02941 }
02942 }
02943
02944
02945
02946 if( big_ion_jump > conv.EdenErrorAllowed*3. )
02947 {
02948 if( j < 1 )
02949 {
02950 fprintf( ioQQQ, " j too small bigjump3 check\n" );
02951 puts( "[Stop in PrtComment]" );
02952 ShowMe();
02953 cdEXIT(EXIT_FAILURE);
02954 }
02955
02956 if( big_ion_jump > conv.EdenErrorAllowed*10. )
02957 {
02958 sprintf( chLine, " C-An electron density oscillation occurred at zone%4ld by%5.0f%% from %.2e to %.2e to %.2e",
02959 j, big_ion_jump*100., struc.ednstr[j-1], struc.ednstr[j],
02960 struc.ednstr[j+1] );
02961 caunin(chLine);
02962 }
02963 else if( big_ion_jump > conv.EdenErrorAllowed*3. )
02964 {
02965 sprintf( chLine, " !An electron density oscillation occurred at zone%4ld by%5.0f%% from %.2e to %.2e to %.2e",
02966 j, big_ion_jump*100., struc.ednstr[j-1], struc.ednstr[j],
02967 struc.ednstr[j+1] );
02968 bangin(chLine);
02969 }
02970 }
02971 }
02972
02973
02974
02975 prt_smooth_predictions();
02976
02977
02978
02979
02980
02981
02982
02983
02984 i = cdLine( "Unit" , 1 , &rate , &absint );
02985 ASSERT( i> 0 );
02986
02987
02988 VolComputed = LineSv[i].sumlin[0] / 1e-10;
02989
02990
02991
02992
02993
02994
02995 if( radius.Radius/radius.rinner > 1.0001 )
02996 {
02997
02998
02999
03000
03001 VolExpected = geometry.covgeo*geometry.FillFac*radius.rinner/(geometry.iEmissPower+1)*
03002 ( powi( radius.Radius/radius.rinner,geometry.iEmissPower+1 ) - 1. );
03003 }
03004 else
03005 {
03006
03007
03008 VolExpected = geometry.covgeo*geometry.FillFac*(radius.depth-DEPTH_OFFSET);
03009 }
03010
03011
03012 error = fabs(VolComputed - VolExpected)/VolExpected;
03013
03014
03015
03016 if( radius.lgCylnOn || geometry.filpow!=0. )
03017 {
03018 error = 0.;
03019 }
03020
03021
03022 if( error > 0.001 && !lgAbort )
03023 {
03024 sprintf( chLine,
03025 " W-PrtComment insanity - Line unit integration did not verify \n");
03026 warnin(chLine);
03027 fprintf( ioQQQ,
03028 " PROBLEM PrtComment insanity - Line unit integration did not verify \n");
03029 fprintf( ioQQQ,
03030 " expected, derived vols were %g %g \n",
03031 VolExpected , VolComputed );
03032 fprintf( ioQQQ,
03033 " relative difference is %g, ratio is %g.\n",error,VolComputed/VolExpected);
03034 TotalInsanity();
03035 }
03036
03037
03038
03039
03040
03041
03042
03043
03044
03045
03046
03047
03048 ConComputed = rfield.ConInterOut[rfield.nflux]/ 1e-10;
03049
03050
03051 ConComputed /= ( (1. + geometry.covrt)/2. );
03052
03053
03054 if( radius.Radius/radius.rinner < 1.001 )
03055 {
03056
03057 ConExpected = (radius.depth-DEPTH_OFFSET)*geometry.FillFac;
03058 }
03059 else
03060 {
03061
03062 ConExpected = radius.rinner*geometry.FillFac * (1. - radius.rinner/radius.Radius );
03063 }
03064
03065 ASSERT( ConExpected > 0. );
03066
03067
03068 error = fabs(ConComputed - ConExpected)/ConExpected;
03069
03070
03071
03072 if( radius.lgCylnOn || geometry.filpow!=0. )
03073 {
03074 error = 0.;
03075 }
03076
03077
03078 if( error > 0.001 && !lgAbort)
03079 {
03080 sprintf( chLine,
03081 " W-PrtComment insanity - Continuum unit integration did not verify \n");
03082 warnin(chLine);
03083 fprintf( ioQQQ," PROBLEM PrtComment insanity - Continuum unit integration did not verify \n");
03084 fprintf( ioQQQ," exact vol= %g, derived vol= %g relative difference is %g \n",
03085 ConExpected , ConComputed ,error);
03086 fprintf( ioQQQ," ConInterOut= %g, \n",
03087 rfield.ConInterOut[rfield.nflux]);
03088 TotalInsanity();
03089 }
03090
03091
03092 cdNwcns(&lgAbort_flag,&nw,&nc,&nn,&ns,&i,&j,&dum1,&dum2);
03093
03094 warnings.lgWarngs = ( nw > 0 );
03095 warnings.lgCautns = ( nc > 0 );
03096
03097 if( called.lgTalk )
03098 {
03099
03100 fprintf( ioQQQ, " %s\n", input.chTitle );
03101
03102 cdReasonGeo(ioQQQ);
03103
03104 cdWarnings(ioQQQ);
03105
03106 cdCautions(ioQQQ);
03107
03108 cdSurprises(ioQQQ);
03109
03110 cdNotes(ioQQQ);
03111 }
03112
03113
03114 if( lgPrnErr )
03115 {
03116 cdWarnings(ioPrnErr);
03117 }
03118
03119 if( trace.lgTrace )
03120 {
03121 fprintf( ioQQQ, " PrtComment returns.\n" );
03122 }
03123
03124 DEBUG_EXIT( "PrtComment()" );
03125 return;
03126 }
03127
03128
03129 static void badprt(
03130
03131 double total)
03132 {
03133
03134 # define RATIO 0.02
03135 char chInfo;
03136 long int i;
03137 float sum_coolants,
03138 sum_recom_lines;
03139
03140 DEBUG_ENTRY( "badprt()" );
03141
03142 fprintf( ioQQQ, " badprt: all entries with greater than%6.2f%% of incident continuum follow.\n",
03143 RATIO*100. );
03144
03145 fprintf( ioQQQ, " badprt: Intensities are relative to total energy radiated.\n" );
03146
03147
03148 chInfo = 'r';
03149 sum_recom_lines = (float)totlin('r');
03150 fprintf( ioQQQ,
03151 " Sum of energy in recombination lines is %.2e relative to total incident radiation is %.2e\n",
03152 sum_recom_lines,
03153 sum_recom_lines/MAX2(1e-30,total) );
03154
03155 fprintf(ioQQQ," all strong information lines \n line wl ener/total\n");
03156
03157 for( i=0; i < LineSave.nsum; i++ )
03158 {
03159 if( LineSv[i].chSumTyp == chInfo && LineSv[i].sumlin[0]/total > RATIO )
03160 {
03161 fprintf( ioQQQ, " %4.4s ", LineSv[i].chALab );
03162 prt_wl( ioQQQ, LineSv[i].wavelength );
03163 fprintf( ioQQQ, " %7.3f %c\n", LineSv[i].sumlin[0]/total, chInfo );
03164 }
03165 }
03166
03167 fprintf(ioQQQ," all strong cooling lines \n line wl ener/total\n");
03168 chInfo = 'c';
03169 sum_coolants = (float)totlin('c');
03170 fprintf( ioQQQ, " Sum of coolants (abs) = %.2e (rel)= %.2e\n",
03171 sum_coolants, sum_coolants/MAX2(1e-30,total) );
03172 for( i=0; i < LineSave.nsum; i++ )
03173 {
03174 if( LineSv[i].chSumTyp == chInfo && LineSv[i].sumlin[0]/total > RATIO )
03175 {
03176 fprintf( ioQQQ, " %4.4s ", LineSv[i].chALab );
03177 prt_wl( ioQQQ, LineSv[i].wavelength );
03178 fprintf( ioQQQ, " %7.3f %c\n", LineSv[i].sumlin[0]/total, chInfo );
03179 }
03180 }
03181
03182 fprintf(ioQQQ," all strong heating lines \n line wl ener/total\n");
03183 chInfo = 'h';
03184 fprintf( ioQQQ, " Sum of heat (abs) = %.2e (rel)= %.2e\n",
03185 thermal.power, thermal.power/MAX2(1e-30,total) );
03186 for( i=0; i < LineSave.nsum; i++ )
03187 {
03188 if( LineSv[i].chSumTyp == chInfo && LineSv[i].sumlin[0]/total > RATIO )
03189 {
03190 fprintf( ioQQQ, " %4.4s ", LineSv[i].chALab );
03191 prt_wl( ioQQQ, LineSv[i].wavelength );
03192 fprintf( ioQQQ, " %7.3f %c\n", LineSv[i].sumlin[0]/total, chInfo );
03193 }
03194 }
03195
03196 DEBUG_EXIT( "badprt()" );
03197
03198 return;
03199 }
03200
03201
03202 static void chkCaHeps(double *totwid)
03203 {
03204 double conca,
03205 conalog ,
03206 conhe;
03207
03208 DEBUG_ENTRY( "chkCaHeps()" );
03209
03210 *totwid = 0.;
03211
03212
03213 if( iso.numLevels_local[ipH_LIKE][ipHYDROGEN] > 6 )
03214 {
03215 if( TauLines[ipT3969].TauIn > 0. &&
03216 EmisLines[ipH_LIKE][ipHYDROGEN][6][2].TauIn > 0. )
03217 {
03218 conca = pow(6.1e-5* TauLines[ipT3969].TauIn,0.5);
03219 conalog = log(TauLines[ipT3969].TauIn);
03220 conalog = sqrt(MAX2(1., conalog));
03221 conca = MAX2(conalog,conca);
03222
03223 conalog = log(EmisLines[ipH_LIKE][ipHYDROGEN][6][2].TauIn);
03224 conalog = sqrt(MAX2(1.,conalog));
03225 conhe = pow(1.7e-6*EmisLines[ipH_LIKE][ipHYDROGEN][6][2].TauIn,0.5);
03226 conhe = MAX2(conalog, conhe);
03227
03228 *totwid = 10.*conhe + 1.6*conca;
03229 }
03230 }
03231
03232 DEBUG_EXIT( "chkCaHeps()" );
03233 return;
03234 }
03235
03236
03237 static void outsum(double *outtot,
03238 double *outin,
03239 double *outout)
03240 {
03241 long int i;
03242
03243 DEBUG_ENTRY( "outsum()" );
03244
03245 *outin = 0.;
03246 *outout = 0.;
03247 for( i=0; i < rfield.nflux; i++ )
03248 {
03249
03250 *outin += rfield.anu[i]*(rfield.flux[i]*EN1RYD);
03251 *outout += rfield.anu[i]*(rfield.outlin[i] + rfield.outlin_noplot[i] +rfield.ConInterOut[i])*
03252 EN1RYD;
03253 }
03254
03255 *outtot = *outin + *outout;
03256
03257 DEBUG_EXIT( "outsum()" );
03258 return;
03259 }
03260
03261
03262 static void prt_smooth_predictions(void)
03263 {
03264 long int i,
03265 nzone_oscillation,
03266 nzone_ion_jump,
03267 nzone_den_jump,
03268 nelem,
03269 ion;
03270 double BigOscillation ,
03271 big_ion_jump,
03272 big_jump,
03273 rel,
03274 big,
03275 bigm;
03276
03277 char chLine[INPUT_LINE_LENGTH];
03278
03279 DEBUG_ENTRY( "prt_smooth_predictions()" );
03280
03281
03282 nzone_oscillation = 0;
03283 nzone_ion_jump = 0;
03284
03285 for( nelem=ipHYDROGEN; nelem<LIMELM; ++nelem )
03286 {
03287 if( dense.lgElmtOn[nelem] )
03288 {
03289 for( ion=0; ion<=nelem+1; ++ion)
03290 {
03291 BigOscillation = 0.;
03292 big_ion_jump = -15.;
03293
03294 for( i=1; i < (nzone - 1-(int)lgAbort); i++ )
03295 {
03296
03297
03298 if( struc.xIonDense[nelem][ion][i-1]/struc.gas_phase[nelem][i-1]>struc.dr_ionfrac_limit &&
03299 struc.xIonDense[nelem][ion][i ]/struc.gas_phase[nelem][i ]>struc.dr_ionfrac_limit &&
03300 struc.xIonDense[nelem][ion][i+1]/struc.gas_phase[nelem][i+1]>struc.dr_ionfrac_limit )
03301 {
03302
03303
03304 big = fabs( (struc.xIonDense[nelem][ion][i-1] - struc.xIonDense[nelem][ion][i])/struc.xIonDense[nelem][ion][i] );
03305 bigm = fabs( (struc.xIonDense[nelem][ion][i] - struc.xIonDense[nelem][ion][i+1])/struc.xIonDense[nelem][ion][i] );
03306
03307
03308 rel = ( (struc.xIonDense[nelem][ion][i-1] - struc.xIonDense[nelem][ion][i] )/struc.xIonDense[nelem][ion][i])*
03309 ( (struc.xIonDense[nelem][ion][i] - struc.xIonDense[nelem][ion][i+1])/struc.xIonDense[nelem][ion][i] );
03310
03311 if( rel < 0. && MIN2( bigm , big ) > BigOscillation )
03312 {
03313 nzone_oscillation = i;
03314 BigOscillation = MIN2( bigm , big );
03315 }
03316
03317
03318
03319
03320 rel = -log10( (struc.xIonDense[nelem][ion][i]/struc.gas_phase[nelem][i]) /
03321 (struc.xIonDense[nelem][ion][i+1]/struc.gas_phase[nelem][i+1] ) );
03322
03323 if( rel > big_ion_jump )
03324 {
03325 big_ion_jump = rel;
03326 nzone_ion_jump = i;
03327 }
03328 }
03329 }
03330
03331
03332
03333 if( BigOscillation > 0.2 )
03334 {
03335
03336 if( nzone_oscillation < 1 )
03337 {
03338 fprintf( ioQQQ, " nzone_oscillation too small bigjump2 check\n" );
03339 puts( "[Stop in prt_smooth_predictions]" );
03340 ShowMe();
03341 cdEXIT(EXIT_FAILURE);
03342 }
03343 if( BigOscillation > 3. )
03344 {
03345 sprintf( chLine,
03346 " W-An ionization oscillation occurred at zone %ld, elem %.2s%2li, by %.0f%% from %.2e to %.2e to %.2e",
03347 nzone_oscillation,
03348 elementnames.chElementSym[nelem], ion+1,
03349 BigOscillation*100.,
03350 struc.xIonDense[nelem][ion][nzone_oscillation-1]/struc.gas_phase[nelem][nzone_oscillation-1],
03351 struc.xIonDense[nelem][ion][nzone_oscillation]/struc.gas_phase[nelem][nzone_oscillation],
03352 struc.xIonDense[nelem][ion][nzone_oscillation+1]/struc.gas_phase[nelem][nzone_oscillation+1] );
03353 warnin(chLine);
03354 }
03355
03356 else if( BigOscillation > 0.7 )
03357 {
03358 sprintf( chLine,
03359 " C-An ionization oscillation occurred at zone %ld, elem %.2s%2li, by %.0f%% from %.2e to %.2e to %.2e",
03360 nzone_oscillation,
03361 elementnames.chElementSym[nelem], ion+1,
03362 BigOscillation*100.,
03363 struc.xIonDense[nelem][ion][nzone_oscillation-1]/struc.gas_phase[nelem][nzone_oscillation-1],
03364 struc.xIonDense[nelem][ion][nzone_oscillation]/struc.gas_phase[nelem][nzone_oscillation],
03365 struc.xIonDense[nelem][ion][nzone_oscillation+1]/struc.gas_phase[nelem][nzone_oscillation+1] );
03366 caunin(chLine);
03367 }
03368 else if( BigOscillation > 0.2 )
03369 {
03370 sprintf( chLine,
03371 " !An ionization oscillation occurred at zone %ld, elem %.2s%2li, by %.0f%% from %.2e to %.2e to %.2e",
03372 nzone_oscillation,
03373 elementnames.chElementSym[nelem], ion+1,
03374 BigOscillation*100.,
03375 struc.xIonDense[nelem][ion][nzone_oscillation-1]/struc.gas_phase[nelem][nzone_oscillation-1],
03376 struc.xIonDense[nelem][ion][nzone_oscillation]/struc.gas_phase[nelem][nzone_oscillation],
03377 struc.xIonDense[nelem][ion][nzone_oscillation+1]/struc.gas_phase[nelem][nzone_oscillation+1] );
03378 bangin(chLine);
03379 }
03380 }
03381
03382
03383
03384 big_ion_jump = pow(10., big_ion_jump );
03385 if( big_ion_jump > 1.5 && nzone_ion_jump > 0 )
03386 {
03387 if( big_ion_jump > 10. )
03388 {
03389 sprintf( chLine,
03390 " C-An ionization jump occurred at zone %ld, elem %.2s%2li, by %.0f%% from %.2e to %.2e to %.2e",
03391 nzone_ion_jump,
03392 elementnames.chElementSym[nelem], ion+1,
03393 big_ion_jump*100.,
03394 struc.xIonDense[nelem][ion][nzone_ion_jump-1]/struc.gas_phase[nelem][nzone_ion_jump-1],
03395 struc.xIonDense[nelem][ion][nzone_ion_jump]/struc.gas_phase[nelem][nzone_ion_jump],
03396 struc.xIonDense[nelem][ion][nzone_ion_jump+1]/struc.gas_phase[nelem][nzone_ion_jump+1] );
03397 caunin(chLine);
03398 }
03399 else
03400 {
03401 sprintf( chLine,
03402 " !An ionization jump occurred at zone %ld, elem %.2s%2li, by %.0f%% from %.2e to %.2e to %.2e",
03403 nzone_ion_jump,
03404 elementnames.chElementSym[nelem], ion+1,
03405 big_ion_jump*100.,
03406 struc.xIonDense[nelem][ion][nzone_ion_jump-1]/struc.gas_phase[nelem][nzone_ion_jump-1],
03407 struc.xIonDense[nelem][ion][nzone_ion_jump]/struc.gas_phase[nelem][nzone_ion_jump],
03408 struc.xIonDense[nelem][ion][nzone_ion_jump+1]/struc.gas_phase[nelem][nzone_ion_jump+1] );
03409 bangin(chLine);
03410 }
03411 }
03412 }
03413 }
03414 }
03415
03416 big_jump = -15;
03417 nzone_den_jump = 0;
03418
03419
03420 for( i=1; i < (nzone - 1 - (int)lgAbort); i++ )
03421 {
03422
03423 rel = fabs(log10( struc.gas_phase[ipHYDROGEN][i] /
03424 struc.gas_phase[ipHYDROGEN][i+1] ) );
03425
03426 if( rel > big_jump )
03427 {
03428 big_jump = rel;
03429 nzone_den_jump = i;
03430 }
03431 }
03432
03433
03434 big_jump = pow( 10., big_jump );
03435 if( big_jump > 1.2 )
03436 {
03437 if( big_jump > 3. )
03438 {
03439 sprintf( chLine,
03440 " C-The H density jumped at by %.0f%% at zone %ld, from %.2e to %.2e to %.2e",
03441 big_jump*100.,
03442 nzone_den_jump,
03443 struc.gas_phase[ipHYDROGEN][nzone_den_jump-1],
03444 struc.gas_phase[ipHYDROGEN][nzone_den_jump],
03445 struc.gas_phase[ipHYDROGEN][nzone_den_jump+1] );
03446 caunin(chLine);
03447 }
03448 else
03449 {
03450 sprintf( chLine,
03451 " !An H density jump occurred at zone %ld, by %.0f%% from %.2e to %.2e to %.2e",
03452 nzone_den_jump,
03453 big_jump*100.,
03454 struc.gas_phase[ipHYDROGEN][nzone_den_jump-1],
03455 struc.gas_phase[ipHYDROGEN][nzone_den_jump],
03456 struc.gas_phase[ipHYDROGEN][nzone_den_jump+1] );
03457 bangin(chLine);
03458 }
03459 }
03460
03461
03462 big_jump = -15;
03463 nzone_den_jump = 0;
03464
03465
03466
03467
03468 for( i=3; i < (nzone - 2 - (int)lgAbort); i++ )
03469 {
03470
03471 rel = fabs(log10( SDIV(struc.pres_radiation_lines_curr[i]) /
03472 SDIV(0.5*(struc.pres_radiation_lines_curr[i-1]+struc.pres_radiation_lines_curr[i+1])) ) );
03473
03474 if( rel > big_jump )
03475 {
03476 big_jump = rel;
03477 nzone_den_jump = i;
03478 }
03479 }
03480
03481
03482
03483 if( pressure.RadBetaMax > 0.01 )
03484 {
03485 big_jump = pow( 10., big_jump );
03486 if( big_jump > 1.2 )
03487 {
03488
03489
03490 if( big_jump > 3. && strcmp(dense.chDenseLaw,"CPRE") == 0)
03491 {
03492 sprintf( chLine,
03493 " C-The radiation pressure jumped by %.0f%% at zone %ld, from %.2e to %.2e to %.2e",
03494 big_jump*100.,
03495 nzone_den_jump,
03496 struc.pres_radiation_lines_curr[nzone_den_jump-1],
03497 struc.pres_radiation_lines_curr[nzone_den_jump],
03498 struc.pres_radiation_lines_curr[nzone_den_jump+1] );
03499 caunin(chLine);
03500 }
03501 else
03502 {
03503 sprintf( chLine,
03504 " !The radiation pressure jumped by %.0f%% at zone %ld, from %.2e to %.2e to %.2e",
03505 big_jump*100.,
03506 nzone_den_jump,
03507 struc.pres_radiation_lines_curr[nzone_den_jump-1],
03508 struc.pres_radiation_lines_curr[nzone_den_jump],
03509 struc.pres_radiation_lines_curr[nzone_den_jump+1] );
03510 bangin(chLine);
03511 }
03512 }
03513 }
03514
03515
03516 phycon.BigJumpTe = 0.;
03517 phycon.BigJumpne = 0.;
03518 phycon.BigJumpH2 = 0.;
03519 phycon.BigJumpCO = 0.;
03520
03521 for( i=1; i < (nzone - 1 - (int)lgAbort); i++ )
03522 {
03523
03524 rel = fabs(log10( struc.testr[i] / struc.testr[i+1] ) );
03525 if( rel > phycon.BigJumpTe )
03526 {
03527 phycon.BigJumpTe = (float)rel;
03528 }
03529
03530
03531 rel = fabs(log10( struc.ednstr[i] / struc.ednstr[i+1] ) );
03532 if( rel > phycon.BigJumpne )
03533 {
03534 phycon.BigJumpne = (float)rel;
03535 }
03536
03537
03538 if( (struc.H2_molec[ipMH2g][i]+struc.H2_molec[ipMH2s][i])>SMALLFLOAT &&
03539 (struc.H2_molec[ipMH2g][i+1]+struc.H2_molec[ipMH2s][i+1]) > SMALLFLOAT
03540
03541 && (struc.H2_molec[ipMH2g][i]+struc.H2_molec[ipMH2s][i])/struc.gas_phase[ipHYDROGEN][i]>1e-3)
03542 {
03543 rel = fabs(log10( (struc.H2_molec[ipMH2g][i]+struc.H2_molec[ipMH2s][i]) /
03544 SDIV(struc.H2_molec[ipMH2g][i+1]+struc.H2_molec[ipMH2s][i+1]) ) );
03545 if( rel > phycon.BigJumpH2 )
03546 {
03547 phycon.BigJumpH2 = (float)rel;
03548 }
03549 }
03550
03551 {
03552 int ipCO = findspecies("CO")->index;
03553
03554 if( struc.CO_molec[ipCO][i]>SMALLFLOAT &&
03555 struc.CO_molec[ipCO][i+1]>SMALLFLOAT &&
03556 struc.CO_molec[ipCO][i]/SDIV(struc.gas_phase[ipCARBON][i])>1e-3 )
03557 {
03558 rel = fabs(log10( struc.CO_molec[ipCO][i] / struc.CO_molec[ipCO][i+1] ) );
03559 if( rel > phycon.BigJumpCO )
03560 {
03561 phycon.BigJumpCO = (float)rel;
03562 }
03563 }
03564 }
03565 }
03566
03567
03568 if(phycon.BigJumpTe>0. )
03569 phycon.BigJumpTe = (float)pow( 10., (double)phycon.BigJumpTe ) -1.f;
03570
03571 if(phycon.BigJumpne>0. )
03572 phycon.BigJumpne = (float)pow( 10., (double)phycon.BigJumpne )-1.f;
03573
03574 if(phycon.BigJumpH2>0. )
03575 phycon.BigJumpH2 = (float)pow( 10., (double)phycon.BigJumpH2 )-1.f;
03576
03577 if(phycon.BigJumpCO>0. )
03578 phycon.BigJumpCO = (float)pow( 10., (double)phycon.BigJumpCO )-1.f;
03579
03580
03581
03582 if( phycon.BigJumpTe > 0.3 )
03583 {
03584 sprintf( chLine,
03585 " C-The temperature varied by %.1f%% between two zones",
03586 phycon.BigJumpTe*100.);
03587 caunin(chLine);
03588 }
03589 else if( phycon.BigJumpTe > 0.1 )
03590 {
03591 sprintf( chLine,
03592 " !The temperature varied by %.1f%% between two zones",
03593 phycon.BigJumpTe*100.);
03594 bangin(chLine);
03595 }
03596
03597 if( phycon.BigJumpne > 0.3 )
03598 {
03599 sprintf( chLine,
03600 " C-The electron density varied by %.1f%% between two zones",
03601 phycon.BigJumpne*100.);
03602 caunin(chLine);
03603 }
03604 else if( phycon.BigJumpne > 0.1 )
03605 {
03606 sprintf( chLine,
03607 " !The electron density varied by %.1f%% between two zones",
03608 phycon.BigJumpne*100.);
03609 bangin(chLine);
03610 }
03611
03612 if( phycon.BigJumpH2 > 0.8 )
03613 {
03614 sprintf( chLine,
03615 " C-The H2 density varied by %.1f%% between two zones",
03616 phycon.BigJumpH2*100.);
03617 caunin(chLine);
03618 }
03619 else if( phycon.BigJumpH2 > 0.1 )
03620 {
03621 sprintf( chLine,
03622 " !The H2 density varied by %.1f%% between two zones",
03623 phycon.BigJumpH2*100.);
03624 bangin(chLine);
03625 }
03626
03627 if( phycon.BigJumpCO > 0.8 )
03628 {
03629 sprintf( chLine,
03630 " C-The CO density varied by %.1f%% between two zones",
03631 phycon.BigJumpCO*100.);
03632 caunin(chLine);
03633 }
03634 else if( phycon.BigJumpCO > 0.2 )
03635 {
03636 sprintf( chLine,
03637 " !The CO density varied by %.1f%% between two zones",
03638 phycon.BigJumpCO*100.);
03639 bangin(chLine);
03640 }
03641
03642 DEBUG_EXIT( "prt_smooth_predictions()" );
03643 return;
03644 }