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-2022 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  /* >>chng 06 mar 22, add time option to vary only some continua with time */
61  if( p.nMatch( "TIME" ) )
62  rfield.lgTimeVary[p.m_nqh] = true;
63 
64  ++p.m_nqh;
65  if( p.m_nqh >= LIMSPC )
66  {
67  fprintf( ioQQQ, " Too many continua entered; increase LIMSPC\n" );
69  }
70  return;
71 }
bool nMatch(const char *chKey) const
Definition: parser.h:150
double FFmtRead(void)
Definition: parser.cpp:472
double exp10(double x)
Definition: cddefines.h:1368
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
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
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:482
NORETURN void NoNumb(const char *chDesc) const
Definition: parser.cpp:345
char chSpNorm[LIMSPC][5]
Definition: rfield.h:335
#define DEBUG_ENTRY(funcname)
Definition: cddefines.h:723
bool lgEOL(void) const
Definition: parser.h:113
int fprintf(const Output &stream, const char *format,...)
Definition: service.cpp:1121