00001
00002
00003
00004 #include "cddefines.h"
00005 #include "rfield.h"
00006 #include "thermal.h"
00007 #include "radius.h"
00008 #include "stopcalc.h"
00009 #include "dynamics.h"
00010 #include "parse.h"
00011
00012
00013 void ParseCoronal(char *chCard,
00014 long int *nqh,
00015 float *ar1)
00016 {
00017 bool lgEOL;
00018 long int i;
00019 double a;
00020
00021 DEBUG_ENTRY( "ParseCoronal()" );
00022
00023 if( nMatch( "INIT" , chCard ) && nMatch( "TIME" , chCard ) )
00024 {
00025 dynamics.lg_coronal_time_init = true;
00026 }
00027
00028
00029 thermal.lgTSetOn = true;
00030 i = 5;
00031 a = FFmtRead(chCard,&i,INPUT_LINE_LENGTH,&lgEOL);
00032 if( lgEOL )
00033 {
00034 fprintf( ioQQQ, " There should be a temperature on this line.\n" );
00035 puts( "[Stop in ParseCoronal]" );
00036 cdEXIT(EXIT_FAILURE);
00037 }
00038
00039
00040 if( a <= 10. && !nMatch("LINE",chCard) )
00041 {
00042 thermal.ConstTemp = (float)pow(10.,a);
00043 }
00044 else
00045 {
00046 thermal.ConstTemp = (float)a;
00047 }
00048
00049
00050 if( thermal.ConstTemp < StopCalc.TeLowest )
00051 {
00052 fprintf( ioQQQ, " temperature on coronal command cannot be below %.3f, reset to 3K.\n",
00053 StopCalc.TeLowest);
00054 thermal.ConstTemp = 3.;
00055 }
00056 else if( thermal.ConstTemp > StopCalc.TeHighest )
00057 {
00058 fprintf( ioQQQ, " temperature on coronal command cannot be above %.3f, reset to 3e9K.\n",
00059 StopCalc.TeHighest);
00060 thermal.ConstTemp = 3e9;
00061 }
00062
00063
00064 strcpy( rfield.chSpType[rfield.nspec], "BREMS" );
00065 rfield.slope[rfield.nspec] = 1e8;
00066 rfield.cutoff[rfield.nspec][0] = 0.;
00067 rfield.cutoff[rfield.nspec][1] = 0.;
00068
00069
00070 strcpy( rfield.chRSpec[*nqh], "SQCM" );
00071 strcpy( rfield.chSpNorm[*nqh], "IONI" );
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082 rfield.totpow[*nqh] = -20.f;
00083
00084
00085
00086
00087 if( !radius.lgRadiusKnown )
00088 {
00089 *ar1 = (float)radius.rdfalt;
00090 radius.Radius = pow(10.,radius.rdfalt);
00091 }
00092
00093 ++rfield.nspec;
00094 if( rfield.nspec >= LIMSPC )
00095 {
00096
00097 fprintf( ioQQQ, " Too many continua entered; increase LIMSPC\n" );
00098 puts( "[Stop in ParseCoronal]" );
00099 cdEXIT(EXIT_FAILURE);
00100 }
00101 ++*nqh;
00102 if( *nqh >= LIMSPC )
00103 {
00104
00105 fprintf( ioQQQ, " Too many continua entered; increase LIMSPC\n" );
00106 puts( "[Stop in ParseCoronal]" );
00107 cdEXIT(EXIT_FAILURE);
00108 }
00109
00110 DEBUG_EXIT( "ParseCoronal()" );
00111 return;
00112 }
00113