78 bool lgSecondFilename;
89 "The limit to the number of SAVE options is %ld. Increase "
90 "LIMPUN in save.h if more are needed.\nSorry.\n",
112 if( strcmp(chLabel.c_str() ,
"opacity.opc") == 0 )
114 fprintf(
ioQQQ,
"ParseSave will not allow save file name %s, please choose another.\nSorry.\n",
118 else if( chLabel==
"" )
120 fprintf(
ioQQQ,
"ParseSave found a null file name between double quotes, please check command line.\nSorry.\n");
128 strcat( chFilename , chLabel.c_str() );
133 if( p.
GetQuote( chSecondFilename ) )
134 lgSecondFilename =
false;
137 lgSecondFilename =
true;
171 sncatf( chTitle,
sizeof(chTitle),
183 ostringstream chHeader;
216 "#nu/%s\tTot opac\tAbs opac\tScat opac\tAlbedo\telem\n",
220 else if( p.
nMatch(
"FIGU") )
225 "#nu/%s\tH\tHe\ttot opac\n",
229 else if( p.
nMatch(
"FINE") )
251 fprintf(
ioQQQ,
"There must be two numbers, the lower and upper energy range in Ryd.\nSorry.\n");
259 unitChange.
set(Energy1, energyUnits );
260 Energy1 = unitChange.
Ryd();
261 unitChange.
set(Energy2, energyUnits );
262 Energy2 = unitChange.
Ryd();
282 fprintf(
ioQQQ,
"The number of fine continuum points to skip must be > 0 \nSorry.\n");
295 else if( p.
nMatch(
"GRAI") )
305 "#grain\tnu/%s\tabs+scat*(1-g)\tabs\tscat*(1-g)\tscat\tscat*(1-g)/[abs+scat*(1-g)]\n",
309 else if( p.
nMatch(
"BREM") )
314 "#nu\tbrems opac\te-e brems opac\n" );
317 else if( p.
nMatch(
"SHEL") )
336 fprintf(
ioQQQ,
"There must be atom number, ion, shell\nSorry.\n" );
340 "#sub shell cross section\n" );
343 else if( p.
nMatch(
"ELEM") )
352 if( (nelem = p.
GetElem() ) < 0 )
354 fprintf(
ioQQQ,
"I did not find an element name on the opacity element command. Sorry.\n" );
363 fprintf(
ioQQQ,
" I did not recognize a keyword on this save opacity command.\n" );
399 else if( p.
nMatch(
" AGE") )
404 "#ages depth\tt(cool)\tt(H2 dest)\tt(CO dest)\tt(OH dest)\tt(H rec)\n" );
407 else if( p.
nMatch(
" AGN") )
418 "#charge exchange rate coefficnt\n" );
421 else if( p.
nMatch(
"RECO") )
426 "#Recom rates for AGN3 table\n" );
429 else if( p.
nMatch(
"OPAC") )
436 else if( p.
nMatch(
"HECS") )
444 else if( p.
nMatch(
"HEMI") )
453 else if( p.
nMatch(
"RECC") )
458 "#T\tbAS\tb1\tbB\n" );
462 fprintf(
ioQQQ,
" I did not recognize this option on the SAVE AGN command.\n" );
468 else if( p.
nMatch(
"AVER") )
489 "#charge exchange rate coefficient\n" );
493 else if( p.
nMatch(
"CHIA"))
498 else if( p.
nMatch(
"CHEM") )
503 if( lgSecondFilename )
507 else if( p.
nMatch(
"CREA" ) )
509 else if( p.
nMatch(
"CATA" ) )
511 else if( p.
nMatch(
"ALL" ) )
528 fprintf(
ioQQQ,
" A species label must appear within a second set of quotes (following the output filename).\n" );
536 fprintf(
ioQQQ,
" I did not recognize a sub keyword on this SAVE CHEMISTRY command.\n" );
542 else if( p.
nMatch(
"COMP") )
547 "#nu, comup, comdn\n" );
550 else if( p.
nMatch(
"COOL") )
557 "#depth(cm)\tTemp(K)\tCtot(erg/cm3/s)\t" );
558 for(
int i = 0 ; i <
LIMELM ; i++ )
564 "%s",
"molecule\tdust\tH2cX\tCT C\tH-fb\tH2ln\tHD \tH2+ \tFF_H\tFF_M\teeff\tadve\tComp\tExtr\tExpn\tCycl\tdima\n" );
571 "#depth cm\tTemp K\tHtot erg/cm3/s\tCtot erg/cm3/s\tcool fracs\n" );
578 if( !lgSecondFilename )
580 fprintf(
ioQQQ,
"This command requires two items in quotes (a filename and a species label). Only one set of quotes was found.\nSorry.\n");
589 "#depth cm\t%s col cm-2\tsrc s-1\tsnk s-1\n",
598 else if( p.
nMatch(
"DYNA") )
609 "#advection depth\tHtot\tadCool\tadHeat\tdCoolHeatdT\t"
610 "Source[hyd][hyd]\tRate\tEnthalph\tadSpecEnthal\n" );
614 fprintf(
ioQQQ,
" I did not recognize a sub keyword on this SAVE DYNAMICS command.\n" );
620 else if( p.
nMatch(
"ENTH") )
625 "#depth\tTotal\tExcit\tIoniz\tBind\tKE\tther+PdV\tmag \n" );
633 "#zone\tdTime\tElapsed t\n" );
638 fprintf(
ioQQQ,
"Error: The 'save feii' commands are obsolete. "
639 " They have been replaced by the 'save species' commands.\n");
667 "#Cont bin AnuOrg/%s\tAnu\td(anu)\n",
671 else if( p.
nMatch(
"DIFF") )
682 "#energy/%s then emission per zone\n",
690 "#energy/%s\tConEmitLocal\tDiffuseLineEmission\tTotal\n",
696 else if( p.
nMatch(
"EMIS") )
703 p.
NoNumb(
"continuum emissivity frequency" );
708 fprintf(
ioQQQ,
" The frequency is outside the Cloudy range\n Sorry.\n" );
713 "#Radius\tdepth\tnujnu\tkappa_abs\tkappa_sct @ %e Ryd\n",
717 else if( p.
nMatch(
"EMIT") )
723 "#Energy/%s\treflec\toutward\ttotal\tline\tcont\n",
727 else if( p.
nMatch(
"FINE" ) )
734 "#Energy/%s\tTransmitted\n",
745 fprintf(
ioQQQ,
"There must be two numbers, the lower and upper energies in Ryd.\nSorry.\n");
753 unitChange.
set(Energy1, energyUnits );
754 Energy1 = unitChange.
Ryd();
755 unitChange.
set(Energy2, energyUnits );
756 Energy2 = unitChange.
Ryd();
776 fprintf(
ioQQQ,
"The number of fine continuum points to skip must be > 0 \nSorry.\n");
786 else if( p.
nMatch(
"GRAI") )
792 "#energy\tgraphite\trest\ttotal\n" );
795 else if( p.
nMatch(
"INCI") )
801 "#Incident Continuum, Enr\tnFn\tOcc Num\n" );
804 else if( p.
nMatch(
"INTE") )
810 "#Continuum interactions inc \totslin \totscon \tConInterOut \toutlin\n" );
815 else if( p.
nMatch(
"IONI") )
845 "#cell(on C scale)\tnu\tflux\tflx*cs\tFinc\totsl\totsc\toutlin\toutcon\trate/tot\tintegral\tline\tcont\n" );
848 else if( p.
nMatch(
"NLTE") )
854 " spectrum1\tNeXY6\tXNUMX\n");
858 else if( p.
nMatch(
"OUTW") )
865 "#Local Out anu\t ConInterOut+line\t SvOt*opc pass*opc\n" );
871 "#Out Con OutIncid OutConD OutLinD OutConS\n" );
875 else if( p.
nMatch(
"TRAN") )
881 "#ener\tTran Contin\ttrn coef\n" );
884 else if( p.
nMatch(
" TWO") )
890 "#energy\t n_nu\tnuF_nu \n" );
893 else if( p.
nMatch(
" RAW") )
899 "#Raw Con anu\tflux\totslin\totscon\tConRefIncid\tConEmitReflec\tConInterOut\toutlin\tConEmitOut\tline\tcont\tnLines\n" );
902 else if( p.
nMatch(
"REFL") )
908 "#Reflected\tcont\tline\ttotal\talbedo\tConID\n" );
921 fprintf(
ioQQQ,
"ERROR: Illegal request of isotropic continuum removal "
922 "for time integrations\n" );
928 strcpy( chHold,
"#Cont " );
930 strcpy( chHold ,
"#Cumul " );
932 "%s nu\tincident\ttrans\tDiffOut\tnet trans\treflc\ttotal\treflin\toutlin\tlineID\tcont\tnLine\n" ,
958 else if( p.
nMatch(
"CONV") )
965 else if( p.
nMatch(
"ERRO") )
971 "#depth\tnPres2Ioniz\tP(cur)\tP%%error\tNE(cor)\tNE(cur)\tNE%%error\tHeat\tCool\tHC%%error\n" );
973 else if( p.
nMatch(
"BASE") )
980 fprintf(
ioQQQ,
"There must be a second keyword on this command.\n" );
981 fprintf(
ioQQQ,
"The ones I know about are REASON, ERROR, and BASE.\n" );
993 else if( p.
nMatch(
" DR ") )
1008 if( nelem < 0 || nelem >=
LIMELM )
1010 fprintf(
ioQQQ,
" I could not recognize a valid element name on this line.\n" );
1011 fprintf(
ioQQQ,
" Please check your input script. Bailing out...\n" );
1027 sncatf( chHeader,
"#depth");
1030 for(i=0; i<=nelem+1;++i )
1041 chList.push_back(
"H2");
1045 chList.push_back(
"C[1]");
1046 chList.push_back(
"C[2]");
1047 chList.push_back(
"C[3]");
1048 chList.push_back(
"C+[1]");
1049 chList.push_back(
"C+[2]");
1050 chList.push_back(
"CO");
1054 chList.push_back(
"O[1]");
1055 chList.push_back(
"O[2]");
1056 chList.push_back(
"O[3]");
1059 for (
size_t ic=0; ic != chList.size(); ++ic)
1060 sncatf( chHeader,
"\t%s",chList[ic].c_str());
1066 else if( p.
nMatch(
"FITS") )
1070 fprintf(
ioQQQ,
"Saving FITS files is not currently supported in double precision.\n" );
1071 fprintf(
ioQQQ,
"Please recompile without the FLT_IS_DBL option.\n" );
1087 else if( p.
nMatch(
"FRED") )
1091 "#Radius\tDepth\tVelocity(km/s)\tdvdr(cm/s)\thden\teden\tTemperature\tRadAccel line\tRadAccel con\t"
1092 "Force multiplier\ta(e thin)\t"
1093 "HI\tHII\tHeI\tHeII\tHeIII\tC2\tC3\tC4\tO1\t"
1094 "O2\tO3\tO4\tO5\tO6\tO7\tO8\t"
1095 "HI\tHII\tHeI\tHeII\tHeIII\tC2\tC3\tC4\tO1\t"
1096 "O2\tO3\tO4\tO5\tO6\tO7\tO8\tMg2\tMg2\tOVI(1034) TauIn\tTauCon\n");
1101 else if( p.
nMatch(
"GAMM") )
1105 "#Photoionization rates \n" );
1106 if( p.
nMatch(
"ELEMENT") )
1120 p.
NoNumb(
"element ionization stage" );
1123 fprintf(
ioQQQ,
"Bad ionization stage - please check Hazy.\nSorry.\n");
1134 else if( p.
nMatch(
"GRAI") )
1142 else if( p.
nMatch(
"ABUN") )
1147 else if( p.
nMatch(
"D/G ") )
1152 else if( p.
nMatch(
"PHYS") )
1157 else if( p.
nMatch(
" QS ") )
1162 else if( p.
nMatch(
"TEMP") )
1167 else if( p.
nMatch(
"DRIF") )
1172 else if( p.
nMatch(
"EXTI") )
1177 "#depth\tA_V(extended)\tA_V(point)\n" );
1179 else if( p.
nMatch(
"CHAR") )
1184 else if( p.
nMatch(
"HEAT") )
1189 else if( p.
nMatch(
"POTE") )
1194 else if( p.
nMatch(
"H2RA") )
1201 fprintf(
ioQQQ,
"There must be a second key on this GRAIN command; The options I know about follow (required key in CAPS):\n");
1202 fprintf(
ioQQQ,
"OPACity, ABUNdance, D/G mass ratio, PHYSical conditions, QS , TEMPerature, DRIFt velocity, EXTInction, CHARge, HEATing, POTEntial, H2RAtes\nSorry.\n" );
1207 else if( p.
nMatch(
"GAUN") )
1211 "#Gaunt factors.\n" );
1213 else if( p.
nMatch(
"GRID") )
1219 else if( p.
nMatch(
"HIST" ) )
1227 "#iter zon\tdensity\tpres cur\tpres error\n" );
1230 else if( p.
nMatch(
"TEMP" ) )
1235 "#iter zon\ttemperature\theating\tcooling\n" );
1239 else if( p.
nMatch(
"HTWO") )
1241 fprintf(
ioQQQ,
" Sorry, this command has been replaced with the "
1242 "SAVE H2 CREATION and SAVE H2 DESTRUCTION commands.\n");
1247 else if( p.
nMatch(
"QHEA") )
1254 else if( p.
nMatch(
"HEAT") )
1260 "#depth cm\tTemp K\tHtot erg/cm3/s\tCtot erg/cm3/s\theat fracs\n" );
1271 "#wavelengths of lines from He-like ions\n" );
1275 fprintf(
ioQQQ,
"save helium has options: LINE WAVElength.\nSorry.\n" );
1281 else if( p.
nMatch(
"HUMM") )
1285 "#input to DHs routine.\n" );
1288 else if( p.
nMatch(
"HYDR") )
1295 "#depth\tTe\tHDEN\tEDEN\tHI/H\tHII/H\tH2/H\tH2+/H\tH3+/H\tH-/H\n" );
1305 "#depth\tT(spin)\tT(kin)\tT(Lya/21cm)\tnLo\tnHi\tOccLya\ttau(21cm)"
1306 "\ttau(Lya)\topac(21 cm)\tn/Ts\ttau(21)\tTex(Lya)\tN(H0)/Tspin"
1307 "\tSum_F0\tSum_F1\tSum_T21\n" );
1310 else if( p.
nMatch(
"IONI") )
1315 "#hion\tzn\tgam1\tcoll ion1\tRecTot\tHRecCaB\thii/hi\tSim hii/hi"
1316 "\time_Hrecom_long(esc)\tdec2grd\texc pht\texc col\trec eff\tsec ion\n" );
1318 else if( p.
nMatch(
"POPU") )
1323 "#depth\tn(H0)\tn(H+)\tn(1s)\tn(2s)\tn(2p)\tetc\n" );
1325 else if( p.
nMatch(
"LINE") )
1331 "#nHi\tlHi\tnLo\tlLo\tE(ryd)\ttau\n" );
1333 else if( p.
nMatch(
" LYA") )
1338 "#depth\tTauIn\tTauTot\tn(2p)/n(1s)\tTexc\tTe\tTex/T\tPesc\tPdes\tpump\topacity\talbedo\n" );
1342 fprintf(
ioQQQ,
"Save hydrogen has options: CONDitions, 21 CM, LINE, POPUlations, and IONIzation.\nSorry.\n" );
1347 else if( p.
nMatch(
"IONI") )
1352 if( (nelem = p.
GetElem() ) < 0 )
1354 fprintf(
ioQQQ,
"There must be an element name on the ionization rates command. Sorry.\n" );
1360 "#%s depth\teden\tdynamics.Rate\tabund\tTotIonize\tTotRecom\tSource\t ... \n",
1368 "#Mean ionization distribution\n" );
1372 else if( p.
nMatch(
" IP ") )
1376 "#ionization potentials, valence shell\n" );
1379 else if( p.
nMatch(
"LEID") )
1386 sncatf( chHeader,
"#ion\twl\tInt\trel int\n");
1395 "#Leid depth\tA_V(extentd)\tA_V(point)\tTe\tH0\tH2\tCo\tC+\tOo\tCO\tO2\tCH\tOH\te\tHe+\tH+\tH3+\t"
1397 "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"
1399 "H2(Sol)\tH2(FrmGrn)\tH2(photodiss)\t"
1401 "G0(DB96)\trate(CO)\trate(C)\theat\tcool\tGrnP\tGr-Gas-Cool\tGr-Gas-Heat\tCOds\tH2dH\tH2vH\tChaT\tCR H\tMgI\tSI\t"
1402 "Si\tFe\tNa\tAl\tC\tC610\tC370\tC157\tC63\tC146\n" );
1409 else if( p.
nMatch(
"NLTE") )
1414 fprintf(
ioQQQ,
" PROBLEM You must enable the USE_NLTE7 macro at compile-time to use this command.\n");
1415 fprintf(
ioQQQ,
" To do so, add EXTRA=\"-DUSE_NLTE7\" to the end of the make command.\n");
1416 fprintf(
ioQQQ,
" An example for a quad core machine:\n make -j 4 EXTRA=\"-DUSE_NLTE7\" \n");
1417 fprintf(
ioQQQ,
" in the sys_XXX folder that you want to use.\n\n\n");
1429 if( !lgSecondFilename )
1431 fprintf(
ioQQQ ,
"There must be a second file name between "
1432 "double quotes on the SAVE LINE LIST command. This second"
1433 " file contains the input line list. I did not find it.\nSorry.\n");
1450 fprintf(
ioQQQ,
"DISASTER could not open SAVE LINE LIST file %s \n",
1451 chSecondFilename.c_str() );
1474 fprintf(
ioQQQ ,
"There must be an even number of lines to"
1475 " take ratios of lines. There were %li, an odd number."
1508 sncatf( chHeader,
"#lineslist" );
1518 sncatf( chHeader,
"\t" );
1523 sncatf( chHeader,
"%s", chTemp );
1526 sncatf( chHeader,
"\n" );
1541 fprintf(
ioQQQ,
" The SAVE LINES STRUCTURE command is now SAVE LINES "
1542 "EMISSIVITY.\n Sorry.\n\n");
1546 else if( p.
nMatch(
"PRES") )
1551 "#P depth\tPtot\tPline/Ptot\tcontributors to line pressure\n" );
1554 else if( p.
nMatch(
"EMIS") )
1568 else if( p.
nMatch(
" RT " ) )
1588 lgEOL = p.
nMatch(
"RELA");
1593 else if( p.
nMatch(
"DATA") )
1607 "#Emission line data.\n" );
1610 else if( p.
nMatch(
"ARRA") )
1616 "#enr\tID\tI(intrinsic)\tI(emergent)\ttype\n" );
1619 else if( p.
nMatch(
"LABE") )
1624 "#index\tlabel\twavelength\tcomment\n" );
1661 "#species\tenergy/%s\topt depth\tdamp\n",
1674 else if( p.
nMatch(
"POPU") )
1681 "#population information\n" );
1697 else if( p.
nMatch(
"INTE") )
1702 "#Emission line intrinsic intensities per unit inner area\n" );
1727 "There must be a second number, the number of zones to print.\nSorry.\n" );
1740 "This option for SAVE LINE is something that I do not understand. Sorry.\n" );
1745 else if( p.
nMatch(
" MAP") )
1749 "#te, heating, cooling.\n" );
1780 fprintf(
ioQQQ,
"There must be a zone number, followed by two temperatures, on this line. Sorry.\n" );
1786 else if( p.
nMatch(
"MOLE") )
1792 else if( p.
nMatch(
"MONI") )
1824 sncatf( chHeader,
"#energy/%s\tTau tot\topacity\n",
1834 fprintf(
ioQQQ,
"There must be two numbers, the lower and upper energy range in Ryd.\nSorry.\n");
1842 unitChange.
set(Energy1, energyUnits );
1843 Energy1 = unitChange.
Ryd();
1844 unitChange.
set(Energy2, energyUnits );
1845 Energy2 = unitChange.
Ryd();
1865 fprintf(
ioQQQ,
"The number of fine continuum points to skip must be > 0 \nSorry.\n");
1882 "#energy/%s\ttotal\tabsorp\tscat\n",
1887 else if( p.
nMatch(
" OTS") )
1891 "#otscon, lin, conOpac LinOpc\n" );
1899 "#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" );
1902 else if( p.
nMatch(
" PDR") )
1906 "#depth\tH colden\tTe\tHI/HDEN\tH2/HDEN\tH2*/HDEN\tCI/C\tCO/C\tH2O/O\tG0\tAV(point)\tAV(extend)\tTauV(point)\n" );
1909 else if( p.
nMatch(
"PERF") )
1914 else if( p.
nMatch(
"PHYS") )
1919 "#PhyC depth\tTe\tn(H)\tn(e)\tHtot\taccel\tfillfac\n" );
1922 else if( p.
nMatch(
"POIN") )
1928 else if( p.
nMatch(
"PRES") )
1933 "#P depth\tPerror%%\tPcurrent\tPIn+Pinteg\tPgas(r0)\tPgas\tPram"
1934 "\tPrad(line)\tPinteg\tV(wind km/s)\tcad(wind km/s)\tP(mag)\tV(turb km/s)"
1935 "\tP(turb)\tPgr_Int\tint thin elec\tconv?\n" );
1938 else if( p.
nMatch(
"RADI") )
1941 sncatf( chHeader,
"#NZONE\tradius\tdepth\tdr\n" );
1955 else if( p.
nMatch(
"RECO") )
1963 else if( p.
nMatch(
"EFFI") )
1968 "#Recom effic H, Heo, He+\n" );
1973 fprintf(
ioQQQ,
"No option recognized on this save recombination command\n" );
1974 fprintf(
ioQQQ,
"Valid options are COEFFICIENTS, AGN, and EFFICIENCY\nSorry.\n" );
1980 else if( p.
nMatch(
"RESU") )
1996 "#results of calculation\n" );
1999 else if( p.
nMatch(
"SECO") )
2004 "#depth\tIon(H^0)\tDiss(H_2)\tExcit(Lya)\n" );
2019 "#continuum source function vs depth\n" );
2021 else if( p.
nMatch(
"SPECTRUM") )
2026 "#continuum source function nu/%s\tConEmitLocal/widflx"
2027 "\tabs opac\tConSourceFcnLocal\tConSourceFcnLocal/plankf\tConSourceFcnLocal/flux\n",
2032 fprintf(
ioQQQ,
"A second keyword must appear on this line.\n" );
2056 "#Cont Enr/%s\tincid nFn\ttrans\tdiff\tlines \n",
2060 else if( p.
nMatch(
"SPECIAL") )
2064 sncatf( chHeader,
"#Special.\n" );
2067 else if( p.
nMatch(
"SPECIES") )
2073 chLabel = chSecondFilename;
2075 bool readlist =
true;
2076 if( lgSecondFilename )
2084 if ( readlist ==
false )
2086 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" );
2096 if( ! lgSecondFilename )
2098 fprintf(
ioQQQ,
"Error: File containing bands not specified\n" );
2102 string speciesLabel;
2118 thisSpBand.
filename = chSecondFilename;
2123 else if (p.
nMatch(
"COLUMN" ) )
2128 else if( p.
nMatch(
"CONT" ) )
2131 string speciesLabel = string( chSecondFilename );
2132 if( speciesLabel ==
"" )
2153 else if( p.
nMatch(
" OUT") )
2177 enum {DEBUG_IN=
false};
2180 fprintf(
ioQQQ,
"\t species :\t %s\n", speciesLabel.c_str() );
2189 else if (p.nMatch(
"DEPAR" ) )
2194 else if (p.nMatch(
"ENERG" ) )
2200 else if( p.nMatch(
"LABELS") )
2204 else if (p.nMatch(
"LEVELS" ) )
2211 else if( p.nMatch(
"LINE" ) )
2214 if( p.nMatch(
" WN " ) )
2220 if( p.nMatch(
"GF " ) )
2226 if( p.nMatch(
"RATE" ) )
2235 else if (p.nMatch(
"POPUL" ) )
2238 fprintf(
ioQQQ,
"Warning, 'save species populations' has changed to 'save species densities'.\n");
2239 fprintf(
ioQQQ,
"'save species populations' is deprecated, please update your input.\n");
2242 else if (p.nMatch(
"OPTICAL" ) )
2247 else if (p.nMatch(
"DENS" ) )
2252 else if (p.nMatch(
"OPTICAL" ) && p.nMatch(
"DEPTH") )
2259 fprintf(
ioQQQ,
"ParseSave cannot find a recognized keyword on this SAVE SPECIES command line.\n" );
2260 fprintf(
ioQQQ,
"I know about the keywords COLUMN DENSITIES, DENSITIES, DEPARTURE, CONTINUUM, BANDS, "
2261 "OPTICAL DEPTH, ENERGIES, LABELS, LEVELS, and DATA SOURCES.\nSorry.\n" );
2270 else if( p.nMatch(
"TEMP") )
2275 "#depth\tTe\tcC/dT\tdt/dr\td^2T/dr^2\n" );
2278 else if( p.nMatch(
"TIME") && p.nMatch(
"DEPE") )
2286 "#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" );
2289 else if( p.nMatch(
"TPRE") )
2295 "#zone old temp, guess Tnew, new temp delta \n" );
2298 else if( p.nMatch(
"WIND") )
2302 "#radius\tdepth\tvel [cm/s]\tTot accel [cm s-2]\tLin accel [cm s-2]"
2303 "\tCon accel [cm s-2]\tforce multiplier\ta_gravity\n" );
2304 if( p.nMatch(
"TERM" ) )
2316 else if( p.nMatch(
"XSPE") )
2328 if( p.nMatch(
"RANGE") )
2335 fprintf(
ioQQQ,
"There must be two numbers, the lower and upper energy range in keV.\nSorry.\n");
2340 fprintf(
ioQQQ,
"The two energies for the range must be in increasing order.\nSorry.\n");
2354 if( p.nMatch(
"ATAB") )
2358 if( p.nMatch(
"TOTA") )
2365 else if( p.nMatch(
"INCI") )
2367 if( p.nMatch(
"ATTE") )
2374 else if( p.nMatch(
"REFL") )
2389 else if( p.nMatch(
"DIFF") )
2391 if( p.nMatch(
"REFL") )
2406 else if( p.nMatch(
"LINE") )
2408 if( p.nMatch(
"REFL") )
2423 else if( p.nMatch(
"SPEC") )
2425 if( p.nMatch(
"REFL") )
2448 else if( p.nMatch(
"MTAB") )
2457 fprintf(
ioQQQ,
"Support only for xspec atable and xspec mtable.\n" );
2465 else if( p.nMatch(
"COLU") && p.nMatch(
"DENS") )
2467 fprintf(
ioQQQ,
"The SAVE COLUMN DENSITIES command is now an option to SAVE SPECIES, please use that command.\nSorry.\n");
2473 "ParseSave cannot find a recognized keyword on this SAVE command line.\nSorry.\n" );
2481 file_name += chFilename;
2492 if( p.nMatch(
"NO BUFFER") )
2505 if( p.nMatch(
"CONV") && p.nMatch(
"REAS") )
2513 "# reason for continued iterations\n" );
2518 else if( p.nMatch(
"CONV") && p.nMatch(
"BASE") )
2529 "#zone\theat\tcool\teden\n" );
2534 else if( p.nMatch(
" DR ") )
2545 "#zone\tdepth\tdr\tdr 2 go\treason\n" );
2550 else if( p.nMatch(
"SPECIES") && p.nMatch(
"DATA") && p.nMatch(
"SOURCE") )
2560 else if( p.nMatch(
"QHEA") )
2566 "#Probability distributions from quantum heating routine\n" );
2570 else if( p.nMatch(
"POIN") )
2582 else if( p.nMatch(
"RECO") && p.nMatch(
"COEF") )
2595 "#recombination coefficients cm3 s-1 for current density and temperature\n" );
2600 else if( p.nMatch(
"GRID") )
2607 else if( p.nMatch(
" MAP") )
2639 static bool lgFIRST =
true;
2651 bool lgNoClobberDefault =
false;
2655 lgNoClobberDefault =
true;
2658 for( i=0; i <
LIMPUN; i++ )
2670 for( i=0; i <
LIMPUN; i++ )
2730 if( file_size%2880 )
2732 fprintf(
ioQQQ,
" PROBLEM FITS file is wrong size!\n" );
2808 for( vector<save_species_bands>::iterator it =
save.
specBands.begin();
2811 if( (*it).filename == filename &&
2812 (*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]
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]
bool lgTraceConvergeBaseHash
bool lgSaveHeader(int ipPun) const
bool lgSaveToSeparateFiles[LIMPUN]