00001
00002
00003
00004 #include "cddefines.h"
00005 #include "rfield.h"
00006 #include "parse.h"
00007 #include "physconst.h"
00008 #include "parser.h"
00009
00010 void ParseAgn(Parser &p)
00011 {
00012 double BigBump,
00013 Ratio,
00014 XRays,
00015 xnu;
00016
00017 DEBUG_ENTRY( "ParseAgn()" );
00018
00019
00020 strcpy( rfield.chSpType[rfield.nShape], "AGN " );
00021
00022
00023
00024 if( p.nMatch("KIRK") )
00025 {
00026
00027 rfield.slope[rfield.nShape] = 1e6 / TE1RYD;
00028
00029
00030 rfield.cutoff[rfield.nShape][0] = -1.40;
00031
00032
00033 rfield.cutoff[rfield.nShape][1] = -0.50;
00034
00035
00036 rfield.cutoff[rfield.nShape][2] = -1.0;
00037 }
00038 else
00039 {
00040
00041
00042
00043 rfield.slope[rfield.nShape] = p.FFmtRead();
00044 if( p.lgEOL() )
00045 {
00046
00047 fprintf( ioQQQ, " The big bump temperature should have been on this line. Sorry.\n" );
00048 cdEXIT(EXIT_FAILURE);
00049 }
00050
00051 if( rfield.slope[rfield.nShape] <= 0. )
00052 {
00053 fprintf( ioQQQ, " Non positive temperature not allowed. Sorry.\n" );
00054 cdEXIT(EXIT_FAILURE);
00055 }
00056
00057
00058 if( rfield.slope[rfield.nShape] <= 10. )
00059 rfield.slope[rfield.nShape] =
00060 pow(10.,rfield.slope[rfield.nShape]);
00061
00062
00063 rfield.slope[rfield.nShape] /= TE1RYD;
00064
00065
00066 rfield.cutoff[rfield.nShape][0] = p.FFmtRead();
00067 if( p.lgEOL() )
00068 {
00069 fprintf( ioQQQ, " alpha ox should have been on this line. Sorry.\n" );
00070 cdEXIT(EXIT_FAILURE);
00071 }
00072
00073 if( rfield.cutoff[rfield.nShape][0] > 3. ||
00074 rfield.cutoff[rfield.nShape][0] < -3. )
00075 {
00076 fprintf( ioQQQ, " An alpha ox of%10.2e looks funny to me. Check Hazy to make sure its ok.\n",
00077 rfield.cutoff[rfield.nShape][0] );
00078 }
00079
00080 if( rfield.cutoff[rfield.nShape][0] >= 0. )
00081 {
00082 fprintf( ioQQQ, " The sign of alpha ox is almost certainly incorrect. Check Hazy.\n" );
00083 }
00084
00085
00086 rfield.cutoff[rfield.nShape][1] = p.FFmtRead();
00087 if( p.lgEOL() )
00088 rfield.cutoff[rfield.nShape][1] = -0.5f;
00089
00090
00091 rfield.cutoff[rfield.nShape][2] = p.FFmtRead();
00092 if( p.lgEOL() )
00093 rfield.cutoff[rfield.nShape][2] = -1.0f;
00094 }
00095
00096
00097
00098 Ratio = pow(403.3,rfield.cutoff[rfield.nShape][0] - 1.);
00099
00100
00101 xnu = 0.3645;
00102 BigBump = pow(xnu,-1. + rfield.cutoff[rfield.nShape][1])*
00103 sexp(xnu/rfield.slope[rfield.nShape]);
00104 xnu = 147.;
00105
00106
00107 XRays = pow(xnu,rfield.cutoff[rfield.nShape][2] - 1.);
00108 if( BigBump <= 0. )
00109 {
00110 fprintf( ioQQQ, " Big Bump had zero flux at .3645 Ryd.\n" );
00111 cdEXIT(EXIT_FAILURE);
00112 }
00113 rfield.cutoff[rfield.nShape][0] = (Ratio/(XRays/BigBump));
00114
00115
00116 ++rfield.nShape;
00117 if( rfield.nShape >= LIMSPC )
00118 {
00119 fprintf( ioQQQ, " Too many continua entered; increase LIMSPC\n" );
00120 cdEXIT(EXIT_FAILURE);
00121 }
00122 return;
00123 }