cloudy  trunk
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
parse_dont.cpp
Go to the documentation of this file.
1 /* This file is part of Cloudy and is copyright (C)1978-2008 by Gary J. Ferland and
2  * others. For conditions of distribution and use see copyright notice in license.txt */
3 /*ParseDont parse the dont command - do not do something */
4 #include "cddefines.h"
5 #include "taulines.h"
6 #include "opacity.h"
7 #include "phycon.h"
8 #include "secondaries.h"
9 #include "pressure.h"
10 #include "prt.h"
11 #include "coolheavy.h"
12 #include "thermal.h"
13 #include "rfield.h"
14 #include "dynamics.h"
15 #include "mole.h"
16 #include "rt.h"
17 #include "hmi.h"
18 #include "atomfeii.h"
19 #include "yield.h"
20 #include "ionbal.h"
21 #include "atmdat.h"
22 #include "grainvar.h"
23 #include "hyperfine.h"
24 #include "parse.h"
25 
26 void ParseDont(char *chCard )
27 {
28  DEBUG_ENTRY( "ParseDont()" );
29 
30  if( (nMatch( "21CM" , chCard ) || nMatch( "21 CM" , chCard )) &&
31  nMatch( " LYA" , chCard ) && nMatch( "PUMP" , chCard ) )
32  {
33  /* no Lya 21 cm pump turns off 21 cm pumping of Lya */
34  hyperfine.lgLya_pump_21cm = false;
35  }
36  else if( nMatch("ADVE",chCard) )
37  {
38  /* turn off different aspects of advection */
39  if( nMatch("H-LI",chCard) )
40  {
41  /* advection for the H-like ion sequence */
42  dynamics.lgISO[ipH_LIKE] = 0;
43  }
44  else if( nMatch("HE-L",chCard) )
45  {
46  /* advection for the He-like ion sequence */
48  }
49  else if( nMatch("META",chCard) )
50  {
51  /* advection for the everything else - those done in ion_solver */
52  dynamics.lgMETALS = 0;
53  }
54  else if( nMatch("COOL",chCard) )
55  {
56  /* turn off cooling - heating due to advection */
57  dynamics.lgCoolHeat = 0;
58  }
59  else
60  {
61  /* no sub option, so turn them all off */
62  dynamics.lgISO[ipH_LIKE] = 0;
64  dynamics.lgMETALS = 0;
65  }
66 
67  }
68 
69  else if( nMatch("AUGE",chCard) )
70  {
71  /* turn off auger effect by killing its block data */
73  phycon.lgPhysOK = false;
74  }
75 
76  else if( nMatch("BUFF",chCard) )
77  {
78  /* NO BUFFERING turn off buffered io for standard output,
79  * used to get output when code crashes */
80 
81  /* >>chng 06 jun 28, moved handling of NO BUFFERING command to cdRead, PvH */
82 
83  /* stderr may be a preprocessor macro, so lets be really careful here */
84  FILE *test = stderr;
85  if( ioQQQ != test )
86  {
87  /* this should really say stdout and not stderr ! */
88  fprintf( ioQQQ, " ioQQQ did not point to stdout, ignored NO BUFFERING command.\n" );
89  }
90 
91  }
92 
93  else if( nMatch("CHAR",chCard) )
94  {
95  /* turn off all charge transfer interactions */
96  atmdat.lgCTOn = false;
97  phycon.lgPhysOK = false;
98  }
99 
100  else if( nMatch("CTHE",chCard) )
101  {
102  /* turn off charge transfer heating */
103  atmdat.HCharHeatOn = 0.;
104  phycon.lgPhysOK = false;
105  }
106 
107  else if( nMatch("COMP",chCard) )
108  {
109  /* turn off both recoil ionization and compton heating of free electron */
110  rfield.comoff = 0.;
111  phycon.lgPhysOK = false;
112  }
113 
114  else if( nMatch("FEII",chCard) )
115  {
116  /* turn off feii ly-alpha pumping - rate evaluated in FeIILyaPump */
117  FeII.lgLyaPumpOn = false;
118  phycon.lgPhysOK = false;
119  }
120 
121  else if( nMatch("FILE",chCard) && nMatch("OPAC",chCard) )
122  {
123  /* no file opacities, generate them on the fly even if file present */
124  opac.lgUseFileOpac = false;
125  }
126 
127  else if( nMatch("FINE",chCard) && nMatch("OPAC",chCard) )
128  {
129  /* no fine opacities */
130  rfield.lgOpacityFine = false;
131  }
132 
133  else if( nMatch("FINE",chCard) )
134  {
135  /* turn off fine structure optical depths */
136  rt.lgFstOn = false;
137  phycon.lgPhysOK = false;
138  }
139 
140  else if( nMatch("FREE",chCard) )
141  {
142  /* turn off free free heating and cooling */
143  CoolHeavy.lgFreeOn = false;
144  phycon.lgPhysOK = false;
145  }
146 
147  else if( nMatch("GRAI",chCard) )
148  {
149  if( nMatch("NEUT",chCard) )
150  {
151  /* turn off ion grain recombination "NO GRAIN NEUTRALIZATION" */
152  ionbal.lgGrainIonRecom = false;
153  phycon.lgPhysOK = false;
154  }
155  else if( nMatch("GAS ",chCard) && nMatch("COLL",chCard) && nMatch("ENER",chCard) )
156  {
157  /* turn off grain - gas collisional energy exchange
158  * "NO GRAIN GAS COLLISIONAL ENERGY EXCHANGE " */
159  gv.lgDColOn = false;
160  phycon.lgPhysOK = false;
161  }
162  else if( nMatch("ELEC",chCard) )
163  {
164  /* turn off grain contributions to electrons "NO GRAIN ELECTRONS" */
165  gv.lgGrainElectrons = false;
166  phycon.lgPhysOK = false;
167  }
168  else if( nMatch("MOLE",chCard) )
169  {
170  /* turn off capture of molecules on grain surfaces "NO GRAIN MOLECULES" */
171  mole.lgGrain_mole_deplete = false;
172  phycon.lgPhysOK = false;
173  }
174  else if( nMatch("QHEA",chCard) )
175  {
176  /* turn off quantum heating of grains "NO GRAIN QHEAT" */
177  gv.lgQHeatOn = false;
178  phycon.lgPhysOK = false;
179  }
180  else if( nMatch("X-RA",chCard) )
181  {
182  /* revert to WD01 physics "NO GRAIN X-RAY TREATMENT" */
183  gv.lgWD01 = true;
184  }
185  else if( nMatch("PHYSICS",chCard) )
186  {
187  /* turn off grain physics "NO GRAIN PHYSICS" */
188  gv.lgGrainPhysicsOn = false;
189  phycon.lgPhysOK = false;
190  }
191  else
192  {
193  fprintf( ioQQQ, " No key recognized on this line.\n" );
194  cdEXIT(EXIT_FAILURE);
195  }
196  }
197 
198  /* no induced processes */
199  else if( nMatch("INDU",chCard) )
200  {
201  /* turn off induced recombination, stimulated emission,
202  * continuum fluorescent excitation of lines,
203  * stimulated emission correction to optical depths attenuation */
204  rfield.lgInducProcess = false;
205  }
206 
207  /* no collisional ionization */
208  else if( nMatch("COLL",chCard) && nMatch("IONI",chCard) )
209  {
210  /* turn off collisional ionization */
211  atmdat.lgCollIonOn = false;
212  }
213 
214  else if( nMatch("LEVE",chCard) )
215  {
216  /* turn off the set of level 2 lines, safe for lower densities
217  * this is the upper limit to the counter that is always used,
218  * so no loops will ever occur */
219  /* >>chng 06 mar 04 from -1 to 0 so that size_t is zero in state put & get */
220  /*nWindLine = -1;*/
221  nWindLine = 0;
222  }
223 
224  /* various no line options */
225  else if( nMatch("LINE",chCard) && !nMatch(" OTS",chCard) )
226  {
227  if( nMatch("DIFF",chCard) && nMatch("PUMP",chCard) )
228  {
229  /* no diffuse line pumping,
230  * turn off pumping of lines by diffuse continuum*/
231  rfield.DiffPumpOn = 0.;
232  }
233  else if( nMatch("TRAN",chCard) )
234  {
235  /* no line transfer command */
236  rfield.lgDoLineTrans = false;
237  }
238  else
239  {
240  /* missing no line option */
241  fprintf( ioQQQ, " There has to be an option on the NO LINE command.\n" );
242  fprintf( ioQQQ, " The optinoas are DIFFUSE PUMP and TRANSFER.\n Sorry.\n" );
243  cdEXIT(EXIT_FAILURE);
244  }
245  }
246 
247 
248  else if( nMatch("OPAC",chCard) && nMatch("REEVAL",chCard) )
249  {
250  /* don't constantly reevaluate the opacities */
251  rfield.lgOpacityReevaluate = false;
252  }
253 
254  else if( nMatch("IONI",chCard) && nMatch("REEVAL",chCard) )
255  {
256  /* "no ionization reevaluation" - don't constantly reevaluate the ionization */
257  rfield.lgIonizReevaluate = false;
258  }
259 
260  /* options to kill ots components as debugging aids */
261  else if( nMatch(" OTS",chCard) )
262  {
263  if( nMatch(" LYA",chCard) )
264  {
265  /* turn off Lya ots rates - for debugging oscillations */
266  rfield.lgLyaOTS = false;
267  }
268 
269  else if( nMatch("HEII",chCard) )
270  {
271  /* turn off Lya ots rates - for debugging oscillations */
272  rfield.lgHeIIOTS = false;
273  }
274 
275  else if( nMatch("LINE",chCard) )
276  {
277  /* turn off line ots rates - for debugging oscillations */
278  rfield.lgKillOTSLine = true;
279  }
280  }
281 
282  /* options to kill outward compoents as a debugging aid */
283  else if( nMatch("OUTW",chCard) )
284  {
285  if( nMatch("LINE",chCard) )
286  {
287  /* turn off Lya ots rates - for debugging oscillations */
288  rfield.lgKillOutLine = true;
289  }
290  else if( nMatch("CONT",chCard) )
291  {
292  /* turn off Lya ots rates - for debugging oscillations */
293  rfield.lgKillOutCont = true;
294  }
295  }
296  else if( nMatch("MOLE",chCard) )
297  {
298  /* disable molecule formation, first option is to turn off only H2 part */
299  if( nMatch(" H2 ",chCard) )
300  {
301  /* turn off only H2 */
302  hmi.lgNoH2Mole = true;
303  }
304  else if( nMatch(" CO ",chCard) )
305  {
306  /* turn off CO network */
307  co.lgNoCOMole = true;
308  }
309  else
310  {
311  /* turn off both CO and H2 networks */
312  hmi.lgNoH2Mole = true;
313  co.lgNoCOMole = true;
314  }
315  phycon.lgPhysOK = false;
316  }
317 
318  else if( nMatch("PHOT",chCard) )
319  {
320  /* disable photoionization */
321  ionbal.lgPhotoIoniz_On = false;
322  phycon.lgPhysOK = false;
323  }
324 
325  else if( nMatch("RADI",chCard) )
326  {
327  /* don't include line radiation pressure */
328  pressure.lgLineRadPresOn = false;
329  }
330 
331  else if( nMatch("RECO",chCard) )
332  {
333  /* disable compton recoil of bound electrons - "no recoil ioniz" */
334  ionbal.lgCompRecoil = false;
335  phycon.lgPhysOK = false;
336  }
337 
338  else if( nMatch("SCAT",chCard) && nMatch("OPAC",chCard))
339  {
340  /* no scattering opacity, for Compton thick spherical geometry */
341  opac.lgScatON = false;
342  }
343 
344  else if( nMatch("SCAT",chCard) && nMatch("ESCA",chCard))
345  {
346  /* no electron scattering contribution to line escape probs */
347  rt.lgElecScatEscape = false;
348  }
349 
350  else if( nMatch("SECO",chCard) )
351  {
352  /* turn off secondary electron ionizations */
353  secondaries.lgSecOFF = true;
354  phycon.lgPhysOK = false;
355  }
356 
357  else if( nMatch("SPOT",chCard) )
358  {
359  /* no on-the-spot; turn on all ground state rec */
360  opac.otsmin = 1.;
361  }
362 
363  else if( nMatch("STAR",chCard) )
364  {
365  /* no stark broadening */
366  rt.lgStarkON = false;
367  phycon.lgPhysOK = false;
368  }
369 
370  else if( nMatch("STAT",chCard) )
371  {
372  /* no static opacities - constantly reevaluate them */
373  opac.lgOpacStatic = false;
374  }
375 
376  else if( nMatch("TEPR",chCard) )
377  {
378  /* no tepredictor */
379  /* turn off prediction of next zone's temperature, as guessed in ZoneStart */
380  thermal.lgPredNextTe = false;
381  }
382 
383  else if( nMatch("THRE",chCard) )
384  {
385  /* turn off Cota's three body rec subroutine */
386  ionbal.lgNoCota = true;
387  phycon.lgPhysOK = false;
388  }
389 
390  else if( nMatch("TIME",chCard) )
391  {
392  /* don't print anything with a time, so that we can expect
393  * perfect agreement between separate runs */
394  prt.lgPrintTime = false;
395  }
396 
397  else if( nMatch(" UTA",chCard) )
398  {
399  /* turn off ALL inner shell absorption ionization */
400  ionbal.lgInnerShellLine_on = false;
401  phycon.lgPhysOK = false;
402  }
403 
404  /* the no vary command is parsed well before we get to this point,
405  * but we have to do something here or the parser will say that
406  * no command existed on the command line */
407  else if( strncmp(chCard , "NO VARY" , 7 ) == 0 )
408  {
409  /* this is a no-nothing, picked up to stop optimizer */
410  ((void)0);
411  }
412 
413  else
414  {
415  /* end of else if trap */
416  fprintf( ioQQQ,
417  " I do not recognize a keyword on this NO ... command.\n %s\n Sorry.\n" ,
418  chCard);
419  cdEXIT(EXIT_FAILURE);
420  }
421 
422  /* this option, if keyword (OK) appears, then do not set warning */
423  if( nMatch("(OK)",chCard) )
424  {
425  /* say that physical conditions are actually ok */
426  phycon.lgPhysOK = true;
427  }
428  return;
429 }

Generated for cloudy by doxygen 1.8.4