cloudy  trunk
 All Data Structures 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-2008 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 "radius.h"
6 #include "rfield.h"
7 #include "parse.h"
8 #include "physconst.h"
9 
10 void ParseCMB(double z,
11  long int *nqh,
12  realnum *ar1)
13 {
14  double a,
15  rlogl;
16 
17  DEBUG_ENTRY( "ParseCMB()" );
18 
19  /* check that stack of shape and luminosity specifications
20  * is parallel, stop if not - this happens is background comes
21  * BETWEEN another set of shape and luminosity commands */
22  if( rfield.nspec != *nqh )
23  {
24  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" );
25  fprintf( ioQQQ, " Sorry.\n" );
26  cdEXIT(EXIT_FAILURE);
27  }
28 
29  /* put in a black body */
30  strcpy( rfield.chSpType[rfield.nspec], "BLACK" );
31  /* >>chng 03 may 23, CMB temp from 2.756 to 2.725 */
32  rfield.slope[rfield.nspec] = (CMB_TEMP*(1. + z));
33  rfield.cutoff[rfield.nspec][0] = 0.;
34  rfield.cutoff[rfield.nspec][1] = 0.;
35  strcpy( rfield.chSpNorm[*nqh], "LUMI" );
36  a = log10(rfield.slope[rfield.nspec]);
37  rlogl = log10(4.*STEFAN_BOLTZ) + 4.*a;
38  strcpy( rfield.chRSpec[*nqh], "SQCM" );
39  rfield.range[*nqh][0] = rfield.emm;
40  rfield.range[*nqh][1] = rfield.egamry;
41  rfield.totpow[*nqh] = rlogl;
42  /* this is an isotropic radiation field */
43  rfield.lgBeamed[*nqh] = false;
44 
45  /* set radius to very large value if not already set */
46  /* >>chng 01 jul 24, from Radius == 0 to this, as per PvH comments */
47  if( !radius.lgRadiusKnown )
48  {
49  *ar1 = (realnum)radius.rdfalt;
50  radius.Radius = pow(10.,radius.rdfalt);
51  }
52 
53  ++rfield.nspec;
54  ++*nqh;
55  if( *nqh >= LIMSPC )
56  {
57  fprintf( ioQQQ, " Too many continua entered; increase LIMSPC\n" );
58  cdEXIT(EXIT_FAILURE);
59  }
60 
61  /* this flag says that CMB has been set */
62  rfield.lgCMB_set = true;
63  return;
64 }

Generated for cloudy by doxygen 1.8.3.1