33 "XTOT",
"XINC",
"XATT",
"XRFI",
"XDFO",
"XDFR",
"XLNO",
"XLNR",
"XTRN",
"XREF",
"XSPM"
90 bool lgSecondFilename;
101 "The limit to the number of SAVE options is %ld. Increase "
102 "LIMPUN in save.h if more are needed.\nSorry.\n",
127 if( strcmp(chLabel.c_str() ,
"opacity.opc") == 0 )
129 fprintf(
ioQQQ,
"ParseSave will not allow save file name %s, please choose another.\nSorry.\n",
133 else if( chLabel==
"" )
135 fprintf(
ioQQQ,
"ParseSave found a null file name between double quotes, please check command line.\nSorry.\n");
143 strcat( chFilename , chLabel.c_str() );
148 if( p.
GetQuote( chSecondFilename ) )
149 lgSecondFilename =
false;
152 lgSecondFilename =
true;
186 sncatf( chTitle,
sizeof(chTitle),
198 ostringstream chHeader;
231 "#nu/%s\tTot opac\tAbs opac\tScat opac\tAlbedo\telem\n",
235 else if( p.
nMatch(
"FIGU") )
240 "#nu/%s\tH\tHe\ttot opac\n",
244 else if( p.
nMatch(
"FINE") )
266 fprintf(
ioQQQ,
"There must be two numbers, the lower and upper energy range in Ryd.\nSorry.\n");
274 unitChange.
set(Energy1, energyUnits );
275 Energy1 = unitChange.
Ryd();
276 unitChange.
set(Energy2, energyUnits );
277 Energy2 = unitChange.
Ryd();
297 fprintf(
ioQQQ,
"The number of fine continuum points to skip must be > 0 \nSorry.\n");
310 else if( p.
nMatch(
"GRAI") )
320 "#grain\tnu/%s\tabs+scat*(1-g)\tabs\tscat*(1-g)\tscat\tscat*(1-g)/[abs+scat*(1-g)]\n",
324 else if( p.
nMatch(
"BREM") )
329 "#nu\tbrems opac\te-e brems opac\n" );
332 else if( p.
nMatch(
"SHEL") )
351 fprintf(
ioQQQ,
"There must be atom number, ion, shell\nSorry.\n" );
355 "#sub shell cross section\n" );
358 else if( p.
nMatch(
"ELEM") )
367 if( (nelem = p.
GetElem() ) < 0 )
369 fprintf(
ioQQQ,
"I did not find an element name on the opacity element command. Sorry.\n" );
378 fprintf(
ioQQQ,
" I did not recognize a keyword on this save opacity command.\n" );
414 else if( p.
nMatch(
" AGE") )
419 "#ages depth\tt(cool)\tt(H2 dest)\tt(CO dest)\tt(OH dest)\tt(H rec)\n" );
422 else if( p.
nMatch(
" AGN") )
433 "#charge exchange rate coefficnt\n" );
436 else if( p.
nMatch(
"RECO") )
441 "#Recom rates for AGN3 table\n" );
444 else if( p.
nMatch(
"OPAC") )
451 else if( p.
nMatch(
"HECS") )
459 else if( p.
nMatch(
"HEMI") )
468 else if( p.
nMatch(
"RECC") )
473 "#T\tbAS\tb1\tbB\n" );
477 fprintf(
ioQQQ,
" I did not recognize this option on the SAVE AGN command.\n" );
483 else if( p.
nMatch(
"AVER") )
504 "#charge exchange rate coefficient\n" );
508 else if( p.
nMatch(
"CHIA"))
513 else if( p.
nMatch(
"CHEM") )
518 if( lgSecondFilename )
522 else if( p.
nMatch(
"CREA" ) )
524 else if( p.
nMatch(
"CATA" ) )
526 else if( p.
nMatch(
"ALL" ) )
543 fprintf(
ioQQQ,
" A species label must appear within a second set of quotes (following the output filename).\n" );
551 fprintf(
ioQQQ,
" I did not recognize a sub keyword on this SAVE CHEMISTRY command.\n" );
557 else if( p.
nMatch(
"COMP") )
562 "#nu, comup, comdn\n" );
565 else if( p.
nMatch(
"COOL") )
572 "#depth(cm)\tTemp(K)\tCtot(erg/cm3/s)\t" );
573 for(
int i = 0 ; i <
LIMELM ; i++ )
579 "%s",
"molecule\tdust\tH2cX\tCT C\tH-fb\tH2ln\tHD \tH2+ \tFF_H\tFF_M\teeff\tadve\tComp\tExtr\tExpn\tCycl\tdima\n" );
586 "#depth cm\tTemp K\tHtot erg/cm3/s\tCtot erg/cm3/s\tcool fracs\n" );
593 if( !lgSecondFilename )
595 fprintf(
ioQQQ,
"This command requires two items in quotes (a filename and a species label). Only one set of quotes was found.\nSorry.\n");
604 "#depth cm\t%s col cm-2\tsrc s-1\tsnk s-1\n",
613 else if( p.
nMatch(
"DYNA") )
624 "#advection depth\tHtot\tadCool\tadHeat\tdCoolHeatdT\t"
625 "Source[hyd][hyd]\tRate\tEnthalph\tadSpecEnthal\n" );
629 fprintf(
ioQQQ,
" I did not recognize a sub keyword on this SAVE DYNAMICS command.\n" );
635 else if( p.
nMatch(
"ENTH") )
640 "#depth\tTotal\tExcit\tIoniz\tBind\tKE\tther+PdV\tmag \n" );
648 "#zone\tdTime\tElapsed t\n" );
653 fprintf(
ioQQQ,
"Error: The 'save feii' commands are obsolete. "
654 " They have been replaced by the 'save species' commands.\n");
682 "#Cont bin Anu/%s\tAnu/Ryd\td(anu)/Ryd\n",
686 else if( p.
nMatch(
"DIFF") )
697 "#energy/%s then emission per zone\n",
705 "#energy/%s\tConEmitLocal\tDiffuseLineEmission\tTotal\n",
711 else if( p.
nMatch(
"EMIS") )
718 p.
NoNumb(
"continuum emissivity frequency" );
723 fprintf(
ioQQQ,
" The frequency is outside the Cloudy range\n Sorry.\n" );
728 "#Radius\tdepth\tnujnu\tkappa_abs\tkappa_sct @ %e Ryd\n",
732 else if( p.
nMatch(
"EMIT") )
738 "#Energy/%s\treflec\toutward\ttotal\tline\tcont\n",
742 else if( p.
nMatch(
"FINE" ) )
749 "#Energy/%s\tTransmitted\n",
760 fprintf(
ioQQQ,
"There must be two numbers, the lower and upper energies in Ryd.\nSorry.\n");
768 unitChange.
set(Energy1, energyUnits );
769 Energy1 = unitChange.
Ryd();
770 unitChange.
set(Energy2, energyUnits );
771 Energy2 = unitChange.
Ryd();
791 fprintf(
ioQQQ,
"The number of fine continuum points to skip must be > 0 \nSorry.\n");
801 else if( p.
nMatch(
"GRAI") )
807 "#energy\tgraphite\trest\ttotal\n" );
810 else if( p.
nMatch(
"INCI") )
816 "#Incident Continuum, Enr\tnFn\tOcc Num\n" );
819 else if( p.
nMatch(
"INTE") )
825 "#Continuum interactions inc \totslin \totscon \tConInterOut \toutlin\n" );
830 else if( p.
nMatch(
"IONI") )
860 "#cell(on C scale)\tnu\tflux\tflx*cs\tFinc\totsl\totsc\toutlin\toutcon\trate/tot\tintegral\tline\tcont\n" );
863 else if( p.
nMatch(
"TRAN") )
872 "#ener\tTran Contin\ttrn coef\n" );
875 else if( p.
nMatch(
" TWO") )
881 "#energy\t n_nu\tnuF_nu \n" );
884 else if( p.
nMatch(
" RAW") )
890 "#Raw Con anu\tflux\totslin\totscon\tConRefIncid\tConEmitReflec\tConInterOut\toutlin\tConEmitOut\tline\tcont\tnLines\n" );
893 else if( p.
nMatch(
"REFL") )
899 "#Reflected\tcont\tline\ttotal\talbedo\tConID\n" );
912 fprintf(
ioQQQ,
"ERROR: Illegal request of isotropic continuum removal "
913 "for time integrations\n" );
919 strcpy( chHold,
"#Cont " );
921 strcpy( chHold ,
"#Cumul " );
923 "%s nu\tincident\ttrans\tDiffOut\tnet trans\treflc\ttotal\treflin\toutlin\tlineID\tcont\tnLine\n" ,
949 else if( p.
nMatch(
"CONV") )
956 else if( p.
nMatch(
"ERRO") )
962 "#depth\tnPres2Ioniz\tP(cur)\tP%%error\tNE(cor)\tNE(cur)\tNE%%error\tHeat\tCool\tHC%%error\n" );
964 else if( p.
nMatch(
"BASE") )
971 fprintf(
ioQQQ,
"There must be a second keyword on this command.\n" );
972 fprintf(
ioQQQ,
"The ones I know about are REASON, ERROR, and BASE.\n" );
984 else if( p.
nMatch(
" DR ") )
999 if( nelem < 0 || nelem >=
LIMELM )
1001 fprintf(
ioQQQ,
" I could not recognize a valid element name on this line.\n" );
1002 fprintf(
ioQQQ,
" Please check your input script. Bailing out...\n" );
1018 sncatf( chHeader,
"#depth");
1021 for(i=0; i<=nelem+1;++i )
1032 chList.push_back(
"H2");
1036 chList.push_back(
"C[1]");
1037 chList.push_back(
"C[2]");
1038 chList.push_back(
"C[3]");
1039 chList.push_back(
"C+[1]");
1040 chList.push_back(
"C+[2]");
1041 chList.push_back(
"CO");
1045 chList.push_back(
"O[1]");
1046 chList.push_back(
"O[2]");
1047 chList.push_back(
"O[3]");
1050 for (
size_t ic=0; ic != chList.size(); ++ic)
1051 sncatf( chHeader,
"\t%s",chList[ic].c_str());
1057 else if( p.
nMatch(
"FITS") )
1061 fprintf(
ioQQQ,
"Saving FITS files is not currently supported in double precision.\n" );
1062 fprintf(
ioQQQ,
"Please recompile without the FLT_IS_DBL option.\n" );
1078 else if( p.
nMatch(
"FRED") )
1082 "#Radius\tDepth\tVelocity(km/s)\tdvdr(cm/s)\thden\teden\tTemperature\tRadAccel line\tRadAccel con\t"
1083 "Force multiplier\ta(e thin)\t"
1084 "HI\tHII\tHeI\tHeII\tHeIII\tC2\tC3\tC4\tO1\t"
1085 "O2\tO3\tO4\tO5\tO6\tO7\tO8\t"
1086 "HI\tHII\tHeI\tHeII\tHeIII\tC2\tC3\tC4\tO1\t"
1087 "O2\tO3\tO4\tO5\tO6\tO7\tO8\tMg2\tMg2\tOVI(1034) TauIn\tTauCon\n");
1092 else if( p.
nMatch(
"GAMM") )
1096 "#Photoionization rates \n" );
1097 if( p.
nMatch(
"ELEMENT") )
1111 p.
NoNumb(
"element ionization stage" );
1114 fprintf(
ioQQQ,
"Bad ionization stage - please check Hazy.\nSorry.\n");
1125 else if( p.
nMatch(
"GRAI") )
1133 else if( p.
nMatch(
"ABUN") )
1138 else if( p.
nMatch(
"D/G ") )
1143 else if( p.
nMatch(
"PHYS") )
1148 else if( p.
nMatch(
" QS ") )
1153 else if( p.
nMatch(
"TEMP") )
1158 else if( p.
nMatch(
"DRIF") )
1163 else if( p.
nMatch(
"EXTI") )
1168 "#depth\tA_V(extended)\tA_V(point)\n" );
1170 else if( p.
nMatch(
"CHAR") )
1175 else if( p.
nMatch(
"HEAT") )
1180 else if( p.
nMatch(
"POTE") )
1185 else if( p.
nMatch(
"H2RA") )
1192 fprintf(
ioQQQ,
"There must be a second key on this GRAIN command; The options I know about follow (required key in CAPS):\n");
1193 fprintf(
ioQQQ,
"OPACity, ABUNdance, D/G mass ratio, PHYSical conditions, QS , TEMPerature, DRIFt velocity, EXTInction, CHARge, HEATing, POTEntial, H2RAtes\nSorry.\n" );
1198 else if( p.
nMatch(
"GAUN") )
1202 "#Gaunt factors.\n" );
1204 else if( p.
nMatch(
"GRID") )
1211 else if( p.
nMatch(
"HIST" ) )
1219 "#iter zon\tdensity\tpres cur\tpres error\n" );
1222 else if( p.
nMatch(
"TEMP" ) )
1227 "#iter zon\ttemperature\theating\tcooling\n" );
1231 else if( p.
nMatch(
"HTWO") )
1233 fprintf(
ioQQQ,
" Sorry, this command has been replaced with the "
1234 "SAVE H2 CREATION and SAVE H2 DESTRUCTION commands.\n");
1239 else if( p.
nMatch(
"QHEA") )
1246 else if( p.
nMatch(
"HEAT") )
1252 "#depth cm\tTemp K\tHtot erg/cm3/s\tCtot erg/cm3/s\theat fracs\n" );
1263 "#wavelengths of lines from He-like ions\n" );
1267 fprintf(
ioQQQ,
"save helium has options: LINE WAVElength.\nSorry.\n" );
1273 else if( p.
nMatch(
"HUMM") )
1277 "#input to DHs routine.\n" );
1280 else if( p.
nMatch(
"HYDR") )
1287 "#depth\tTe\tHDEN\tEDEN\tHI/H\tHII/H\tH2/H\tH2+/H\tH3+/H\tH-/H\n" );
1297 "#depth\tT(spin)\tT(kin)\tT(Lya/21cm)\tnLo\tnHi\tOccLya\ttau(21cm)"
1298 "\ttau(Lya)\topac(21 cm)\tn/Ts\ttau(21)\tTex(Lya)\tN(H0)/Tspin"
1299 "\tSum_F0\tSum_F1\tSum_T21\n" );
1302 else if( p.
nMatch(
"IONI") )
1307 "#hion\tzn\tgam1\tcoll ion1\tRecTot\tHRecCaB\thii/hi\tSim hii/hi"
1308 "\time_Hrecom_long(esc)\tdec2grd\texc pht\texc col\trec eff\tsec ion\n" );
1310 else if( p.
nMatch(
"POPU") )
1315 "#depth\tn(H0)\tn(H+)\tn(1s)\tn(2s)\tn(2p)\tetc\n" );
1317 else if( p.
nMatch(
"LINE") )
1323 "#nHi\tlHi\tnLo\tlLo\tE(ryd)\ttau\n" );
1325 else if( p.
nMatch(
" LYA") )
1330 "#depth\tTauIn\tTauTot\tn(2p)/n(1s)\tTexc\tTe\tTex/T\tPesc\tPdes\tpump\topacity\talbedo\n" );
1334 fprintf(
ioQQQ,
"Save hydrogen has options: CONDitions, 21 CM, LINE, POPUlations, and IONIzation.\nSorry.\n" );
1339 else if( p.
nMatch(
"IONI") )
1344 if( (nelem = p.
GetElem() ) < 0 )
1346 fprintf(
ioQQQ,
"There must be an element name on the ionization rates command. Sorry.\n" );
1352 "#%s depth\teden\tdynamics.Rate\tabund\tTotIonize\tTotRecom\tSource\t ... \n",
1360 "#Mean ionization distribution\n" );
1364 else if( p.
nMatch(
" IP ") )
1368 "#ionization potentials, valence shell\n" );
1371 else if( p.
nMatch(
"LEID") )
1378 sncatf( chHeader,
"#ion\twl\tInt\trel int\n");
1387 "#Leid depth\tA_V(extentd)\tA_V(point)\tTe\tH0\tH2\tCo\tC+\tOo\tCO\tO2\tCH\tOH\te\tHe+\tH+\tH3+\t"
1389 "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"
1391 "H2(Sol)\tH2(FrmGrn)\tH2(photodiss)\t"
1393 "G0(DB96)\trate(CO)\trate(C)\theat\tcool\tGrnP\tGr-Gas-Cool\tGr-Gas-Heat\tCOds\tH2dH\tH2vH\tChaT\tCR H\tMgI\tSI\t"
1394 "Si\tFe\tNa\tAl\tC\tC610\tC370\tC157\tC63\tC146\n" );
1405 if( !lgSecondFilename )
1407 fprintf(
ioQQQ ,
"There must be a second file name between "
1408 "double quotes on the SAVE LINE LIST command. This second"
1409 " file contains the input line list. I did not find it.\nSorry.\n");
1426 fprintf(
ioQQQ,
"DISASTER could not open SAVE LINE LIST file %s \n",
1427 chSecondFilename.c_str() );
1450 fprintf(
ioQQQ ,
"There must be an even number of lines to"
1451 " take ratios of lines. There were %li, an odd number."
1484 sncatf( chHeader,
"#lineslist" );
1494 sncatf( chHeader,
"\t" );
1499 sncatf( chHeader,
"%s", chTemp );
1502 sncatf( chHeader,
"\n" );
1517 fprintf(
ioQQQ,
" The SAVE LINES STRUCTURE command is now SAVE LINES "
1518 "EMISSIVITY.\n Sorry.\n\n");
1522 else if( p.
nMatch(
"PRES") )
1527 "#P depth\tPtot\tPline/Ptot\tcontributors to line pressure\n" );
1530 else if( p.
nMatch(
"EMIS") )
1544 else if( p.
nMatch(
" RT " ) )
1564 lgEOL = p.
nMatch(
"RELA");
1569 else if( p.
nMatch(
"DATA") )
1583 "#Emission line data.\n" );
1586 else if( p.
nMatch(
"ARRA") )
1592 "#enr\tID\tI(intrinsic)\tI(emergent)\ttype\n" );
1595 else if( p.
nMatch(
"LABE") )
1600 "#index\tlabel\twavelength\tcomment\n" );
1637 "#species\tenergy/%s\tmean opt depth\tdamp\n",
1650 else if( p.
nMatch(
"POPU") )
1657 "#population information\n" );
1673 else if( p.
nMatch(
"INTE") )
1678 "#Emission line intrinsic intensities per unit inner area\n" );
1703 "There must be a second number, the number of zones to print.\nSorry.\n" );
1716 "This option for SAVE LINE is something that I do not understand. Sorry.\n" );
1721 else if( p.
nMatch(
" MAP") )
1725 "#te, heating, cooling.\n" );
1756 fprintf(
ioQQQ,
"There must be a zone number, followed by two temperatures, on this line. Sorry.\n" );
1761 fprintf(
ioQQQ,
" The upper temperature limit must be larger than the lower: "
1768 else if( p.
nMatch(
"MOLE") )
1774 else if( p.
nMatch(
"MONI") )
1806 sncatf( chHeader,
"#energy/%s\tTau tot\topacity\n",
1816 fprintf(
ioQQQ,
"There must be two numbers, the lower and upper energy range in Ryd.\nSorry.\n");
1824 unitChange.
set(Energy1, energyUnits );
1825 Energy1 = unitChange.
Ryd();
1826 unitChange.
set(Energy2, energyUnits );
1827 Energy2 = unitChange.
Ryd();
1847 fprintf(
ioQQQ,
"The number of fine continuum points to skip must be > 0 \nSorry.\n");
1864 "#energy/%s\ttotal\tabsorp\tscat\n",
1869 else if( p.
nMatch(
" OTS") )
1873 "#otscon, lin, conOpac LinOpc\n" );
1876 else if( p.
nMatch(
" OVER") )
1882 "#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)\tTau912\n" );
1885 else if( p.
nMatch(
" PDR") )
1889 "#depth\tH colden\tTe\tHI/HDEN\tH2/HDEN\tH2*/HDEN\tCI/C\tCO/C\tH2O/O\tG0\tAV(point)\tAV(extend)\tTauV(point)\n" );
1892 else if( p.
nMatch(
"PERF") )
1897 else if( p.
nMatch(
"PHYS") )
1902 "#PhyC depth\tTe\tn(H)\tn(e)\tHtot\taccel\tfillfac\n" );
1905 else if( p.
nMatch(
"POIN") )
1911 else if( p.
nMatch(
"PRES") )
1916 "#P depth\tPerror%%\tPcurrent\tPIn+Pinteg\tPgas(r0)\tPgas\tPram"
1917 "\tPrad(line)\tPinteg\tV(wind km/s)\tcad(wind km/s)\tP(mag)\tV(turb km/s)"
1918 "\tP(turb)\tPgr_Int\tint thin elec\tconv?\n" );
1921 else if( p.
nMatch(
"RADI") )
1924 sncatf( chHeader,
"#NZONE\tradius\tdepth\tdr\n" );
1938 else if( p.
nMatch(
"RECO") )
1946 else if( p.
nMatch(
"EFFI") )
1951 "#Recom effic H, Heo, He+\n" );
1956 fprintf(
ioQQQ,
"No option recognized on this save recombination command\n" );
1957 fprintf(
ioQQQ,
"Valid options are COEFFICIENTS, AGN, and EFFICIENCY\nSorry.\n" );
1963 else if( p.
nMatch(
"RESU") )
1979 "#results of calculation\n" );
1982 else if( p.
nMatch(
"SECO") )
1987 "#depth\tIon(H^0)\tDiss(H_2)\tExcit(Lya)\n" );
2002 "#continuum source function vs depth\n" );
2004 else if( p.
nMatch(
"SPECTRUM") )
2009 "#continuum source function nu/%s\tConEmitLocal/widflx"
2010 "\tabs opac\tConSourceFcnLocal\tConSourceFcnLocal/plankf\tConSourceFcnLocal/flux\n",
2015 fprintf(
ioQQQ,
"A second keyword must appear on this line.\n" );
2022 else if( p.
nMatch(
"SPECIAL") )
2026 sncatf( chHeader,
"#Special.\n" );
2029 else if( p.
nMatch(
"SPECIES") )
2035 chLabel = chSecondFilename;
2037 bool readlist =
true;
2038 if( lgSecondFilename )
2046 if ( readlist ==
false )
2048 fprintf(
ioQQQ,
"ParseSave SAVE SPECIES command must have just one of a) a single species matcher, b) a list, or c) the keyword ALL. Sorry.\n" );
2058 if( ! lgSecondFilename )
2060 fprintf(
ioQQQ,
"Error: File containing bands not specified\n" );
2064 string speciesLabel;
2080 thisSpBand.
filename = chSecondFilename;
2085 else if (p.
nMatch(
"COLUMN" ) )
2090 else if( p.
nMatch(
"CONT" ) )
2093 string speciesLabel = string( chSecondFilename );
2094 if( speciesLabel ==
"" )
2115 else if( p.
nMatch(
" OUT") )
2139 enum {DEBUG_IN=
false};
2142 fprintf(
ioQQQ,
"\t species :\t %s\n", speciesLabel.c_str() );
2151 else if (p.nMatch(
"DEPAR" ) )
2156 else if (p.nMatch(
"ENERG" ) )
2162 else if( p.nMatch(
"LABELS") )
2166 else if (p.nMatch(
"LEVELS" ) )
2173 else if( p.nMatch(
"LINE" ) )
2176 if( p.nMatch(
" WN " ) )
2182 if( p.nMatch(
"GF " ) )
2188 if( p.nMatch(
"RATE" ) )
2197 else if (p.nMatch(
"POPUL" ) )
2200 fprintf(
ioQQQ,
"Warning, 'save species populations' has changed to 'save species densities'.\n");
2201 fprintf(
ioQQQ,
"'save species populations' is deprecated, please update your input.\n");
2204 else if (p.nMatch(
"OPTICAL" ) )
2209 else if (p.nMatch(
"DENS" ) )
2214 else if (p.nMatch(
"OPTICAL" ) && p.nMatch(
"DEPTH") )
2221 fprintf(
ioQQQ,
"ParseSave cannot find a recognized keyword on this SAVE SPECIES command line.\n" );
2222 fprintf(
ioQQQ,
"I know about the keywords COLUMN DENSITIES, DENSITIES, DEPARTURE, CONTINUUM, BANDS, "
2223 "OPTICAL DEPTH, ENERGIES, LABELS, LEVELS, and DATA SOURCES.\nSorry.\n" );
2232 else if( p.nMatch(
"TEMP") )
2237 "#depth\tTe\tcC/dT\tdt/dr\td^2T/dr^2\n" );
2240 else if( p.nMatch(
"TIME") && p.nMatch(
"DEPE") )
2248 "#elapsed time\ttime step \tscale cont\tscalingDen\t<T>\t<H+/H rad>\t<H0/H rad>\t<2*H2/H rad>\t<He+/He rad>\t<CO/H>\t<redshift>\t<ne/nH>\n" );
2251 else if( p.nMatch(
"TPRE") )
2257 "#zone old temp, guess Tnew, new temp delta \n" );
2260 else if( p.nMatch(
"WIND") )
2264 "#radius\tdepth\tvel [cm/s]\tTot accel [cm s-2]\tLin accel [cm s-2]"
2265 "\tCon accel [cm s-2]\tforce multiplier\ta_gravity\n" );
2266 if( p.nMatch(
"TERM" ) )
2278 else if( p.nMatch(
"XSPE") )
2297 if( p.nMatch(
"RANGE") )
2300 double Elo_keV = p.FFmtRead();
2301 double Ehi_keV = p.FFmtRead();
2303 p.NoNumb(
"lower and upper energy range");
2304 if( Elo_keV >= Ehi_keV )
2306 fprintf(
ioQQQ,
"The two energies for the range must be in increasing order.\nSorry.\n");
2315 fprintf(
ioQQQ,
"Energy range is out of bounds.\nSorry.\n");
2326 if( p.nMatch(
"ATAB") )
2330 if( p.nMatch(
"TOTA") )
2334 else if( p.nMatch(
"INCI") )
2336 if( p.nMatch(
"ATTE") )
2338 else if( p.nMatch(
"REFL") )
2343 else if( p.nMatch(
"DIFF") )
2345 if( p.nMatch(
"REFL") )
2350 else if( p.nMatch(
"LINE") )
2352 if( p.nMatch(
"REFL") )
2357 else if( p.nMatch(
"SPEC") )
2359 if( p.nMatch(
"REFL") )
2369 if( p.nMatch(
"NORM") )
2373 double Enorm_keV = p.FFmtRead();
2379 fprintf(
ioQQQ,
"Normalization energy is out of bounds.\nSorry.\n");
2388 else if( p.nMatch(
"MTAB") )
2394 fprintf(
ioQQQ,
"Support only for xspec atable and xspec mtable.\n" );
2402 else if( p.nMatch(
"COLU") && p.nMatch(
"DENS") )
2404 fprintf(
ioQQQ,
"The SAVE COLUMN DENSITIES command is now an option to SAVE SPECIES, please use that command.\nSorry.\n");
2410 "ParseSave cannot find a recognized keyword on this SAVE command line.\nSorry.\n" );
2427 if( p.nMatch(
"NO BUFFER") )
2440 if( p.nMatch(
"CONV") && p.nMatch(
"REAS") )
2448 "# reason for continued iterations\n" );
2453 else if( p.nMatch(
"CONV") && p.nMatch(
"BASE") )
2464 "#zone\theat\tcool\teden\n" );
2469 else if( p.nMatch(
" DR ") )
2480 "#zone\tdepth\tdr\tdr 2 go\treason\n" );
2485 else if( p.nMatch(
"SPECIES") && p.nMatch(
"DATA") && p.nMatch(
"SOURCE") )
2495 else if( p.nMatch(
"QHEA") )
2501 "#Probability distributions from quantum heating routine\n" );
2505 else if( p.nMatch(
"POIN") )
2517 else if( p.nMatch(
"RECO") && p.nMatch(
"COEF") )
2530 "#recombination coefficients cm3 s-1 for current density and temperature\n" );
2535 else if( p.nMatch(
"GRID") )
2542 else if( p.nMatch(
" MAP") )
2574 static bool lgFIRST =
true;
2586 bool lgNoClobberDefault =
false;
2590 lgNoClobberDefault =
true;
2593 for( i=0; i <
LIMPUN; i++ )
2605 for( i=0; i <
LIMPUN; i++ )
2665 if( file_size%2880 )
2667 fprintf(
ioQQQ,
" PROBLEM FITS file is wrong size!\n" );
2743 for( vector<save_species_bands>::iterator it =
save.
specBands.begin();
2746 if( (*it).filename == filename &&
2747 (*it).speciesLabel == speciesLabel )
bool lgPunLstIter[LIMPUN]
void Parse_Save_Line_RT(Parser &p)
bool nMatch(const char *chKey) const
void parse_save_average(Parser &p, long int ipPun, ostringstream &chHeader)
realnum punarg[LIMPUN][3]
FILE * open_data(const char *fname, const char *mode, access_scheme scheme)
NORETURN void TotalInsanity(void)
vector< save_species_bands > specBands
size_t sncatf(char *buf, size_t bufSize, const char *fmt,...)
void H2_ParseSave(Parser &p, ostringstream &chHeader)
bool lgSaveGrid_noclobber
int GetQuote(string &chLabel)
void CloseSaveFiles(bool lgFinal)
bool nMatchErase(const char *chKey)
long int cdGetLineList(const char chFile[], vector< string > &chLabels, vector< realnum > &wl)
void parse_save_line(Parser &p, bool lgLog3, ostringstream &chHeader, long int ipPun)
void ParseSave(Parser &p)
bool lgTraceConvergeBase_noclobber
void trimTrailingWhiteSpace(string &str)
NORETURN void StringError() const
static t_version & Inst()
t_elementnames elementnames
bool lgCumulative[LIMPUN]
string SpeciesBandFile[LIMPUN]
bool lg_separate_iterations[LIMPUN]
FILE * ipTraceConvergeBase
char chSaveArgs[LIMPUN][5]
const char * StandardEnergyUnit(void) const
bool lgPunPoint_noclobber
const int NUM_OUTPUT_TYPES
const int INPUT_LINE_LENGTH
long int nSaveEveryZone[LIMPUN]
bool lgQHSaveFile_noclobber
bool lgLineListRatio[LIMPUN]
vector< string > chLineListLabel[LIMPUN]
NORETURN void NoNumb(const char *chDesc) const
long int GetElem(void) const
diatomics h2("h2", 4100.,&hmi.H2_total, Yan_H2_CS)
bool exists(const molecule *m)
void SaveTitleDone(int ipPun)
STATIC bool specBandsExists(const string filename, const string speciesLabel)
char chElementNameShort[LIMELM][CHARS_ELEMENT_NAME_SHORT]
double anumin(size_t i) const
SaveParams params[LIMPUN]
char chElementSym[LIMELM][CHARS_ELEMENT_SYM]
void SaveLineListFree(long i)
vector< string > contSaveSpeciesLabel
bool lgSaveEveryZone[LIMPUN]
string makeChemical(long nelem, long ion)
void SaveHeaderDone(int ipPun)
void sprt_wl(char *chString, realnum wl)
bool lgPrtIsotropicCont[LIMPUN]
const char * StandardEnergyUnit(const char *chCard)
vector< realnum > wlLineList[LIMPUN]
bool lgHashEndIter[LIMPUN]
bool lgPrtOldStyleLogs[LIMPUN]
#define DEBUG_ENTRY(funcname)
STATIC const char * ChkUnits(Parser &p)
bool lgSaveTitle(int ipPun) const
diatomics hd("hd", 4100.,&hmi.HD_total, Yan_H2_CS)
bool lgOutputTypeOn[NUM_OUTPUT_TYPES]
int fprintf(const Output &stream, const char *format,...)
string chSpeciesDominantRates[LIMPUN]
const char * chConSavEnr[LIMPUN]
vector< string > chSaveSpecies[LIMPUN]
double anumax(size_t i) const
bool lgTraceConvergeBaseHash
bool lgSaveHeader(int ipPun) const
bool lgSaveToSeparateFiles[LIMPUN]
void saveXSPEC(unsigned int option)
vector< string > chFileName