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-2017 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 "rfield.h"
6 #include "radius.h"
7 #include "parser.h"
8 
9 void ParseF_nu(
10  Parser &p,
11  const char *chType,
12  bool lgNU2)
13 {
14  double fr;
15 
16  DEBUG_ENTRY( "ParseF_nu()" );
17 
18  /* flux density of this continuum source, at optional frequency */
19 
20  strcpy( rfield.chRSpec[p.m_nqh], chType );
21 
22  rfield.totpow[p.m_nqh] = p.FFmtRead();
23 
24  /* large luminosity but per sq cm */
25  if( rfield.totpow[p.m_nqh] > 37. &&
26  strcmp(rfield.chRSpec[p.m_nqh],"SQCM") == 0 )
27  {
28  fprintf( ioQQQ, " This intensity is VERY large. Problems? Was luminosity intended??\n" );
29  }
30 
31  if( p.lgEOL() )
32  {
33  p.NoNumb("flux density");
34  }
35 
36  strcpy( rfield.chSpNorm[p.m_nqh], "FLUX" );
37 
38  /* this is optional frequency in Rydbergs */
39  rfield.range[p.m_nqh][0] = p.FFmtRead();
40 
41  /* >>chng 96 dec 18, was 1 changed to H mass nuc ryd
42  * if( lgEOL ) range(nqh,1) = 1. */
43  if( p.lgEOL() )
44  {
45  rfield.range[p.m_nqh][0] = HIONPOT;
46  }
47 
48  if( rfield.range[p.m_nqh][0] <= 0. )
49  {
50  rfield.range[p.m_nqh][0] = exp10(rfield.range[p.m_nqh][0]);
51  }
52 
53  if( lgNU2 )
54  {
55  /* range is now freq in ryd, totpow is log of product nu*f_nu */
56  fr = log10(rfield.range[p.m_nqh][0]*FR1RYD);
57  rfield.totpow[p.m_nqh] -= fr;
58  }
59 
60  /* set R to large value in case R not specified (per sq cm)
61  * and this is per unit area */
62  if( strcmp(chType,"SQCM") == 0 && radius.Radius == 0. )
63  {
64  /* RDFALT in BLOCK DATA SCALAR, is 25 */
66  }
67 
68  /* >>chng 06 mar 22, add time option to vary only some continua with time */
69  if( p.nMatch( "TIME" ) )
70  rfield.lgTimeVary[p.m_nqh] = true;
71 
72  ++p.m_nqh;
73  if( p.m_nqh >= LIMSPC )
74  {
75  fprintf( ioQQQ, " Too many continua entered; increase LIMSPC\n" );
77  }
78  return;
79 }
bool nMatch(const char *chKey) const
Definition: parser.h:140
double Radius
Definition: radius.h:31
double FFmtRead(void)
Definition: parser.cpp:438
double exp10(double x)
Definition: cddefines.h:1383
long int m_nqh
Definition: parser.h:52
double totpow[LIMSPC]
Definition: rfield.h:286
char chRSpec[LIMSPC][5]
Definition: rfield.h:333
FILE * ioQQQ
Definition: cddefines.cpp:7
Definition: parser.h:42
bool lgTimeVary[LIMSPC]
Definition: rfield.h:292
double range[LIMSPC][2]
Definition: rfield.h:329
const int LIMSPC
Definition: rfield.h:20
void ParseF_nu(Parser &p, const char *chType, bool lgNU2)
Definition: parse_f_nu.cpp:9
t_rfield rfield
Definition: rfield.cpp:9
#define EXIT_FAILURE
Definition: cddefines.h:168
#define cdEXIT(FAIL)
Definition: cddefines.h:484
NORETURN void NoNumb(const char *chDesc) const
Definition: parser.cpp:318
char chSpNorm[LIMSPC][5]
Definition: rfield.h:333
t_radius radius
Definition: radius.cpp:5
#define DEBUG_ENTRY(funcname)
Definition: cddefines.h:729
bool lgEOL(void) const
Definition: parser.h:103
int fprintf(const Output &stream, const char *format,...)
Definition: service.cpp:1217
double rdfalt
Definition: radius.h:129