59 static bool lgmole_Init_called=
false;
60 static long int num_total_MALLOC=-1;
61 if(! lgmole_Init_called )
64 lgmole_Init_called =
true;
77 fprintf(
ioQQQ,
"DISASTER - the number of species in the chemistry network has increased. This is not allowed.\n");
78 fprintf(
ioQQQ,
"This could happen if an element was initially turned off or grains not included, then the element or grains was included. There are not allowed.\n");
102 for(
long nelem=0; nelem<
LIMELM; ++nelem )
106 (
double*)
MALLOC(
sizeof(
double)*(unsigned)(nelem+2) );
108 (
double*)
MALLOC(
sizeof(
double)*(unsigned)(nelem+2) );
111 for(
long ion=0; ion<nelem+2; ++ion )
121 for(
long nelem=0; nelem<
LIMELM; ++nelem )
124 for(
long ion=0; ion<nelem+2; ++ion )
128 sink[nelem][ion] = 0.;
129 for(
long ion2=0; ion2<nelem+2; ++ion2 )
135 for(
long i=0; i < mole_global.
num_calc; i++ )
152 fprintf(
ioQQQ,
"Error, CHEMISTRY requires option to be specified\n");
160 if (!strncmp(
"REAC",s.
value.c_str(),4))
163 vector<string> reactions;
166 reactions.push_back(s.
value);
175 fprintf(
ioQQQ,
"No reactions found for CHEMistry REACtion command\n");
176 fprintf(
ioQQQ,
"Reactions needs to be included in quotes \"\"\n");
179 reactions.push_back(s.
value);
187 else if (s.
value !=
",")
189 fprintf(
ioQQQ,
"Syntax error for CHEMistry REACtion command\n");
195 fprintf(
ioQQQ,
"Syntax error for CHEMistry REACtion command\n");
202 fprintf(
ioQQQ,
"No reaction found for CHEMistry REACtion command\n");
203 fprintf(
ioQQQ,
"Reaction needs to be included in quotes \"\"\n");
209 if (s.
value ==
"OFF")
211 for (vector<string>::iterator it = reactions.begin();
212 it != reactions.end(); ++it)
220 "not known\n",s.
value.c_str());
226 fprintf(
ioQQQ,
"Error, CHEMISTRY REACTION needs action\n");
233 fprintf(
ioQQQ,
"Error, unknown option to CHEMISTRY: %s\n",
245 fprintf(
ioQQQ,
"Syntax error, CHEMISTRY option [, option]\n");
t_mole_global mole_global
vector< double > reaction_rks
vector< bool > lgTreatIsotopes
void mole_make_list(void)
map< string, bool > offReactions
vector< double > old_reaction_rks
realnum *** xMoleChTrRate
valarray< class molezone > species
#define DEBUG_ENTRY(funcname)
bool lgGrain_mole_deplete
int fprintf(const Output &stream, const char *format,...)
void mole_make_groups(void)
void ParseChemistry(Parser &p)