Cloudy Data Archive
cloudy
trunk
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
source
parse_absmag.cpp
Go to the documentation of this file.
1
/* This file is part of Cloudy and is copyright (C)1978-2022 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
9
void
ParseAbsMag
(
Parser
&p)
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
}
22
cdEXIT
(
EXIT_FAILURE
);
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
}
49
cdEXIT
(
EXIT_FAILURE
);
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
{
59
cdEXIT
(
EXIT_FAILURE
);
60
}
61
return
;
62
}
t_mesh::emm
double emm() const
Definition:
mesh.h:93
Parser::nMatch
bool nMatch(const char *chKey) const
Definition:
parser.h:150
Parser::FFmtRead
double FFmtRead(void)
Definition:
parser.cpp:472
Parser::m_nqh
long int m_nqh
Definition:
parser.h:54
t_rfield::totpow
double totpow[LIMSPC]
Definition:
rfield.h:284
t_rfield::chRSpec
char chRSpec[LIMSPC][5]
Definition:
rfield.h:335
ioQQQ
FILE * ioQQQ
Definition:
cddefines.cpp:7
t_called::lgTalk
bool lgTalk
Definition:
called.h:12
Parser
Definition:
parser.h:43
parser.h
t_rfield::lgTimeVary
bool lgTimeVary[LIMSPC]
Definition:
rfield.h:290
t_rfield::range
double range[LIMSPC][2]
Definition:
rfield.h:331
LIMSPC
const int LIMSPC
Definition:
rfield.h:21
called.h
rfield
t_rfield rfield
Definition:
rfield.cpp:9
ParseAbsMag
void ParseAbsMag(Parser &p)
Definition:
parse_absmag.cpp:9
EXIT_FAILURE
#define EXIT_FAILURE
Definition:
cddefines.h:168
cdEXIT
#define cdEXIT(FAIL)
Definition:
cddefines.h:482
t_rfield::chSpNorm
char chSpNorm[LIMSPC][5]
Definition:
rfield.h:335
cddefines.h
DEBUG_ENTRY
#define DEBUG_ENTRY(funcname)
Definition:
cddefines.h:723
t_mesh::egamry
double egamry() const
Definition:
mesh.h:97
Parser::lgEOL
bool lgEOL(void) const
Definition:
parser.h:113
fprintf
int fprintf(const Output &stream, const char *format,...)
Definition:
service.cpp:1121
rfield.h
called
t_called called
Definition:
called.cpp:4
Generated by
1.8.5