19 static bool lgFirst =
true;
26 bool lgForceLog=
false, lgForceLinear=
false;
40 for( i=0; i<
NISO; ++i )
42 for( nelem=0; nelem<
LIMELM; ++nelem )
52 if(
nMatch(
"READ",chCard) )
55 for( i=1; i <
LIMELM; i++ )
61 fprintf(
ioQQQ,
" Hit EOF while reading element list; use END to end list.\n" );
65 strcpy( chCap, chCard );
69 if( strncmp(chCap,
"END",3) == 0 )
76 while( j < LIMELM && !lgHIT )
90 fprintf(
ioQQQ,
"%80.80s\n", chCard );
91 fprintf(
ioQQQ,
" Sorry, but I did not recognize element name on this line.\n" );
92 fprintf(
ioQQQ,
" Here is the list of names I recognize.\n" );
93 fprintf(
ioQQQ,
" " );
95 for( k=2; k <=
LIMELM; k++ )
106 strcpy( chCap, chCard );
109 if( strncmp(chCap,
"END",3) == 0 )
116 fprintf(
ioQQQ,
" Too many elements were entered.\n" );
117 fprintf(
ioQQQ,
" I only know about%3d elements.\n",
119 fprintf(
ioQQQ,
" Sorry.\n" );
128 bool lgElementSet =
false;
137 if(
nMatch(
" LOG",chCard) )
139 else if(
nMatch(
"LINE",chCard) )
140 lgForceLinear =
true;
145 if(
nMatch(
"SCAL",chCard) )
150 fprintf(
ioQQQ,
" There must be a number on this line.\n" );
151 fprintf(
ioQQQ,
" Sorry.\n" );
161 " ParseElement did not find an element on the following line:\n" );
163 "%80.80s\n", chCard );
167 if( (lgForceLog || param <= 0.) && !lgForceLinear )
170 param = pow(10.,param);
176 else if(
nMatch(
"ABUN",chCard) )
181 fprintf(
ioQQQ,
" There must be a number on this line.\n" );
182 fprintf(
ioQQQ,
" Sorry.\n" );
192 " ParseElement did not find an element on the following line:\n" );
194 "%80.80s\n", chCard );
209 " Please check the abundance of this element. It seems high to me.\n" );
214 else if(
nMatch(
" OFF",chCard) )
219 if(
nMatch(
"LIMI",chCard) )
223 fprintf(
ioQQQ,
" There must be an abundances on the ELEMENT OFF LIMIT command.\n" );
224 fprintf(
ioQQQ,
" Sorry.\n" );
234 " ParseElement did not find an element on the following line:\n" );
236 "%80.80s\n", chCard );
255 fprintf(
ioQQQ,
" It is not possible to turn hydrogen off.\n" );
256 fprintf(
ioQQQ,
" Sorry.\n" );
263 else if(
nMatch(
"IONI",chCard) )
265 bool lgLogSet =
false;
273 " ParseElement did not find an element on the following line:\n" );
275 "%80.80s\n", chCard );
280 fprintf(
ioQQQ,
"Sorry, you cannot set the ionization of %s since it has been turned off.\n" ,
306 for( i=ion; i<nelem+2; ++i )
312 for( i=0; i<ion; ++i )
326 fprintf(
ioQQQ,
" element ionization command has all zero ionization fractions. This is not possible.\n Sorry\n");
329 for(i=low; i<=ihi; ++i )
333 fprintf(
ioQQQ,
" element abundance command has zero abundance between positive values. This is not possible.\n Sorry\n");
344 fprintf(
ioQQQ,
" Hydrogen ionization has been set, H chemistry is disabled.\n");
353 fprintf(
ioQQQ,
" The ionization of an element in the CO chemistry network has been set, CO chemistry is disabled.\n");
361 else if(
nMatch(
" ON ",chCard) )
367 " ParseElement did not find an element on the following line:\n" );
369 "%80.80s\n", chCard );
382 else if(
nMatch(
"TABL",chCard) )
388 " ParseElement did not find an element on the following line:\n" );
390 "%80.80s\n", chCard );
401 if(
nMatch(
"DEPT",chCard) )
409 fprintf(
ioQQQ,
" cannot change abundance of hydrogen.\n" );
410 fprintf(
ioQQQ,
" Sorry.\n" );
422 fprintf(
ioQQQ,
" no pairs entered - cannot interpolate\n" );
438 cap4(chCap , chCard);
439 if( strncmp(chCap,
"END",3) == 0 )
464 fprintf(
ioQQQ,
"ParseElement: TABLE ELEMENT TABLE radii "
465 "must be in increasing order\n" );
473 fprintf(
ioQQQ,
"ParseElement: ELEMENT command - there must be "
474 "a keyword on this line.\n" );
475 fprintf(
ioQQQ,
" The keys I know about are TABLE, SCALE, _OFF, "
476 "_ON_, IONIZATION, and ABUNDANCE.\n" );
477 fprintf(
ioQQQ,
" Sorry.\n" );
488 if(
nMatch(
"SCAL",chCard) )
499 else if(
nMatch(
"ABUN",chCard) )