41 string chString_quotes_lowercase;
47 bool lgQuotesFound =
true;
48 if (p.
GetQuote(chString_quotes_lowercase))
49 lgQuotesFound =
false;
63 else if( p.
nMatch(
"KINE") )
68 else if( p.
nMatch(
"CONS") )
109 else if (p.
nMatch(
" DIMA"))
116 " \nPROBLEM Unrecognized set collisional ionization data option.\n");
132 else if( p.
nMatch(
"AD69" ) )
143 fprintf(
ioQQQ,
" There should have been an option on this SET H2 CONTinuum DISSociation command.\n" );
144 fprintf(
ioQQQ,
" consult Hazy to find valid options.\n Sorry.\n" );
157 p.
NoNumb(
"minimum charge transfer rate");
175 else if( p.
nMatch(
" OFF" ) )
211 else if( p.
nMatch(
" OFF" ) )
245 else if( p.
nMatch(
" OFF" ) )
260 " There should have been an option on this SET CHEMISTRY command.\n");
261 fprintf(
ioQQQ,
" consult Hazy to find valid options.\n Sorry.\n");
280 else if (p.
nMatch(
"COVE"))
296 else if (p.
nMatch(
"CSUP"))
303 p.
NoNumb(
"secondary ionization rate");
308 else if (p.
nMatch(
"CUMU"))
314 else if (p.
nMatch(
"MASS"))
318 else if (p.
nMatch(
"FLUX"))
325 " Did not recognize option on 'set cumulative' command."
326 " It should be FLUX, MASS or OFF. Sorry.\n");
331 else if (p.
nMatch(
" D/H"))
338 "The command 'set D/H' has been deprecated.\n"
339 "Please use 'element hydrogen isotopes' instead.\n");
343 if (tmp <= 0. || p.
nMatch(
" LOG"))
348 "The command 'set D/H' has been deprecated.\n"
349 "Please use 'element hydrogen isotopes (1, 1) (2, %g)' instead.\n",
361 p.
NoNumb(
"density tolerance");
371 fprintf(
ioQQQ,
" The SET HO CHAR command is no longer supported.\n" );
377 fprintf(
ioQQQ,
" The SET HHE CHAR command is no longer supported.\n" );
381 else if( p.
nMatch(
"12C1") )
392 fprintf(
ioQQQ,
"Deprecated option. Please use command: \"element carbon isotope\"\n");
396 if (c12c13 <= 0. || p.
nMatch(
" LOG"))
397 c12c13 =
exp10(c12c13);
398 fprintf(
ioQQQ,
"Deprecated option. Please use command: \"element carbon isotope (12, %.2f), (13, 1)\"\n",
405 else if (p.
nMatch(
"DYNA"))
413 p.
NoNumb(
"advection length");
440 else if (p.
nMatch(
"SUPE"))
445 else if (p.
nMatch(
"STRO"))
450 else if (p.
nMatch(
"ORIG"))
464 p.
NoNumb(
"antishock depth");
475 p.
NoNumb(
"antishock-by-mach");
477 else if (p.
nMatch(
"RELA"))
483 p.
NoNumb(
"relaxation cycles before start of dynamics");
487 " First iteration to relax dynamics must be > 1."
513 " There should have been an option on this SET DYNAMICS command.\n");
514 fprintf(
ioQQQ,
" consult Hazy to find valid options.\n Sorry.\n");
519 else if (p.
nMatch(
"DIDZ"))
531 p.
NoNumb(
"largest optical depth allowed in zone");
536 else if (p.
nMatch(
"EDEN"))
547 p.
NoNumb(
"electron density error allowed");
555 else if(p.
nMatch(
"FRACTION"))
561 p.
NoNumb(
"electron density fraction");
571 else if (p.
nMatch(
"SOLV"))
578 else if (p.
nMatch(
"SECA"))
585 "'set eden solver' options are 'vWDB' and 'SECA'.\n");
596 p.
NoNumb(
"electron density");
605 else if( p.
nMatch(
"GBAR"))
620 p.
NoNumb(
"ionization error allowed");
634 "The command 'set isotopes all' has been deprecated.\n"
635 "Please use 'element isotopes all' instead.\n");
651 " An element name must appear on this line\n Sorry.\n");
660 " The number of resolution elements within FWHM of line must appear\n Sorry.\n");
670 lower_limit =
exp10(lower_limit);
672 if (lower_limit > 0.2f)
675 " The fine continuum lower limit is quite high (%f Ryd). Please check.\n",
685 upper_limit =
exp10(upper_limit);
687 if (upper_limit < 10.f)
690 " The fine continuum upper limit is quite low (%f Ryd). Please check.\n",
710 p.
NoNumb(
"grain heating");
716 " A keyword must appear on the SET GRAIN line - options are HEAT \n Sorry.\n");
746 else if (p.
nMatch(
" H2 "))
752 " The first number on this line must be the 2 in H2\n Sorry.\n");
763 "PROBLEM - *set H2 Solomon* has been changed to *set H2 small model*."
764 " This is OK for now but it may not work in a future version.\n");
771 else if (p.
nMatch(
" BHT"))
778 else if (p.
nMatch(
"BD96"))
785 else if (p.
nMatch(
"ELWE"))
795 " One of the keywords TH85, _BHT, BD96 or ELWErt must appear.\n Sorry.\n");
809 else if (p.
nMatch(
"TAKA"))
815 else if (p.
nMatch(
"THER"))
821 else if (p.
nMatch(
" OFF"))
829 " The grain form pump option is wrong.\n Sorry.\n");
835 else if (p.
nMatch(
"JURA"))
842 else if (p.
nMatch(
"CT02"))
847 else if (p.
nMatch(
"ELRD"))
852 else if (p.
nMatch(
"SN99"))
857 else if (p.
nMatch(
"RATE"))
872 else if (p.
nMatch(
"SCAL"))
882 p.
NoNumb(
"scale for Jura rate");
889 "SET H2 JURA SCALE %f LOG");
904 fprintf(
ioQQQ,
" The Jura rate option is wrong.\n Sorry.\n");
910 else if (p.
nMatch(
" TAD"))
914 p.
NoNumb(
"temperature for binding energy");
920 else if (p.
nMatch(
"FRAC"))
928 p.
NoNumb(
"H2 fractional abundance");
947 p.
NoNumb(
"H2 formation scale");
950 if (
hmi.H2_formation_scale <= 0.)
959 else if (p.
nMatch(
"HCOR"))
963 p.
NoNumb(
"scale for H0 correction to e- collision rate");
966 else if (p.
nMatch(
" PAH"))
974 else if (p.
nMatch(
"CONS"))
979 else if (p.
nMatch(
"BAKE"))
990 " a string, or one of the keywords BAKES, or CONStant must appear.\n Sorry.");
996 else if (p.
nMatch(
"PRES"))
1005 p.
NoNumb(
"pressure convergence tolerance");
1010 else if( p.
nMatch(
"IONI") )
1017 p.
NoNumb(
"number of calls from pressure to ion solver");
1021 fprintf(
ioQQQ,
" The limit must be greater than zero.\n Sorry.");
1031 " I didn\'t recognize a key on this SET PRESSURE line.\n");
1032 fprintf(
ioQQQ,
" The ones I know about are: CONVergence and IONIze.\n");
1036 else if (p.
nMatch(
"RECOMBIN"))
1039 if (p.
nMatch(
"DIELECTR"))
1046 for (
int ion = 0; ion <
LIMELM; ++ion)
1050 else if (p.
nMatch(
"SCALE"))
1058 " There must be at least one scale factor on the SET RECOMBIANTION MEAN command.\n");
1062 for (
int ion = 1; ion <
LIMELM; ++ion)
1069 for (
int ion = 0; ion <
LIMELM; ++ion)
1074 " All scale factors on the SET RECOMBIANTION MEAN command must be >=0.\n");
1080 else if (p.
nMatch(
"NOISE"))
1101 fprintf(
ioQQQ,
" key MEAN or SUPPression must appear.\n");
1108 " key DIELECTRonic must appear on set recombination command.\n");
1113 else if (p.
nMatch(
" DR "))
1125 p.
NoNumb(
"zone thickness");
1138 "\n Thicknesses less than about %.0e will NOT give accurate results. If tricking the code\n",
1142 " into computing emissivities instead of intensities, try to instead use a thickness of unity,\n");
1145 " and then multiply (divide) the results by the necessary thickness (product of densities).\n\n");
1152 " When using a relative dr, a fraction between 0 and 1 must be entered. Found: %g\n",
1158 else if (p.
nMatch(
"DRMA"))
1163 p.
NoNumb(
"maximum zone thickness");
1174 " When using a relative drmax, a fraction between 0 and 1 must be entered. Found: %g\n",
1185 p.
NoNumb(
"minimum zone thickness rel to depth");
1192 fprintf(
ioQQQ,
" When using a relative drmin, a fraction between 0 and 1 must be entered. Found: %g\n",
1198 else if (p.
nMatch(
"DRMI"))
1203 p.
NoNumb(
"minimum zone thickness");
1213 fprintf(
ioQQQ,
" When using a relative drmin, a fraction between 0 and 1 must be entered. Found: %g\n",
1219 else if (p.
nMatch(
"FLXF"))
1225 p.
NoNumb(
"faintest continuum flux to consider");
1235 fprintf(
ioQQQ,
"Sorry, this command changed to PRINT LINE PRECISION.\n");
1240 else if (p.
nMatch(
"NFNU"))
1263 || p.
nMatch(
"DIFFUSE I");
1273 " set nFnu expects one or more of the following keywords:\n");
1274 fprintf(
ioQQQ,
" INCIDENT_REFLECTED, INCIDENT_TRANSMITTED, "
1275 "DIFFUSE_INWARD, DIFFUSE_OUTWARD\n");
1281 else if (p.
nMatch(
"IND2"))
1288 else if( p.
nMatch(
" OFF") )
1294 fprintf(
ioQQQ,
" set ind2 needs either ON or OFF.\n" );
1299 else if (p.
nMatch(
"SPECIES"))
1308 p.
NoNumb(
"the default collision strengths when no collision or radiative data are available");
1313 else if( p.
nMatch(
"CONT") )
1319 string species = chString_quotes_lowercase;
1325 fprintf(
ioQQQ,
"PROBLEM No species specified with the "
1326 "'set species continuum command'\n" );
1339 "PROBLEM The 'set species continuum' command must have"
1340 " three numbers, the lower and upper wavelength range in Angstroms"
1341 " and the number of bins to divide this into.\n");
1345 if( thisCont.
wlLo >= thisCont.
wlHi )
1348 "PROBLEM The first two numbers on the 'set "
1349 "species continuum' command must be the lower and upper "
1350 "wavelength range in Angstroms and the first must be less "
1351 "than the second.\n");
1354 if( thisCont.
nBins < 2 )
1357 "PROBLEM The third number on the 'set species continuum' "
1358 "command must be the number of bins to divide the range into and"
1359 " it must be greater than 1.\n");
1365 enum { DEBUG_SPEC =
false };
1378 fprintf(
ioQQQ,
" SET SPECIES takes options GBAR and CONTINUUM.\n");
1383 else if (p.
nMatch(
"TEMP"))
1390 p.
NoNumb(
"temperature floor");
1407 " TE > %gK. Cloudy cannot handle this. Bailing out.\n",
1417 "SET TEMPERATURE FLOOR %f LOG");
1441 p.
NoNumb(
"heating cooling tolerance");
1452 "\nI did not recognize a keyword on this SET TEMPERATURE command.\n");
1454 fprintf(
ioQQQ,
"The keywords are FLOOr and CONVergence.\n");
1459 else if (p.
nMatch(
"TEST"))
1465 else if (p.
nMatch(
"TRIM"))
1485 else if (p.
nMatch(
"LOWE"))
1512 else if (p.
nMatch(
"NEW"))
1519 else if (p.
nMatch(
"NEW"))
1538 p.
NoNumb(
"trimming parameter");
1543 fprintf(
ioQQQ,
" number must be negative since log\n");
1548 else if (p.
nMatch(
"SKIP"))
1554 p.
NoNumb(
"number of points to skip in save");
1558 else if (p.
nMatch(
" UTA"))
1567 else if( p.
nMatch(
" ON " ) )
1573 fprintf(
ioQQQ,
"Error: SET UTA KISIELIUS expects ON or OFF\n" );
1577 else if( p.
nMatch(
" OFF" ) )
1585 else if (p.
nMatch(
"WEAKH"))
1592 p.
NoNumb(
"threshold on save heating and cooling");
1602 else if (p.
nMatch(
"KSHE"))
1608 p.
NoNumb(
"k-shell ionization opacity limit");
1619 fprintf(
ioQQQ,
" k-shell energy must be greater than 194 Ryd\n");
1624 else if (p.
nMatch(
"NCHR"))
1631 p.
NoNumb(
"number of charge states");
1635 long nChrg =
nint(val);
1636 if (nChrg < 2 || nChrg >
NCHU)
1639 " illegal value for number of charge states: %ld\n",
1641 fprintf(
ioQQQ,
" choose a value between 2 and %d\n", NCHU);
1643 " or increase NCHS in grainvar.h and recompile\n");
1653 else if (p.
nMatch(
"NEGO"))
1659 else if (p.
nMatch(
"NEND"))
1671 p.
NoNumb(
"limit to zone number");
1680 "CAUTION - it will take a lot of memory to save"
1681 " results for %li zones. Is this many zones really necessary?\n",
1686 else if (p.
nMatch(
"TSQD"))
1694 p.
NoNumb(
"highest density in t^2 section of printout");
1699 else if (p.
nMatch(
"NMAP"))
1705 p.
NoNumb(
"steps in heating-cooling map");
1715 else if (p.
nMatch(
"PATH"))
1717 fprintf(
ioQQQ,
" The SET PATH command is no longer supported.\n");
1718 fprintf(
ioQQQ,
" Please set the correct path using the environment variable CLOUDY_DATA_PATH.\n");
1722 else if (p.
nMatch(
"PHFI"))
1728 p.
NoNumb(
"version of PHFIT");
1736 else if (ip == 1996)
1743 fprintf(
ioQQQ,
" Two possible values are 1995 and 1996.\n");
1757 " I didn\'t recognize a key on this SET SAVE HASH line.\n");
1766 if (chString_quotes_lowercase ==
"return")
1771 else if (chString_quotes_lowercase ==
"time")
1789 fprintf(
ioQQQ,
" the keyword C is no longer necessary since"
1790 " energy conservation is now supported by default.\n");
1793 else if (p.
nMatch(
"SUPP"))
1800 p.
NoNumb(
"line width or resolution");
1804 " line width or resolution must be greater than zero.\n");
1822 else if (p.
nMatch(
"PREF"))
1826 fprintf(
ioQQQ,
" The SET SAVE PREFIX command should precede all save commands.\n" );
1836 fprintf(
ioQQQ,
" PROBLEM No prefix between double quotes was found on this line.\n" );
1841 else if (p.
nMatch(
"FLUS"))
1856 " There should have been an option on this command.\n");
1858 " Valid options for SET SAVE are summarized in Hazy 1 Miscellaneous Commands, and are:\n"
1859 " HASH, LINEWIDTH, RESOLUTION, PREFIX, FLUSH, LUMINOSITY OLD.\n");
1865 else if (p.
nMatch(
"CONT"))
1874 p.
NoNumb(
"continuum resolution scale");
1879 else if (p.
nMatch(
"SHIE"))
1892 else if (p.
nMatch(
"FEDE"))
1901 else if (p.
nMatch(
"FBUG"))
1909 else if (p.
nMatch(
"FERL"))
1913 else if (p.
nMatch(
"RODG"))
1920 else if (p.
nMatch(
"INTE"))
1926 else if (p.
nMatch(
"NONE"))
1934 " I didn\'t recognize a key on this SET CONTINUUM SHIELDing line.\n");
1936 " The ones I know about are: PESC, FEDErman, FERLand, RODGers and INTEgral.\n");
1944 " I didn\'t recognize a key on this SET CONTINUUM line.\n");
1946 " The ones I know about are: RESOlution and SHIEld.\n");
1953 fprintf(
ioQQQ,
" I didn\'t recognize a key on this SET command.\n");
bool nMatch(const char *chKey) const
t_mole_global mole_global
long int fine_opac_nresolv
bool lgLeiden_Keep_ipMH2s
bool lgCheckEnergyEveryZone
int GetQuote(string &chLabel)
realnum varang[LIMPAR][2]
char chHashString[INPUT_LINE_LENGTH]
realnum GasPhaseAbundErrorAllowed
void setAssertAbort(bool val)
char chVarFmt[LIMPAR][FILENAME_PATH_LENGTH_2]
realnum vparm[LIMEXT][LIMPAR]
double rate_h2_form_grains_set
realnum PressureErrorAllowed
void trimTrailingWhiteSpace(string &str)
const double TEMP_LIMIT_LOW
double energy(const genericState &gs)
const double TEMP_LIMIT_HIGH
double DR_mean_scale[LIMELM]
const char * StandardEnergyUnit(void) const
realnum IonizErrorAllowed
NORETURN void NoNumb(const char *chDesc) const
long int GetElem(void) const
realnum HeatCoolRelErrorAllowed
LyaSourceFunctionShape LyaSourceFunctionShape_assumed
bool lgInnerShell_Kisielius
char chH2_small_model_type
#define DEBUG_ENTRY(funcname)
realnum GrainHeatScaleFactor
bool lgCollStrenThermAver
int fprintf(const Output &stream, const char *format,...)
void init_genrand(unsigned long s)
int PrintLine(FILE *fp) const
t_secondaries secondaries
void SetNChrgStates(long nChrg)
const double DEPTH_OFFSET
void set_version(phfit_version val)
vector< adjPseudoCont > setPseudoCont