cloudy  trunk
cont_negative.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 /*ContNegative sanity check for negative continuum intensities */
4 #include "cddefines.h"
5 #include "rfield.h"
6 #include "dense.h"
7 #include "phycon.h"
8 #include "continuum.h"
9 
10 void ContNegative(void)
11 {
12  bool lgFNeg;
13  long int i;
14 
15  DEBUG_ENTRY( "ContNegative()" );
16 
17  /* look for negative continuum points */
18  lgFNeg = false;
19  for( i=0; i < rfield.nflux; i++ )
20  {
21  if( rfield.flux[0][i] < 0. )
22  {
23  fprintf( ioQQQ, " FLUX negative, value, freq, pointer=%10.2e%10.2e%5ld %4.4s %4.4s\n",
24  rfield.flux[0][i], rfield.anu[i], i, rfield.chLineLabel[i]
25  , rfield.chContLabel[i] );
26  lgFNeg = true;
27  }
28  else if( rfield.otslin[i] < 0. )
29  {
30  fprintf( ioQQQ, " OTSLIN negative, value, freq, pointer=%10.2e%10.2e%5ld\n",
31  rfield.otslin[i], rfield.anu[i], i );
32  lgFNeg = true;
33  }
34  else if( rfield.otscon[i] < 0. )
35  {
36  fprintf( ioQQQ, " OTSCON negative, value, freq, pointer=%10.2e%10.2e%5ld\n",
37  rfield.otscon[i], rfield.anu[i], i );
38  lgFNeg = true;
39  }
40  else if( rfield.SummedCon[i] < 0. )
41  {
42  fprintf( ioQQQ, " OUTCON negative, value, freq, pointer=%10.2e%10.2e%5ld\n",
43  rfield.ConInterOut[i], rfield.anu[i], i );
44  lgFNeg = true;
45  }
46  else if( rfield.ConInterOut[i] < 0. )
47  {
48  fprintf( ioQQQ, " OUTCON negative, value, freq, pointer=%10.2e%10.2e%5ld\n",
49  rfield.ConInterOut[i], rfield.anu[i], i );
50  lgFNeg = true;
51  }
52  else if( rfield.outlin[0][i] < 0. )
53  {
54  fprintf( ioQQQ, " OUTLIN negative, value, freq, pointer=%10.2e%10.2e%5ld\n",
55  rfield.outlin[0][i], rfield.anu[i], i );
56  lgFNeg = true;
57  }
58  }
59 
60  if( !lgFNeg )
61  {
62  fprintf( ioQQQ, " No parts of the continuum were negative, the electron density was%10.2e te=%10.2e\n",
63  dense.eden, phycon.te );
64  fprintf( ioQQQ, " This is zone number%4ld\n", nzone );
65  }
66  return;
67 }
t_dense::eden
double eden
Definition: dense.h:190
dense
t_dense dense
Definition: dense.cpp:24
rfield
t_rfield rfield
Definition: rfield.cpp:8
t_rfield::flux
realnum ** flux
Definition: rfield.h:86
ioQQQ
FILE * ioQQQ
Definition: cddefines.cpp:7
rfield.h
t_rfield::otscon
realnum * otscon
Definition: rfield.h:195
phycon
t_phycon phycon
Definition: phycon.cpp:6
t_rfield::outlin
realnum ** outlin
Definition: rfield.h:199
nzone
long int nzone
Definition: cddefines.cpp:14
ContNegative
void ContNegative(void)
Definition: cont_negative.cpp:10
dense.h
cddefines.h
t_rfield::chLineLabel
char ** chLineLabel
Definition: rfield.h:220
t_rfield::nflux
long int nflux
Definition: rfield.h:43
t_rfield::SummedCon
double * SummedCon
Definition: rfield.h:171
t_rfield::otslin
realnum * otslin
Definition: rfield.h:193
t_rfield::anu
double * anu
Definition: rfield.h:58
t_rfield::ConInterOut
realnum * ConInterOut
Definition: rfield.h:164
phycon.h
continuum.h
t_phycon::te
double te
Definition: phycon.h:11
DEBUG_ENTRY
#define DEBUG_ENTRY(funcname)
Definition: cddefines.h:684
t_rfield::chContLabel
char ** chContLabel
Definition: rfield.h:223