cloudy  trunk
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
parse_f_nu.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 /*ParseF_nu parse intensity command parameters */
4 #include "cddefines.h"
5 #include "physconst.h"
6 #include "rfield.h"
7 #include "radius.h"
8 #include "parser.h"
9 
10 void ParseF_nu(
11  Parser &p,
12  const char *chType,
13  bool lgNU2)
14 {
15  double fr;
16 
17  DEBUG_ENTRY( "ParseF_nu()" );
18 
19  /* flux density of this continuum source, at optional frequency */
20 
21  strcpy( rfield.chRSpec[p.m_nqh], chType );
22 
23  rfield.totpow[p.m_nqh] = p.FFmtRead();
24 
25  /* large luminosity but per sq cm */
26  if( rfield.totpow[p.m_nqh] > 37. &&
27  strcmp(rfield.chRSpec[p.m_nqh],"SQCM") == 0 )
28  {
29  fprintf( ioQQQ, " This intensity is VERY large. Problems? Was luminosity intended??\n" );
30  }
31 
32  if( p.lgEOL() )
33  {
34  p.NoNumb("flux density");
35  }
36 
37  strcpy( rfield.chSpNorm[p.m_nqh], "FLUX" );
38 
39  /* this is optional frequency in Rydbergs */
40  rfield.range[p.m_nqh][0] = p.FFmtRead();
41 
42  /* >>chng 96 dec 18, was 1 changed to H mass nuc ryd
43  * if( lgEOL ) range(nqh,1) = 1. */
44  if( p.lgEOL() )
45  {
46  rfield.range[p.m_nqh][0] = HIONPOT;
47  }
48 
49  if( rfield.range[p.m_nqh][0] <= 0. )
50  {
51  rfield.range[p.m_nqh][0] = pow(10.,rfield.range[p.m_nqh][0]);
52  }
53 
54  if( lgNU2 )
55  {
56  /* range is now freq in ryd, totpow is log of product nu*f_nu */
57  fr = log10(rfield.range[p.m_nqh][0]*FR1RYD);
58  rfield.totpow[p.m_nqh] -= fr;
59  }
60 
61  /* set R to large value in case R not specified (per sq cm)
62  * and this is per unit area */
63  if( strcmp(chType,"SQCM") == 0 && radius.Radius == 0. )
64  {
65  /* RDFALT in BLOCK DATA SCALAR, is 25 */
66  radius.Radius = pow(10.,radius.rdfalt);
67  }
68 
69  /* >>chng 06 mar 22, add time option to vary only some continua with time */
70  if( p.nMatch( "TIME" ) )
71  rfield.lgTimeVary[p.m_nqh] = true;
72 
73  ++p.m_nqh;
74  if( p.m_nqh >= LIMSPC )
75  {
76  fprintf( ioQQQ, " Too many continua entered; increase LIMSPC\n" );
78  }
79  return;
80 }
bool nMatch(const char *chKey) const
Definition: parser.h:135
double Radius
Definition: radius.h:22
double FFmtRead(void)
Definition: parser.cpp:353
long int m_nqh
Definition: parser.h:41
double totpow[LIMSPC]
Definition: rfield.h:300
char chRSpec[LIMSPC][5]
Definition: rfield.h:351
FILE * ioQQQ
Definition: cddefines.cpp:7
Definition: parser.h:31
bool lgTimeVary[LIMSPC]
Definition: rfield.h:306
double range[LIMSPC][2]
Definition: rfield.h:347
const int LIMSPC
Definition: rfield.h:18
const double FR1RYD
Definition: physconst.h:195
void ParseF_nu(Parser &p, const char *chType, bool lgNU2)
Definition: parse_f_nu.cpp:10
t_rfield rfield
Definition: rfield.cpp:8
#define EXIT_FAILURE
Definition: cddefines.h:144
const double HIONPOT
Definition: physconst.h:119
#define cdEXIT(FAIL)
Definition: cddefines.h:438
NORETURN void NoNumb(const char *chDesc) const
Definition: parser.cpp:233
char chSpNorm[LIMSPC][5]
Definition: rfield.h:351
t_radius radius
Definition: radius.cpp:5
#define DEBUG_ENTRY(funcname)
Definition: cddefines.h:688
bool lgEOL(void) const
Definition: parser.h:98
double rdfalt
Definition: radius.h:124