root/branches/newmole/source/cont_negative.cpp

Revision 2346, 1.9 kB (checked in by rjrw, 5 months ago)

Merged from trunk r2137:2345

  • Property svn:eol-style set to native
Line 
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/*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
10void 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}
Note: See TracBrowser for help on using the browser.