cloudy  trunk
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
prt_alltau.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 /*PrtAllTau master routine controlling printout of optical depths at end of calculation */
4 #include "cddefines.h"
5 #include "taulines.h"
6 #include "iso.h"
7 #include "opacity.h"
8 #include "dense.h"
9 #include "colden.h"
10 #include "elementnames.h"
11 #include "geometry.h"
12 #include "prt.h"
13 
14 void PrtAllTau(void)
15 {
16  long int i,
17  n,
18  nelem;
19  realnum fcon,
20  flin;
21 
22  DEBUG_ENTRY( "PrtAllTau()" );
23 
24  /* optical depths used by code are total through model,
25  * when sphere is set, this is twice optical depth through
26  * computed structure */
27  if( geometry.lgSphere )
28  {
29  fcon = 2.;
30  if( geometry.lgStatic )
31  {
32  flin = 2.;
33  }
34  else
35  {
36  flin = 1.;
37  }
38  }
39  else
40  {
41  fcon = 1.;
42  flin = 1.;
43  }
44 
45  /* print out optical depths and column densities */
46 
47  /* R(1300) is Rayleigh scattering */
48  fprintf( ioQQQ, "\n Contin Optical Depths: COMP:");
49 
50  fprintf( ioQQQ,PrintEfmt("%9.2e", opac.telec));
51  fprintf( ioQQQ, " H-:");
52  fprintf( ioQQQ,PrintEfmt("%9.2e",opac.thmin ));
53 
54  fprintf( ioQQQ, " R(1300):");
55  fprintf( ioQQQ,PrintEfmt("%9.2e", colden.colden[ipCOL_H0]*6.71e-24));
56 
57  fprintf( ioQQQ, " H2+:");
58  fprintf( ioQQQ,PrintEfmt("%9.2e", colden.colden[ipCOL_H2p]*7e-18));
59 
60  fprintf( ioQQQ, " Pfa:");
61  /* 06 aug 28, from numLevels_max to _local. */
63  {
64  ASSERT( Transitions[ipH_LIKE][ipHYDROGEN][ipH5p][ipH4s].ipCont > 0 );
66  }
67  else
68  {
69  PrintE82( ioQQQ , 0.);
70  }
71  fprintf( ioQQQ, "\n" );
72 
73  fprintf( ioQQQ, " Pa:");
74  /* 06 aug 28, from numLevels_max to _local. */
76  {
77  fprintf( ioQQQ,PrintEfmt("%9.2e", opac.TauTotalGeo[0][Transitions[ipH_LIKE][ipHYDROGEN][ipH4p][ipH3s].ipCont-1]/fcon));
78  }
79  else
80  {
81  PrintE82( ioQQQ , 0.);
82  }
83 
84  fprintf( ioQQQ, " Ba:");
85  /* 06 aug 28, from numLevels_max to _local. */
87  {
88  fprintf( ioQQQ,PrintEfmt("%9.2e", opac.TauTotalGeo[0][Transitions[ipH_LIKE][ipHYDROGEN][ipH3p][ipH2s].ipCont-1]/fcon));
89  }
90  else
91  {
92  PrintE82( ioQQQ , 0.);
93  }
94 
95  fprintf( ioQQQ, " Hb:");
96  /* 06 aug 28, from numLevels_max to _local. */
98  {
99  fprintf( ioQQQ,PrintEfmt("%9.2e", opac.TauTotalGeo[0][Transitions[ipH_LIKE][ipHYDROGEN][ipH4p][ipH2s].ipCont-1]/fcon));
100  }
101  else
102  {
103  PrintE82( ioQQQ , 0.);
104  }
105 
106  fprintf( ioQQQ, " La:");
107  fprintf( ioQQQ,PrintEfmt("%9.2e", opac.TauTotalGeo[0][Transitions[ipH_LIKE][ipHYDROGEN][ipH2p][ipH1s].ipCont-1]/fcon));
108 
109  fprintf( ioQQQ, " 1r:");
111 
112  fprintf( ioQQQ, " 1.8:");
114 
115  fprintf( ioQQQ, " 4.:");
117  fprintf( ioQQQ, "\n");
118 
119  /* print optical depths of some metal lines */
120  prtmet();
121 
122  /* print H-like H, He+ optical depths */
123  for( nelem=ipHYDROGEN; nelem<=ipHELIUM; ++nelem )
124  {
125  /* helium may be turned off */
126  if( dense.lgElmtOn[nelem] )
127  {
128 # define NUMB_PER_LINE 8
129  fprintf( ioQQQ, "\n Old, new %s%2li continuum optical depths:\n",
130  elementnames.chElementSym[nelem] ,
131  nelem+1);
132  /* absorption continuum optical depths are energies of the h-like ion continua
133  * loop over old, then new optical depths */
134  for( i=1; i>=0; --i )
135  {
136  /* print ground, skip t2, then do 2p */
137  /* 06 aug 28, from numLevels_max to _local. */
138  for( n=ipH1s; n < iso.numLevels_local[ipH_LIKE][nelem]; n++ )
139  {
140  if( n==ipH2s )
141  continue;
142  if( n%NUMB_PER_LINE ==1)
143  fprintf(ioQQQ,"\n");
144  /* this, combined with "continue" above, ensures that we print
145  * 1 (1s), 2(tot 2), then 3 */
146  fprintf( ioQQQ , "%6ld",MAX2(1,n));
147  fprintf( ioQQQ,PrintEfmt("%9.2e", opac.TauAbsGeo[i][iso.ipIsoLevNIonCon[ipH_LIKE][nelem][n]-1]/fcon));
148  }
149  fprintf( ioQQQ, "\n" );
150  }
151 
152  /* now do h-like line optical depths */
153  fprintf( ioQQQ, "\n Old, new %s%2li line optical depths:\n",
154  elementnames.chElementSym[nelem] ,
155  nelem+1);
156  /* Lya is a special case due to 2s-2p resolution - explictly print it first */
157  fprintf( ioQQQ, "%3i-%2i",2, 1 );
158  fprintf( ioQQQ,PrintEfmt("%9.2e", Transitions[ipH_LIKE][nelem][ipH2p][ipH1s].Emis->TauTot/flin ));
159  /* total optical depth in 3-2s and 3-2p, is total of both so 2-1 is correct for 3-2*/
160  /* 06 aug 28, from numLevels_max to _local. */
161  for( n=3; n <= iso.n_HighestResolved_local[ipH_LIKE][nelem]; n++ )
162  {
163  if( n%NUMB_PER_LINE ==1)
164  fprintf(ioQQQ,"\n");
165  fprintf( ioQQQ, "%3ld-%2ld",n, n-1 );
166  fprintf( ioQQQ,PrintEfmt("%9.2e",
167  /* just do nP - n'S */
168  Transitions[ipH_LIKE][nelem][ iso.QuantumNumbers2Index[ipH_LIKE][nelem][n][1][2] ][ iso.QuantumNumbers2Index[ipH_LIKE][nelem][n-1][0][2] ].Emis->TauTot/flin ));
169  }
170  for( n=iso.numLevels_local[ipH_LIKE][nelem] - iso.nCollapsed_local[ipH_LIKE][nelem]; n < iso.numLevels_local[ipH_LIKE][nelem]; n++ )
171  {
172  if( StatesElem[ipH_LIKE][nelem][n].n % NUMB_PER_LINE ==1)
173  fprintf(ioQQQ,"\n");
174  fprintf( ioQQQ, "%3ld-%2ld", StatesElem[ipH_LIKE][nelem][n].n, StatesElem[ipH_LIKE][nelem][n-1].n );
175  fprintf( ioQQQ,PrintEfmt("%9.2e", Transitions[ipH_LIKE][nelem][n][n-1].Emis->TauTot/flin ));
176  }
177 
178  fprintf( ioQQQ, "\n" );
179 
180  fprintf( ioQQQ, "%3i-%2i",2, 1 );
181  fprintf( ioQQQ,PrintEfmt("%9.2e", Transitions[ipH_LIKE][nelem][ipH2p][ipH1s].Emis->TauIn/flin ));
182  /* 06 aug 28, from numLevels_max to _local. */
183  for( n=3; n <= iso.n_HighestResolved_local[ipH_LIKE][nelem]; n++ )
184  {
185  if( n%NUMB_PER_LINE ==1)
186  fprintf(ioQQQ,"\n");
187  fprintf( ioQQQ, "%3ld-%2ld",n, n-1 );
188  fprintf( ioQQQ,PrintEfmt("%9.2e",
189  /* just do nP - n'S */
190  Transitions[ipH_LIKE][nelem][ iso.QuantumNumbers2Index[ipH_LIKE][nelem][n][1][2] ][ iso.QuantumNumbers2Index[ipH_LIKE][nelem][n-1][0][2] ].Emis->TauIn/flin ));
191  }
192  for( n=iso.numLevels_local[ipH_LIKE][nelem] - iso.nCollapsed_local[ipH_LIKE][nelem]; n < iso.numLevels_local[ipH_LIKE][nelem]; n++ )
193  {
194  if( StatesElem[ipH_LIKE][nelem][n].n % NUMB_PER_LINE ==1)
195  fprintf(ioQQQ,"\n");
196  fprintf( ioQQQ, "%3ld-%2ld", StatesElem[ipH_LIKE][nelem][n].n, StatesElem[ipH_LIKE][nelem][n-1].n );
197  fprintf( ioQQQ,PrintEfmt("%9.2e", Transitions[ipH_LIKE][nelem][n][n-1].Emis->TauIn/flin ));
198  }
199  fprintf( ioQQQ, "\n" );
200  }
201  }
202 
203  /* ================================================================================ */
204 
205  /* print helium lines if helium exists */
206  if( dense.lgElmtOn[ipHELIUM] )
207  {
208  fprintf( ioQQQ, "\n Old He Is optical depths:" );
209  for( i=0; i < 5; i++ )
210  {
211  fprintf( ioQQQ, "%5ld", i+1 );
212  fprintf( ioQQQ,PrintEfmt("%9.2e", opac.TauAbsGeo[1][iso.ipIsoLevNIonCon[ipHE_LIKE][ipHELIUM][i]-1]/fcon) );
213  }
214  fprintf( ioQQQ, "\n" );
215 
216  fprintf( ioQQQ, " New He Is optical depths:" );
217  for( i=0; i < 5; i++ )
218  {
219  fprintf( ioQQQ, "%5ld", i+1 );
220  fprintf( ioQQQ,PrintEfmt("%9.2e", opac.TauAbsGeo[0][iso.ipIsoLevNIonCon[ipHE_LIKE][ipHELIUM][i]-1]/fcon ));
221  }
222  fprintf( ioQQQ, "\n" );
223 
224  /* ================================================================================*/
225 
226  fprintf( ioQQQ, " Old He Is Lines:" );
227  fprintf( ioQQQ, " %4d",584 );
228  fprintf( ioQQQ,PrintEfmt("%9.2e", Transitions[ipHE_LIKE][ipHELIUM][ipHe2p1P][ipHe1s1S].Emis->TauTot/flin ));
229  fprintf( ioQQQ, " %4d",3889 );
230  fprintf( ioQQQ,PrintEfmt("%9.2e", Transitions[ipHE_LIKE][ipHELIUM][ipHe3p3P][ipHe2s3S].Emis->TauTot/flin ));
231  fprintf( ioQQQ, " %4d",5016 );
232  fprintf( ioQQQ,PrintEfmt("%9.2e", Transitions[ipHE_LIKE][ipHELIUM][ipHe3p1P][ipHe2s1S].Emis->TauTot/flin ));
233  fprintf( ioQQQ, " %4d",5876 );
234  fprintf( ioQQQ,PrintEfmt("%9.2e", Transitions[ipHE_LIKE][ipHELIUM][ipHe3d3D][ipHe2p3P2].Emis->TauTot/flin ));
235  fprintf( ioQQQ, "\n" );
236 
237  fprintf( ioQQQ, " New He Is Lines:" );
238  fprintf( ioQQQ, " %4d",584 );
239  fprintf( ioQQQ,PrintEfmt("%9.2e", Transitions[ipHE_LIKE][ipHELIUM][ipHe2p1P][ipHe1s1S].Emis->TauIn/flin ));
240  fprintf( ioQQQ, " %4d",3889 );
241  fprintf( ioQQQ,PrintEfmt("%9.2e", Transitions[ipHE_LIKE][ipHELIUM][ipHe3p3P][ipHe2s3S].Emis->TauIn/flin ));
242  fprintf( ioQQQ, " %4d",5016 );
243  fprintf( ioQQQ,PrintEfmt("%9.2e", Transitions[ipHE_LIKE][ipHELIUM][ipHe3p1P][ipHe2s1S].Emis->TauIn/flin ));
244  fprintf( ioQQQ, " %4d",5876 );
245  fprintf( ioQQQ,PrintEfmt("%9.2e", Transitions[ipHE_LIKE][ipHELIUM][ipHe3d3D][ipHe2p3P2].Emis->TauIn/flin ));
246  fprintf( ioQQQ, "\n" );
247 
248  /* ================================================================================*/
249  }
250  return;
251 }

Generated for cloudy by doxygen 1.8.3.1