77 const char *chFunction);
198 if( strcmp(chTime,
"LAST") != 0 )
216 if( strcmp(chTime,
"LAST") != 0 )
219 "%.5e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\n",
252 if( strcmp(chTime,
"LAST") != 0 )
254 fprintf(
punch.
ipPnunit[ipPun],
"%.5e\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\n",
272 if( strcmp(chTime,
"LAST") == 0 )
286 fprintf(
ioQQQ,
" PunchDo does not recognize flag %4.4s set for AGN punch. This is impossible.\n",
296 if( strcmp(chTime,
"LAST") == 0 )
305 if( strcmp(chTime,
"LAST") == 0 )
314 if( strcmp(chTime,
"LAST") == 0 )
324 if( strcmp(chTime,
"LAST") != 0 )
331 if( strcmp(chTime,
"LAST") != 0 )
337 if( strcmp(chTime,
"LAST") != 0 )
339 "%.5e\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\n",
353 if( strcmp(chTime,
"LAST") == 0 )
362 if( strcmp(chTime,
"LAST") == 0 )
372 if( strcmp(chTime,
"LAST") != 0 )
390 bool lgPrintThis =
false;
394 if( strcmp(chTime,
"LAST") != 0 )
418 if( strcmp(chTime,
"LAST") == 0 )
458 flxtrn = conem + flxatt;
490 if( strcmp(chTime,
"LAST") == 0 )
500 if( strcmp(chTime,
"LAST") == 0 )
517 if( strcmp(chTime,
"LAST") == 0 )
546 if( strcmp(chTime,
"LAST") == 0 )
550 fprintf(
punch.
ipPnunit[ipPun],
" Reflected continuum not predicted when SPHERE is set.\n" );
552 "\n\n>>>>>>>>>>>>>\n Reflected continuum not predicted when SPHERE is set.\n" );
574 fprintf(
punch.
ipPnunit[ipPun],
"%.5e\t%.4e\t%.4e\t%.4e\t%.4e\t%.4s\n",
584 if( strcmp(chTime,
"LAST") != 0 )
587 "%.5e\t%li\t%.4e\t%.4e\t%.4f\t%.4e\t%.4e\t%.3f\t%.4e\t%.4e\t%.4f\n",
607 if( strcmp(chTime,
"LAST") != 0 )
622 if( strcmp(chTime,
"LAST") == 0 )
640 if( strcmp(chTime,
"LAST") == 0 )
658 fprintf(
punch.
ipPnunit[ipPun],
"%.5e\t%.3e\t%.3e\t%.3e\t%4.4s\t%4.4s\n",
673 if( strcmp(chTime,
"LAST") == 0 )
696 for( jj=1; jj<nskip; ++jj )
706 }
while( j < nu_hi );
717 if( strcmp(chTime,
"LAST") != 0 )
747 fprintf(
punch.
ipPnunit[ipPun],
"%10.2e%10.2e%10.2e%10.2e%10.2e\n",
748 fref, fout, fsum, sum, flxin );
758 if( (
punch.
punarg[ipPun][2]>0) || (strcmp(chTime,
"LAST") == 0) )
825 "%li\t%.5e\t%.2e\t%.2e\t%.2f\t%.2f\t%.2f\t%.2f\t%.2f\t%.2e\t%.2e\t%.4s\t%.4s\n",
845 " punchdo, the PUNCH IONIZING CONTINUUM command "
846 "did not find a strong point, sum and fsum were %.2e %.2e\n",
849 " punchdo, the low-frequency energy was %.5e Ryd\n",
852 " You can reset the threshold for the lowest fractional "
853 "interaction to print with the second number of the punch command\n"
854 " The fraction was %.3f and this was too large.\n",
866 if( strcmp(chTime,
"LAST") == 0 )
872 "%.5e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%4.4s\t%4.4s\t",
897 if( strcmp(chTime,
"LAST") == 0 )
918 if( strcmp(chTime,
"LAST") == 0 )
923 fprintf(
punch.
ipPnunit[ipPun],
"%11.5e%10.2e%10.2e%10.2e%10.2e\n",
942 if( strcmp(chTime,
"LAST") == 0 )
972 flxtrn = conem + flxatt;
987 if( strcmp(chTime,
"LAST") == 0 )
1003 if( strcmp(chTime,
"LAST") != 0 )
1019 if( strcmp(chTime,
"LAST") == 0 )
1025 "%.5e\t%.2e\t%.2e\t%.2e\t",
1037 for( nd=0; nd <
gv.
nBin; nd++ )
1054 bool lgDGRatio = ( strcmp(
punch.
chPunch[ipPun],
"DUSD") == 0 );
1057 if( strcmp(chTime,
"LAST") != 0 )
1060 static bool lgMustPrtHeaderDRRatio =
true,
1061 lgMustPrtHeaderAbundance=
true;
1063 if( ( lgMustPrtHeaderDRRatio && lgDGRatio ) ||
1064 ( lgMustPrtHeaderAbundance && !lgDGRatio ) )
1068 if( lgMustPrtHeaderDRRatio && lgDGRatio )
1069 lgMustPrtHeaderDRRatio =
false;
1070 else if( lgMustPrtHeaderAbundance &&!lgDGRatio )
1071 lgMustPrtHeaderAbundance =
false;
1074 for( nd=0; nd <
gv.
nBin; ++nd )
1080 for( nd=0; nd <
gv.
nBin; ++nd )
1088 for( nd=0; nd <
gv.
nBin; ++nd )
1104 if( strcmp(chTime,
"LAST") != 0 )
1107 static bool lgMustPrtHeader =
true;
1109 if( lgMustPrtHeader )
1113 for( nd=0; nd <
gv.
nBin; ++nd )
1119 for( nd=0; nd <
gv.
nBin; ++nd )
1124 lgMustPrtHeader =
false;
1129 for( nd=0; nd <
gv.
nBin; ++nd )
1138 if( strcmp(chTime,
"LAST") != 0 )
1141 static bool lgMustPrtHeader =
true;
1143 if( lgMustPrtHeader )
1147 for( nd=0; nd <
gv.
nBin; ++nd )
1153 for( nd=0; nd <
gv.
nBin; ++nd )
1158 lgMustPrtHeader =
false;
1163 for( nd=0; nd <
gv.
nBin; ++nd )
1172 if( strcmp(chTime,
"LAST") != 0 )
1175 static bool lgMustPrtHeader =
true;
1177 if( lgMustPrtHeader )
1181 for( nd=0; nd <
gv.
nBin; ++nd )
1187 for( nd=0; nd <
gv.
nBin; ++nd )
1192 lgMustPrtHeader =
false;
1196 for( nd=0; nd <
gv.
nBin; ++nd )
1206 if( strcmp(chTime,
"LAST") != 0 )
1209 static bool lgMustPrtHeader =
true;
1211 if( lgMustPrtHeader )
1215 for( nd=0; nd <
gv.
nBin; ++nd )
1221 for( nd=0; nd <
gv.
nBin; ++nd )
1226 lgMustPrtHeader =
false;
1236 for( nd=0; nd <
gv.
nBin; ++nd )
1247 if( strcmp(chTime,
"LAST") != 0 )
1250 static bool lgMustPrtHeader =
true;
1252 if( lgMustPrtHeader )
1256 for( nd=0; nd <
gv.
nBin; ++nd )
1262 for( nd=0; nd <
gv.
nBin; ++nd )
1267 lgMustPrtHeader =
false;
1272 for( nd=0; nd <
gv.
nBin; ++nd )
1281 if( strcmp(chTime,
"LAST") != 0 )
1284 static bool lgMustPrtHeader =
true;
1286 if( lgMustPrtHeader )
1290 for( nd=0; nd <
gv.
nBin; ++nd )
1296 for( nd=0; nd <
gv.
nBin; ++nd )
1301 lgMustPrtHeader =
false;
1306 for( nd=0; nd <
gv.
nBin; ++nd )
1316 if( strcmp(chTime,
"LAST") == 0 )
1322 for( nd=0; nd <
gv.
nBin; nd++ )
1335 if( strcmp(chTime,
"LAST") != 0 )
1354 for( j=0; j <= (nelem + 1); ++j)
1402 "%12.4e %12.4e %12.4e %12.4e\n",
1412 if( strcmp(chTime,
"LAST") == 0 )
1434 if( strcmp(chTime,
"LAST") == 0 )
1443 if( strcmp(chTime,
"LAST") == 0 )
1452 if( strcmp(chTime,
"LAST") == 0 )
1461 if( strcmp(chTime,
"LAST") == 0 )
1472 if( strcmp(chTime,
"LAST") != 0 )
1475 fprintf(
punch.
ipPnunit[ipPun],
"%.5e\t%.5e\t%.3e\t%.3e\t%.3e"
1476 "\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e"
1477 "\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e"
1478 "\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e"
1479 "\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\n",
1509 if( strcmp(chTime,
"LAST") != 0 )
1516 if( strcmp(chTime,
"LAST") != 0 )
1522 bool lgFlag =
false;
1526 if( strcmp(chTime,
"LAST") != 0 )
1533 bool lgFlag =
false;
1537 if( strcmp(chTime,
"LAST") != 0 )
1548 if( strcmp(chTime,
"LAST") == 0 )
1556 if( strcmp(chTime,
"LAST") != 0 )
1560 for( nelem=0; nelem <
LIMELM; nelem++ )
1562 for( ion=0; ion <= nelem; ion++ )
1566 fprintf(
punch.
ipPnunit[ipPun],
"%3ld%3ld%3ld%10.2e%10.2e%10.2e",
1567 nelem+1, ion+1, ns+1,
1587 if( strcmp(chTime,
"LAST") != 0 )
1608 if( strcmp(chTime,
"LAST") != 0 )
1649 if( strcmp(chTime,
"LAST") != 0 )
1655 "#PROBLEM Pressure not converged iter %li zone %li density-pressure follows:\n",
1662 "#PROBLEM Temperature not converged iter %li zone %li density-pressure follows:\n",
1668 fprintf(
punch.
ipPnunit[ipPun] ,
"%2li %4li\t%.5e\t%.5e\t%.5e\n",
1681 if( strcmp(chTime,
"LAST") != 0 )
1687 "#PROBLEM Pressure not converged iter %li zone %li temp heat cool follows:\n",
1694 "#PROBLEM Temperature not converged iter %li zone %li temp heat cool follows:\n",
1700 fprintf(
punch.
ipPnunit[ipPun] ,
"%2li %4li\t%.5e\t%.5e\t%.5e\n",
1719 if( strcmp(chTime,
"LAST") != 0 )
1729 if( strcmp(chTime,
"LAST") == 0 )
1733 "Z\tElem\t2 1P->1 1S\t2 3P1->1 1S\t2 3P2->1 1S"
1734 "\t2 3S->1 1S\t2 3P2->2 3S\t2 3P1->2 3S\t2 3P0->2 3S" );
1777 " %.5e %10.3e %10.3e %10.3e %10.3e %10.3e %10.3e\n",
1785 else if( strncmp(
punch.
chPunch[ipPun] ,
"HYD", 3 ) == 0 )
1790 if( strcmp(chTime,
"LAST") != 0 )
1794 " %.5e\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\n",
1807 if( strcmp(chTime,
"LAST") != 0 )
1831 fprintf(
punch.
ipPnunit[ipPun],
"hion\t%4ld\t%.2e\t%.2e\t%.2e",
1842 "\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\n",
1847 fref/
MAX2(1e-37,fout),
1848 stage/
MAX2(1e-37,fout),
1861 if( strcmp(chTime,
"LAST") != 0 )
1882 if( strcmp(chTime,
"LAST") == 0 )
1890 for( ipLo=ipHi-5; ipLo<ipHi; ++ipLo )
1907 if( strcmp(chTime,
"LAST") != 0 )
1914 "%.5e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\n",
1937 double ThinCoolingCaseB;
1940 ThinCoolingCaseB = pow(10.,((-25.859117 +
1963 fprintf(
ioQQQ ,
"punch agn now exits since solution is disturbed.\n");
1972 if( strcmp(chTime,
"LAST") == 0 )
1982 if( strcmp(chTime,
"LAST") != 0 )
1993 for( ion=0; ion<nelem+1; ++ion )
1996 "\t%.4e\t%.4e\t%.4e\t%.4e",
2008 if( strcmp(chTime,
"LAST") == 0 )
2011 for( nelem=0; nelem <
LIMELM; nelem++ )
2017 const int NELEM_LINE = 10;
2019 for( ion_big=0; ion_big<=nelem; ion_big += NELEM_LINE )
2021 int ion_limit =
MIN2(ion_big+NELEM_LINE-1,nelem);
2028 for( ion=ion_big; ion <= ion_limit; ++ion )
2035 ASSERT( ion_limit < LIMELM );
2044 for( ion=ion_big; ion<=ion_limit; ++ion )
2060 else if( energy < 100. )
2064 else if( energy < 1000. )
2086 if( strcmp(chTime,
"LAST") != 0 )
2103 bool lgPrintAll=
false;
2112 if( strcmp(chTime,
"LAST") == 0 )
2121 if( strcmp(chTime,
"LAST") != 0 )
2123 static bool lgFirst=
true;
2139 if( strcmp(chTime,
"LAST") != 0 )
2150 if( strcmp(chTime,
"LAST") != 0 )
2159 if( strcmp(chTime,
"LAST") == 0 )
2191 if( strcmp(chTime,
"LAST") == 0 &&
2198 else if( strcmp(chTime,
"LAST") != 0 )
2216 if( strcmp(chTime,
"LAST") == 0 )
2218 double absval , rel;
2224 const int NLINE_H2 = 31;
2226 const int NLINE_NOTH_H2 = 5;
2228 char chLabel[NLINE_NOTH_H2][5]=
2229 {
"C 2",
"O 1",
"O 1",
"C 1",
"C 1" };
2230 double Wl[NLINE_NOTH_H2]=
2231 {157.6 , 63.17 , 145.5 ,609.2 , 369.7 , };
2235 double Wl_H2[NLINE_H2]=
2237 28.21 , 17.03 , 12.28 , 9.662 , 8.024 , 6.907 , 6.107 , 5.510 , 5.051 , 4.693 ,
2238 4.408 , 4.180 , 3.996 , 3.845 , 3.724 , 3.626 , 3.547 , 3.485 , 3.437 , 3.403 ,
2239 3.381 , 3.368 , 3.365 , 3.371 , 3.387 , 3.410 , 3.441 , 3.485 , 3.542 , 3.603};
2241 for( n=0; n<NLINE_NOTH_H2; ++n )
2243 fprintf(
punch.
ipPnunit[ipPun],
"%s\t%.2f",chLabel[n] , Wl[n]);
2246 if(
cdLine( chLabel[n] , (
realnum)(Wl[n]*1e4) , &absval , &rel ) <= 0 )
2252 fprintf(
punch.
ipPnunit[ipPun],
"\t%.3e\t%.3e\n",pow(10.,rel),absval);
2261 "Here are some of the H2 Intensities, The first one is the\n"
2262 "1-0 S(0) line and the following ones are the 0-0 S(X)\n"
2263 "lines where X goes from 0 to 29\n\n");
2264 for( n=0; n<NLINE_H2; ++n )
2266 fprintf(
punch.
ipPnunit[ipPun],
"%s\t%.3f",
"H2 " , Wl_H2[n]);
2268 if(
cdLine(
"H2 " , (
realnum)(Wl_H2[n]*1e4) , &absval , &rel ) <= 0 )
2274 fprintf(
punch.
ipPnunit[ipPun],
"\t%.3e\t%.3e\n",pow(10.,rel),absval);
2283 if( strcmp(chTime,
"LAST") != 0 )
2286 double col_ci , col_oi , col_cii, col_heii;
2287 if(
cdColm(
"carb" , 1 , &col_ci ) )
2289 if(
cdColm(
"carb" , 2 , &col_cii ) )
2291 if(
cdColm(
"oxyg" , 1 , &col_oi ) )
2293 if(
cdColm(
"heli" , 2 , &col_heii ) )
2297 "%.5e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t"
2298 "%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t"
2299 "%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t"
2300 "%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t"
2301 "%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\n",
2382 if( strcmp(chTime,
"LAST") == 0 )
2394 double relative , absolute, PrtQuantity;
2397 &relative , &absolute ))<=0 )
2401 static bool lgMustPrintFirstTime =
true;
2402 if( lgMustPrintFirstTime )
2405 fprintf(
ioQQQ,
"Did not find an H2 line, the large model is not "
2406 "included, so I will ignore it. Log intensity set to -30.\n" );
2407 fprintf(
ioQQQ,
"I will totally ignore any future missed H2 lines\n");
2408 lgMustPrintFirstTime =
false;
2421 fprintf(
ioQQQ,
"DISASTER - did not find a line in the Line List table\n");
2431 PrtQuantity = absolute;
2433 PrtQuantity = relative;
2439 static double SaveQuantity = 0;
2442 SaveQuantity /
SDIV( PrtQuantity ) );
2444 SaveQuantity = PrtQuantity;
2458 if( strcmp(chTime,
"LAST") != 0 )
2468 if( strcmp(chTime,
"LAST") != 0 )
2490 if( strcmp(chTime,
"LAST") != 0 )
2492 static bool lgMustPrintHeader =
true;
2493 if( lgMustPrintHeader )
2495 lgMustPrintHeader =
false;
2497 "#depth\tAV(point)\tAV(extend)\tCO diss rate\tC recom rate");
2542 if( strcmp(chTime,
"LAST") == 0 )
2549 if( strcmp(chTime,
"LAST") == 0 )
2554 "%12.4e\t%.3e\t%12.4e\t%.3e\n",
2566 if( strcmp(chTime,
"LAST") == 0 )
2590 for( jj=1; jj<nskip; ++jj )
2598 "%12.6e\t%.3e\t%.3e\n",
2603 }
while( j < nu_hi );
2632 "tot con lin=%.2e%.2e lin=%.4s%.4e%.2e con=%.4s%.4e%.2e\n",
2647 if( strcmp(chTime,
"LAST") != 0 )
2681 for( j=1; j <= 3; j++ )
2692 hold =
MAX2(toosmall, hold );
2696 for( j=1; j <= 4; j++ )
2705 for( j=1; j <= 6; j++ )
2724 if( strcmp(chTime,
"LAST") != 0 )
2734 "%.5e\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\t",
2764 if( strcmp(chTime,
"LAST") != 0 )
2767 fprintf(
punch.
ipPnunit[ipPun],
"%.5e\t%.4e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\n",
2776 if( strcmp(chTime,
"LAST") != 0 )
2779 "%.5e\t%.5e\t%.5e\t%.5e\t%.5e\t%.5e\t%.5e\t%.5e\t%.5e\t%.5e\t%.5e\t%.5e\t%.5e\t%.5e\t%c\n",
2820 if( strcmp(chTime,
"LAST") != 0 )
2831 if( strcmp(chTime,
"LAST") == 0 )
2842 if( strcmp(chTime,
"LAST") == 0 )
2855 if( strcmp(chTime,
"LAST") != 0 )
2857 "%.5e\t%.3e\t%.3e\t%.3e\n",
2868 if( strcmp(chTime,
"LAST") != 0 )
2871 for( j=0; j < limit; j++ )
2874 "%.4e\t%.4e\t%.4e\t%.4e\t%.4e\n",
2890 "%.4e\t%.4e\t%.4e\t%.4e\n",
2906 if( strcmp(chTime,
"LAST") != 0 )
2909 for( j=0; j <
NGRID; j++ )
2912 "%4ld%11.3e%11.3e%11.3e\n",
2923 static double deriv_old=-1;
2924 double deriv=-1. , deriv_sec;
2950 if( strcmp(chTime,
"LAST") == 0 )
2957 static double ElapsedTime , ZoneTime;
2966 ZoneTime = t - ElapsedTime;
2972 nzone, ZoneTime , ElapsedTime );
2978 fprintf(
punch.
ipPnunit[ipPun],
"%5ld %11.4e %11.4e %11.4e %g\n",
2988 if( (
punch.
punarg[ipPun][0] == 0 && strcmp(chTime,
"LAST") == 0)
2991 (
punch.
punarg[ipPun][0] == 1 && strcmp(chTime,
"LAST") != 0 ) )
2994 "%.5e\t%.5e\t%.4e\t%.4e\t%.4e\t%.4e\t%.4e\t%.4e\n",
3011 if( strcmp(chTime,
"LAST") == 0 )
3017 fprintf(
ioQQQ,
" Cannot punch xspec files unless doing a grid.\n" );
3027 if( strcmp(chTime,
"LAST") == 0 )
3033 fprintf(
ioQQQ,
" Cannot punch xspec files unless doing a grid.\n" );
3043 if( strcmp(chTime,
"LAST") == 0 )
3049 fprintf(
ioQQQ,
" Cannot punch xspec files unless doing a grid.\n" );
3059 if( strcmp(chTime,
"LAST") == 0 )
3065 fprintf(
ioQQQ,
" Cannot punch xspec files unless doing a grid.\n" );
3075 if( strcmp(chTime,
"LAST") == 0 )
3081 fprintf(
ioQQQ,
" Cannot punch xspec files unless doing a grid.\n" );
3091 if( strcmp(chTime,
"LAST") == 0 )
3097 fprintf(
ioQQQ,
" Cannot punch xspec files unless doing a grid.\n" );
3107 if( strcmp(chTime,
"LAST") == 0 )
3113 fprintf(
ioQQQ,
" Cannot punch xspec files unless doing a grid.\n" );
3123 if( strcmp(chTime,
"LAST") == 0 )
3129 fprintf(
ioQQQ,
" Cannot punch xspec files unless doing a grid.\n" );
3139 if( strcmp(chTime,
"LAST") == 0 )
3145 fprintf(
ioQQQ,
" Cannot punch xspec files unless doing a grid.\n" );
3155 if( strcmp(chTime,
"LAST") == 0 )
3161 fprintf(
ioQQQ,
" Cannot punch xspec files unless doing a grid.\n" );
3172 fprintf(
ioQQQ,
" PROBLEM DISASTER PunchDo does not recognize flag %4.4s set by ParsePunch. This is impossible.\n",
3185 if( strcmp(chTime,
"LAST") == 0 &&
3223 fprintf( ioPUN,
"**********************************************************************************************************************************\n" );
3231 fprintf( ioPUN,
"%s\n", chCard );
3238 fprintf( ioPUN,
"zone=%5ld\n",
nzone );
3239 fprintf( ioPUN,
"**********************************************************************************************************************************\n" );
3240 fprintf( ioPUN,
"begin emission lines\n" );
3255 fprintf( ioPUN,
" \n" );
3256 fprintf( ioPUN,
"**********************************************************************************************************************************\n" );
3271 long int nelem , ipLo , ipHi , i , ipISO;
3273 static bool lgFirst=
true;
3278 if( strcmp( &*chJob ,
"optical" ) == 0 )
3284 else if( strcmp( &*chJob ,
"populat" ) == 0 )
3291 fprintf(ioPUN,
"index\tAn.ion\tgLo\tgUp\tE(wn)\tgf\n");
3301 fprintf(
ioQQQ,
" insane job in PunchLineStuff =%s\n",
3311 for( nelem=ipISO; nelem <
LIMELM; nelem++ )
3318 for( ipLo=0; ipLo <ipHi; ipLo++ )
3363 for( i=0; i <
nUTA; i++ )
3404 fprintf( ioPUN ,
"%2.2s%2.2s\t",
3420 fprintf( ioPUN ,
"\t%.3f", t->
Emis->
TauIn );
3422 fprintf(ioPUN,
"\t%.3e",
3424 fprintf(ioPUN,
"\n");
3432 fprintf(ioPUN,
"%li\t%s" , index , chLbl );
3434 fprintf(ioPUN,
"\t%.0f\t%.0f",
3437 fprintf(ioPUN,
"\t%.2f\t%.3e",
3439 fprintf(ioPUN,
"\n");
3444 if( t->
Hi->
Pop > xLimit )
3446 fprintf(ioPUN,
"%li\t%.2e\t%.2e\n", index,
3451 t->
Lo->
Pop*abundance ,
3452 t->
Hi->
Pop*abundance );
3460 long int ipLo, ipHi,
3496 ncells = (long)((wlhi-wllo)/resolution + 1);
3503 ncells = ipHi - ipLo + 1;
3507 energy = (
double *)
MALLOC( (
size_t)(ncells+1)*
sizeof(
double) );
3508 cont_incid = (
double *)
MALLOC( (
size_t)(ncells+1)*
sizeof(
double) );
3509 cont_atten = (
double *)
MALLOC( (
size_t)(ncells+1)*
sizeof(
double) );
3510 diffuse_in = (
double *)
MALLOC( (
size_t)(ncells+1)*
sizeof(
double) );
3511 diffuse_out = (
double *)
MALLOC( (
size_t)(ncells+1)*
sizeof(
double) );
3512 emis_lines_out = (
double *)
MALLOC( (
size_t)(ncells+1)*
sizeof(
double) );
3513 emis_lines_in = (
double *)
MALLOC( (
size_t)(ncells+1)*
sizeof(
double) );
3523 while( energy[j]-resolution > wllo )
3527 energy[j] = energy[j-1] - resolution;
3532 for( j=0; j<ncells; ++j )
3534 energy[j] =
RYDLAM / energy[j];
3540 for( j=0; j<ncells; ++j )
3548 cdSPEC( 1 , energy , ncells , cont_incid );
3550 cdSPEC( 2 , energy , ncells , cont_atten );
3552 cdSPEC( 5 , energy , ncells , diffuse_in );
3554 cdSPEC( 4 , energy , ncells , diffuse_out );
3557 cdSPEC( 6 , energy , ncells , emis_lines_out );
3558 cdSPEC( 7 , energy , ncells , emis_lines_in );
3563 for( j=0; j<ncells-1; ++j )
3567 fprintf( ioPUN,
"%.3e\t", cont_incid[j] );
3568 fprintf( ioPUN,
"%.3e\t", cont_atten[j] );
3569 fprintf( ioPUN,
"%.3e\t", diffuse_in[j]+diffuse_out[j] );
3570 fprintf( ioPUN,
"%.3e",
3571 emis_lines_out[j]+emis_lines_in[j] );
3572 fprintf( ioPUN,
"\n" );
3580 free(emis_lines_out);
3581 free(emis_lines_in);
3590 realnum te[NTE] = {5000., 10000., 15000., 20000.};
3599 for( i=0;i<NTE; ++i)
3619 fprintf(ioPUN,
"wl");
3620 for( i=0;i<NTE; ++i)
3622 fprintf(ioPUN,
"\tT=%.0f",te[i]);
3624 fprintf( ioPUN ,
"\tcont\n");
3629 fprintf( ioPUN ,
"%12.5e",
3632 for( i=0;i<NTE; ++i)
3641 for( i=0;i<NTE; ++i)
3643 free( agn_continuum[i] );
3650 fprintf(
ioQQQ,
"AGN_Hemis - result of punch AGN3 hemis - I have left the code in a disturbed state, and will now exit.\n");
3660 long int i , nelem , ion;
3670 fprintf( ioPUN,
"**********************************************************************************************************************************\n" );
3677 strcpy( chCAPS , chCard );
3680 if( !
nMatch(
"HIDE" , chCAPS ) )
3681 fprintf( ioPUN,
"%s\n", chCard );
3688 fprintf( ioPUN,
"**********************************************************************************************************************************\n" );
3690 fprintf( ioPUN,
"C*OPTICAL DEPTHS ELECTRON=%10.3e\n",
opac.
telec );
3692 fprintf( ioPUN,
"BEGIN EMISSION LINES\n" );
3706 fprintf( ioPUN,
" \n" );
3708 fprintf( ioPUN,
"BEGIN COLUMN DENSITIES\n" );
3716 for( nelem=0; nelem<
LIMELM; nelem++ )
3718 for(ion=0; ion < nelem+1; ion++)
3722 if( nelem==9|| nelem==19 || nelem==29 )
3724 fprintf( ioPUN,
"\n" );
3729 fprintf( ioPUN,
"END OF RESULTS\n" );
3730 fprintf( ioPUN,
"**********************************************************************************************************************************\n" );
3745 const char *chFunction)
3758 if( strcmp(chFunction,
"Start") == 0 )
3762 else if( strcmp(chFunction,
"Line ") == 0 )
3765 wavelength[ipLine] =
wl;
3766 strcpy( chLabSave[ipLine], chLab );
3767 xIntenSave[ipLine] = xInten;
3777 for( i=0; i < ipLine; i++ )
3779 fprintf( ioPUN,
" %4.4s ", chLabSave[i] );
3780 prt_wl( ioPUN, wavelength[i] );
3781 fprintf( ioPUN,
"\t%.3e", xIntenSave[i]);
3785 fprintf( ioPUN,
"\n" );
3789 fprintf( ioPUN,
" \n" );
3793 else if( strcmp(chFunction,
"Flush") == 0 )
3802 for( i=0; i < ipLine; i++ )
3804 fprintf( ioPUN,
" %4.4s", chLabSave[i] );
3805 prt_wl( ioPUN, wavelength[i] );
3806 fprintf( ioPUN,
"\t%.3e", xIntenSave[i]);
3810 fprintf( ioPUN,
"\n" );
3813 fprintf( ioPUN,
" \n" );
3818 fprintf(
ioQQQ,
" PunResults1Line called with insane request=%5.5s\n",
3856 ener[i] = 0.5f*i - 8.f;
3859 for( charge = 1; charge<
LIMELM; charge++ )
3862 z = (
realnum)log10((
double)charge);
3880 fprintf( ioPUN,
" " );
3883 fprintf( ioPUN,
"\t%6.1f", ste[i-1] );
3885 fprintf( ioPUN,
"\n" );
3889 fprintf( ioPUN,
"\t%6.2f", ener[j] );
3892 fprintf( ioPUN,
"\t%6.2f", log10(g[j][ite]) );
3894 fprintf( ioPUN,
"\n" );
3897 fprintf( ioPUN,
" " );
3900 fprintf( ioPUN,
"\t%6.1f", ste[i] );
3902 fprintf( ioPUN,
"\n" );
3905 fprintf( ioPUN,
" " );
3908 fprintf( ioPUN,
"\t%6.1f", ste[i] );
3910 fprintf( ioPUN,
"\n" );
3916 fprintf( ioPUN,
"\t%6.2f\t%6.2f\t%6.2e\n", ste[i], ener[j],
3921 fprintf( ioPUN,
"Below is log(u), log(gamma**2), gff\n" );
3927 fprintf( ioPUN,
"\t%6.2f\t%6.2f\t%6.2e\n", 2.*z + log10(
TE1RYD) - ste[i] , log10(
TE1RYD)+ener[j]-ste[i],
3931 fprintf( ioPUN,
"end of charge = %li\n", charge);
3932 fprintf( ioPUN,
"****************************\n");