56 bool lgSecondFilename;
69 "The limit to the number of SAVE options is %ld. Increase "
70 "LIMPUN in save.h if more are needed.\nSorry.\n",
93 if( strcmp(chLabel ,
"opacity.opc") == 0 )
95 fprintf(
ioQQQ,
"ParseSave will not allow save file name %s, please choose another.\nSorry.\n",
99 else if( chLabel[0]==
'\0' )
101 fprintf(
ioQQQ,
"ParseSave found a null file name between double quotes, please check command line.\nSorry.\n");
109 strcat( chFilename , chLabel );
114 if( p.
GetQuote( chSecondFilename ,
false ) )
115 lgSecondFilename =
false;
117 lgSecondFilename =
true;
184 "#nu/%s\tTot opac\tAbs opac\tScat opac\tAlbedo\telem\n",
188 else if( p.
nMatch(
"FIGU") )
193 "#nu/%s\tH\tHe\ttot opac\n",
197 else if( p.
nMatch(
"FINE") )
219 fprintf(
ioQQQ,
"There must be two numbers, the lower and upper energy range in Ryd.\nSorry.\n");
227 unitChange.
set(Energy1, energyUnits );
228 Energy1 = unitChange.
Ryd();
229 unitChange.
set(Energy2, energyUnits );
230 Energy2 = unitChange.
Ryd();
254 fprintf(
ioQQQ,
"The number of fine opacities to skip must be > 0 \nSorry.\n");
259 else if( p.
nMatch(
"GRAI") )
265 "#grain\tnu\tabs+scat*(1-g)\tabs\tscat*(1-g)\tscat\tscat*(1-g)/[abs+scat*(1-g)]\n" );
268 else if( p.
nMatch(
"BREM") )
273 "#nu\tbrem opac\n" );
276 else if( p.
nMatch(
"SHEL") )
295 fprintf(
ioQQQ,
"There must be atom number, ion, shell\nSorry.\n" );
299 "#sub shell cross section\n" );
302 else if( p.
nMatch(
"ELEM") )
311 if( (nelem = p.
GetElem() ) < 0 )
313 fprintf(
ioQQQ,
"I did not find an element name on the opacity element command. Sorry.\n" );
322 fprintf(
ioQQQ,
" I did not recognize a keyword on this save opacity command.\n" );
323 fprintf(
ioQQQ,
" Sorry.\n" );
351 sprintf( chTemp,
"\t%s",
358 else if( p.
nMatch(
" AGE") )
363 "#ages depth\tt(cool)\tt(H2 dest)\tt(CO dest)\tt(OH dest)\tt(H rec)\n" );
366 else if( p.
nMatch(
" AGN") )
377 "#charge exchange rate coefficnt\n" );
380 else if( p.
nMatch(
"RECO") )
385 "#Recom rates for AGN3 table\n" );
388 else if( p.
nMatch(
"OPAC") )
395 else if( p.
nMatch(
"HECS") )
403 else if( p.
nMatch(
"HEMI") )
412 else if( p.
nMatch(
"RECC") )
417 "#T\tbAS\tb1\tbB\n" );
421 fprintf(
ioQQQ,
" I did not recognize this option on the SAVE HYDROGEN command.\n" );
422 fprintf(
ioQQQ,
" Sorry.\n" );
427 else if( p.
nMatch(
"AVER") )
448 "#charge exchange rate coefficient\n" );
452 else if( p.
nMatch(
"CHIA"))
457 else if( p.
nMatch(
"CHEM") )
463 if( lgSecondFilename )
467 else if( p.
nMatch(
"CREA" ) )
469 else if( p.
nMatch(
"CATA" ) )
471 else if( p.
nMatch(
"ALL" ) )
484 fprintf(
ioQQQ,
" A species label must appear within a second set of quotes (following the output filename).\n" );
485 fprintf(
ioQQQ,
" Sorry.\n" );
492 else if( p.
nMatch(
"COMP") )
497 "#nu, comup, comdn\n" );
500 else if( p.
nMatch(
"COOL") )
507 "#depth(cm)\tTemp(K)\tCtot(erg/cm3/s)\t" );
508 for(
int i = 0 ; i <
LIMELM ; i++ )
513 strcat(
save.
chHeader[
save.
nsave],
"molecule\tdust\tH2cX\tCT C\tH-fb\tH2ln\tHDro\tH2+ \tFFcm\thvFB\teeff\tComp\tExtr\tExpn\tCycl\tHvin\tdima\n" );
520 "#depth cm\tTemp K\tHtot erg/cm3/s\tCtot erg/cm3/s\tcool fracs\n" );
527 if( !lgSecondFilename )
529 fprintf(
ioQQQ,
"This command requires two items in quotes (a filename and a species label). Only one set of quotes was found.\nSorry.\n");
538 "#depth cm\t%s col cm-2\tsrc s-1\tsnk s-1\n",
542 else if( p.
nMatch(
"DYNA") )
553 "#advection depth\tHtot\tadCool\tadHeat\tdCoolHeatdT\t"
554 "Source[hyd][hyd]\tRate\tEnthalph\tadSpecEnthal\n" );
558 fprintf(
ioQQQ,
" I did not recognize a sub keyword on this SAVE DYNAMICS command.\n" );
559 fprintf(
ioQQQ,
" Sorry.\n" );
564 else if( p.
nMatch(
"ENTH") )
569 "#depth\tTotal\tExcit\tIoniz\tBind\tKE\tther+PdV\tmag \n" );
577 "#zone\tdTime\tElapsed t\n" );
591 "#FeII: energy\tstat wght\tcol den\n" );
595 else if( p.
nMatch(
"CONT") )
606 else if( p.
nMatch(
" OUT") )
634 else if( p.
nMatch(
"DEPA") )
638 "#FeII departure coefficient \n" );
652 else if( p.
nMatch(
"LEVE") )
656 "#FeII energy(wn)\tstat weight\n" );
660 else if( p.
nMatch(
"LINE") )
721 "#FeII ipHi\tipLo\tWL(A)\tlog I\tI/Inorm\t\tTau\n" );
728 "#FeII hi\tlow\twl(A)\ttau\n" );
732 else if( p.
nMatch(
"POPU") )
736 "#FeII level populations [cm^-3]\n" );
760 else if( p.
nMatch(
"RANG") )
769 fprintf(
ioQQQ,
"There must be two numbers on this save "
770 "FeII populations range command.\n" );
771 fprintf(
ioQQQ,
"These give the lower and upper levels "
772 "for the range of FeII levels.\n" );
773 fprintf(
ioQQQ,
"The first, %g, must be less than the second, %g.\n",
776 fprintf(
ioQQQ,
"Sorry.\n" );
789 fprintf(
ioQQQ,
"There must be a second keyword on this SAVE FEII command.\n" );
790 fprintf(
ioQQQ,
"The ones I know about are COLUmn, CONTinuum, "
791 "DEPArture, LEVEls, LINE, OPTIcal DEPTh, and POPUlations.\n" );
792 fprintf(
ioQQQ,
"Sorry.\n" );
816 "#Continuum binning enrOrg/%s\tEnergy\twidth of cells\n",
820 else if( p.
nMatch(
"DIFF") )
831 "#energy/%s then emission per zone\n",
839 "#energy/%s\tConEmitLocal\tDiffuseLineEmission\tTotal\n",
845 else if( p.
nMatch(
"EMIS") )
852 p.
NoNumb(
"continuum emissivity frequency" );
857 fprintf(
ioQQQ,
" The frequency is outside the Cloudy range\n Sorry.\n" );
862 "#Radius\tdepth\tnujnu\tkappa_abs\tkappa_sct @ %e Ryd\n",
866 else if( p.
nMatch(
"EMIT") )
872 "#Energy/%s\treflec\toutward\ttotal\tline\tcont\n",
876 else if( p.
nMatch(
"FINE" ) )
883 "#Energy/%s\tTransmitted\n",
894 fprintf(
ioQQQ,
"There must be two numbers, the lower and upper energies in Ryd.\nSorry.\n");
902 unitChange.
set(Energy1, energyUnits );
903 Energy1 = unitChange.
Ryd();
904 unitChange.
set(Energy2, energyUnits );
905 Energy2 = unitChange.
Ryd();
929 fprintf(
ioQQQ,
"The number of fine opacities to skip must be > 0 \nSorry.\n");
934 else if( p.
nMatch(
"GRAI") )
940 "#energy\tgraphite\trest\ttotal\n" );
943 else if( p.
nMatch(
"INCI") )
949 "#Incident Continuum, Enr\tnFn \n" );
952 else if( p.
nMatch(
"INTE") )
958 "#Continuum interactions, inc, otslin. otscon, ConInterOut, outlin \n" );
963 else if( p.
nMatch(
"IONI") )
993 "#cell(on C scale)\tnu\tflux\tflx*cs\tFinc\totsl\totsc\toutlin\toutcon\trate/tot\tintegral\tline\tcont\n" );
996 else if( p.
nMatch(
"NLTE") )
1002 " spectrum1 NeXY6 XNUMX\n");
1006 else if( p.
nMatch(
"OUTW") )
1013 "#Local Out ConInterOut+line SvOt*opc pass*opc\n" );
1019 "#Out Con OutIncid OutConD OutLinD OutConS\n" );
1023 else if( p.
nMatch(
"TRAN") )
1029 "#ener\tTran Contin\ttrn coef\n" );
1032 else if( p.
nMatch(
" TWO") )
1038 "#energy\t n_nu\tnuF_nu \n" );
1041 else if( p.
nMatch(
" RAW") )
1047 "#Raw Con anu\tflux\totslin\totscon\tConRefIncid\tConEmitReflec\tConInterOut\toutlin\tConEmitOut\tline\tcont\tnLines\n" );
1050 else if( p.
nMatch(
"REFL") )
1056 "#Reflected\tcont\tline\ttotal\talbedo\tConID\n" );
1070 strcpy( chHold,
"#Cont " );
1072 strcpy( chHold ,
"#Cumul " );
1074 "%s nu\tincident\ttrans\tDiffOut\tnet trans\treflc\ttotal\treflin\toutlin\tlineID\tcont\tnLine\n" ,
1100 else if( p.
nMatch(
"CONV") )
1110 else if( p.
nMatch(
"ERRO") )
1116 "#depth\tnPres2Ioniz\tP(cur)\tP%%error\tNE(cor)\tNE(cur)\tNE%%error\tHeat\tCool\tHC%%error\n" );
1118 else if( p.
nMatch(
"BASE") )
1128 fprintf(
ioQQQ,
"There must be a second keyword on this command.\n" );
1129 fprintf(
ioQQQ,
"The ones I know about are REASON, ERROR, and BASE.\n" );
1130 fprintf(
ioQQQ,
"Sorry.\n" );
1135 else if( p.
nMatch(
" DR ") )
1152 if( nelem < 0 || nelem >=
LIMELM )
1154 fprintf(
ioQQQ,
" I could not recognize a valid element name on this line.\n" );
1155 fprintf(
ioQQQ,
" Please check your input script. Bailing out...\n" );
1171 for(i=0; i<=nelem+1;++i )
1183 sprintf( chTemp,
"\tH2");
1188 sprintf( chTemp,
"\tC1\tC1*\tC1**\tC2\tC2*\tCO");
1193 sprintf( chTemp,
"\tO1\tO1*\tO1**");
1201 else if( p.
nMatch(
"FITS") )
1205 fprintf(
ioQQQ,
"Saving FITS files is not currently supported in double precision.\n" );
1206 fprintf(
ioQQQ,
"Please recompile without the FLT_IS_DBL option.\n" );
1207 fprintf(
ioQQQ,
"Sorry.\n" );
1222 else if( p.
nMatch(
"FRED") )
1226 "#Radius\tDepth\tVelocity(km/s)\tdvdr(cm/s)\thden\teden\tTemperature\tRadAccel line\tRadAccel con\t"
1227 "Force multiplier\ta(e thin)\t"
1228 "HI\tHII\tHeI\tHeII\tHeIII\tC2\tC3\tC4\tO1\t"
1229 "O2\tO3\tO4\tO5\tO6\tO7\tO8\t"
1230 "HI\tHII\tHeI\tHeII\tHeIII\tC2\tC3\tC4\tO1\t"
1231 "O2\tO3\tO4\tO5\tO6\tO7\tO8\tMg2\tMg2\tOVI(1034) TauIn\tTauCon\n");
1236 else if( p.
nMatch(
"GAMM") )
1240 "#Photoionization rates \n" );
1241 if( p.
nMatch(
"ELEMENT") )
1255 p.
NoNumb(
"element ionization stage" );
1258 fprintf(
ioQQQ,
"Bad ionization stage - please check Hazy.\nSorry.\n");
1269 else if( p.
nMatch(
"GRAI") )
1281 "#grain\tnu/%s\tabs+scat*(1-g)\tabs\tscat*(1-g)\tscat\tscat*(1-g)/[abs+scat*(1-g)]\n",
1284 else if( p.
nMatch(
"ABUN") )
1289 "#grain\tdepth\tabundance (g/cm^3)\n" );
1291 else if( p.
nMatch(
"D/G ") )
1296 "#grain\tdepth\tdust/gas mass ratio\n" );
1298 else if( p.
nMatch(
"PHYS") )
1303 "#grain\tdepth\tpotential\n" );
1305 else if( p.
nMatch(
" QS ") )
1309 "#grain\tnu\tQ_abs\tQ_scat\n" );
1311 else if( p.
nMatch(
"TEMP") )
1317 "#grain temperature\n" );
1319 else if( p.
nMatch(
"DRIF") )
1325 "#grain drift velocity\n" );
1327 else if( p.
nMatch(
"EXTI") )
1333 "#depth\tA_V(extended)\tA_V(point)\n" );
1335 else if( p.
nMatch(
"CHAR") )
1341 "#grain charge\n" );
1343 else if( p.
nMatch(
"HEAT") )
1349 "#grain heating\n" );
1351 else if( p.
nMatch(
"POTE") )
1357 "#grain\tdepth\tpotential\n" );
1359 else if( p.
nMatch(
"H2RA") )
1365 "#grain H2 formation rates\n" );
1369 fprintf(
ioQQQ,
"There must be a second key on this GRAIN command; The options I know about follow (required key in CAPS):\n");
1370 fprintf(
ioQQQ,
"OPACity, ABUNdance, D/G mass ratio, PHYSical conditions, QS , TEMPerature, DRIFt velocity, EXTInction, CHARge, HEATing, POTEntial, H2RAtes\nSorry.\n" );
1375 else if( p.
nMatch(
"GAUN") )
1379 "#Gaunt factors.\n" );
1381 else if( p.
nMatch(
"GRID") )
1387 else if( p.
nMatch(
"HIST" ) )
1395 "#iter zon\tdensity\tpres cur\tpres error\n" );
1398 else if( p.
nMatch(
"TEMP" ) )
1403 "#iter zon\ttemperature\theating\tcooling\n" );
1407 else if( p.
nMatch(
"HTWO") )
1409 fprintf(
ioQQQ,
" Sorry, this command has been replaced with the "
1410 "SAVE H2 CREATION and SAVE H2 DESTRUCTION commands.\n");
1415 else if( p.
nMatch(
"QHEA") )
1422 else if( p.
nMatch(
"HEAT") )
1428 "#depth cm\tTemp K\tHtot erg/cm3/s\tCtot erg/cm3/s\theat fracs\n" );
1439 "#wavelengths of lines from He-like ions\n" );
1443 fprintf(
ioQQQ,
"save helium has options: LINE WAVElength.\nSorry.\n" );
1449 else if( p.
nMatch(
"HUMM") )
1453 "#input to DHs routine.\n" );
1456 else if( p.
nMatch(
"HYDR") )
1463 "#depth\tTe\tHDEN\tEDEN\tHI/H\tHII/H\tH2/H\tH2+/H\tH3+/H\tH-/H\n" );
1473 "#depth\tT(spin)\tT(kin)\tT(Lya/21cm)\tnLo\tnHi\tOccLya\ttau(21cm)"
1474 "\ttau(Lya)\topac(21 cm)\tn/Ts\ttau(21)\tTex(Lya)\tN(H0)/Tspin"
1475 "\tSum_F0\tSum_F1\tSum_T21\n" );
1478 else if( p.
nMatch(
"IONI") )
1483 "#hion\tzn\tgam1\tcoll ion1\tRecTot\tHRecCaB\thii/hi\tSim hii/hi"
1484 "\time_Hrecom_long(esc)\tdec2grd\texc pht\texc col\trec eff\tsec ion\n" );
1486 else if( p.
nMatch(
"POPU") )
1491 "#depth\tn(H0)\tn(H+)\tn(1s)\tn(2s)\tn(2p)\tetc\n" );
1493 else if( p.
nMatch(
"LINE") )
1499 "#nHi\tlHi\tnLo\tlLo\tE(ryd)\ttau\n" );
1501 else if( p.
nMatch(
" LYA") )
1506 "#depth\tTauIn\tTauTot\tn(2p)/n(1s)\tTexc\tTe\tTex/T\tPesc\tPdes\tpump\topacity\talbedo\n" );
1510 fprintf(
ioQQQ,
"Save hydrogen has options: CONDitions, 21 CM, LINE, POPUlations, and IONIzation.\nSorry.\n" );
1515 else if( p.
nMatch(
"IONI") )
1520 if( (nelem = p.
GetElem() ) < 0 )
1522 fprintf(
ioQQQ,
"There must be an element name on the ionization rates command. Sorry.\n" );
1528 "#%s depth\teden\tdynamics.Rate\tabund\tTotIonize\tTotRecom\tSource\t ... \n",
1536 "#Mean ionization distribution\n" );
1540 else if( p.
nMatch(
" IP ") )
1544 "#ionization potentials, valence shell\n" );
1547 else if( p.
nMatch(
"LEID") )
1563 "#Leid depth\tA_V(extentd)\tA_V(point)\tTe\tH0\tH2\tCo\tC+\tOo\tCO\tO2\tCH\tOH\te\tHe+\tH+\tH3+\t"
1565 "N(H0)\tN(H2)\tN(Co)\tN(C+)\tN(Oo)\tN(CO)\tN(O2)\tN(CH)\tN(OH)\tN(e)\tN(He+)\tN(H+)\tN(H3+)\t"
1567 "H2(Sol)\tH2(FrmGrn)\tH2(photodiss)\t"
1569 "G0(DB96)\trate(CO)\trate(C)\theat\tcool\tGrnP\tGr-Gas-Cool\tGr-Gas-Heat\tCOds\tH2dH\tH2vH\tChaT\tCR H\tMgI\tSI\t"
1570 "Si\tFe\tNa\tAl\tC\tC610\tC370\tC157\tC63\tC146\n" );
1577 else if( p.
nMatch(
"NLTE") )
1582 fprintf(
ioQQQ,
" PROBLEM You must enable the USE_NLTE7 macro at compile-time to use this command.\n");
1583 fprintf(
ioQQQ,
" To do so, add EXTRA=\"-DUSE_NLTE7\" to the end of the make command.\n");
1584 fprintf(
ioQQQ,
" An example for a quad core machine:\n make -j 4 EXTRA=\"-DUSE_NLTE7\" \n");
1585 fprintf(
ioQQQ,
" in the sys_XXX folder that you want to use.\n\n\n");
1591 else if (p.
nMatch(
"FE2NRG"))
1596 else if (p.
nMatch(
"FE2TP"))
1601 else if (p.
nMatch(
"FE2COLL"))
1615 if( !lgSecondFilename )
1617 fprintf(
ioQQQ ,
"There must be a second file name between "
1618 "double quotes on the SAVE LINE LIST command. This second"
1619 " file contains the input line list. I did not find it.\nSorry.\n");
1636 fprintf(
ioQQQ,
"DISASTER could not open SAVE LINE LIST file %s \n",
1660 fprintf(
ioQQQ ,
"There must be an even number of lines to"
1661 " take ratios of lines. There were %li, an odd number."
1726 fprintf(
ioQQQ,
" The SAVE LINES STRUCTURE command is now SAVE LINES "
1727 "EMISSIVITY.\n Sorry.\n\n");
1731 else if( p.
nMatch(
"PRES") )
1736 "#P depth\tPtot\tPline/Ptot\tcontributors to line pressure\n" );
1739 else if( p.
nMatch(
"EMIS") )
1756 else if( p.
nMatch(
" RT " ) )
1765 else if( p.
nMatch(
"CUMU") )
1791 else if( p.
nMatch(
"DATA") )
1805 "#Emission line data.\n" );
1808 else if( p.
nMatch(
"ARRA") )
1814 "#enr\tID\tI(intrinsic)\tI(emergent)\ttype\n" );
1817 else if( p.
nMatch(
"LABE") )
1822 "#index\tlabel\twavelength\tcomment\n" );
1832 else if( p.
nMatch(
"OPTI") )
1847 "#species\tenergy/%s\topt depth\tdamp\n",
1859 else if( p.
nMatch(
"POPU") )
1866 "#population information\n" );
1882 else if( p.
nMatch(
"INTE") )
1887 "#Emission line intrinsic intensities per unit inner area\n" );
1912 "There must be a second number, the number of zones to print.\nSorry.\n" );
1925 "This option for SAVE LINE is something that I do not understand. Sorry.\n" );
1930 else if( p.
nMatch(
" MAP") )
1934 "#te, heating, cooling.\n" );
1965 fprintf(
ioQQQ,
"There must be a zone number, followed by two temperatures, on this line. Sorry.\n" );
1971 else if( p.
nMatch(
"MOLE") )
1977 else if( p.
nMatch(
"MONI") )
2019 fprintf(
ioQQQ,
"There must be two numbers, the lower and upper energy range in Ryd.\nSorry.\n");
2027 unitChange.
set(Energy1, energyUnits );
2028 Energy1 = unitChange.
Ryd();
2029 unitChange.
set(Energy2, energyUnits );
2030 Energy2 = unitChange.
Ryd();
2052 fprintf(
ioQQQ,
"The number of fine opacities to skip must be > 0 \nSorry.\n");
2061 "#energy/%s\ttotal\tabsorp\tscat\n",
2066 else if( p.
nMatch(
" OTS") )
2070 "#otscon, lin, conOpac LinOpc\n" );
2078 "#depth\tTe\tHtot\thden\teden\t2H_2/H\tHI\tHII\tHeI\tHeII\tHeIII\tCO/C\tC1\tC2\tC3\tC4\tO1\tO2\tO3\tO4\tO5\tO6\tH2O/O\tAV(point)\tAV(extend)\n" );
2081 else if( p.
nMatch(
" PDR") )
2085 "#depth\tH colden\tTe\tHI/HDEN\tH2/HDEN\tH2*/HDEN\tCI/C\tCO/C\tH2O/O\tG0\tAV(point)\tAV(extend)\tTauV(point)\n" );
2088 else if( p.
nMatch(
"PERF") )
2093 "#zone\tdTime\tElapsed t\tnPres2Ioniz\n" );
2096 else if( p.
nMatch(
"PHYS") )
2101 "#PhyC depth\tTe\tn(H)\tn(e)\tHtot\taccel\tfillfac\n" );
2104 else if( p.
nMatch(
"POIN") )
2113 else if( p.
nMatch(
"PRES") )
2118 "#P depth\tPerror%%\tPcurrent\tPIn+Pinteg\tPgas(r0)\tPgas\tPram"
2119 "\tPrad(line)\tPinteg\tV(wind km/s)\tcad(wind km/s)\tP(mag)\tV(turb km/s)"
2120 "\tP(turb)\tPgr_Int\tint thin elec\tconv?\n" );
2123 else if( p.
nMatch(
"RADI") )
2140 else if( p.
nMatch(
"RECO") )
2153 else if( p.
nMatch(
"EFFI") )
2158 "#Recom effic H, Heo, He+\n" );
2163 fprintf(
ioQQQ,
"No option recognized on this save recombination command\n" );
2164 fprintf(
ioQQQ,
"Valid options are COEFFICIENTS, AGN, and EFFICIENCY\nSorry.\n" );
2170 else if( p.
nMatch(
"RESU") )
2186 "#results of calculation\n" );
2189 else if( p.
nMatch(
"SECO") )
2194 "#depth\tIon(H^0)\tDiss(H_2)\tExcit(Lya)\n" );
2197 else if( p.
nMatch(
"SOUR") )
2209 "#continuum source function vs depth\n" );
2211 else if( p.
nMatch(
"SPEC") )
2216 "#continuum source function nu/%s\tConEmitLocal/widflx"
2217 "\tabs opac\tConSourceFcnLocal\tConSourceFcnLocal/plankf\tConSourceFcnLocal/flux\n",
2222 fprintf(
ioQQQ,
"A second keyword must appear on this line.\n" );
2223 fprintf(
ioQQQ,
"They are DEPTH and SPECTRUM.\n" );
2224 fprintf(
ioQQQ,
"Sorry.\n" );
2246 "#Cont Enr/%s\tincid nFn\ttrans\tdiff\tlines \n",
2250 else if( p.
nMatch(
"SPECIAL") )
2257 else if( p.
nMatch(
"SPECIES") )
2263 strcpy( chLabel, chSecondFilename );
2264 if( !lgSecondFilename )
2270 fprintf(
ioQQQ,
"Species string is limited to %li characters.\nSorry.\n", (
long)
CHARS_SPECIES );
2276 if (p.
nMatch(
"COLUMN" ) )
2281 else if (p.
nMatch(
"ENERG" ) )
2287 else if( p.
nMatch(
"LABELS") )
2291 else if (p.
nMatch(
"LEVELS" ) )
2296 else if (p.
nMatch(
"POPUL" ) )
2303 fprintf(
ioQQQ,
"ParseSave cannot find a recognized keyword on this SAVE SPECIES command line.\n" );
2304 fprintf(
ioQQQ,
"I know about the keywords COLUMN DENSITIES, LABELS, LEVELS, and POPULATIONS.\nSorry.\n" );
2309 else if( p.
nMatch(
"TEMP") )
2314 "#depth\tTe\tcC/dT\tdt/dr\td^2T/dr^2\n" );
2325 "#elapsed time\ttime step \tscale cont\tscalingDen\t<T>\t<H+/H rad>\t<H0/H rad>\t<H2/H rad>\t<He+/He rad>\t<CO/H>\t<redshift>\t<ne/nH>\n" );
2328 else if( p.
nMatch(
"TPRE") )
2334 "#zone old temp, guess Tnew, new temp delta \n" );
2337 else if( p.
nMatch(
"WIND") )
2341 "#radius\tdepth\tvel [cm/s]\tTot accel [cm s-2]\tLin accel [cm s-2]"
2342 "\tCon accel [cm s-2]\tforce multiplier\ta_gravity\n" );
2355 else if( p.
nMatch(
"XSPE") )
2374 fprintf(
ioQQQ,
"There must be two numbers, the lower and upper energy range in keV.\nSorry.\n");
2379 fprintf(
ioQQQ,
"The two energies for the range must be in increasing order.\nSorry.\n");
2404 else if( p.
nMatch(
"INCI") )
2413 else if( p.
nMatch(
"REFL") )
2428 else if( p.
nMatch(
"DIFF") )
2445 else if( p.
nMatch(
"LINE") )
2462 else if( p.
nMatch(
"SPEC") )
2487 else if( p.
nMatch(
"MTAB") )
2496 fprintf(
ioQQQ,
"Support only for xspec atable and xspec mtable.\n" );
2521 "ParseSave cannot find a recognized keyword on this SAVE command line.\nSorry.\n" );
2529 file_name += chFilename;
2540 if( p.
nMatch(
"NO BUFFER") )
2561 "# reason for continued iterations\n" );
2577 static bool lgPrtHeader =
true;
2580 "#zone\theat\tcool\teden\n" );
2581 lgPrtHeader =
false;
2584 else if( p.
nMatch(
" DR ") )
2586 static bool lgPrtHeader =
true;
2597 "#zone\tdepth\tdr\tdr 2 go\treason \n" );
2598 lgPrtHeader =
false;
2603 else if( p.
nMatch(
"QHEA") )
2609 "#Probability distributions from quantum heating routine.\n" );
2613 else if( p.
nMatch(
"POIN") )
2638 "#recombination coefficients cm3 s-1 for current density and temperature\n" );
2643 else if( p.
nMatch(
"GRID") )
2650 else if( p.
nMatch(
" MAP") )
2666 fprintf(
ioQQQ,
"DISASTER save.chHeader[%li] has been overwritten "
2667 "with a line too long to be read.\n",
save.
nsave );
2690 static bool lgFIRST =
true;
2701 bool lgNoClobberDefault =
false;
2705 lgNoClobberDefault =
true;
2708 for( i=0; i <
LIMPUN; i++ )
2723 for( i=0; i <
LIMPUN; i++ )
2787 if( file_size%2880 )
2789 fprintf(
ioQQQ,
" PROBLEM FITS file is wrong size!\n" );
long nMatch(const char *chKey, const char *chCard)
const int INPUT_LINE_LENGTH
const char * strchr_s(const char *s, int c)
NORETURN void TotalInsanity(void)
#define DEBUG_ENTRY(funcname)
long int cdGetLineList(const char chFile[], vector< char * > &chLabels, vector< realnum > &wl)
long int GetElem(void) const
bool nMatch(const char *chKey) const
bool nMatchErase(const char *chKey)
const char * StandardEnergyUnit(void) const
NORETURN void NoNumb(const char *chDesc) const
int GetQuote(char *chLabel, bool lgABORT)
static t_version & Inst()
void H2_ParseSave(Parser &p, char *chHeader)
char chVersion[INPUT_LINE_LENGTH]
FILE * open_data(const char *fname, const char *mode, access_scheme scheme)
t_elementnames elementnames
const char * StandardEnergyUnit(const char *chCard)
const int NUM_OUTPUT_TYPES
diatomics hd("hd", 4100., &hmi.HD_total, Yan_H2_CS)
diatomics h2("h2", 4100., &hmi.H2_total, Yan_H2_CS)
void ParseSave(Parser &p)
STATIC void ChkUnits(Parser &p)
void CloseSaveFiles(bool lgFinal)
void Parse_Save_Line_RT(Parser &p)
void parse_save_line(Parser &p, bool lgLog3, char *chHeader)
void parse_save_colden(Parser &p, char chHeader[])
void parse_save_average(Parser &p, long int ipPun, char *chHeader)
UNUSED const double WAVNRYD
void sprt_wl(char *chString, realnum wl)
static const long MAX_HEADER_SIZE
char chElementSym[LIMELM][CHARS_ELEMENT_SYM]
char chElementNameShort[LIMELM][CHARS_ELEMENT_NAME_SHORT]
bool lgOutputTypeOn[NUM_OUTPUT_TYPES]
bool lgSaveGrid_noclobber
char chHeader[LIMPUN][MAX_HEADER_SIZE]
vector< char * > chLineListLabel[LIMPUN]
const char * chConPunEnr[LIMPUN]
bool lg_separate_iterations[LIMPUN]
long int nSaveEveryZone[LIMPUN]
realnum punarg[LIMPUN][3]
bool lgSaveToSeparateFiles[LIMPUN]
bool lgTraceConvergeBase_noclobber
bool lgQHSaveFile_noclobber
void SaveLineListFree(long i)
bool lgCumulative[LIMPUN]
bool lgHashEndIter[LIMPUN]
bool lgTraceConvergeBaseHash
bool lgPunPoint_noclobber
char chSaveSpecies[LIMPUN][CHARS_SPECIES]
char chSpeciesDominantRates[LIMPUN][CHARS_SPECIES]
bool lgPunLstIter[LIMPUN]
char chSaveArgs[LIMPUN][5]
bool lgSaveEveryZone[LIMPUN]
bool lgLineListRatio[LIMPUN]
vector< realnum > wlLineList[LIMPUN]
FILE * ipTraceConvergeBase