/*ParseFireBall parse parameters from fireball command */ #include #include "cddefines.h" #include "incidspec.h" #include "radius.h" #include "bounds.h" #include "parse.h" void ParseFireBall(double z, long int *nqh, float *ar1) { double a, rlogl; # ifdef DEBUG_FUN fputs( "<+>ParseFireBall()\n", debug_fp ); # endif /* check that stack of shape and luminosity specifications * is parallel, stop if not - this happens is background comes * BETWEEN another set of shape and luminosity commands */ if( IncidSpec.nspec != *nqh ) { 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" ); fprintf( ioQQQ, " Sorry.\n" ); puts( "[Stop in ParseFireBall]" ); exit(1); } IncidSpec.nspec += 1; *nqh += 1; if( *nqh > LIMSPC ) { fprintf( ioQQQ, " Too many continua entered; increase LIMSPC\n" ); puts( "[Stop in ParseFireBall]" ); exit(1); } /* put in a black body */ strcpy( spnorm.chSpType[IncidSpec.nspec-1], "BLACK" ); IncidSpec.slope[IncidSpec.nspec-1] = (float)(2.756*(1. + z)); IncidSpec.cutoff[0][IncidSpec.nspec-1] = 0.; IncidSpec.cutoff[1][IncidSpec.nspec-1] = 0.; strcpy( spnorm.chSpNorm[*nqh-1], "LUMI" ); a = log10(IncidSpec.slope[IncidSpec.nspec-1]); rlogl = log10(2.99792e10*7.56464e-15) + 4.*a; strcpy( spnorm.chRSpec[*nqh-1], "SQCM" ); IncidSpec.range[0][*nqh-1] = bounds.emm; IncidSpec.range[1][*nqh-1] = bounds.egamry; IncidSpec.totpow[*nqh-1] = (float)rlogl; /* set radius to very large value if not already set */ if( radius.Radius == 0. ) { *ar1 = (float)radius.rdfalt; radius.Radius = pow(10.,*ar1); } # ifdef DEBUG_FUN fputs( " <->ParseFireBall()\n", debug_fp ); # endif return; }