/home66/gary/public_html/cloudy/c08_branch/source/parse_CMB.cpp

Go to the documentation of this file.
00001 /* This file is part of Cloudy and is copyright (C)1978-2008 by Gary J. Ferland and
00002  * others.  For conditions of distribution and use see copyright notice in license.txt */
00003 /*ParseCMB parse parameters from fireball command */
00004 #include "cddefines.h"
00005 #include "radius.h"
00006 #include "rfield.h"
00007 #include "parse.h"
00008 #include "physconst.h"
00009 
00010 void ParseCMB(double z, 
00011   long int *nqh, 
00012   realnum *ar1)
00013 {
00014         double a, 
00015           rlogl;
00016 
00017         DEBUG_ENTRY( "ParseCMB()" );
00018 
00019         /* check that stack of shape and luminosity specifications
00020          * is parallel, stop if not - this happens is background comes
00021          * BETWEEN another set of shape and luminosity commands */
00022         if( rfield.nspec != *nqh )
00023         {
00024                 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" );
00025                 fprintf( ioQQQ, " Sorry.\n" );
00026                 cdEXIT(EXIT_FAILURE);
00027         }
00028 
00029         /* put in a black body */
00030         strcpy( rfield.chSpType[rfield.nspec], "BLACK" );
00031         /* >>chng 03 may 23, CMB temp from 2.756 to 2.725 */
00032         rfield.slope[rfield.nspec] = (CMB_TEMP*(1. + z));
00033         rfield.cutoff[rfield.nspec][0] = 0.;
00034         rfield.cutoff[rfield.nspec][1] = 0.;
00035         strcpy( rfield.chSpNorm[*nqh], "LUMI" );
00036         a = log10(rfield.slope[rfield.nspec]);
00037         rlogl = log10(4.*STEFAN_BOLTZ) + 4.*a;
00038         strcpy( rfield.chRSpec[*nqh], "SQCM" );
00039         rfield.range[*nqh][0] = rfield.emm;
00040         rfield.range[*nqh][1] = rfield.egamry;
00041         rfield.totpow[*nqh] = rlogl;
00042         /* this is an isotropic radiation field */
00043         rfield.lgBeamed[*nqh] = false;
00044 
00045         /* set radius to very large value if not already set */
00046         /* >>chng 01 jul 24, from Radius == 0 to this, as per PvH comments */
00047         if( !radius.lgRadiusKnown )
00048         {
00049                 *ar1 = (realnum)radius.rdfalt;
00050                 radius.Radius = pow(10.,radius.rdfalt);
00051         }
00052 
00053         ++rfield.nspec;
00054         ++*nqh;
00055         if( *nqh >= LIMSPC )
00056         {
00057                 fprintf( ioQQQ, " Too many continua entered; increase LIMSPC\n" );
00058                 cdEXIT(EXIT_FAILURE);
00059         }
00060 
00061         /* this flag says that CMB has been set */
00062         rfield.lgCMB_set = true;
00063         return;
00064 }

Generated on Mon Feb 16 12:01:25 2009 for cloudy by  doxygen 1.4.7