cloudy  trunk
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
parse_CMB.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 /*ParseCMB parse parameters from fireball command */
4 #include "cddefines.h"
5 #include "parser.h"
6 #include "cosmology.h"
7 #include "radius.h"
8 #include "rfield.h"
9 
10 void ParseCMB(double z,
11  long int *nqh)
12 {
13  double a,
14  rlogl;
15 
16  DEBUG_ENTRY( "ParseCMB()" );
17 
18  /* check that stack of shape and luminosity specifications
19  * is parallel, stop if not - this happens is background comes
20  * BETWEEN another set of shape and luminosity commands */
21  if( rfield.nShape != *nqh )
22  {
23  fprintf( ioQQQ, " This command has come between a previous ordered pair of continuum shape and luminosity commands.\n Reorder the commands to complete each continuum specification before starting another.\n" );
24  fprintf( ioQQQ, " Sorry.\n" );
26  }
27 
28  /* put in a black body */
29  strcpy( rfield.chSpType[rfield.nShape], "BLACK" );
30  /* >>chng 03 may 23, CMB temp from 2.756 to 2.725 */
31  rfield.slope[rfield.nShape] = (CMB_TEMP*(1. + z));
32  rfield.cutoff[rfield.nShape][0] = 0.;
33  rfield.cutoff[rfield.nShape][1] = 0.;
34  strcpy( rfield.chSpNorm[*nqh], "LUMI" );
35  a = log10(rfield.slope[rfield.nShape]);
36  rlogl = log10(4.*STEFAN_BOLTZ) + 4.*a;
37  strcpy( rfield.chRSpec[*nqh], "SQCM" );
38  rfield.range[*nqh][0] = rfield.emm();
39  rfield.range[*nqh][1] = rfield.egamry();
40  rfield.totpow[*nqh] = rlogl;
41  /* this is an isotropic radiation field */
42  rfield.lgBeamed[*nqh] = false;
44 
45  ++rfield.nShape;
46  ++*nqh;
47  if( *nqh >= LIMSPC )
48  {
49  fprintf( ioQQQ, " Too many continua entered; increase LIMSPC\n" );
51  }
52 
53  /* this flag says that CMB has been set */
54  rfield.lgCMB_set = true;
55  return;
56 }
double emm() const
Definition: mesh.h:93
bool lgBeamed[LIMSPC]
Definition: rfield.h:294
double totpow[LIMSPC]
Definition: rfield.h:284
char chRSpec[LIMSPC][5]
Definition: rfield.h:335
FILE * ioQQQ
Definition: cddefines.cpp:7
double cutoff[LIMSPC][3]
Definition: rfield.h:284
double range[LIMSPC][2]
Definition: rfield.h:331
const int LIMSPC
Definition: rfield.h:21
double slope[LIMSPC]
Definition: rfield.h:284
bool lgCMB_set
Definition: rfield.h:106
t_rfield rfield
Definition: rfield.cpp:9
#define EXIT_FAILURE
Definition: cddefines.h:168
Illuminate::IlluminationType Illumination[LIMSPC]
Definition: rfield.h:300
#define cdEXIT(FAIL)
Definition: cddefines.h:482
void ParseCMB(double z, long int *nqh)
Definition: parse_CMB.cpp:10
char chSpNorm[LIMSPC][5]
Definition: rfield.h:335
#define DEBUG_ENTRY(funcname)
Definition: cddefines.h:723
double egamry() const
Definition: mesh.h:97
#define CMB_TEMP
Definition: cosmology.h:10
int fprintf(const Output &stream, const char *format,...)
Definition: service.cpp:1121
long int nShape
Definition: rfield.h:306
char chSpType[LIMSPC][6]
Definition: rfield.h:335