56 long int *ipSortLines;
57 double *xLog_line_lumin;
137 fprintf(
ioQQQ,
"\f\n");
138 fprintf(
ioQQQ,
"%23c",
' ' );
140 int repeat = (72-len)/2;
141 for( i=0; i < repeat; ++i )
142 fprintf(
ioQQQ,
"*" );
144 for( i=0; i < 72-repeat-len; ++i )
145 fprintf(
ioQQQ,
"*" );
146 fprintf(
ioQQQ,
"\n" );
176 " *********************************> Log(U):%6.2f <*********************************\n",
182 "\n This is a beta test version of the code, and is intended for testing only.\n\n" );
187 fprintf(
ioQQQ,
" \n" );
188 fprintf(
ioQQQ,
" >>>>>>>>>> Warning!\n" );
189 fprintf(
ioQQQ,
" >>>>>>>>>> Warning!\n" );
190 fprintf(
ioQQQ,
" >>>>>>>>>> Warning! Warnings exist, this calculation has serious problems.\n" );
191 fprintf(
ioQQQ,
" >>>>>>>>>> Warning!\n" );
192 fprintf(
ioQQQ,
" >>>>>>>>>> Warning!\n" );
193 fprintf(
ioQQQ,
" \n" );
198 " >>>>>>>>>> Cautions are present.\n" );
204 " >>>>>>>>>> The calculation stopped for unintended reasons.\n" );
210 " >>>>>>>>>> Another iteration is needed.\n" );
216 strcpy( chGeo,
"Closed" );
220 strcpy( chGeo,
" Open" );
226 strcpy( chPlaw,
" Constant Pressure " );
231 strcpy( chPlaw,
" Constant Density " );
237 strcpy( chPlaw,
" Power Law Density " );
242 strcpy( chPlaw,
" Rapid Fluctuations " );
247 strcpy( chPlaw,
" Special Density Lw " );
252 strcpy( chPlaw,
" Hydrostatic Equlib " );
257 strcpy( chPlaw,
" Radia Driven Wind " );
262 strcpy( chPlaw,
" Globule " );
267 strcpy( chPlaw,
" UNRECOGNIZED CPRES " );
271 "\n Emission Line Spectrum. %20.20sModel. %6.6s geometry. Iteration %ld of %ld.\n",
279 " Flux observed at the Earth (erg/s/cm^2)\n" );
285 " Surface brightness (erg/s/cm^2/" );
288 fprintf(
ioQQQ,
"sr)\n");
292 fprintf(
ioQQQ,
"srcsec^2)\n");
302 " Luminosity (erg/s) emitted by partial cylinder.\n" );
308 " Luminosity (erg/s) emitted by shell with full coverage.\n" );
314 " Luminosity (erg/s) emitted by shell with a covering factor of%6.1f%%.\n",
321 fprintf(
ioQQQ,
" Intensity (erg/s/cm^2)\n" );
325 fprintf(
ioQQQ,
" %c\n",
' ' );
336 realnum wlh[
NWLH] = {6563.e0f, 4861.e0f, 4340.e0f, 4102.e0f, 1.875e4f, 1.282e4f,
337 1.094e4f, 1.005e4f, 2.625e4f, 2.166e4f, 1.945e4f, 7.458e4f,
338 4.653e4f, 3.740e4f, 4.051e4f, 7.458e4f, 3.296e4f, 1216.e0f,
339 1026.e0f, 972.5e0f, 949.7e0f };
347 if( (strcmp(
LineSv[i].chALab,
"Ca B" )==0) ||
348 (strcmp(
LineSv[i].chALab,
"Ca A" )==0) )
355 for( j=0; j<
NWLH; ++j )
357 if( fabs(
LineSv[i].wavelength-wlh[j] ) <= errorwave )
372 realnum wlhe[
NWLHE] = {1640.e0f, 1215.e0f, 1085.e0f, 1025.e0f, 4686.e0f, 3203.e0f,
373 2733.e0f, 2511.e0f, 1.012e4f, 6560.e0f, 5412.e0f, 4860.e0f,
374 1.864e4f, 1.163e4f, 9345.e0f, 8237.e0f, 303.8e0f, 256.3e0f,
378 if( (strcmp(
LineSv[i].chALab,
"Ca B" )==0) ||
379 (strcmp(
LineSv[i].chALab,
"Ca A" )==0) )
386 for( j=0; j<
NWLHE; ++j )
388 if( fabs(
LineSv[i].wavelength-wlhe[j] ) <= errorwave )
405 if(
cdLine(
"TOTL",4861.,&hbeta,&absint)<=0 )
410 fprintf(
ioQQQ,
" PrtFinal could not find TOTL 4861 with cdLine.\n" );
419 if(
cdLine(
"He 1",5875.61f,&he5876,&absint)<=0 )
425 fprintf(
ioQQQ,
" PrtFinal could not find He 1 5876 with cdLine.\n" );
432 if(
cdLine(
"He 2",4686.01f,&he4686,&absint)<=0 )
439 fprintf(
ioQQQ,
" PrtFinal could not find He 2 4686 with cdLine.\n" );
453 heabun = (he4686*0.078 + he5876*0.739)/hbeta;
471 if(
cdLine(
"O 3",5007.,&o5007,&absint)<=0 )
476 fprintf(
ioQQQ,
" PrtFinal could not find O 3 5007 with cdLine.\n" );
481 if(
cdLine(
"TOTL",4363.,&o4363,&absint)<=0 )
486 fprintf(
ioQQQ,
" PrtFinal could not find TOTL 4363 with cdLine.\n" );
492 if( (o4363 != 0.) && (o5007 != 0.) )
534 if(
cdLine(
"Bac ",3646.,&bacobs,&absint)<=0 )
536 fprintf(
ioQQQ,
" PrtFinal could not find Bac 3546 with cdLine.\n" );
571 tel = -4.827969400906710 + x*(33.08493347410885 + x*(-56.08886262205931 +
572 x*(52.44759454803217 + x*(-25.07958990094209 + x*(4.815046760060006)))));
574 if( tel > 1. && tel < 5. )
590 if(
cdLine(
"thin",3646.,&bacthn,&absint)<=0 )
592 fprintf(
ioQQQ,
" PrtFinal could not find thin 3646 with cdLine.\n" );
597 if(
cdLine(
"Ca B",4861.36f,&hbcab,&absint)<=0 )
599 fprintf(
ioQQQ,
" PrtFinal could not find Ca B 4861 with cdLine.\n" );
632 x = 1.e0/log10(bacthn);
633 tel = -4.827969400906710 + x*(33.08493347410885 + x*(-56.08886262205931 +
634 x*(52.44759454803217 + x*(-25.07958990094209 + x*(4.815046760060006)))));
636 if( tel > 1. && tel < 5. )
697 chSLab[i] = (
char*)
MALLOC(5*
sizeof(
char));
704 for( ipEmType=0; ipEmType<2; ++ipEmType )
713 fprintf(
ioQQQ,
"\n\n >>PROBLEM Normalization line has small or zero intensity, its value was %.2e and its intensity was set to 1."
714 "\n >>Please consider using another normalization line (this is set with the NORMALIZE command).\n" , snorm);
715 fprintf(
ioQQQ,
" >>The relative intensities will be meaningless, and many lines may appear too faint.\n" );
733 if(
LineSv[i].sumlin[ipEmType] > 0. )
739 xLog_line_lumin[i] = -38.;
747 if( strcmp(
LineSv[i].chALab,
"Unit") == 0 )
770 ( (strcmp(
LineSv[i].chALab,
"nFnu") == 0) || (strcmp(
LineSv[i].chALab,
"nInu") == 0) ) )
784 for(i=0; i< 32; i++ )
786 ipNegIntensity[i] = LONG_MAX;
795 const char chIntensityType[2][10]={
"Intrinsic" ,
" Emergent"};
796 ASSERT( ipEmType==0 || ipEmType==1 );
799 fprintf(
ioQQQ,
"\n" );
801 fprintf(
ioQQQ,
" " );
802 fprintf(
ioQQQ,
"%s" , chIntensityType[ipEmType] );
803 fprintf(
ioQQQ,
" line intensities\n" );
823 sclsav[iprnt] = scaled[i];
828 strcpy( chSLab[iprnt],
LineSv[i].chALab );
835 ipNegIntensity[nNegIntenLines] = i;
836 nNegIntenLines =
MIN2(32,nNegIntenLines+1);
842 strcpy( chSLab[iprnt],
LineSv[i].chALab );
843 xLog_line_lumin[iprnt] = 0.;
858 if( strcmp(
LineSv[i].chALab,
"####" ) == 0 )
860 strcpy( chSLab[i],
LineSv[i].chALab );
861 xLog_line_lumin[i] = 0.;
868 sclsav[i] = scaled[i];
870 strcpy( chSLab[i],
LineSv[i].chALab );
875 ipNegIntensity[nNegIntenLines] = i;
876 nNegIntenLines =
MIN2(32,nNegIntenLines+1);
896 for( i=0; i<iprnt; ++i )
902 sclsav[j] = sclsav[i];
903 chSTyp[j] = chSTyp[i];
904 strcpy( chSLab[j], chSLab[i] );
905 wavelength[j] = wavelength[i];
908 xLog_line_lumin[j] = xLog_line_lumin[i];
948 for( i=0; i<iprnt; ++i )
963 nline = (iprnt + 2)/3;
969 nline = (iprnt + 3)/4;
979 for( i=0; i < nline; i++ )
981 fprintf(
ioQQQ,
" " );
985 for( j=i; j<iprnt; j = j + nline)
988 long ipLin = ipSortLines[j];
991 if( strcmp( chSLab[ipLin],
"####" ) == 0 )
1001 fprintf(
ioQQQ,
"%4.4s ",chSLab[ipLin] );
1010 fprintf(
ioQQQ,
" %7.3f", xLog_line_lumin[ipLin] );
1015 fprintf(
ioQQQ,
" %.2e ", xLog_line_lumin[ipLin] );
1021 if( sclsav[ipLin] < 9999.5 )
1023 fprintf(
ioQQQ,
"%9.4f",sclsav[ipLin] );
1025 else if( sclsav[ipLin] < 99999.5 )
1027 fprintf(
ioQQQ,
"%9.3f",sclsav[ipLin] );
1029 else if( sclsav[ipLin] < 999999.5 )
1031 fprintf(
ioQQQ,
"%9.2f",sclsav[ipLin] );
1033 else if( sclsav[ipLin] < 9999999.5 )
1035 fprintf(
ioQQQ,
"%9.1f",sclsav[ipLin] );
1039 fprintf(
ioQQQ,
"*********" );
1043 fprintf(
ioQQQ,
" " );
1047 fprintf(
ioQQQ,
" \n" );
1050 if( nNegIntenLines > 0 )
1052 fprintf(
ioQQQ,
" Lines with negative intensities - Linear intensities relative to normalize line.\n" );
1053 fprintf(
ioQQQ,
" " );
1055 for( i=0; i < nNegIntenLines; ++i )
1057 fprintf(
ioQQQ,
"%ld %s %.0f %.1e, ",
1059 LineSv[ipNegIntensity[i]].chALab,
1060 LineSv[ipNegIntensity[i]].wavelength,
1061 scaled[ipNegIntensity[i]] );
1063 fprintf(
ioQQQ,
"\n" );
1074 ipNegIntensity[j] = i;
1083 fprintf(
ioQQQ,
" Cooling: " );
1084 for( i=0; i < j; i++ )
1086 fprintf(
ioQQQ,
" %4.4s ",
1087 LineSv[ipNegIntensity[i]].chALab);
1091 fprintf(
ioQQQ,
":%5.3f",
1094 fprintf(
ioQQQ,
" \n" );
1104 ipNegIntensity[j] = i;
1112 fprintf(
ioQQQ,
" Heating: " );
1113 for( i=0; i < j; i++ )
1115 fprintf(
ioQQQ,
" %4.4s ",
1116 LineSv[ipNegIntensity[i]].chALab);
1120 fprintf(
ioQQQ,
":%5.3f",
1123 fprintf(
ioQQQ,
" \n" );
1216 "\n IONIZE PARMET: U(1-)%8.4f U(4-):%8.4f U(sp):%6.2f "
1217 "Q(ion): %7.3f L(ion)%7.3f Q(low):%7.3f L(low)%7.3f\n",
1218 uhl, uhel, usp, qion, pion, qlow, plow );
1261 " ENERGY BUDGET: Heat:%8.3f Coolg:%8.3f Error:%5.1f%% Rec Lin:%8.3f F-F H%7.3f P(rad/tot)max ",
1268 fprintf(
ioQQQ,
"\n");
1281 fprintf(
ioQQQ,
"\n Col(Heff): ");
1283 fprintf(
ioQQQ,
" snd travl time ");
1285 fprintf(
ioQQQ,
" sec Te-low: ");
1287 fprintf(
ioQQQ,
" Te-hi: ");
1292 fprintf(
ioQQQ,
" G0TH85: ");
1296 fprintf(
ioQQQ,
" G0DB96:");
1299 fprintf(
ioQQQ,
"\n");
1301 fprintf(
ioQQQ,
" Emiss Measure n(e)n(p) dl ");
1303 fprintf(
ioQQQ,
" n(e)n(He+)dl ");
1305 fprintf(
ioQQQ,
" En(e)n(He++) dl ");
1307 fprintf(
ioQQQ,
" ne nC+:");
1309 fprintf(
ioQQQ,
"\n");
1322 fprintf(
ioQQQ,
" He/Ha:");
1326 fprintf(
ioQQQ,
" =%7.2f*true Lthin:",hescal);
1349 fprintf(
ioQQQ,
" itr/zn:%5.2f",znit);
1355 fprintf(
ioQQQ,
" File Opacity: F" );
1362 fprintf(
ioQQQ,
" Mass tot %.3f",
1365 fprintf(
ioQQQ,
"\n");
1370 if(
cdTemp(
"opti",0,&THI,
"volume" ) )
1372 fprintf(
ioQQQ,
"\n>>>>>>>>>>>>>>>>> PrtFinal, impossible problem getting 21cm opt.\n");
1375 fprintf(
ioQQQ,
" Temps(21 cm) T(21cm/Ly a) ");
1382 if(
cdTemp(
"21cm",0,&THI,
"radius" ) )
1384 fprintf(
ioQQQ,
"\n>>>>>>>>>>>>>>>>> PrtFinal, impossible problem getting 21cm temp.\n");
1387 fprintf(
ioQQQ,
" T(<nH/Tkin>) ");
1392 if(
cdTemp(
"spin",0,&THI,
"radius" ) )
1394 fprintf(
ioQQQ,
"\n>>>>>>>>>>>>>>>>> PrtFinal, impossible problem getting 21cm spin.\n");
1397 fprintf(
ioQQQ,
" T(<nH/Tspin>) ");
1402 fprintf(
ioQQQ,
" TB21cm:");
1406 if(
cdTemp(
"spin",0,&THI,
"volume" ) )
1408 fprintf(
ioQQQ,
"\n>>>>>>>>>>>>>>>>> PrtFinal, impossible problem getting spin temp.\n");
1411 fprintf(
ioQQQ,
"\n <Tspin> ");
1413 fprintf(
ioQQQ,
" N(H0/Tspin) ");
1415 fprintf(
ioQQQ,
" N(OH/Tkin) ");
1420 fprintf(
ioQQQ,
" B(21cm):");
1424 fprintf(
ioQQQ,
"\n");
1455 fprintf(
ioQQQ,
" <a>:");
1457 fprintf(
ioQQQ,
" erdeFe");
1459 fprintf(
ioQQQ,
" Tcompt");
1461 fprintf(
ioQQQ,
" Tthr");
1463 fprintf(
ioQQQ,
" <Tden>: ");
1465 fprintf(
ioQQQ,
" <dens>:");
1467 fprintf(
ioQQQ,
" <MolWgt>");
1469 fprintf(
ioQQQ,
"\n");
1485 rjeans = (double)pow(10.,rjeans);
1491 ajmass = pow(10.,ajmass);
1508 ajmin = pow(10.,ajmin);
1530 if( bottom > 1e-30 && top > 1e-30 )
1532 ratio = log10(top) - log10(bottom);
1533 if( ratio < 36. && ratio > -36. )
1535 ratio = pow(10.,ratio);
1552 alfox = log(ratio)/log(freq_ratio);
1575 fprintf(
ioQQQ,
" Mean Jeans l(cm)");
1577 fprintf(
ioQQQ,
" M(sun)");
1579 fprintf(
ioQQQ,
" smallest: len(cm):");
1581 fprintf(
ioQQQ,
" M(sun):");
1583 fprintf(
ioQQQ,
" a_ox tran:%6.2f\n" , alfox);
1599 " Hatom level%3ld HatomType:%4.4s HInducImp %2c"
1600 " He tot level:%3ld He2 level: %3ld ExecTime%8.1f\n",
1613 " ConvrgError(%%) <eden>%7.3f MaxEden%7.3f <H-C>%7.2f Max(H-C)%8.2f <Press>%8.3f MaxPrs er%7.3f\n",
1622 " Continuity(%%) chng Te%6.1f elec den%6.1f n(H2)%7.1f n(CO) %7.1f\n",
1629 aver(
"prin",0.,0.,
" ");
1635 fprintf(
ioQQQ,
" \n" );
1638 fprintf(
ioQQQ,
" Peimbert T(OIIIr)");
1642 fprintf(
ioQQQ,
" T(Bac)");
1646 fprintf(
ioQQQ,
" T(Hth)");
1650 fprintf(
ioQQQ,
" t2(Hstrc)");
1654 fprintf(
ioQQQ,
" T(O3-BAC)");
1658 fprintf(
ioQQQ,
" t2(O3-BC)");
1662 fprintf(
ioQQQ,
" t2(O3str)");
1665 fprintf(
ioQQQ,
"\n");
1669 fprintf(
ioQQQ,
" Be careful: grains exist. This spectrum was not corrected for reddening before analysis.\n" );
1681 double total_dust2gas = 0.;
1683 fprintf(
ioQQQ,
"\n Average Grain Properties (over radius):\n" );
1685 for( i0=0; i0 <
gv.
nBin; i0 += 10 )
1688 fprintf(
ioQQQ,
"\n" );
1693 fprintf(
ioQQQ,
" " );
1694 for( nd=i0; nd < i1; nd++ )
1699 fprintf(
ioQQQ,
"\n" );
1701 fprintf(
ioQQQ,
" nd:" );
1702 for( nd=i0; nd < i1; nd++ )
1704 if( nd != i0 ) fprintf(
ioQQQ,
" " );
1705 fprintf(
ioQQQ,
"%7ld ", nd );
1707 fprintf(
ioQQQ,
"\n" );
1709 fprintf(
ioQQQ,
" <Tgr>:" );
1710 for( nd=i0; nd < i1; nd++ )
1712 if( nd != i0 ) fprintf(
ioQQQ,
" " );
1715 fprintf(
ioQQQ,
"\n" );
1717 fprintf(
ioQQQ,
" <Vel>:" );
1718 for( nd=i0; nd < i1; nd++ )
1720 if( nd != i0 ) fprintf(
ioQQQ,
" " );
1723 fprintf(
ioQQQ,
"\n" );
1725 fprintf(
ioQQQ,
" <Pot>:" );
1726 for( nd=i0; nd < i1; nd++ )
1728 if( nd != i0 ) fprintf(
ioQQQ,
" " );
1731 fprintf(
ioQQQ,
"\n" );
1733 fprintf(
ioQQQ,
" <D/G>:" );
1734 for( nd=i0; nd < i1; nd++ )
1736 if( nd != i0 ) fprintf(
ioQQQ,
" " );
1741 fprintf(
ioQQQ,
"\n" );
1744 fprintf(
ioQQQ,
" Dust to gas ratio (by mass):");
1754 fprintf(
ioQQQ,
", A(V)/N(H)(pnt):%.3e, (ext):%.3e",
1759 fprintf(
ioQQQ,
", R:");
1764 fprintf(
ioQQQ,
"%.3e", AV/(AB-AV) );
1768 fprintf(
ioQQQ,
"%.3e", 0. );
1770 fprintf(
ioQQQ,
" AV(ext):%.3e (pnt):%.3e\n",
1777 free( ipSortLines );
1790 free( xLog_line_lumin );
1836 fprintf(
ioQQQ,
" Too many comments have been entered into line array; increase the value of NHOLDCOMMENTS.\n" );
1846 for( i=0; i<
NWIDTH-n-1-6; ++i )
1853 for( i=0; i<6; ++i )
1880 for( i=0; i <
nzone; i++ )
1900 for( i=0; i <
nzone; i++ )
1926 for( i=0; i <
nzone; i++ )
1947 for( i=0; i <
nzone; i++ )