cloudy  trunk
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 
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 }
double emm() const
Definition: mesh.h:93
bool nMatch(const char *chKey) const
Definition: parser.h:150
double FFmtRead(void)
Definition: parser.cpp:472
long int m_nqh
Definition: parser.h:54
double totpow[LIMSPC]
Definition: rfield.h:284
char chRSpec[LIMSPC][5]
Definition: rfield.h:335
FILE * ioQQQ
Definition: cddefines.cpp:7
bool lgTalk
Definition: called.h:12
Definition: parser.h:43
bool lgTimeVary[LIMSPC]
Definition: rfield.h:290
double range[LIMSPC][2]
Definition: rfield.h:331
const int LIMSPC
Definition: rfield.h:21
t_rfield rfield
Definition: rfield.cpp:9
void ParseAbsMag(Parser &p)
Definition: parse_absmag.cpp:9
#define EXIT_FAILURE
Definition: cddefines.h:168
#define cdEXIT(FAIL)
Definition: cddefines.h:482
char chSpNorm[LIMSPC][5]
Definition: rfield.h:335
#define DEBUG_ENTRY(funcname)
Definition: cddefines.h:723
double egamry() const
Definition: mesh.h:97
bool lgEOL(void) const
Definition: parser.h:113
int fprintf(const Output &stream, const char *format,...)
Definition: service.cpp:1121
t_called called
Definition: called.cpp:4