cloudy trunk
Loading...
Searching...
No Matches
parse_absmag.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/*ParseAbsMag parse the absolute magnitude command */
4#include "cddefines.h"
5#include "rfield.h"
6#include "called.h"
7#include "parser.h"
8
10{
11 DEBUG_ENTRY( "ParseAbsMag()" );
12
13 /* enter luminosity in absolute magnitudes */
14 strcpy( rfield.chRSpec[p.m_nqh], "4 PI" );
15 rfield.totpow[p.m_nqh] = p.FFmtRead();
16 if( p.lgEOL() )
17 {
18 if( called.lgTalk )
19 {
20 fprintf( ioQQQ, " There should have been a number on this line. Sorry.\n" );
21 }
23 }
24 if( p.nMatch("BOLO") )
25 {
26 strcpy( rfield.chSpNorm[p.m_nqh], "LUMI" );
27 rfield.range[p.m_nqh][0] = rfield.emm;
28 rfield.range[p.m_nqh][1] = rfield.egamry;
29 /* page 197 allen 76 */
30 rfield.totpow[p.m_nqh] = ((4.75 - rfield.totpow[p.m_nqh])/
31 2.5 + 33.5827);
32 }
33 else if( p.nMatch("VISU") )
34 {
35 strcpy( rfield.chSpNorm[p.m_nqh], "FLUX" );
36 /* this is 5550A, the center of the V filter */
37 rfield.range[p.m_nqh][0] = 0.164f;
38 /* totpow(nqh) = (4.79 - totpow(nqh)) / 2.5 + 18.758
39 * page 197, allen 76, 3rd line from bottom */
40 rfield.totpow[p.m_nqh] = (-rfield.totpow[p.m_nqh]/2.5 +
41 20.65296);
42 }
43 else
44 {
45 if( called.lgTalk )
46 {
47 fprintf( ioQQQ, " Keyword BOLOmetric or VISUal must appear.\n" );
48 }
50 }
51
52 /* >>chng 06 mar 22, add time option to vary only some continua with time */
53 if( p.nMatch( "TIME" ) )
54 rfield.lgTimeVary[p.m_nqh] = true;
55
56 ++p.m_nqh;
57 if( p.m_nqh >= LIMSPC )
58 {
60 }
61 return;
62}
t_called called
Definition called.cpp:5
FILE * ioQQQ
Definition cddefines.cpp:7
#define EXIT_FAILURE
Definition cddefines.h:140
#define cdEXIT(FAIL)
Definition cddefines.h:434
#define DEBUG_ENTRY(funcname)
Definition cddefines.h:684
double FFmtRead(void)
Definition parser.cpp:353
bool nMatch(const char *chKey) const
Definition parser.h:135
bool lgEOL(void) const
Definition parser.h:98
long int m_nqh
Definition parser.h:41
void ParseAbsMag(Parser &p)
t_rfield rfield
Definition rfield.cpp:8
const int LIMSPC
Definition rfield.h:18