00001 
00002 
00003 
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         
00020 
00021 
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         
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(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         
00043         rfield.lgBeamed[*nqh] = false;
00044 
00045         
00046         
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         
00062         rfield.lgCMB_set = true;
00063         return;
00064 }