cloudy trunk
Loading...
Searching...
No Matches
prt_met.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/*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#include "trace.h"
13
14/*prtmet print all line optical depths at end of iteration */
15void prtmet(void)
16{
17 long int i,
18 nelem ,
19 ipHi ,
20 ipLo ,
21 ipISO;
22
23 DEBUG_ENTRY( "prtmet()" );
24
25 /* default is to not print optical depths, turn on with
26 * print optical depths on command */
27 if( prt.lgPrtTau || (trace.lgTrace && trace.lgOptcBug) )
28 {
29 fprintf( ioQQQ, "\n\n Mean Line Optical Depths\n");
30
31 // initialize -- TauLines[0] is just a dummy here
32 prme(true, TauLines[0]);
33
34 /* iso sequences */
35 for( ipISO=ipH_LIKE; ipISO<NISO; ++ipISO )
36 {
37 for( nelem=ipISO; nelem < LIMELM; nelem++ )
38 {
39 if( dense.lgElmtOn[nelem] )
40 {
41 /* print Lyman, Balmer, Paschen, etc sequence optical depths */
42 for( ipLo=0; ipLo < iso_sp[ipISO][nelem].numLevels_local-1; ipLo++ )
43 {
44 for( ipHi=ipLo+1; ipHi < iso_sp[ipISO][nelem].numLevels_local; ipHi++ )
45 {
46 prme(false,iso_sp[ipISO][nelem].trans(ipHi,ipLo));
47 }
48 }
49 }
50 }
51 }
52
53 /* print main lines optical depths */
54 for( i=1; i <= nLevel1; i++ )
55 {
56 prme(false,TauLines[i]);
57 }
58
59 for( i=0; i < nWindLine; i++ )
60 {
61 if( (*TauLine2[i].Hi()).IonStg() < (*TauLine2[i].Hi()).nelem()+1-NISO )
62 {
63 prme(false,TauLine2[i]);
64 }
65 }
66
67 for( i=0; i < nUTA; i++ )
68 {
69 prme(false,UTALines[i]);
70 }
71
72 /* print H2 line optical depths */
73 for( diatom_iter diatom = diatoms.begin(); diatom != diatoms.end(); ++diatom )
74 (*diatom)->H2_Prt_line_tau();
75
76 for( i=0; i < nHFLines; i++ )
77 {
78 prme(false,HFLines[i]);
79 }
80
81 /* data base lines */
82 for (int ipSpecies=0; ipSpecies < nSpecies; ++ipSpecies)
83 {
84 for( EmissionList::iterator em=dBaseTrans[ipSpecies].Emis().begin();
85 em != dBaseTrans[ipSpecies].Emis().end(); ++em)
86 {
87 prme(false,(*em).Tran());
88 }
89 }
90
91 fprintf( ioQQQ, "\n");
92 }
93 return;
94}
95
96/* prme - print line optical depth */
97void prme(
98 const bool lgReset,
99 const TransitionProxy &t)
100{
101 static long int n ;
102
103 DEBUG_ENTRY( "prme()" );
104
105 if( lgReset )
106 n = 0;
107
108 if( t.ipCont() <= 0 )
109 {
110 /* line is not transferred */
111 return;
112 }
113
114 /* print optical depth if greater than lower limit, or significantly negative
115 * PrtTauFnt is threshold for printing it
116 * */
117 if( t.Emis().TauIn()*SQRTPI > prt.PrtTauFnt || t.Emis().TauIn()*SQRTPI < -1e-5 )
118 {
119 fprintf( ioQQQ, " %10.10s",chLineLbl(t));
120 /*>> chng 12 jul 25, print mean optical depths, rather than line center */
121 fprintf( ioQQQ, PrintEfmt("%9.2e", t.Emis().TauIn()*SQRTPI ));
122
123 // throw CR after printing 6 numbers
124 ++n;
125 if(n == 6)
126 {
127 n = 0;
128 fprintf( ioQQQ, " \n");
129 }
130 }
131
132 return;
133}
FILE * ioQQQ
Definition cddefines.cpp:7
#define PrintEfmt(F, V)
Definition cddefines.h:1472
const int LIMELM
Definition cddefines.h:258
const int NISO
Definition cddefines.h:261
#define DEBUG_ENTRY(funcname)
Definition cddefines.h:684
long nWindLine
Definition cdinit.cpp:19
EmissionProxy::iterator iterator
Definition emission.h:317
realnum & TauIn() const
Definition emission.h:423
long & ipCont() const
Definition transition.h:450
EmissionList::reference Emis() const
Definition transition.h:408
t_dense dense
Definition dense.cpp:24
vector< diatomics * > diatoms
Definition h2.cpp:8
vector< diatomics * >::iterator diatom_iter
Definition h2.h:13
t_iso_sp iso_sp[NISO][LIMELM]
Definition iso.cpp:8
const int ipH_LIKE
Definition iso.h:62
UNUSED const double SQRTPI
Definition physconst.h:44
t_prt prt
Definition prt.cpp:10
void prme(const bool lgReset, const TransitionProxy &t)
Definition prt_met.cpp:97
void prtmet(void)
Definition prt_met.cpp:15
long int nSpecies
Definition taulines.cpp:21
TransitionList UTALines("UTALines", &AnonStates)
TransitionList TauLine2("TauLine2", &AnonStates)
vector< TransitionList > dBaseTrans
Definition taulines.cpp:17
TransitionList HFLines("HFLines", &AnonStates)
long int nUTA
Definition taulines.cpp:26
long int nLevel1
Definition taulines.cpp:28
long int nHFLines
Definition taulines.cpp:31
TransitionList TauLines("TauLines", &AnonStates)
t_trace trace
Definition trace.cpp:5
char * chLineLbl(const TransitionProxy &t)