cloudy trunk
Loading...
Searching...
No Matches
parse_dont.cpp
Go to the documentation of this file.
1/* This file is part of Cloudy and is copyright (C)1978-2013 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 "save.h"
25#include "parser.h"
26
28{
29 DEBUG_ENTRY( "ParseDont()" );
30
31 if( (p.nMatch( "21CM" ) || p.nMatch( "21 CM" )) &&
32 p.nMatch( " LYA" ) && p.nMatch( "PUMP" ) )
33 {
34 /* no Lya 21 cm pump turns off 21 cm pumping of Lya */
36 }
37 else if( p.nMatch("ADVE") )
38 {
39 /* turn off different aspects of advection */
40 if( p.nMatch("H-LI") )
41 {
42 /* advection for the H-like ion sequence */
44 }
45 else if( p.nMatch("HE-L") )
46 {
47 /* advection for the He-like ion sequence */
49 }
50 else if( p.nMatch("META") )
51 {
52 /* advection for the everything else - those done in ion_solver */
54 }
55 else if( p.nMatch("COOL") )
56 {
57 /* turn off cooling - heating due to advection */
59 }
60 else
61 {
62 /* no sub option, so turn them all off */
66 }
67
68 }
69
70 else if( p.nMatch("AUGE") )
71 {
72 /* turn off auger effect by killing its block data */
74 phycon.lgPhysOK = false;
75 }
76
77 else if( p.nMatch("BUFF") )
78 {
79 /* NO BUFFERING turn off buffered io for standard output,
80 * used to get output when code crashes */
81
82 /* >>chng 06 jun 28, moved handling of NO BUFFERING command to cdRead, PvH */
83
84 /* stderr may be a preprocessor macro, so lets be really careful here */
85 FILE *test = stderr;
86 if( ioQQQ != test && save.chOutputFile.empty() )
87 {
88 /* this should really say stdout and not stderr ! */
89 fprintf( ioQQQ, " ignored NO BUFFERING command since it could not be done safely.\n" );
90 }
91
92 }
93
94 else if( p.nMatch("CHAR") )
95 {
96 /* turn off all charge transfer interactions */
97 atmdat.lgCTOn = false;
98 phycon.lgPhysOK = false;
99 }
100
101 else if( p.nMatch("CTHE") )
102 {
103 /* turn off charge transfer heating */
104 atmdat.HCharHeatOn = 0.;
105 phycon.lgPhysOK = false;
106 }
107
108 else if( p.nMatch("COMP") )
109 {
110 /* turn off both recoil ionization and compton heating of free electron */
111 rfield.lgComptonOn = false;
112 phycon.lgPhysOK = false;
113 }
114
115 else if( p.nMatch("FEII") )
116 {
117 /* turn off feii ly-alpha pumping - rate evaluated in FeIILyaPump */
118 FeII.lgLyaPumpOn = false;
119 phycon.lgPhysOK = false;
120 }
121
122 else if( p.nMatch("FILE") && p.nMatch("OPAC") )
123 {
124 /* no file opacities, generate them on the fly even if file present */
125 opac.lgUseFileOpac = false;
126 }
127
128 else if( p.nMatch("FINE") && p.nMatch("OPAC") )
129 {
130 /* no fine opacities */
131 rfield.lgOpacityFine = false;
132 }
133
134 else if( p.nMatch("FINE") )
135 {
136 /* turn off fine structure optical depths */
137 rt.lgFstOn = false;
138 phycon.lgPhysOK = false;
139 }
140
141 else if( p.nMatch("FREE") )
142 {
143 /* turn off free free heating and cooling */
144 CoolHeavy.lgFreeOn = false;
145 phycon.lgPhysOK = false;
146 }
147
148 else if( p.nMatch("GRAI") )
149 {
150 if( p.nMatch("NEUT") )
151 {
152 /* turn off ion grain recombination "NO GRAIN NEUTRALIZATION" */
153 ionbal.lgGrainIonRecom = false;
154 phycon.lgPhysOK = false;
155 }
156 else if( p.nMatch("GAS ") && p.nMatch("COLL") && p.nMatch("ENER") )
157 {
158 /* turn off grain - gas collisional energy exchange
159 * "NO GRAIN GAS COLLISIONAL ENERGY EXCHANGE " */
160 gv.lgDColOn = false;
161 phycon.lgPhysOK = false;
162 }
163 else if( p.nMatch("ELEC") )
164 {
165 /* turn off grain contributions to electrons "NO GRAIN ELECTRONS" */
166 gv.lgGrainElectrons = false;
167 phycon.lgPhysOK = false;
168 }
169 else if( p.nMatch("MOLE") )
170 {
171 /* turn off capture of molecules on grain surfaces "NO GRAIN MOLECULES" */
173 phycon.lgPhysOK = false;
174 }
175 else if( p.nMatch("QHEA") )
176 {
177 /* turn off quantum heating of grains "NO GRAIN QHEAT" */
178 gv.lgQHeatOn = false;
179 phycon.lgPhysOK = false;
180 }
181 else if( p.nMatch("X-RA") )
182 {
183 /* revert to WD01 physics "NO GRAIN X-RAY TREATMENT" */
184 gv.lgWD01 = true;
185 }
186 else if( p.nMatch("PHYSICS") )
187 {
188 /* turn off grain physics "NO GRAIN PHYSICS" */
189 gv.lgGrainPhysicsOn = false;
190 phycon.lgPhysOK = false;
191 }
192 else
193 {
194 fprintf( ioQQQ, " No key recognized on this line.\n" );
196 }
197 }
198
199 /* no induced processes */
200 else if( p.nMatch("INDU") )
201 {
202 /* turn off induced recombination, stimulated emission,
203 * continuum fluorescent excitation of lines,
204 * stimulated emission correction to optical depths attenuation */
205 rfield.lgInducProcess = false;
206 }
207
208 /* no collisional ionization */
209 else if( p.nMatch("COLL") && p.nMatch("IONI") )
210 {
211 fixit(); // This variable doesn't do anything!
212
213 /* turn off collisional ionization */
214 atmdat.lgCollIonOn = false;
215 fprintf( ioQQQ, " This option is not working.\n Sorry.\n" );
217 }
218
219 else if( p.nMatch("LEVE") )
220 {
221 /* turn off the set of level 2 lines, safe for lower densities
222 * this is the upper limit to the counter that is always used,
223 * so no loops will ever occur */
224 /* >>chng 06 mar 04 from -1 to 0 so that size_t is zero in state put & get */
225 /*nWindLine = -1;*/
226 nWindLine = 0;
227 }
228
229 /* various no line options */
230 else if( p.nMatch("LINE") && !p.nMatch(" OTS") && !p.nMatch("OUTW") )
231 {
232 if( p.nMatch("DIFF") && p.nMatch("PUMP") )
233 {
234 /* no diffuse line pumping,
235 * turn off pumping of lines by diffuse continuum*/
236 rfield.DiffPumpOn = 0.;
237 fprintf( ioQQQ, " This option is disabled.\n Sorry.\n" );
239 }
240 else if( p.nMatch("TRAN") )
241 {
242 /* no line transfer command */
243 rfield.lgDoLineTrans = false;
244 }
245 else
246 {
247 /* missing no line option */
248 fprintf( ioQQQ, " There has to be an option on the NO LINE command.\n" );
249 fprintf( ioQQQ, " The options are DIFFUSE PUMP and TRANSFER.\n Sorry.\n" );
251 }
252 }
253
254
255 else if( p.nMatch("OPAC") && p.nMatch("REEVAL") )
256 {
257 /* don't constantly reevaluate the opacities */
259 }
260
261 else if( p.nMatch("IONI") && p.nMatch("REEVAL") )
262 {
263 /* "no ionization reevaluation" - don't constantly reevaluate the ionization */
265 }
266
267 /* options to kill ots components as debugging aids */
268 else if( p.nMatch(" OTS") )
269 {
270 if( p.nMatch(" LYA") )
271 {
272 /* turn off Lya ots rates - for debugging oscillations */
273 rfield.lgLyaOTS = false;
274 }
275
276 else if( p.nMatch("HEII") )
277 {
278 /* turn off Lya ots rates - for debugging oscillations */
279 rfield.lgHeIIOTS = false;
280 }
281
282 else if( p.nMatch("LINE") )
283 {
284 /* turn off line ots rates - for debugging oscillations */
285 rfield.lgKillOTSLine = true;
286 }
287 }
288
289 /* options to kill outward compoents as a debugging aid */
290 else if( p.nMatch("OUTW") )
291 {
292 if( p.nMatch("LINE") )
293 {
294 /* turn off Lya ots rates - for debugging oscillations */
295 rfield.lgKillOutLine = true;
296 }
297 else if( p.nMatch("CONT") )
298 {
299 /* turn off Lya ots rates - for debugging oscillations */
300 rfield.lgKillOutCont = true;
301 }
302 }
303 else if( p.nMatch("MOLE") )
304 {
305 /* disable molecule formation, first option is to turn off only high Z part */
306 if( p.nMatch("HEAV") )
307 {
308 /* turn off only Z>=2 molecules */
310 }
311 else
312 {
313 mole_global.lgNoMole = true;
314 }
315 phycon.lgPhysOK = false;
316 }
317
318 else if( p.nMatch("PHOT") )
319 {
320 /* disable photoionization */
321 ionbal.lgPhotoIoniz_On = false;
322 phycon.lgPhysOK = false;
323 }
324
325 else if( p.nMatch("RADI") )
326 {
327 /* don't include line radiation pressure */
329 }
330
331 else if( p.nMatch("RECO") )
332 {
333 /* disable compton recoil of bound electrons - "no recoil ioniz" */
334 ionbal.lgCompRecoil = false;
335 phycon.lgPhysOK = false;
336 }
337
338 else if( p.nMatch("SCAT") && p.nMatch("OPAC"))
339 {
340 /* no scattering opacity, for Compton thick spherical geometry */
341 opac.lgScatON = false;
342 }
343
344 else if( p.nMatch("SCAT") && p.nMatch("ESCA"))
345 {
346 /* no electron scattering contribution to line escape probs */
347 rt.lgElecScatEscape = false;
348 }
349
350 else if( p.nMatch("SECO") )
351 {
352 /* turn off secondary electron ionizations */
353 secondaries.lgSecOFF = true;
354 phycon.lgPhysOK = false;
355 }
356
357 else if( p.nMatch("SPOT") )
358 {
359 /* no on-the-spot; turn on all ground state rec */
360 opac.otsmin = 1.;
361 }
362
363 else if( p.nMatch("STAR") )
364 {
365 /* no stark broadening */
366 rt.lgStarkON = false;
367 phycon.lgPhysOK = false;
368 }
369
370 else if( p.nMatch("STAT") )
371 {
372 /* no static opacities - constantly reevaluate them */
373 opac.lgOpacStatic = false;
374 }
375
376 else if( p.nMatch("TEPR") )
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( p.nMatch("THRE") )
384 {
385 /* turn off Cota's three body rec subroutine */
386 ionbal.lgNoCota = true;
387 phycon.lgPhysOK = false;
388 }
389
390 else if( p.nMatch("TIME") )
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( p.nMatch(" UTA") )
398 {
399 /* turn off ALL inner shell absorption ionization */
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( p.nMatch("VARY") )
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," I do not recognize a keyword on this NO ... command.\n");
417 p.PrintLine(ioQQQ);
418 fprintf( ioQQQ, " Sorry.\n");
420 }
421
422 /* this option, if keyword (OK) appears, then do not set warning */
423 if( p.nMatch("(OK)") )
424 {
425 /* say that physical conditions are actually ok */
426 phycon.lgPhysOK = true;
427 }
428 return;
429}
t_atmdat atmdat
Definition: atmdat.cpp:6
t_FeII FeII
Definition: atomfeii.cpp:5
FILE * ioQQQ
Definition: cddefines.cpp:7
#define EXIT_FAILURE
Definition: cddefines.h:140
#define cdEXIT(FAIL)
Definition: cddefines.h:434
#define DEBUG_ENTRY(funcname)
Definition: cddefines.h:684
void fixit(void)
Definition: service.cpp:991
long nWindLine
Definition: cdinit.cpp:19
bool lgDColOn
Definition: grainvar.h:490
bool lgGrainElectrons
Definition: grainvar.h:494
bool lgQHeatOn
Definition: grainvar.h:486
bool lgGrainPhysicsOn
Definition: grainvar.h:479
bool lgWD01
Definition: grainvar.h:475
Definition: parser.h:32
bool nMatch(const char *chKey) const
Definition: parser.h:135
int PrintLine(FILE *fp) const
Definition: parser.h:204
static t_yield & Inst()
Definition: cddefines.h:175
bool lgCompRecoil
Definition: ionbal.h:149
bool lgInnerShellLine_on
Definition: ionbal.h:175
bool lgNoCota
Definition: ionbal.h:239
bool lgPhotoIoniz_On
Definition: ionbal.h:116
int lgGrainIonRecom
Definition: ionbal.h:228
bool lgNoHeavyMole
Definition: mole.h:280
bool lgNoMole
Definition: mole.h:277
bool lgGrain_mole_deplete
Definition: mole.h:308
void kill_yield()
Definition: yield.h:78
t_CoolHeavy CoolHeavy
Definition: coolheavy.cpp:5
t_dynamics dynamics
Definition: dynamics.cpp:44
GrainVar gv
Definition: grainvar.cpp:5
t_hyperfine hyperfine
Definition: hyperfine.cpp:5
t_ionbal ionbal
Definition: ionbal.cpp:5
const int ipHE_LIKE
Definition: iso.h:63
const int ipH_LIKE
Definition: iso.h:62
t_mole_global mole_global
Definition: mole.cpp:6
t_opac opac
Definition: opacity.cpp:5
void ParseDont(Parser &p)
Definition: parse_dont.cpp:27
t_phycon phycon
Definition: phycon.cpp:6
t_pressure pressure
Definition: pressure.cpp:5
t_prt prt
Definition: prt.cpp:10
t_rfield rfield
Definition: rfield.cpp:8
t_rt rt
Definition: rt.cpp:5
t_save save
Definition: save.cpp:5
t_secondaries secondaries
Definition: secondaries.cpp:5
bool lgFreeOn
Definition: coolheavy.h:116
bool lgLyaPumpOn
Definition: atomfeii.h:229
bool lgCTOn
Definition: atmdat.h:177
bool lgCollIonOn
Definition: atmdat.h:200
double HCharHeatOn
Definition: atmdat.h:156
bool lgISO[NISO]
Definition: dynamics.h:83
bool lgCoolHeat
Definition: dynamics.h:89
bool lgMETALS
Definition: dynamics.h:86
bool lgLya_pump_21cm
Definition: hyperfine.h:50
bool lgUseFileOpac
Definition: opacity.h:196
bool lgOpacStatic
Definition: opacity.h:140
realnum otsmin
Definition: opacity.h:294
bool lgScatON
Definition: opacity.h:183
bool lgPhysOK
Definition: phycon.h:101
bool lgLineRadPresOn
Definition: pressure.h:157
bool lgPrintTime
Definition: prt.h:120
bool lgOpacityFine
Definition: rfield.h:421
bool lgKillOutLine
Definition: rfield.h:434
bool lgOpacityReevaluate
Definition: rfield.h:121
bool lgKillOutCont
Definition: rfield.h:437
realnum DiffPumpOn
Definition: rfield.h:217
bool lgComptonOn
Definition: rfield.h:295
bool lgHeIIOTS
Definition: rfield.h:431
bool lgKillOTSLine
Definition: rfield.h:440
bool lgLyaOTS
Definition: rfield.h:427
bool lgInducProcess
Definition: rfield.h:252
bool lgDoLineTrans
Definition: rfield.h:117
bool lgIonizReevaluate
Definition: rfield.h:128
bool lgElecScatEscape
Definition: rt.h:262
bool lgFstOn
Definition: rt.h:256
bool lgStarkON
Definition: rt.h:280
string chOutputFile
Definition: save.h:314
bool lgPredNextTe
Definition: thermal.h:28
t_thermal thermal
Definition: thermal.cpp:5