cloudy  trunk
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
prt_zone.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 /*PrtZone print out individual zone results */
4 #include "cddefines.h"
5 #include "physconst.h"
6 #include "iso.h"
7 #include "grainvar.h"
8 #include "pressure.h"
9 #include "wind.h"
10 #include "conv.h"
11 #include "trace.h"
12 #include "magnetic.h"
13 #include "dense.h"
14 #include "called.h"
15 #include "dynamics.h"
16 #include "h2.h"
17 #include "mole.h"
18 #include "secondaries.h"
19 #include "opacity.h"
20 #include "colden.h"
21 #include "geometry.h"
22 #include "hmi.h"
23 #include "rfield.h"
24 #include "thermal.h"
25 #include "radius.h"
26 #include "phycon.h"
27 #include "abund.h"
28 #include "hydrogenic.h"
29 #include "ionbal.h"
30 #include "elementnames.h"
31 #include "atomfeii.h"
32 #include "prt.h"
33 
34 void PrtZone(void)
35 {
36  char chField7[8];
37  char chLet,
38  chQHMark;
39  long int i,
40  ishift,
41  nelem ,
42  nd,
43  mol;
44  double cdif,
45  coninc,
46  con_density,
47  fac,
48  hatmic;
49 
50  DEBUG_ENTRY( "PrtZone()" );
51 
52  if( thermal.lgUnstable )
53  {
54  chLet = 'u';
55  }
56  else
57  {
58  chLet = ' ';
59  }
60 
61  /* middle of zone for printing
62  rmidle = radius.Radius - radius.drad*0.5*radius.dRadSign;
63  dmidle = radius.depth - radius.drad*0.5; */
64 
65  /* option to print single line when quiet but tracing convergence
66  * with "trace convergence" command */
67  if( called.lgTalk || trace.nTrConvg )
68  {
69  /* print either ####123 or ###1234 */
70  if( nzone <= 999 )
71  {
72  sprintf( chField7, "####%3ld", nzone );
73  }
74  else
75  {
76  sprintf( chField7, "###%4ld", nzone );
77  }
78 
79  fprintf(ioQQQ, " %7.7s %cTe:",chField7, chLet);
81  fprintf(ioQQQ," Hden:");
83  fprintf(ioQQQ," Ne:");
85  fprintf(ioQQQ," R:");
87  fprintf(ioQQQ," R-R0:");
89  fprintf(ioQQQ," dR:");
91  fprintf(ioQQQ," NTR:%3ld Htot:",conv.nPres2Ioniz);
93  fprintf(ioQQQ," T912:");
95  fprintf(ioQQQ,"###\n");
96 
97  if( trace.nTrConvg )
98  {
99  fprintf( ioQQQ, " H:%.2e %.2e 2H2/H: %.2e He: %.2e %.2e %.2e\n",
106  );
107  }
108  }
109 
110  /* now return if not talking */
111  if( !called.lgTalk || trace.nTrConvg )
112  {
113  return;
114  }
115 
116  /* lgDenFlucOn set to true in zero, only false when variable abundances are on,
117  * lgAbTaON set true when element table used */
118  if( !dense.lgDenFlucOn || abund.lgAbTaON )
119  {
120  fprintf( ioQQQ, " Abun:" );
121  for( i=0; i < LIMELM; i++ )
122  {
123  fprintf( ioQQQ,PrintEfmt("%8.1e", dense.gas_phase[i] ));
124  }
125  fprintf( ioQQQ, "\n" );
126  }
127 
128  /*-------------------------------------------------
129  * print wind parameters if windy model */
131  if( wind.windv != 0. )
132  {
133  /* find denominator for fractional contributions */
134  if( wind.AccelTot == 0. )
135  fac = 1.;
136  else
137  fac = wind.AccelTot;
138  fprintf( ioQQQ,
139  " Dynamics wind V:%.3e km/s a(grav):%.2e a(tot):%.2e Fr(cont):%6.3f "
140  "Fr(line):%6.3f Fr(dP):%6.3f\n",
141  wind.windv/1e5 ,
143  wind.AccelTot,
144  wind.AccelCont/ fac,
145  wind.AccelLine/fac,
146  wind.AccelPres/fac );
147 
148  /* print advection information */
149  if( dynamics.lgAdvection )
150  DynaPrtZone();
151  }
152 
153  /* print line with radiation pressure if significant */
154  if( pressure.pbeta > .05 )
155  PrtLinePres();
156 
157  /*---------------------------------------------------- */
158 
159  hatmic = 0.;
160  for(mol = 0; mol < N_H_MOLEC; mol++) {
161  hatmic += hmi.Hmolec[mol]*hmi.nProton[mol];
162  }
163  ASSERT(hatmic > 0.);
164  hatmic = (dense.xIonDense[ipHYDROGEN][0] + dense.xIonDense[ipHYDROGEN][1])/hatmic;
165 
166  fprintf( ioQQQ, " Hydrogen ");
169  fprintf( ioQQQ, " H+o/Hden");
170  fprintf(ioQQQ,PrintEfmt("%9.2e",hatmic ));
171  fprintf(ioQQQ,PrintEfmt("%9.2e",hmi.Hmolec[ipMHm]/dense.gas_phase[ipHYDROGEN] ));
172  fprintf( ioQQQ, " H- H2");
173  /* this is total H2, the sum of "ground" and excited */
174  fprintf(ioQQQ,PrintEfmt("%9.2e",hmi.H2_total/dense.gas_phase[ipHYDROGEN]));
176  fprintf( ioQQQ, " H2+ HeH+");
178  fprintf( ioQQQ, " Ho+ ColD");
179  fprintf(ioQQQ,PrintEfmt("%9.2e",colden.colden[ipCOL_H0]));
180  fprintf(ioQQQ,PrintEfmt("%9.2e",colden.colden[ipCOL_Hp]));
181  fprintf( ioQQQ, "\n");
182 
183  /* print departure coef if desired */
185  {
186  fprintf( ioQQQ, " Hydrogen " );
187  fprintf(ioQQQ,PrintEfmt("%9.2e", iso.DepartCoef[ipH_LIKE][ipHYDROGEN][ipH1s]));
188  fprintf(ioQQQ,PrintEfmt("%9.2e", 1.));
189  fprintf( ioQQQ, " H+o/Hden");
190  fprintf(ioQQQ,PrintEfmt("%9.2e", (dense.xIonDense[ipHYDROGEN][0] + dense.xIonDense[ipHYDROGEN][1])/dense.gas_phase[ipHYDROGEN]));
191  fprintf(ioQQQ,PrintEfmt("%9.2e", hmi.hmidep));
192  fprintf( ioQQQ, " H- H2");
193  fprintf(ioQQQ,PrintEfmt("%9.2e", hmi.h2dep));
194  fprintf( ioQQQ, " H2+");
195  fprintf(ioQQQ,PrintEfmt("%9.2e", hmi.h2pdep));
196  fprintf( ioQQQ, " H3+");
197  fprintf(ioQQQ,PrintEfmt("%9.2e",hmi.h3pdep));
198  fprintf( ioQQQ, "\n" );
199  }
200 
201  if( prt.lgPrintHeating )
202  {
203  fprintf( ioQQQ, " ");
204  fprintf(ioQQQ,PrintEfmt("%9.2e", thermal.heating[0][0]/thermal.htot));
205  fprintf( ioQQQ," ");
206  fprintf(ioQQQ,PrintEfmt("%9.2e", thermal.heating[0][15]/thermal.htot));
207  fprintf( ioQQQ," ");
208  fprintf(ioQQQ,PrintEfmt("%9.2e", thermal.heating[0][16]/thermal.htot));
209  fprintf( ioQQQ,"\n");
210  }
211 
212  /* temperature correspoding to radiation fields */
213  coninc = 0.;
214  cdif = 0.;
215  for( i=0; i < rfield.nflux; i++ )
216  {
217  /* integrated energy flux, ergs s^-1 cm^-2 */
218  coninc += rfield.flux[i]*(rfield.anu[i]*EN1RYD);
219  cdif += (rfield.outlin[i] + rfield.outlin_noplot[i] +
220  rfield.ConInterOut[i])* (rfield.anu[i]*EN1RYD);
221  }
222  /* convert flux in attenuated incident continuum, diffuse emission, into equivalent temperature */
223  coninc = pow(coninc/SPEEDLIGHT/7.56464e-15,0.25);
224  cdif = pow(cdif/SPEEDLIGHT/7.56464e-15,0.25);
225 
226  /* convert sum of flux into energy density, then equivalent pressure */
227  con_density = (coninc + cdif) / SPEEDLIGHT;
228  con_density /= BOLTZMANN;
229 
230  if( prt.lgPrintHeating )
231  {
232  fprintf( ioQQQ, " ");
233  fprintf(ioQQQ,PrintEfmt("%9.2e", thermal.heating[0][1]/thermal.htot ));
234  fprintf( ioQQQ, " ");
235  fprintf(ioQQQ,PrintEfmt("%9.2e", 0. ));
236  fprintf( ioQQQ, " BoundCom");
238  fprintf( ioQQQ, " Extra:");
239  fprintf(ioQQQ,PrintEfmt("%9.2e",thermal.heating[0][20]/thermal.htot));
240  fprintf( ioQQQ, " Pairs:");
241  fprintf(ioQQQ,PrintEfmt("%9.2e", thermal.heating[0][21]/ thermal.htot ));
242  fprintf( ioQQQ," H-lines\n");
243  }
244 
245  /* Helium */
246  if( dense.lgElmtOn[ipHELIUM] )
247  {
248  fprintf( ioQQQ, " Helium " );
249  for( i=0; i < 3; i++ )
250  {
251  fprintf(ioQQQ,PrintEfmt("%9.2e", dense.xIonDense[ipHELIUM][i]/dense.gas_phase[ipHELIUM]) );
252  }
253 
254  fprintf( ioQQQ, " He I2SP3");
255  fprintf(ioQQQ,PrintEfmt("%9.2e",
257  fprintf( ioQQQ, " Comp H,C");
258  fprintf(ioQQQ,PrintEfmt("%9.2e", rfield.cmheat ));
259  fprintf(ioQQQ,PrintEfmt("%9.2e", rfield.cmcool*phycon.te));
260  fprintf( ioQQQ , " Fill Fac");
261  fprintf(ioQQQ,PrintEfmt("%9.2e", geometry.FillFac));
262  fprintf( ioQQQ , " Gam1/tot");
263  fprintf(ioQQQ,PrintEfmt("%9.2e", hydro.H_ion_frac_photo));
264  fprintf( ioQQQ, "\n");
265 
266  /* option to print departure coef */
268  {
269  fprintf( ioQQQ, " Helium " );
270  fprintf(ioQQQ,PrintEfmt("%9.2e", iso.DepartCoef[ipHE_LIKE][ipHELIUM][0]));
271  fprintf(ioQQQ,PrintEfmt("%9.2e", iso.DepartCoef[ipH_LIKE][ipHELIUM][ipH1s]));
272  fprintf(ioQQQ,PrintEfmt("%9.2e", 1.));
273 
274  fprintf( ioQQQ, " Comp H,C");
275  fprintf(ioQQQ,PrintEfmt("%9.2e", rfield.cmheat ));
276  fprintf(ioQQQ,PrintEfmt("%9.2e", rfield.cmcool*phycon.te ));
277  fprintf( ioQQQ , " Fill Fac");
278  fprintf(ioQQQ,PrintEfmt("%9.2e", geometry.FillFac ));
279  fprintf( ioQQQ , " Gam1/tot");
280  fprintf(ioQQQ,PrintEfmt("%9.2e", hydro.H_ion_frac_photo));
281  fprintf( ioQQQ, "\n");
282  }
283 
284  /* print heating from He (and others) if desired
285  * entry "lines" is induced line heating
286  * 1,12 ffheat: 2,3 he triplets, 1,20 compton */
287  if( prt.lgPrintHeating )
288  {
289  /*fprintf( ioQQQ, " %10.3e%10.3e Lines:%10.2e%10.2e Compton:%10.3e FF Heatig%10.3e\n",
290  thermal.heating[1][0]/thermal.htot, thermal.heating[1][1]/
291  thermal.htot, thermal.heating[0][22]/thermal.htot, thermal.heating[1][2]/
292  thermal.htot, thermal.heating[0][19]/thermal.htot, thermal.heating[0][11]/
293  thermal.htot );*/
294  fprintf( ioQQQ, " ");
295  fprintf(ioQQQ,PrintEfmt("%9.2e",thermal.heating[1][0]/thermal.htot));
296  fprintf(ioQQQ,PrintEfmt("%9.2e",thermal.heating[1][1]/thermal.htot));
297  fprintf( ioQQQ, " Lines:");
298  fprintf(ioQQQ,PrintEfmt("%9.2e",thermal.heating[0][22]/thermal.htot));
299  fprintf(ioQQQ,PrintEfmt("%9.2e",thermal.heating[1][2]/thermal.htot));
300  fprintf( ioQQQ, " Compton:");
301  fprintf(ioQQQ,PrintEfmt("%9.2e",thermal.heating[0][19]/thermal.htot));
302  fprintf( ioQQQ, " FFHeatig");
303  fprintf(ioQQQ,PrintEfmt("%9.2e",thermal.heating[0][11]/thermal.htot));
304  fprintf( ioQQQ, "\n");
305  }
306 
307  if( dense.lgElmtOn[ipHELIUM] )
308  {
309  /* helium singlets and triplets relative to total helium gas phase density */
311  fprintf( ioQQQ, " He singlet n " );
312  fprintf(ioQQQ,PrintEfmt("%9.2e", StatesElem[ipHE_LIKE][1][ipHe1s1S].Pop*fac ));
313  /* singlet n=2 complex */
314  if( iso.numPrintLevels[ipHE_LIKE][ipHELIUM]>= ipHe2p1P )
315  {
316  fprintf(ioQQQ,PrintEfmt("%9.2e", StatesElem[ipHE_LIKE][1][ipHe2s1S].Pop*fac ));
317  fprintf(ioQQQ,PrintEfmt("%9.2e", StatesElem[ipHE_LIKE][1][ipHe2p1P].Pop*fac ));
318  }
319  else
320  {
321  fprintf(ioQQQ,PrintEfmt("%9.2e", 0. ));
322  fprintf(ioQQQ,PrintEfmt("%9.2e", 0. ));
323  }
324  /* singlet n=3 complex */
325  if( iso.numPrintLevels[ipHE_LIKE][ipHELIUM]>= ipHe3p1P )
326  {
327  fprintf(ioQQQ,PrintEfmt("%9.2e", StatesElem[ipHE_LIKE][ipHELIUM][ipHe3s1S].Pop*fac ));
328  fprintf(ioQQQ,PrintEfmt("%9.2e", StatesElem[ipHE_LIKE][ipHELIUM][ipHe3p1P].Pop*fac ));
329  fprintf(ioQQQ,PrintEfmt("%9.2e", StatesElem[ipHE_LIKE][ipHELIUM][ipHe3d1D].Pop*fac ));
330  }
331  else
332  {
333  fprintf(ioQQQ,PrintEfmt("%9.2e", 0. ));
334  fprintf(ioQQQ,PrintEfmt("%9.2e", 0. ));
335  fprintf(ioQQQ,PrintEfmt("%9.2e", 0. ));
336  }
337 
338  fprintf( ioQQQ, " He tripl" );
339  /* triplet n=2 complex */
340  if( iso.numPrintLevels[ipHE_LIKE][ipHELIUM]>= ipHe2p3P2 )
341  {
342  fprintf(ioQQQ,PrintEfmt("%9.2e", StatesElem[ipHE_LIKE][ipHELIUM][ipHe2s3S].Pop*fac ));
343  fprintf(ioQQQ,PrintEfmt("%9.2e",
344  StatesElem[ipHE_LIKE][ipHELIUM][ipHe2p3P0].Pop*fac+
345  StatesElem[ipHE_LIKE][ipHELIUM][ipHe2p3P1].Pop*fac+
346  StatesElem[ipHE_LIKE][ipHELIUM][ipHe2p3P2].Pop*fac ));
347  }
348  else
349  {
350  fprintf(ioQQQ,PrintEfmt("%9.2e", 0. ));
351  fprintf(ioQQQ,PrintEfmt("%9.2e", 0. ));
352  }
353  /* triplet n=3 complex */
354  if( iso.numPrintLevels[ipHE_LIKE][ipHELIUM]> ipHe3d3D )
355  {
356  fprintf(ioQQQ,PrintEfmt("%9.2e", StatesElem[ipHE_LIKE][ipHELIUM][ipHe3s3S].Pop*fac ));
357  fprintf(ioQQQ,PrintEfmt("%9.2e", StatesElem[ipHE_LIKE][ipHELIUM][ipHe3p3P].Pop*fac ));
358  fprintf(ioQQQ,PrintEfmt("%9.2e", StatesElem[ipHE_LIKE][ipHELIUM][ipHe3d3D].Pop*fac ));
359  }
360  else
361  {
362  fprintf(ioQQQ,PrintEfmt("%9.2e", 0. ));
363  fprintf(ioQQQ,PrintEfmt("%9.2e", 0. ));
364  fprintf(ioQQQ,PrintEfmt("%9.2e", 0. ));
365  }
366  fprintf( ioQQQ, "\n" );
367  }
368  }
369 
370  /* loop over iso sequences to see if any populations
371  * and/or departure coefficients need to be printed */
372  for( long ipISO = ipH_LIKE; ipISO < NISO; ipISO++ )
373  {
374  for( nelem=ipISO; nelem<LIMELM; ++nelem )
375  {
376  if( dense.lgElmtOn[nelem] )
377  {
378  if( iso.lgPrtLevelPops[ipISO][nelem] )
379  {
380  iso_prt_pops(ipISO, nelem, false);
381  }
382  if( iso.lgPrtDepartCoef[ipISO][nelem] )
383  {
384  /* true says print departure coefficients
385  * instead of populations. */
386  iso_prt_pops(ipISO, nelem, true);
387  }
388  }
389  }
390  }
391 
392  /* >>chng 01 dec 08, move pressure to line before grains, after radiation properties */
393  /* gas pressure, pressure due to incident radiation field, rad accel */
394  fprintf( ioQQQ, " Pressure NgasTgas");
395  fprintf(ioQQQ,PrintEfmt("%9.2e", pressure.PresGasCurr/BOLTZMANN));
396  fprintf( ioQQQ, " P(total)");
397  fprintf(ioQQQ,PrintEfmt("%9.2e", pressure.PresTotlCurr));
398  fprintf( ioQQQ, " P( gas )");
399  fprintf(ioQQQ,PrintEfmt("%9.2e", pressure.PresGasCurr));
400  fprintf( ioQQQ, " P(Radtn)");
402  fprintf( ioQQQ, " Rad accl");
403  fprintf(ioQQQ,PrintEfmt("%9.2e", wind.AccelTot));
404  fprintf( ioQQQ, " ForceMul");
405  fprintf(ioQQQ,PrintEfmt("%9.2e", wind.fmul));
406  fprintf( ioQQQ, "\n" );
407 
408  fprintf( ioQQQ , " Texc(La)");
409  fprintf(ioQQQ,PrintEfmt("%9.2e", hydro.TexcLya ));
410  fprintf( ioQQQ , " T(contn)");
411  fprintf(ioQQQ,PrintEfmt("%9.2e", coninc ));
412  fprintf( ioQQQ , " T(diffs)");
413  fprintf(ioQQQ,PrintEfmt("%9.2e", cdif ));
414  /* print the total radiation density expressed as an equivalent gas pressure */
415  fprintf( ioQQQ , " nT (c+d)");
416  fprintf(ioQQQ,PrintEfmt("%9.2e", con_density ));
417  /* print the radiation to gas pressure */
418  fprintf( ioQQQ , " Prad/Gas");
419  fprintf(ioQQQ,PrintEfmt("%9.2e", pressure.pbeta ));
420  /* magnetic to gas pressure ratio */
421  fprintf( ioQQQ , " Pmag/Gas");
422  fprintf(ioQQQ,PrintEfmt("%9.2e", magnetic.pressure / pressure.PresGasCurr) );
423  fprintf( ioQQQ, "\n" );
424 
425  if( gv.lgGrainPhysicsOn )
426  {
427  for( nd=0; nd < gv.nBin; nd++ )
428  {
429  /* Change things so the quantum heated dust species are marked with an
430  * asterisk just after the name (K Volk)
431  * added QHMARK here and in the write statement */
432  chQHMark = (char)(( gv.bin[nd]->lgQHeat && gv.bin[nd]->lgUseQHeat ) ? '*' : ' ');
433  fprintf( ioQQQ, "%-12.12s%c DustTemp",gv.bin[nd]->chDstLab, chQHMark);
434  fprintf(ioQQQ,PrintEfmt("%9.2e", gv.bin[nd]->tedust));
435  fprintf( ioQQQ, " Pot Volt");
436  fprintf(ioQQQ,PrintEfmt("%9.2e", gv.bin[nd]->dstpot*EVRYD));
437  fprintf( ioQQQ, " Chrg (e)");
438  fprintf(ioQQQ,PrintEfmt("%9.2e", gv.bin[nd]->AveDustZ));
439  fprintf( ioQQQ, " drf cm/s");
440  fprintf(ioQQQ,PrintEfmt("%9.2e", gv.bin[nd]->DustDftVel));
441  fprintf( ioQQQ, " Heating:");
442  fprintf(ioQQQ,PrintEfmt("%9.2e", gv.bin[nd]->GasHeatPhotoEl));
443  fprintf( ioQQQ, " Frac tot");
444  fprintf(ioQQQ,PrintEfmt("%9.2e", gv.bin[nd]->GasHeatPhotoEl/thermal.htot));
445  fprintf( ioQQQ, "\n" );
446  }
447  }
448  /* >>chng 00 apr 20, moved punch-out of quantum heating data to qheat(), by PvH */
449 
450  /* heavy element molecules */
451  if( findspecies("CO")->hevmol > 0. )
452  {
453  fprintf( ioQQQ, " Molecules CH/Ctot:");
454  fprintf(ioQQQ,PrintEfmt("%9.2e", findspecies("CH")->hevmol/dense.gas_phase[ipCARBON]));
455  fprintf( ioQQQ, " CH+/Ctot");
456  fprintf(ioQQQ,PrintEfmt("%9.2e", findspecies("CH+")->hevmol/dense.gas_phase[ipCARBON]));
457  fprintf( ioQQQ, " CO/Ctot:");
458  fprintf(ioQQQ,PrintEfmt("%9.2e", findspecies("CO")->hevmol/dense.gas_phase[ipCARBON]));
459  fprintf( ioQQQ, " CO+/Ctot");
460  fprintf(ioQQQ,PrintEfmt("%9.2e", findspecies("CO+")->hevmol/dense.gas_phase[ipCARBON]));
461  fprintf( ioQQQ, " H2O/Otot");
462  fprintf(ioQQQ,PrintEfmt("%9.2e", findspecies("H2O")->hevmol/dense.gas_phase[ipOXYGEN]));
463  fprintf( ioQQQ, " OH/Ototl");
464  fprintf(ioQQQ,PrintEfmt("%9.2e", findspecies("OH")->hevmol/dense.gas_phase[ipOXYGEN]));
465  fprintf( ioQQQ, "\n");
466  }
467 
468  /* information about the large H2 molecule - this just returns if not turned on */
469  H2_Prt_Zone();
470 
471  /* Lithium, Beryllium */
473  (secondaries.csupra[ipHYDROGEN][0]>0.) )
474  {
475  fprintf( ioQQQ, " Lithium " );
476  for( i=0; i < 4; i++ )
477  {
478  fprintf(ioQQQ,PrintEfmt("%9.2e", dense.xIonDense[ipLITHIUM][i]/MAX2(1e-35,dense.gas_phase[ipLITHIUM]) ));
479  }
480  fprintf( ioQQQ, " Berylliu" );
481  for( i=0; i < 5; i++ )
482  {
483  fprintf(ioQQQ,PrintEfmt("%9.2e", dense.xIonDense[ipBERYLLIUM][i]/MAX2(1e-35,dense.gas_phase[ipBERYLLIUM])) );
484  }
485 
486  /* print secondary ionization rate for atomic hydrogen */
487  fprintf( ioQQQ, " sec ion:" );
488  fprintf(ioQQQ,PrintEfmt("%9.2e", secondaries.csupra[ipHYDROGEN][0]) );
489  fprintf( ioQQQ, "\n" );
490 
491  /* option to print heating due to these stages*/
492  if( prt.lgPrintHeating )
493  {
494  fprintf( ioQQQ, " " );
495  for( i=0; i < 3; i++ )
496  {
497  fprintf(ioQQQ,PrintEfmt("%9.2e", thermal.heating[ipLITHIUM][i]/ thermal.htot) );
498  }
499  fprintf( ioQQQ, " " );
500 
501  for( i=0; i < 4; i++ )
502  {
503  fprintf(ioQQQ,PrintEfmt("%9.2e", thermal.heating[ipBERYLLIUM][i]/thermal.htot ));
504  }
505  fprintf( ioQQQ, "\n" );
506  }
507  }
508 
509  /* Boron */
510  if( dense.lgElmtOn[ipBORON] )
511  {
512  fprintf( ioQQQ, " Boron " );
513  for( i=0; i < 6; i++ )
514  {
515  fprintf(ioQQQ,PrintEfmt("%9.2e", dense.xIonDense[ipBORON][i]/MAX2(1e-35,dense.gas_phase[ipBORON]) ));
516  }
517  fprintf( ioQQQ, "\n" );
518 
519  /* option to print heating*/
520  if( prt.lgPrintHeating )
521  {
522  fprintf( ioQQQ, " " );
523  for( i=0; i < 5; i++ )
524  {
525  fprintf(ioQQQ,PrintEfmt("%9.2e", thermal.heating[ipBORON][i]/thermal.htot ));
526  }
527  fprintf( ioQQQ, "\n" );
528  }
529  }
530 
531  /* Carbon */
532  fprintf( ioQQQ, " Carbon " );
533  for( i=0; i < 7; i++ )
534  {
535  fprintf(ioQQQ,PrintEfmt("%9.2e", dense.xIonDense[ipCARBON][i]/SDIV(dense.gas_phase[ipCARBON])) );
536  }
537  /* some molecules trail the line */
538  fprintf( ioQQQ, " H2O+/O " );
539  fprintf(ioQQQ,PrintEfmt("%9.2e", findspecies("H2O+")->hevmol/MAX2(1e-35,dense.gas_phase[ipOXYGEN]) ));
540  fprintf( ioQQQ, " OH+/Otot" );
541  fprintf(ioQQQ,PrintEfmt("%9.2e", findspecies("OH+")->hevmol/ MAX2(1e-35,dense.gas_phase[ipOXYGEN]) ));
542  /* print extra heating, normally zero */
543  fprintf( ioQQQ, " Hex(tot)" );
544  fprintf(ioQQQ,PrintEfmt("%9.2e", thermal.heating[0][20] ));
545  fprintf( ioQQQ, "\n" );
546 
547  /* option to print heating*/
548  if( prt.lgPrintHeating )
549  {
550  fprintf( ioQQQ, " " );
551  for( i=0; i < ipCARBON+1; i++ )
552  {
553  fprintf(ioQQQ,PrintEfmt("%9.2e", thermal.heating[ipCARBON][i]/ thermal.htot) );
554  }
555  fprintf( ioQQQ, "\n" );
556  }
557 
558  /* Nitrogen */
559  fprintf( ioQQQ, " Nitrogen " );
560  for( i=1; i <= 8; i++ )
561  {
562  fprintf(ioQQQ,PrintEfmt("%9.2e",dense.xIonDense[ipNITROGEN][i-1]/ SDIV(dense.gas_phase[ipNITROGEN]) ));
563  }
564  fprintf( ioQQQ, " O2/Ototl" );
565  fprintf(ioQQQ,PrintEfmt("%9.2e", findspecies("O2")->hevmol/MAX2(1e-35,dense.gas_phase[ipOXYGEN])));
566  fprintf( ioQQQ, " O2+/Otot" );
567  fprintf(ioQQQ,PrintEfmt("%9.2e", findspecies("O2+")->hevmol/ MAX2(1e-35,dense.gas_phase[ipOXYGEN]) ));
568  fprintf( ioQQQ, "\n" );
569 
570  /* option to print heating*/
571  if( prt.lgPrintHeating )
572  {
573  fprintf( ioQQQ, " " );
574  for( i=0; i < ipNITROGEN+1; i++ )
575  {
576  fprintf(ioQQQ,PrintEfmt("%9.2e", thermal.heating[ipNITROGEN][i]/ thermal.htot ));
577  }
578  fprintf( ioQQQ, "\n" );
579  }
580 
581 # if 0
582  /* Oxygen */
583  fprintf( ioQQQ, " Oxygen " );
584  for( i=1; i <= 9; i++ )
585  {
586  fprintf(ioQQQ,PrintEfmt("%9.2e",dense.xIonDense[ipOXYGEN][i-1]/ SDIV(dense.gas_phase[ipOXYGEN]) ));
587  }
588  fprintf( ioQQQ, "\n" );
589 
590  /* option to print heating*/
591  if( prt.lgPrintHeating )
592  {
593  fprintf( ioQQQ, " " );
594  for( i=0; i < ipOXYGEN+1; i++ )
595  {
596  fprintf(ioQQQ,PrintEfmt("%9.2e", thermal.heating[ipOXYGEN][i]/ thermal.htot ));
597  }
598  fprintf( ioQQQ, "\n" );
599  }
600 # endif
601 
602  /* now print rest of elements inside loops */
603  /* fluorine through Magnesium */
604  for( nelem=ipOXYGEN; nelem < ipALUMINIUM; ++nelem )
605  {
606  if( dense.lgElmtOn[nelem] )
607  {
608  /* print the element name and amount of shift */
609  fprintf( ioQQQ, " %10.10s ", elementnames.chElementName[nelem]);
610 
611  for( i=0; i < nelem+2; i++ )
612  {
613  fprintf(ioQQQ,PrintEfmt("%9.2e", dense.xIonDense[nelem][i]/dense.gas_phase[nelem] ));
614  }
615  fprintf( ioQQQ, "\n" );
616 
617  /* print heating but only if needed */
618  if( prt.lgPrintHeating )
619  {
620  fprintf( ioQQQ, " " );
621  for( i=0; i < nelem+1; i++ )
622  {
623  fprintf(ioQQQ,PrintEfmt("%9.2e", thermal.heating[nelem][i]/thermal.htot ));
624  }
625  fprintf( ioQQQ, "\n" );
626  }
627  }
628  }
629 
630  /* Aluminium through Zinc */
631  for( nelem=ipALUMINIUM; nelem < LIMELM; ++nelem )
632  {
633  if( dense.lgElmtOn[nelem] )
634  {
635  /* number of ionization stages to print across the page */
636  /*@-redef@*/
637  enum {LINE=13};
638  /*@+redef@*/
639  ishift = MAX2(0,dense.IonHigh[nelem]-LINE+1);
640 
641  /* print the element name and amount of shift */
642  fprintf( ioQQQ, " %10.10s%2ld ", elementnames.chElementName[nelem],ishift );
643 
644  for( i=0; i < LINE; i++ )
645  {
646  fprintf(ioQQQ,PrintEfmt("%9.2e", dense.xIonDense[nelem][i+ishift]/dense.gas_phase[nelem]) );
647  }
648  fprintf( ioQQQ, "\n" );
649 
650  /* print heating but only if needed */
651  if( prt.lgPrintHeating )
652  {
653  fprintf( ioQQQ, " " );
654  for( i=0; i < LINE; i++ )
655  {
656  fprintf(ioQQQ,
657  PrintEfmt("%9.2e", thermal.heating[nelem][i+ishift]/thermal.htot ));
658  }
659  fprintf( ioQQQ, "\n" );
660  }
661  }
662  }
663 
664  /* call FeII print routine if large atom is turned on */
665  FeIIPrint();
666  return;
667 }
668 
669 

Generated for cloudy by doxygen 1.8.3.1