cloudy  trunk
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
prt_met.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 /*prtmet print all line optical depths at end of iteration */
4 #include "cddefines.h"
5 #include "taulines.h"
6 #include "h2.h"
7 #include "iso.h"
8 #include "lines_service.h"
9 #include "dense.h"
10 #include "prt.h"
11 #include "mole.h"
12 
13 void prtmet(void)
14 {
15  long int i,
16  nelem ,
17  ipHi ,
18  ipLo ,
19  ipISO;
20 
21  DEBUG_ENTRY( "prtmet()" );
22 
23  /* default is to not print optical depths, turn on with
24  * print optical depths on command */
25  if( prt.lgPrtTau )
26  {
27  fprintf( ioQQQ, " Line Optical Depths\n");
28 
29  /* "IN" - initialize */
30  prme("IN",&TauLines[0]);
31 
32  /* iso sequences */
33  for( ipISO=ipH_LIKE; ipISO<NISO; ++ipISO )
34  {
35  for( nelem=ipISO; nelem < LIMELM; nelem++ )
36  {
37  if( dense.lgElmtOn[nelem] )
38  {
39  /* print Lyman, Balmer, Paschen, etc sequence optical depths */
40  for( ipLo=0; ipLo < iso.numLevels_local[ipISO][nelem]-1; ipLo++ )
41  {
42  for( ipHi=ipLo+1; ipHi < iso.numLevels_local[ipISO][nelem]; ipHi++ )
43  {
44  prme(" c",&Transitions[ipISO][nelem][ipHi][ipLo]);
45  }
46  }
47  }
48  }
49  }
50 
51  /* print main lines optical depths */
52  for( i=1; i <= nLevel1; i++ )
53  {
54  prme(" c",&TauLines[i]);
55  }
56 
57  for( i=0; i < nWindLine; i++ )
58  {
59  if( TauLine2[i].Hi->IonStg < TauLine2[i].Hi->nelem+1-NISO )
60  {
61  prme(" c",&TauLine2[i]);
62  }
63  }
64 
65  for( i=0; i < nUTA; i++ )
66  {
67  if( UTALines[i].Emis->Aul > 0. )
68  prme(" c",&UTALines[i]);
69  }
70 
71  /* print H2 line optical depths */
73 
74  for( i=0; i < nCORotate; i++ )
75  {
76  prme(" c",&C12O16Rotate[i]);
77  }
78 
79  for( i=0; i < nCORotate; i++ )
80  {
81  prme(" c",&C13O16Rotate[i]);
82  }
83 
84  for( i=0; i < nHFLines; i++ )
85  {
86  prme(" c",&HFLines[i]);
87  }
88 
89  /* data base lines */
90  for( i=0; i < linesAdded2; i++)
91  {
92  prme("DB",atmolEmis[i].tran);
93  }
94 
95  fprintf( ioQQQ, "\n");
96  }
97  return;
98 }
99 
100 /* prme - print optical depth */
101 void prme(
102  /* flag saying what to do
103  * "IN" initialize
104  * " c" add to list of old style lines
105  * "DB" add to list of database lines
106  */
107  const char *chDoIt,
108  transition * t)
109 {
110  char chAtMolWL[20],chAtMol[35];
111  static long int n ;
112 
113  DEBUG_ENTRY( "prme()" );
114 
115  if( t->ipCont <= 0 )
116  {
117  /* line is not transferred */
118  return;
119  }
120 
121  /* "In" is to initialize for new printout */
122  if( strncmp(chDoIt,"IN",2) == 0 )
123  {
124  n = 0;
125  }
126 
127  else if( strncmp(chDoIt,"DB",2) == 0)
128  {
129  /* database lines, - cannot now address species labels for atoms
130  * and molecules in one simple way so separate from most lines
131  * print optical depth if greater than lower limit, or significantly negative */
132  if( t->Emis->TauIn > prt.PrtTauFnt || t->Emis->TauIn < -1e-5 )
133  {
134  sprt_wl(chAtMolWL,t->WLAng);
135  strcpy(chAtMol,t->Hi->chLabel);
136  strcat(chAtMol," ");
137  strcat(chAtMol,chAtMolWL);
138  fprintf( ioQQQ, " %10.15s",chAtMol);
139  fprintf( ioQQQ,PrintEfmt("%9.2e", t->Emis->TauIn));
140  fprintf( ioQQQ, " ");
141  // throw CR after printing 6 numbers
142  ++n;
143  if(n == 6)
144  {
145  n = 0;
146  fprintf( ioQQQ, " \n");
147  }
148  }
149  }
150 
151  else if( strncmp(chDoIt," c",2) == 0)
152  {
153  /* print optical depth if greater than lower limit, or significantly negative */
154  if( t->Emis->TauIn > prt.PrtTauFnt || t->Emis->TauIn < -1e-5 )
155  {
156  /* PrtTauFnt is threshold for printing it */
157  fprintf( ioQQQ, " %10.10s",chLineLbl(t));
158  fprintf( ioQQQ, PrintEfmt("%9.2e", t->Emis->TauIn ));
159 
160  // throw CR after printing 6 numbers
161  ++n;
162  if(n == 6)
163  {
164  n = 0;
165  fprintf( ioQQQ, " \n");
166  }
167  }
168  }
169  else
170  TotalInsanity();
171  return;
172 }

Generated for cloudy by doxygen 1.8.1.2