21 static bool lgFirst =
true;
26 bool lgForceLog=
false, lgForceLinear=
false;
39 for(
long i=0; i<
NISO; ++i )
41 for( nelem=0; nelem<
LIMELM; ++nelem )
54 for(
long i=1; i <
LIMELM; i++ )
60 fprintf(
ioQQQ,
" Hit EOF while reading element list; use END to end list.\n" );
72 while( j < LIMELM && !lgHIT )
87 fprintf(
ioQQQ,
" Sorry, but I did not recognize element name on this line.\n" );
88 fprintf(
ioQQQ,
" Here is the list of names I recognize.\n" );
91 for( k=2; k <=
LIMELM; k++ )
122 bool lgElementSet =
false;
133 else if( p.
nMatch(
"LINE") )
134 lgForceLinear =
true;
143 fprintf(
ioQQQ,
" There must be a number on this line.\n" );
153 " ParseElement did not find an element on the following line:\n" );
158 if( (lgForceLog || param <= 0.) && !lgForceLinear )
161 param =
exp10(param);
167 else if( p.
nMatch(
"ABUN") )
174 fprintf(
ioQQQ,
" There must be a number on this line.\n" );
184 " ParseElement did not find an element on the following line:\n" );
194 fprintf(
ioQQQ,
"log of abundance was entered, but it too large for this cpu.\n");
197 param =
exp10(param);
204 " Please check the abundance of this element. It seems high to me.\n" );
209 else if( p.
nMatch(
"ISOT") )
221 " ParseElement did not find an element on the following line:\n" );
228 fprintf(
ioQQQ,
"Sorry, you cannot set the isotope fractions of %s since it has been turned off.\n" ,
238 if( p.
lgEOL() )
break;
242 p.
NoNumb(
"isotope abundance" );
248 fprintf(
ioQQQ,
"Element Isotope: For %s, illegal isotope mass number: %d\n",
260 fprintf(
ioQQQ,
"Element Isotope: %s requires %d isotope pairs to be specified, but found %d\n",
262 fprintf(
ioQQQ,
"Enter fractionations for all isotopes, eg:\n");
270 fprintf(
ioQQQ,
"Element Isotope: Non-positive isotope fractions are illegal.\n");
289 else if( p.
nMatch(
" OFF") )
299 fprintf(
ioQQQ,
" There must be an abundances on the ELEMENT OFF LIMIT command.\n" );
310 " ParseElement did not find an element on the following line:\n" );
331 fprintf(
ioQQQ,
" It is not possible to turn hydrogen off.\n" );
339 else if( p.
nMatch(
"IONI") )
341 bool lgLogSet =
false;
349 " ParseElement did not find an element on the following line:\n" );
355 fprintf(
ioQQQ,
"Sorry, you cannot set the ionization of %s since it has been turned off.\n" ,
381 for(
long i=ion; i<nelem+2; ++i )
387 for(
long i=0; i<ion; ++i )
401 fprintf(
ioQQQ,
" element ionization command has all zero ionization fractions. This is not possible.\n Sorry\n");
405 for(
long i=low; i<=ihi; ++i )
409 fprintf(
ioQQQ,
" element abundance command has zero abundance between positive values. This is not possible.\n Sorry\n");
416 for(
long i=low; i<=ihi; ++i )
423 else if( p.
nMatch(
" ON ") )
429 " ParseElement did not find an element on the following line:\n" );
444 else if( p.
nMatch(
"TABL") )
450 " ParseElement did not find an element on the following line:\n" );
470 fprintf(
ioQQQ,
" cannot change abundance of hydrogen.\n" );
482 fprintf(
ioQQQ,
" no pairs entered - cannot interpolate\n" );
522 fprintf(
ioQQQ,
"ParseElement: TABLE ELEMENT TABLE radii "
523 "must be in increasing order\n" );
531 fprintf(
ioQQQ,
"ParseElement: ELEMENT command - there must be "
532 "a keyword on this line.\n" );
533 fprintf(
ioQQQ,
" The keys I know about are TABLE, SCALE, _OFF, "
534 "_ON_, IONIZATION, ABUNDANCE, and ISOTOPES.\n" );
550 else if( p.
nMatch(
"ABUN") )
bool nMatch(const char *chKey) const
t_mole_global mole_global
bool hasCommand(const char *s2)
vector< bool > lgTreatIsotopes
realnum AbTabFac[LIMTABD][LIMELM]
realnum SetIoniz[LIMELM][LIMELM+1]
long int IonHigh[LIMELM+1]
bool lgElmtSetOff[LIMELM]
char chVarFmt[LIMPAR][FILENAME_PATH_LENGTH_2]
realnum vparm[LIMEXT][LIMPAR]
t_elementnames elementnames
t_iso_sp iso_sp[NISO][LIMELM]
NORETURN void NoNumb(const char *chDesc) const
long int GetElem(void) const
char chElementNameShort[LIMELM][CHARS_ELEMENT_NAME_SHORT]
realnum AbTabRad[LIMTABD][LIMELM]
double levels(const genericState &gs)
#define DEBUG_ENTRY(funcname)
int fprintf(const Output &stream, const char *format,...)
int PrintLine(FILE *fp) const
char chElementName[LIMELM][CHARS_ELEMENT_NAME]
realnum ScaleElement[LIMELM]
int setAbn(int Anum, realnum abn)
void prtIsoPairs(FILE *fp)
void ParseElement(Parser &p)