00001
00002
00003
00004 #include "cddefines.h"
00005 #include "radius.h"
00006 #include "rfield.h"
00007 #include "parse.h"
00008
00009 void ParseCMB(double z,
00010 long int *nqh,
00011 float *ar1)
00012 {
00013 double a,
00014 rlogl;
00015
00016 DEBUG_ENTRY( "ParseCMB()" );
00017
00018
00019
00020
00021 if( rfield.nspec != *nqh )
00022 {
00023 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" );
00024 fprintf( ioQQQ, " Sorry.\n" );
00025 puts( "[Stop in ParseCMB]" );
00026 cdEXIT(EXIT_FAILURE);
00027 }
00028
00029
00030 strcpy( rfield.chSpType[rfield.nspec], "BLACK" );
00031
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(2.99792e10*7.56464e-15) + 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
00043
00044
00045
00046 if( !radius.lgRadiusKnown )
00047 {
00048 *ar1 = (float)radius.rdfalt;
00049 radius.Radius = pow(10.,radius.rdfalt);
00050 }
00051
00052 ++rfield.nspec;
00053 ++*nqh;
00054 if( *nqh >= LIMSPC )
00055 {
00056 fprintf( ioQQQ, " Too many continua entered; increase LIMSPC\n" );
00057 puts( "[Stop in ParseCMB]" );
00058 cdEXIT(EXIT_FAILURE);
00059 }
00060
00061
00062 rfield.lgCMB_set = true;
00063
00064 DEBUG_EXIT( "ParseCMB()" );
00065 return;
00066 }
00067