00001
00002
00003
00004
00005
00006
00007 #include "cddefines.h"
00008 #include "cddrive.h"
00009 #include "physconst.h"
00010 #include "optimize.h"
00011 #include "rfield.h"
00012 #include "trace.h"
00013 #include "radius.h"
00014 #include "input.h"
00015 #include "stars.h"
00016 #include "lines.h"
00017 #include "path.h"
00018 #include "prt.h"
00019 #include "parse.h"
00020
00021 #if defined(__HP_aCC)
00022 # pragma OPT_LEVEL 1
00023 #endif
00024
00025
00026
00027 static char **chLabel;
00028 static float *wl;
00029 static long int nLINE_TABLE = 0;
00030 static char chLINE_LIST[FILENAME_PATH_LENGTH];
00031
00032
00033
00034 #define NCRAB 10
00035 static double tnucrb[NCRAB],
00036 fnucrb[NCRAB];
00037
00038
00039 #define NRUBIN 56
00040 double tnurbn[NRUBIN] = {1.05E-08,1.05E-07,1.05E-06,1.04E-05,1.00E-04,1.00E-03,1.00E-02,3.01E-02,1.00E-01,
00041 1.50E-01,2.50E-01,4.01E-01,6.01E-01,9.8E-01,9.96E-01,1.00E+00,1.02445,1.07266,1.12563,1.18411,1.23881,
00042 1.29328,1.35881,1.42463,1.48981,1.55326,1.6166,1.68845,1.76698,1.8019,1.808,1.84567,1.9317,2.04891,2.14533,
00043 2.19702,2.27941,2.37438,2.43137,2.49798,2.56113,2.59762,2.66597,2.80543,2.95069,3.02911,3.11182,3.22178,
00044 3.3155,3.42768,3.50678,3.56157,3.61811,3.75211,3.89643,4.},
00045 fnurbn[NRUBIN] = {1.56E-20,1.55E-17,1.54E-14,1.53E-11,1.35E-08,1.34E-05,1.35E-02,3.62E-01,1.27E+01,
00046 3.90E+01,1.48E+02,4.52E+02,1.02E+03,2.27E+03,8.69E+02,8.04E+02,6.58E+02,6.13E+02,6.49E+02,6.06E+02,
00047 6.30E+02,5.53E+02,5.55E+02,5.24E+02,4.86E+02,4.49E+02,4.42E+02,3.82E+02,3.91E+02,2.91E+02,2.61E+02,
00048 1.32E+02,1.20E+02,1.16E+02,9.56E+01,9.94E+01,9.10E+01,4.85E+01,7.53E+01,9.53E+01,8.52E+01,5.76E+01,
00049 6.72E+01,5.20E+01,8.09E+00,3.75E+00,5.57E+00,3.80E+00,2.73E+00,2.22E+00,3.16E-01,1.26E-01,1.39E-01,
00050 6.15E-02,3.22E-02,7.98E-03};
00051
00052
00053 #define NCFL 40
00054 static double cfle[NCFL],
00055 cflf[NCFL];
00056
00057
00058 #define NKN120 11
00059 static double tnuakn[NKN120],
00060 fnuakn[NKN120];
00061
00062
00063 #define NISM 23
00064 static double tnuism[NISM],
00065 fnuism[NISM];
00066
00067
00068
00069
00070 #define NHM96 14
00071
00072 static double tnuHM96[NHM96]={-8,-1.722735683,-0.351545683,-0.222905683,-0.133385683,
00073
00074 -0.127655683,-0.004575683,0.297544317,0.476753,0.476756,0.588704317,
00075 0.661374317,1.500814317,2.245164317};
00076
00077
00078 static double fnuHM96[NHM96]={-32.53342863,-19.9789,-20.4204,-20.4443,-20.5756,-20.7546,
00079 -21.2796,-21.6256,-21.8404,-21.4823,-22.2102,-22.9263,-23.32,-24.2865};
00080
00081
00082 #define NAGN 8
00083 static double tnuagn[NAGN],
00084 tslagn[NAGN];
00085
00086 #define NDRAINE 15
00087 static double tnudrn[NDRAINE] , tsldrn[NDRAINE];
00088
00089
00090 static void ZeroContin(void);
00091
00092
00093
00094 static void read_hm05( char chFile[] , double **tnuHM , double **fnuHM ,
00095 long int *nhm , double redshift )
00096 {
00097
00098 FILE *ioFILE;
00099 double *table_redshifts = NULL,
00100 *table_wl = NULL ,
00101 **table_fn=NULL,
00102 frac_hi;
00103 char chLine[1000];
00104 long int nRedshift , i , n , nz , ipLo , ipHi;
00105 bool lgEOL;
00106
00107 DEBUG_ENTRY( "read_hm05()" );
00108
00109
00110 if( NULL==(ioFILE=fopen( chFile,"r")))
00111 {
00112 char chFileFull[FILENAME_PATH_LENGTH_2];
00113 strcpy( chFileFull , chDataPath );
00114 strcat( chFileFull , chFile );
00115 if( NULL==(ioFILE=fopen( chFileFull,"r")))
00116 {
00117 fprintf( ioQQQ, " I could not open file %s.\n",chFile );
00118 fprintf( ioQQQ, " Set the path to the data files and still failed\n" );
00119 puts( "[Stop in read_hm05]" );
00120 cdEXIT(EXIT_FAILURE);
00121 }
00122 }
00123
00124
00125 *nhm = 0;
00126
00127 nRedshift = -1;
00128
00129 while( fgets( chLine , (int)sizeof(chLine) , ioFILE ) != NULL )
00130 {
00131
00132
00133 if( chLine[0] != '#')
00134 {
00135 ++*nhm;
00136
00137 if( *nhm==1 )
00138 {
00139 long mag_read;
00140
00141 i = 1;
00142 mag_read = (long)FFmtRead(chLine,&i,(int)sizeof(chLine),&lgEOL);
00143 if( mag_read != 50808 )
00144 {
00145 fprintf(ioQQQ,
00146 " Magic number in Haardt & Madau file is not correct, I expected 50808 and found %li\n",
00147 mag_read );
00148 puts( "[Stop in read_hm05]" );
00149 cdEXIT(EXIT_FAILURE);
00150 }
00151 }
00152
00153 else if( *nhm==2 )
00154 {
00155 double a;
00156 i = 2;
00157 lgEOL = false;
00158 nRedshift = 0;
00159 while( !lgEOL )
00160 {
00161 ++nRedshift;
00162 a = FFmtRead(chLine,&i,(int)sizeof(chLine),&lgEOL);
00163 ASSERT( a >= 0. );
00164 }
00165
00166 --nRedshift;
00167
00168 --nRedshift;
00169
00170
00171 table_redshifts = (double*)MALLOC( (size_t)nRedshift*sizeof(double) );
00172
00173 i = 2;
00174 for( n=0; n<nRedshift; ++n )
00175 {
00176 table_redshifts[n] = FFmtRead(chLine,&i,(int)sizeof(chLine),&lgEOL);
00177
00178 }
00179 if( lgEOL )
00180 TotalInsanity();
00181 }
00182 }
00183 }
00184
00185
00186
00187 table_wl = (double*)MALLOC( (size_t)*nhm*sizeof(double) );
00188
00189 table_fn = (double**)MALLOC( (size_t)nRedshift*sizeof(double*) );
00190 for(n=0; n<nRedshift; ++n )
00191 {
00192 table_fn[n] = (double*)MALLOC( (size_t)(*nhm)*sizeof(double) );
00193 }
00194
00195
00196 if( fseek( ioFILE , 0 , SEEK_SET ) != 0 )
00197 {
00198 fprintf( ioQQQ, " read_hm05 could not rewind HM05 date file.\n");
00199 puts( "[Stop in read_hm05]" );
00200 cdEXIT(EXIT_FAILURE);
00201 }
00202 n = 0;
00203 *nhm = 0;
00204 while( fgets( chLine , (int)sizeof(chLine) , ioFILE ) != NULL )
00205 {
00206
00207
00208 if( chLine[0] != '#')
00209 {
00210
00211
00212 ++n;
00213 if( n>2 )
00214 {
00215 i = 1;
00216 table_wl[*nhm] = FFmtRead(chLine,&i,(int)sizeof(chLine),&lgEOL);
00217 if( lgEOL )
00218 TotalInsanity();
00219 for( nz=0; nz<nRedshift; ++nz )
00220 {
00221
00222
00223 double p1 = FFmtRead(chLine,&i,(int)sizeof(chLine),&lgEOL);
00224
00225 double p2 = FFmtRead(chLine,&i,(int)sizeof(chLine),&lgEOL);
00226 if( lgEOL )
00227 TotalInsanity();
00228
00229 table_fn[nz][*nhm] = p1*pow(10.,p2);
00230
00231 }
00232 ++*nhm;
00233 }
00234 }
00235 }
00236
00237
00238 {
00239
00240
00241 enum {DEBUG_LOC=false};
00242
00243 if( DEBUG_LOC)
00244 {
00245 fprintf(ioQQQ,"wavelength/z");
00246 for(nz=0; nz<nRedshift; ++nz )
00247 fprintf(ioQQQ,"\t%.3f", table_redshifts[nz] );
00248 fprintf(ioQQQ,"\n");
00249 for( i=0; i<*nhm; ++i )
00250 {
00251 fprintf(ioQQQ,"%.3e", table_wl[i] );
00252 for( nz=0; nz<nRedshift; ++nz )
00253 fprintf(ioQQQ,"\t%.3e", table_fn[nz][i] );
00254 fprintf(ioQQQ,"\n");
00255 }
00256 }
00257 }
00258
00259
00260 assert( table_redshifts!=NULL );
00261
00262
00263 if( redshift < table_redshifts[0] ||
00264 redshift > table_redshifts[nRedshift-1] )
00265 {
00266 fprintf(ioQQQ," The redshift requested on table HM05 is %g but is not within the range of the table, which goes from %g to %g.\n",
00267 redshift, table_redshifts[0] , table_redshifts[nRedshift-1] );
00268 fprintf(ioQQQ," Sorry.\n");
00269 puts( "[Stop in read_hm05]" );
00270 cdEXIT(EXIT_FAILURE);
00271 }
00272
00273 ipLo = -1;
00274 ipHi = -1;
00275
00276 for( nz=0; nz<nRedshift-1; ++nz )
00277 {
00278 if( redshift >= table_redshifts[nz] &&
00279 redshift <= table_redshifts[nz+1] )
00280 {
00281 ipLo = nz;
00282 ipHi = nz+1;
00283 break;
00284 }
00285 }
00286 ASSERT( ipLo>=0 && ipHi >=0 );
00287
00288
00289
00290 for( i=0; i<*nhm-1; ++i )
00291 {
00292 if( table_wl[i]>=table_wl[i+1] )
00293 {
00294 fprintf(ioQQQ," The wavelengths in the table HM05 data table are not in increasing order. This is required.\n");
00295 fprintf(ioQQQ," Sorry.\n");
00296 puts( "[Stop in read_hm05]" );
00297 cdEXIT(EXIT_FAILURE);
00298 }
00299 }
00300
00301
00302 *fnuHM = (double *)MALLOC( (size_t)(*nhm)*sizeof(double ) );
00303 *tnuHM = (double *)MALLOC( (size_t)(*nhm)*sizeof(double ) );
00304
00305
00306
00307
00308
00309 frac_hi = (redshift-table_redshifts[ipLo]) / (table_redshifts[ipHi]-table_redshifts[ipLo]);
00310 for( i=0; i<*nhm; ++i )
00311 {
00312
00313
00314
00315 (*tnuHM)[*nhm-1-i] = RYDLAM / table_wl[i];
00316
00317 (*fnuHM)[*nhm-1-i] = table_fn[ipLo][i]*(1.-frac_hi) + table_fn[ipHi][i]*frac_hi;
00318
00319 }
00320
00321 for( n=0; n<nRedshift; ++n )
00322 free( table_fn[n] );
00323 free( table_fn );
00324 free( table_wl );
00325 free( table_redshifts );
00326
00327 DEBUG_EXIT( "read_hm05()" );
00328 return;
00329
00330 }
00331
00332 void ParseTable(long int *nqh,
00333 char *chCard,
00334 float *ar1)
00335 {
00336 char chFile[FILENAME_PATH_LENGTH_2];
00337
00338 IntMode imode = IM_ILLEGAL_MODE;
00339 bool lgEOL,
00340 lgHit,
00341 lgLogSet;
00342 static bool lgCalled=false;
00343
00344 long int i,
00345 j,
00346 k,
00347 ncont,
00348 nstar,
00349 ipNORM;
00350
00351 double alpha,
00352 brakmm,
00353 brakxr,
00354 ConBreak,
00355 fac,
00356 scale,
00357 slopir,
00358 slopxr;
00359
00360 bool lgNoContinuum = false,
00361 lgQuoteFound;
00362
00363 DEBUG_ENTRY( "ParseTable()" );
00364
00365
00366 if( !lgCalled )
00367 {
00368 ZeroContin();
00369 lgCalled = true;
00370 }
00371
00372 if( rfield.nspec >= LIMSPC )
00373 {
00374 fprintf( ioQQQ, " %ld is too many spectra entered. Increase LIMSPC\n Sorry.\n",
00375 rfield.nspec );
00376 puts( "[Stop in ParseTable]" );
00377 cdEXIT(EXIT_FAILURE);
00378 }
00379
00380
00381
00382
00383 lgQuoteFound = true;
00384 if( GetQuote( chFile , chCard , false ) )
00385 lgQuoteFound = false;
00386
00387
00388 strcpy( rfield.chSpType[rfield.nspec], "INTER" );
00389
00390 if( !rfield.lgContMalloc[rfield.nspec] )
00391 {
00392 rfield.tNuRyd[rfield.nspec] = (float*)CALLOC( (size_t)NCELL , sizeof(float) );
00393 rfield.tslop[rfield.nspec] = (float*)CALLOC( (size_t)NCELL , sizeof(float) );
00394 rfield.tFluxLog[rfield.nspec] = (float*)CALLOC( (size_t)NCELL , sizeof(float) );
00395 rfield.lgContMalloc[rfield.nspec] = true;
00396 }
00397
00398
00399 if( nMatch(" AGN",chCard) )
00400 {
00401
00402 ASSERT( NAGN < NCELL);
00403 for( i=0; i < NAGN; i++ )
00404 {
00405 rfield.tNuRyd[rfield.nspec][i] = (float)tnuagn[i];
00406 rfield.tslop[rfield.nspec][i] = (float)tslagn[i];
00407 }
00408
00409 ncont = NAGN - 1;
00410
00411
00412 if( nMatch("BREA",chCard) )
00413 {
00414 i = 4;
00415 ConBreak = FFmtRead(chCard,&i,INPUT_LINE_LENGTH,&lgEOL);
00416
00417 if( lgEOL )
00418 {
00419
00420 if( nMatch(" NO ",chCard) )
00421 {
00422 ConBreak = rfield.emm*1.01f;
00423 }
00424 else
00425 {
00426 fprintf( ioQQQ, " There must be a number for the break.\n Sorry.\n" );
00427 puts( "[Stop in ParseTable]" );
00428 cdEXIT(EXIT_FAILURE);
00429 }
00430 }
00431
00432 if( ConBreak == 0. )
00433 {
00434 fprintf( ioQQQ, " The break must be greater than 0.2 Ryd.\n Sorry.\n" );
00435 puts( "[Stop in ParseTable]" );
00436 cdEXIT(EXIT_FAILURE);
00437 }
00438
00439 if( nMatch("MICR",chCard) )
00440 {
00441
00442 ConBreak = 0.0912/ConBreak;
00443 }
00444
00445 if( ConBreak < 0. )
00446 {
00447
00448 ConBreak = pow(10.,ConBreak);
00449 }
00450
00451 else if( ConBreak == 0. )
00452 {
00453 fprintf( ioQQQ, " An energy of 0 is not allowed.\n Sorry.\n" );
00454 puts( "[Stop in ParseTable]" );
00455 cdEXIT(EXIT_FAILURE);
00456 }
00457
00458 if( ConBreak >= rfield.tNuRyd[rfield.nspec][2] )
00459 {
00460 fprintf( ioQQQ, " The energy of the break cannot be greater than%10.2e Ryd.\n Sorry.\n",
00461 rfield.tNuRyd[rfield.nspec][2] );
00462 puts( "[Stop in ParseTable]" );
00463 cdEXIT(EXIT_FAILURE);
00464 }
00465
00466 else if( ConBreak <= rfield.tNuRyd[rfield.nspec][0] )
00467 {
00468 fprintf( ioQQQ, " The energy of the break cannot be less than%10.2e Ryd.\n Sorry.\n",
00469 rfield.tNuRyd[rfield.nspec][0] );
00470 puts( "[Stop in ParseTable]" );
00471 cdEXIT(EXIT_FAILURE);
00472 }
00473
00474 rfield.tNuRyd[rfield.nspec][1] = (float)ConBreak;
00475
00476 rfield.tslop[rfield.nspec][1] =
00477 (float)(rfield.tslop[rfield.nspec][2] +
00478 log10(rfield.tNuRyd[rfield.nspec][2]/rfield.tNuRyd[rfield.nspec][1]));
00479
00480 rfield.tslop[rfield.nspec][0] =
00481 (float)(rfield.tslop[rfield.nspec][1] -
00482 2.5*log10(rfield.tNuRyd[rfield.nspec][1]/rfield.tNuRyd[rfield.nspec][0]));
00483 }
00484 }
00485
00486 else if( nMatch("AKN1",chCard) )
00487 {
00488
00489 ASSERT( NKN120 < NCELL );
00490 for( i=0; i < NKN120; i++ )
00491 {
00492 rfield.tNuRyd[rfield.nspec][i] = (float)tnuakn[i];
00493 rfield.tslop[rfield.nspec][i] = (float)log10(fnuakn[i]);
00494 }
00495 ncont = NKN120 - 1;
00496 }
00497
00498 else if( nMatch("CRAB",chCard) )
00499 {
00500 ASSERT( NCRAB < NCELL );
00501
00502 for( i=0; i < NCRAB; i++ )
00503 {
00504 rfield.tNuRyd[rfield.nspec][i] = (float)tnucrb[i];
00505 rfield.tslop[rfield.nspec][i] = (float)log10(fnucrb[i]);
00506 }
00507 ncont = NCRAB - 1;
00508 }
00509
00510 else if( nMatch("COOL",chCard) )
00511 {
00512 ASSERT( NCFL < NCELL );
00513
00514 for( i=0; i < NCFL; i++ )
00515 {
00516 rfield.tNuRyd[rfield.nspec][i] = (float)cfle[i];
00517 rfield.tslop[rfield.nspec][i] = (float)cflf[i];
00518 }
00519 ncont = NCFL - 1;
00520 }
00521
00522 else if( (i=nMatch("HM96",chCard))>0 )
00523 {
00524
00525
00526
00527
00528 strcpy( rfield.chSpType[rfield.nspec], "INTER" );
00529
00530 ASSERT( NHM96 < NCELL );
00531
00532
00533 for( j=0; j < NHM96; j++ )
00534 {
00535
00536 rfield.tNuRyd[rfield.nspec][j] = (float)pow( 10. , tnuHM96[j] );
00537 rfield.tslop[rfield.nspec][j] = (float)fnuHM96[j];
00538 }
00539
00540 ncont = NHM96 - 1;
00541
00542
00543
00544
00545 i += 4;
00546 scale = FFmtRead(chCard,&i,INPUT_LINE_LENGTH,&lgEOL);
00547 if( scale > 0. )
00548 scale = log10(scale);
00549
00550
00551 if( *nqh >= LIMSPC )
00552 {
00553 fprintf( ioQQQ, " %ld is too many continua entered. Increase LIMSPC\n Sorry.\n",
00554 *nqh );
00555 puts( "[Stop in ParseTable]" );
00556 cdEXIT(EXIT_FAILURE);
00557 }
00558
00559
00560
00561
00562 if( rfield.nspec != *nqh )
00563 {
00564 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" );
00565 fprintf( ioQQQ, " Sorry.\n" );
00566 puts( "[Stop in ParseTable]" );
00567 cdEXIT(EXIT_FAILURE);
00568 }
00569
00570 strcpy( rfield.chRSpec[*nqh], "SQCM" );
00571 strcpy( rfield.chSpNorm[*nqh], "FLUX" );
00572
00573
00574
00575
00576 rfield.range[*nqh][0] = pow(10. , tnuHM96[2] )*1.0001;
00577
00578
00579 rfield.totpow[*nqh] = (fnuHM96[2] + log10(PI4) + scale);
00580
00581
00582
00583 if( !radius.lgRadiusKnown )
00584 {
00585 *ar1 = (float)radius.rdfalt;
00586 radius.Radius = pow(10.,radius.rdfalt);
00587 }
00588 ++*nqh;
00589
00590
00591
00592 if( !radius.lgRadiusKnown )
00593 {
00594 *ar1 = (float)radius.rdfalt;
00595 radius.Radius = pow(10.,radius.rdfalt);
00596 }
00597 }
00598
00599 else if( nMatch("HM05",chCard) )
00600 {
00601 double *tnuHM , *fnuHM;
00602 double redshift;
00603 long int nhm;
00604
00605
00606
00607
00608
00609 strcpy( rfield.chSpType[rfield.nspec], "INTER" );
00610 if( nMatch("QUAS",chCard) )
00611 {
00612
00613 strcpy( chFile , "haardt_madau_quasar.dat" );
00614 }
00615 else
00616 {
00617
00618 strcpy( chFile , "haardt_madau_galaxy.dat" );
00619 }
00620
00621
00622
00623 i = 4;
00624
00625 k = (long)FFmtRead(chCard,&i,INPUT_LINE_LENGTH,&lgEOL);
00626 if( lgEOL || k!=5 )
00627 TotalInsanity();
00628 redshift = FFmtRead(chCard,&i,INPUT_LINE_LENGTH,&lgEOL);
00629 if( lgEOL )
00630 {
00631 fprintf(ioQQQ," The redshift MUST be specified on the table HM05 command. I did not find one.\n Sorry.\n");
00632 puts( "[Stop in ParseTable]" );
00633 cdEXIT(EXIT_FAILURE);
00634 }
00635
00636
00637
00638 read_hm05( chFile , &tnuHM , &fnuHM , &nhm , redshift );
00639
00640 ipNORM = -1;
00641 for( j=0; j < nhm-1; j++ )
00642 {
00643
00644
00645 if( tnuHM[j]<=1. && 1. <= tnuHM[j+1] )
00646 {
00647 ipNORM = j;
00648 break;
00649 }
00650 }
00651 ASSERT( ipNORM>=0 );
00652
00653
00654
00655
00656 scale = FFmtRead(chCard,&i,INPUT_LINE_LENGTH,&lgEOL);
00657 if( scale > 0. )
00658 scale = log10(scale);
00659
00660
00661
00662 rfield.range[*nqh][0] = tnuHM[ipNORM];
00663
00664
00665 rfield.totpow[*nqh] = log10(fnuHM[ipNORM]) + log10(PI4) + scale;
00666
00667 ncont = nhm - 1;
00668
00669
00670 if( *nqh >= LIMSPC )
00671 {
00672 fprintf( ioQQQ, " %ld is too many continua entered. Increase LIMSPC\n Sorry.\n",
00673 *nqh );
00674 puts( "[Stop in ParseTable]" );
00675 cdEXIT(EXIT_FAILURE);
00676 }
00677
00678
00679
00680
00681 if( rfield.nspec != *nqh )
00682 {
00683 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" );
00684 fprintf( ioQQQ, " Sorry.\n" );
00685 puts( "[Stop in ParseTable]" );
00686 cdEXIT(EXIT_FAILURE);
00687 }
00688
00689 strcpy( rfield.chRSpec[*nqh], "SQCM" );
00690 strcpy( rfield.chSpNorm[*nqh], "FLUX" );
00691
00692
00693
00694 scale = SDIV( fnuHM[ipNORM] );
00695 for( j=0; j < nhm; j++ )
00696 {
00697
00698 rfield.tNuRyd[rfield.nspec][j] = (float)tnuHM[j];
00699 rfield.tslop[rfield.nspec][j] = (float)log10(fnuHM[j]/scale);
00700
00701
00702
00703 }
00704 for( j=0; j < nhm-1; j++ )
00705 {
00706 ASSERT( rfield.tNuRyd[rfield.nspec][j] < rfield.tNuRyd[rfield.nspec][j+1] );
00707 }
00708
00709
00710
00711 if( !radius.lgRadiusKnown )
00712 {
00713 *ar1 = (float)radius.rdfalt;
00714 radius.Radius = pow(10.,radius.rdfalt);
00715 }
00716 ++*nqh;
00717
00718
00719
00720 if( !radius.lgRadiusKnown )
00721 {
00722 *ar1 = (float)radius.rdfalt;
00723 radius.Radius = pow(10.,radius.rdfalt);
00724 }
00725 free( tnuHM );
00726 free( fnuHM );
00727
00728 }
00729 else if( nMatch(" ISM",chCard) )
00730 {
00731 ASSERT( NISM < NCELL );
00732
00733
00734
00735 rfield.tNuRyd[rfield.nspec][0] = 6.;
00736 rfield.tslop[rfield.nspec][0] = -21.21f - 6.f;
00737 for( i=6; i < NISM; i++ )
00738 {
00739 rfield.tNuRyd[rfield.nspec][i-5] = (float)tnuism[i];
00740 rfield.tslop[rfield.nspec][i-5] = (float)(fnuism[i] -
00741 tnuism[i]);
00742 }
00743
00744 ncont = NISM - 1 -5;
00745 i = 5;
00746
00747
00748
00749
00750
00751 scale = FFmtRead(chCard,&i,INPUT_LINE_LENGTH,&lgEOL);
00752 if( scale > 0. && !nMatch(" LOG",chCard) )
00753 scale = log10(scale);
00754
00755
00756 if( *nqh >= LIMSPC )
00757 {
00758 fprintf( ioQQQ, " %4ld is too many continua entered. Increase LIMSPC\n Sorry.\n",
00759 *nqh );
00760 puts( "[Stop in ParseTable]" );
00761 cdEXIT(EXIT_FAILURE);
00762 }
00763
00764
00765
00766
00767 if( rfield.nspec != *nqh )
00768 {
00769 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" );
00770 fprintf( ioQQQ, " Sorry.\n" );
00771 puts( "[Stop in ParseTable]" );
00772 cdEXIT(EXIT_FAILURE);
00773 }
00774
00775 strcpy( rfield.chRSpec[*nqh], "SQCM" );
00776 strcpy( rfield.chSpNorm[*nqh], "FLUX" );
00777
00778
00779
00780
00781 rfield.range[*nqh][0] = HIONPOT;
00782
00783
00784 rfield.totpow[*nqh] = (-18.517 + scale);
00785
00786
00787
00788 if( !radius.lgRadiusKnown )
00789 {
00790 *ar1 = (float)radius.rdfalt;
00791 radius.Radius = pow(10.,radius.rdfalt);
00792 }
00793 ++*nqh;
00794
00795 if( optimize.lgVarOn )
00796 {
00797 optimize.nvarxt[optimize.nparm] = 1;
00798 strcpy( optimize.chVarFmt[optimize.nparm], "TABLE ISM LOG %f");
00799
00800 optimize.nvfpnt[optimize.nparm] = input.nRead;
00801
00802 optimize.vparm[0][optimize.nparm] = (float)scale;
00803 optimize.vincr[optimize.nparm] = 0.2f;
00804 ++optimize.nparm;
00805 }
00806 }
00807 else if( nMatch("DRAI",chCard) )
00808 {
00809 ASSERT( NDRAINE < NCELL );
00810
00811 for( i=0; i < NDRAINE; i++ )
00812 {
00813 rfield.tNuRyd[rfield.nspec][i] = (float)tnudrn[i];
00814 rfield.tslop[rfield.nspec][i] = (float)tsldrn[i];
00815 }
00816
00817 ncont = NDRAINE - 1;
00818 i = 5;
00819
00820
00821
00822
00823 scale = FFmtRead(chCard,&i,INPUT_LINE_LENGTH,&lgEOL);
00824 if( scale > 0. && !nMatch(" LOG",chCard) )
00825 scale = log10(scale);
00826
00827
00828 if( *nqh >= LIMSPC )
00829 {
00830 fprintf( ioQQQ, " %4ld is too many continua entered. Increase LIMSPC\n Sorry.\n",
00831 *nqh );
00832 puts( "[Stop in ParseTable]" );
00833 cdEXIT(EXIT_FAILURE);
00834 }
00835
00836
00837
00838
00839 if( rfield.nspec != *nqh )
00840 {
00841 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" );
00842 fprintf( ioQQQ, " Sorry.\n" );
00843 puts( "[Stop in ParseTable]" );
00844 cdEXIT(EXIT_FAILURE);
00845 }
00846
00847 strcpy( rfield.chRSpec[*nqh], "SQCM" );
00848 strcpy( rfield.chSpNorm[*nqh], "FLUX" );
00849
00850
00851
00852
00853 rfield.range[*nqh][0] = tnudrn[0]*1.01;
00854
00855
00856 rfield.totpow[*nqh] = tsldrn[0] + scale;
00857
00858 if( optimize.lgVarOn )
00859 {
00860 optimize.nvarxt[optimize.nparm] = 1;
00861 strcpy( optimize.chVarFmt[optimize.nparm], "TABLE DRAINE LOG %f");
00862
00863 optimize.nvfpnt[optimize.nparm] = input.nRead;
00864
00865 optimize.vparm[0][optimize.nparm] = (float)scale;
00866 optimize.vincr[optimize.nparm] = 0.2f;
00867 ++optimize.nparm;
00868 }
00869
00870
00871
00872 if( !radius.lgRadiusKnown )
00873 {
00874 *ar1 = (float)radius.rdfalt;
00875 radius.Radius = pow(10.,radius.rdfalt);
00876 }
00877 ++*nqh;
00878 }
00879
00880 else if( nMatch("LINE",chCard) )
00881 {
00882
00883
00884 static bool lgLines_Malloc = false;
00885
00886
00887 lgNoContinuum = true;
00888
00889
00890 if( lgLines_Malloc )
00891 {
00892 fprintf(ioQQQ," sorry, only one table line per input stream\n");
00893 cdEXIT(EXIT_FAILURE);
00894 }
00895
00896
00897
00898 if( lgQuoteFound )
00899 strcpy( chLINE_LIST , chFile );
00900 else
00901 strcpy( chLINE_LIST , "LineList_BLR.dat" );
00902
00903 lgLines_Malloc = true;
00904
00905
00906 ncont = -10;
00907
00908
00909 nLINE_TABLE = cdGetLineList( chLINE_LIST , &chLabel , &wl);
00910 }
00911
00912 else if( nMatch("POWE",chCard) )
00913 {
00914
00915
00916 i = 5;
00917 alpha = FFmtRead(chCard,&i,INPUT_LINE_LENGTH,&lgEOL);
00918
00919
00920 if( lgEOL )
00921 alpha = -1.;
00922
00923
00924 rfield.tNuRyd[rfield.nspec][0] =(float) rfield.emm;
00925
00926 rfield.tslop[rfield.nspec][0] = -5.f;
00927
00928 lgLogSet = false;
00929
00930
00931 brakmm = FFmtRead(chCard,&i,INPUT_LINE_LENGTH,&lgEOL);
00932
00933
00934 if( lgEOL )
00935 {
00936 lgLogSet = true;
00937 brakmm = 9.115e-3;
00938 }
00939
00940 else if( brakmm == 0. )
00941 {
00942
00943
00944
00945 lgLogSet = false;
00946 brakmm = rfield.tNuRyd[rfield.nspec][0]*1.001;
00947 }
00948
00949 else if( brakmm < 0. )
00950 {
00951
00952 lgLogSet = true;
00953 brakmm = pow(10.,brakmm);
00954 }
00955
00956
00957 if( nMatch("MICR",chCard) )
00958 brakmm = RYDLAM / (1e4*brakmm);
00959
00960 rfield.tNuRyd[rfield.nspec][1] = (float)brakmm;
00961
00962
00963 if( brakmm > 1. )
00964 fprintf(ioQQQ,
00965 " Check the order of parameters on this table power law command - the low-energy break of %f Ryd seems high to me.\n",
00966 brakmm );
00967
00968
00969
00970
00971
00972
00973 slopir = 5./2.;
00974
00975
00976
00977 rfield.tslop[rfield.nspec][1] =
00978 (float)(rfield.tslop[rfield.nspec][0] +
00979 slopir*log10(rfield.tNuRyd[rfield.nspec][1]/rfield.tNuRyd[rfield.nspec][0]));
00980
00981
00982 rfield.tNuRyd[rfield.nspec][3] = (float)rfield.egamry;
00983
00984
00985 brakxr = FFmtRead(chCard,&i,INPUT_LINE_LENGTH,&lgEOL);
00986
00987
00988 if( lgEOL )
00989 {
00990 brakxr = 3676.;
00991 }
00992
00993 else if( brakxr == 0. )
00994 {
00995 brakxr = rfield.tNuRyd[rfield.nspec][3]/1.001;
00996 }
00997
00998 else if( lgLogSet )
00999 {
01000
01001 brakxr = pow(10.,brakxr);
01002 }
01003
01004
01005 rfield.tNuRyd[rfield.nspec][2] = (float)brakxr;
01006
01007
01008
01009 if( brakmm >= brakxr )
01010 {
01011 fprintf( ioQQQ, " HELP!! The lower energy for the power law, %f, is greater than the upper energy, %f. This is not possible.\n Sorry.\n",
01012 brakmm , brakxr );
01013 puts( "[Stop in ParseTable]" );
01014 cdEXIT(EXIT_FAILURE);
01015 }
01016
01017
01018 rfield.tslop[rfield.nspec][2] =
01019 (float)(rfield.tslop[rfield.nspec][1] +
01020 alpha*log10(rfield.tNuRyd[rfield.nspec][2]/rfield.tNuRyd[rfield.nspec][1]));
01021
01022
01023 slopxr = -2.;
01024
01025 rfield.tslop[rfield.nspec][3] =
01026 (float)(rfield.tslop[rfield.nspec][2] +
01027 slopxr*log10(rfield.tNuRyd[rfield.nspec][3]/rfield.tNuRyd[rfield.nspec][2]));
01028
01029
01030 ncont = 3;
01031 }
01032
01033 else if( nMatch("READ",chCard) )
01034 {
01035
01036 if( rfield.lgTableRead )
01037 {
01038 fprintf(ioQQQ," Oops, there are more than one TABLE READ command in this input stream. I can only deal with a single TABLE READ.\n Sorry.\n");
01039 puts( "[Stop in ParseTable]" );
01040 cdEXIT(EXIT_FAILURE);
01041 }
01042 rfield.lgTableRead = true;
01043
01044
01045
01046
01047 if( !lgQuoteFound )
01048 {
01049 fprintf( ioQQQ, " Name of file must appear on TABLE READ.\n");
01050 puts( "[Stop in ParseTable]" );
01051 cdEXIT(EXIT_FAILURE);
01052 }
01053
01054
01055 if( NULL==(rfield.ioTableRead[rfield.nspec]=fopen( chFile,"r")))
01056 {
01057 fprintf( ioQQQ, " I could not open file %s.\n",chFile );
01058 puts( "[Stop in ParseTable]" );
01059 cdEXIT(EXIT_FAILURE);
01060 }
01061
01062
01063 strcpy( rfield.chSpType[rfield.nspec], "READ " );
01064
01065
01066 rfield.tslop[rfield.nspec][0] = 0.;
01067 rfield.tslop[rfield.nspec][1] = 0.;
01068
01069
01070
01071
01072
01073 ++rfield.nspec;
01074
01075 DEBUG_EXIT( "ParseTable()" );
01076 return;
01077
01078 }
01079
01080 else if( nMatch("TLUSTY",chCard) && !nMatch("STAR",chCard) )
01081 {
01082
01083 fprintf( ioQQQ, " The TABLE TLUSTY command is no longer supported.\n" );
01084 fprintf( ioQQQ, " Please use TABLE STAR TLUSTY instead. See Hazy for details.\n" );
01085 puts( "[Stop in ParseTable]" );
01086 cdEXIT(EXIT_FAILURE);
01087 }
01088
01089 else if( nMatch("RUBI",chCard) )
01090 {
01091
01092 for( i=0; i < NRUBIN; i++ )
01093 {
01094 rfield.tNuRyd[rfield.nspec][i] = (float)tnurbn[i];
01095 rfield.tslop[rfield.nspec][i] = (float)log10(fnurbn[i] /tnurbn[i] );
01096 }
01097 ncont = NRUBIN - 1;
01098 }
01099
01100
01101
01102 else if( nMatch("STAR",chCard) )
01103 {
01104 char *ptr, chMetalicity[5] = "", chODFNew[8], chVaryFlag[6] = "";
01105 bool lgPG1159 = false, lgHCa = false, lgHNi = false, lgSolar, lgHalo, lgList;
01106 long nval, ndim=0;
01107 double Tlow = -1., Thigh = -1.;
01108 double val[MDIM];
01109
01110
01111 if( (ptr = strstr(chCard,"1-DI")) != NULL )
01112 ndim = 1;
01113 else if( (ptr = strstr(chCard,"2-DI")) != NULL )
01114 ndim = 2;
01115 else if( (ptr = strstr(chCard,"3-DI")) != NULL )
01116 ndim = 3;
01117 else if( (ptr = strstr(chCard,"4-DI")) != NULL )
01118 ndim = 4;
01119
01120 if( ptr != NULL )
01121 {
01122
01123 strncpy(chVaryFlag,ptr,5);
01124 chVaryFlag[5] = '\0';
01125
01126 strncpy(ptr," ",5);
01127 }
01128
01129
01130 if( (ptr = strstr(chCard,"Z+1.0")) != NULL )
01131 strncpy( chMetalicity, "p10", sizeof(chMetalicity) );
01132 else if( (ptr = strstr(chCard,"Z+0.75")) != NULL )
01133 strncpy( chMetalicity, "p075", sizeof(chMetalicity) );
01134 else if( (ptr = strstr(chCard,"Z+0.5")) != NULL )
01135 strncpy( chMetalicity, "p05", sizeof(chMetalicity) );
01136 else if( (ptr = strstr(chCard,"Z+0.4")) != NULL )
01137 strncpy( chMetalicity, "p04", sizeof(chMetalicity) );
01138 else if( (ptr = strstr(chCard,"Z+0.3")) != NULL )
01139 strncpy( chMetalicity, "p03", sizeof(chMetalicity) );
01140 else if( (ptr = strstr(chCard,"Z+0.25")) != NULL )
01141 strncpy( chMetalicity, "p025", sizeof(chMetalicity) );
01142 else if( (ptr = strstr(chCard,"Z+0.2")) != NULL )
01143 strncpy( chMetalicity, "p02", sizeof(chMetalicity) );
01144 else if( (ptr = strstr(chCard,"Z+0.1")) != NULL )
01145 strncpy( chMetalicity, "p01", sizeof(chMetalicity) );
01146 else if( (ptr = strstr(chCard,"Z+0.0")) != NULL )
01147 strncpy( chMetalicity, "p00", sizeof(chMetalicity) );
01148 else if( (ptr = strstr(chCard,"Z-0.1")) != NULL )
01149 strncpy( chMetalicity, "m01", sizeof(chMetalicity) );
01150 else if( (ptr = strstr(chCard,"Z-0.2")) != NULL )
01151 strncpy( chMetalicity, "m02", sizeof(chMetalicity) );
01152 else if( (ptr = strstr(chCard,"Z-0.25")) != NULL )
01153 strncpy( chMetalicity, "m025", sizeof(chMetalicity) );
01154 else if( (ptr = strstr(chCard,"Z-0.3")) != NULL )
01155 strncpy( chMetalicity, "m03", sizeof(chMetalicity) );
01156 else if( (ptr = strstr(chCard,"Z-0.4")) != NULL )
01157 strncpy( chMetalicity, "m04", sizeof(chMetalicity) );
01158 else if( (ptr = strstr(chCard,"Z-0.5")) != NULL )
01159 strncpy( chMetalicity, "m05", sizeof(chMetalicity) );
01160 else if( (ptr = strstr(chCard,"Z-0.7")) != NULL )
01161 strncpy( chMetalicity, "m07", sizeof(chMetalicity) );
01162 else if( (ptr = strstr(chCard,"Z-0.75")) != NULL )
01163 strncpy( chMetalicity, "m075", sizeof(chMetalicity) );
01164 else if( (ptr = strstr(chCard,"Z-1.0")) != NULL )
01165 strncpy( chMetalicity, "m10", sizeof(chMetalicity) );
01166 else if( (ptr = strstr(chCard,"Z-1.3")) != NULL )
01167 strncpy( chMetalicity, "m13", sizeof(chMetalicity) );
01168 else if( (ptr = strstr(chCard,"Z-1.5")) != NULL )
01169 strncpy( chMetalicity, "m15", sizeof(chMetalicity) );
01170 else if( (ptr = strstr(chCard,"Z-1.7")) != NULL )
01171 strncpy( chMetalicity, "m17", sizeof(chMetalicity) );
01172 else if( (ptr = strstr(chCard,"Z-2.0")) != NULL )
01173 strncpy( chMetalicity, "m20", sizeof(chMetalicity) );
01174 else if( (ptr = strstr(chCard,"Z-2.5")) != NULL )
01175 strncpy( chMetalicity, "m25", sizeof(chMetalicity) );
01176 else if( (ptr = strstr(chCard,"Z-3.0")) != NULL )
01177 strncpy( chMetalicity, "m30", sizeof(chMetalicity) );
01178 else if( (ptr = strstr(chCard,"Z-3.5")) != NULL )
01179 strncpy( chMetalicity, "m35", sizeof(chMetalicity) );
01180 else if( (ptr = strstr(chCard,"Z-4.0")) != NULL )
01181 strncpy( chMetalicity, "m40", sizeof(chMetalicity) );
01182 else if( (ptr = strstr(chCard,"Z-4.5")) != NULL )
01183 strncpy( chMetalicity, "m45", sizeof(chMetalicity) );
01184 else if( (ptr = strstr(chCard,"Z-5.0")) != NULL )
01185 strncpy( chMetalicity, "m50", sizeof(chMetalicity) );
01186 else if( (ptr = strstr(chCard,"Z-INF")) != NULL )
01187 strncpy( chMetalicity, "m99", sizeof(chMetalicity) );
01188 else
01189 strncpy( chMetalicity, "p00", sizeof(chMetalicity) );
01190
01191 if( ptr != NULL )
01192 {
01193
01194 strncpy(chVaryFlag,ptr,5);
01195 chVaryFlag[5] = '\0';
01196
01197 strncpy(ptr," ",5);
01198 }
01199
01200
01201
01202 if( nMatch("HALO",chCard) )
01203 lgHalo = true;
01204 else
01205 lgHalo = false;
01206 lgSolar = ( !lgHalo && strcmp( chMetalicity, "p00" ) == 0 );
01207
01208
01209 if( (ptr = strstr(chCard,"PG1159")) != NULL )
01210 {
01211 lgPG1159 = true;
01212
01213 strncpy(ptr," ",6);
01214 }
01215
01216 if( nMatch("LIST",chCard) )
01217 lgList = true;
01218 else
01219 lgList = false;
01220
01221 if( nMatch("AVAI",chCard) )
01222 {
01223 AtmospheresAvail();
01224 cdEXIT(EXIT_SUCCESS);
01225 }
01226
01227
01228 i = 5;
01229 for( nval=0; nval < MDIM; nval++ )
01230 {
01231 val[nval] = FFmtRead(chCard,&i,INPUT_LINE_LENGTH,&lgEOL);
01232 if( lgEOL )
01233 break;
01234 }
01235
01236 if( nval == 0 && !lgList )
01237 {
01238 fprintf( ioQQQ, " The stellar temperature MUST be entered.\n" );
01239 puts( "[Stop in ParseTable]" );
01240 cdEXIT(EXIT_FAILURE);
01241 }
01242
01243
01244
01245
01246
01247
01248
01249 if( ( val[0] <= 10. && !nMatch("LINE",chCard) ) || nMatch("LOG ",chCard) )
01250 val[0] = pow(10.,val[0]);
01251
01252 if( lgQuoteFound )
01253 {
01254 nstar = GridInterpolate(val,&nval,&ndim,chFile,lgList,&Tlow,&Thigh);
01255 }
01256
01257 else if( nMatch("ATLA",chCard) )
01258 {
01259
01260
01261
01262
01263 if( nMatch("ODFN",chCard) )
01264 strncpy( chODFNew, "_odfnew", sizeof(chODFNew) );
01265 else
01266 strncpy( chODFNew, "", sizeof(chODFNew) );
01267
01268
01269 nstar = AtlasInterpolate(val,&nval,&ndim,chMetalicity,chODFNew,lgList,&Tlow,&Thigh);
01270 }
01271
01272 else if( nMatch("COST",chCard) )
01273 {
01274
01275
01276
01277
01278 if( nMatch("INDE",chCard) )
01279 {
01280 imode = IM_COSTAR_TEFF_MODID;
01281 if( nval == 1 )
01282 {
01283 val[1] = 1.;
01284 nval++;
01285 }
01286
01287
01288
01289 if( val[1] < 1. || val[1] > 7. )
01290 {
01291 fprintf( ioQQQ, " The second number must be the id sequence number, 1 to 7.\n" );
01292 fprintf( ioQQQ, " reset to 1.\n" );
01293 val[1] = 1.;
01294 }
01295 }
01296 else if( nMatch("ZAMS",chCard) )
01297 {
01298 imode = IM_COSTAR_MZAMS_AGE;
01299 if( nval == 1 )
01300 {
01301 fprintf( ioQQQ, " A second number, the age of the star, must be present.\n" );
01302 puts( "[Stop in ParseTable]" );
01303 cdEXIT(EXIT_FAILURE);
01304 }
01305 }
01306 else if( nMatch(" AGE",chCard) )
01307 {
01308 imode = IM_COSTAR_AGE_MZAMS;
01309 if( nval == 1 )
01310 {
01311 fprintf( ioQQQ, " A second number, the ZAMS mass of the star, must be present.\n" );
01312 puts( "[Stop in ParseTable]" );
01313 cdEXIT(EXIT_FAILURE);
01314 }
01315 }
01316 else
01317 {
01318 if( nval == 1 )
01319 {
01320 imode = IM_COSTAR_TEFF_MODID;
01321
01322 val[1] = 1.;
01323 nval++;
01324 }
01325 else
01326 {
01327
01328
01329
01330 imode = IM_COSTAR_TEFF_LOGG;
01331 }
01332 }
01333
01334 if( ! ( lgSolar || lgHalo ) )
01335 {
01336 fprintf( ioQQQ, " Please choose SOLAR or HALO abundances.\n" );
01337 puts( "[Stop in ParseTable]" );
01338 cdEXIT(EXIT_FAILURE);
01339 }
01340
01341 nstar = CoStarInterpolate(val,&nval,&ndim,imode,lgHalo,lgList,&Tlow,&Thigh);
01342 }
01343
01344 else if( nMatch("KURU",chCard) )
01345 {
01346 nstar = Kurucz79Interpolate(val,&nval,&ndim,lgList,&Tlow,&Thigh);
01347 }
01348
01349 else if( nMatch("MIHA",chCard) )
01350 {
01351 nstar = MihalasInterpolate(val,&nval,&ndim,lgList,&Tlow,&Thigh);
01352 }
01353
01354 else if( nMatch("RAUC",chCard) )
01355 {
01356 if( ! ( lgSolar || lgHalo ) )
01357 {
01358 fprintf( ioQQQ, " Please choose SOLAR or HALO abundances.\n" );
01359 puts( "[Stop in ParseTable]" );
01360 cdEXIT(EXIT_FAILURE);
01361 }
01362
01363
01364
01365
01366 if( nMatch("H-CA",chCard) || nMatch(" OLD",chCard) )
01367 {
01368 lgHCa = true;
01369 nstar = RauchInterpolateHCa(val,&nval,&ndim,lgHalo,lgList,&Tlow,&Thigh);
01370 }
01371 else if( nMatch("HYDR",chCard) )
01372 {
01373 nstar = RauchInterpolateHydr(val,&nval,&ndim,lgList,&Tlow,&Thigh);
01374 }
01375 else if( nMatch("HELI",chCard) )
01376 {
01377 nstar = RauchInterpolateHelium(val,&nval,&ndim,lgList,&Tlow,&Thigh);
01378 }
01379 else if( nMatch("H+HE",chCard) )
01380 {
01381 nstar = RauchInterpolateHpHe(val,&nval,&ndim,lgList,&Tlow,&Thigh);
01382 }
01383 else if( lgPG1159 )
01384 {
01385 nstar = RauchInterpolatePG1159(val,&nval,&ndim,lgList,&Tlow,&Thigh);
01386 }
01387 else
01388 {
01389 lgHNi = true;
01390 nstar = RauchInterpolateHNi(val,&nval,&ndim,lgHalo,lgList,&Tlow,&Thigh);
01391 }
01392 }
01393
01394 else if( nMatch("TLUS",chCard) )
01395 {
01396 if( nMatch("BSTA",chCard) )
01397 {
01398
01399
01400 nstar = TlustyInterpolate(val,&nval,&ndim,TL_BSTAR,chMetalicity,lgList,&Tlow,&Thigh);
01401 }
01402 else if( nMatch("OSTA",chCard) )
01403 {
01404
01405
01406 nstar = TlustyInterpolate(val,&nval,&ndim,TL_OSTAR,chMetalicity,lgList,&Tlow,&Thigh);
01407 }
01408 else
01409 {
01410 fprintf( ioQQQ, " There must be a third key on TABLE STAR TLUSTY;" );
01411 fprintf( ioQQQ, " the options are BSTAR, OSTAR.\n" );
01412 puts( "[Stop in ParseTable]" );
01413 cdEXIT(EXIT_FAILURE);
01414 }
01415 }
01416
01417 else if( nMatch("WERN",chCard) )
01418 {
01419
01420
01421 nstar = WernerInterpolate(val,&nval,&ndim,lgList,&Tlow,&Thigh);
01422 }
01423
01424 else if( nMatch("WMBA",chCard) )
01425 {
01426
01427
01428 nstar = WMBASICInterpolate(val,&nval,&ndim,lgList,&Tlow,&Thigh);
01429 }
01430
01431 else
01432 {
01433 fprintf( ioQQQ, " There must be a second key on TABLE STAR;" );
01434 fprintf( ioQQQ, " the options are ATLAS, KURUCZ, MIHALAS, RAUCH, WERNER, and WMBASIC.\n" );
01435 puts( "[Stop in ParseTable]" );
01436 cdEXIT(EXIT_FAILURE);
01437 }
01438
01439
01440 strcpy( rfield.chSpType[rfield.nspec], "VOLK " );
01441
01442 ncont = nstar - 1;
01443
01444
01445 if( optimize.lgVarOn )
01446 {
01447 optimize.vincr[optimize.nparm] = (float)0.1;
01448
01449 if( lgQuoteFound )
01450 {
01451
01452 optimize.nvarxt[optimize.nparm] = nval;
01453 sprintf( optimize.chVarFmt[optimize.nparm], "TABLE STAR \"%s\"", chFile );
01454 strcat( optimize.chVarFmt[optimize.nparm], " %f LOG" );
01455 for( i=1; i < nval; i++ )
01456 strcat( optimize.chVarFmt[optimize.nparm], ", %f" );
01457 }
01458
01459 if( nMatch("ATLA",chCard) )
01460 {
01461
01462 optimize.nvarxt[optimize.nparm] = ndim;
01463 strcpy( optimize.chVarFmt[optimize.nparm], "TABLE STAR ATLAS " );
01464 strcat( optimize.chVarFmt[optimize.nparm], chVaryFlag );
01465 if( nMatch("ODFN",chCard) )
01466 strcat( optimize.chVarFmt[optimize.nparm], " ODFNEW" );
01467
01468 strcat( optimize.chVarFmt[optimize.nparm], " %f LOG, LOG(G)= %f" );
01469
01470 if( ndim == 3 )
01471 strcat( optimize.chVarFmt[optimize.nparm], ", LOG(Z)= %f" );
01472
01473 }
01474
01475 else if( nMatch("COST",chCard) )
01476 {
01477
01478 optimize.nvarxt[optimize.nparm] = 2;
01479
01480 strcpy( optimize.chVarFmt[optimize.nparm], "TABLE STAR COSTAR " );
01481 if( lgHalo )
01482 strcat( optimize.chVarFmt[optimize.nparm], "HALO " );
01483
01484 if( imode == IM_COSTAR_TEFF_MODID )
01485 {
01486 strcat( optimize.chVarFmt[optimize.nparm], "TEFF= %f LOG, INDEX= %f" );
01487 }
01488 else if( imode == IM_COSTAR_TEFF_LOGG )
01489 {
01490 strcat( optimize.chVarFmt[optimize.nparm], "TEFF= %f LOG, LOG(G)= %f" );
01491 }
01492 else if( imode == IM_COSTAR_MZAMS_AGE )
01493 {
01494
01495 strcat( optimize.chVarFmt[optimize.nparm], "ZAMS MASS= %f LOG, TIME= %f" );
01496 }
01497 else if( imode == IM_COSTAR_AGE_MZAMS )
01498 {
01499
01500 strcat( optimize.chVarFmt[optimize.nparm], "AGE= %f LOG, MASS= %f" );
01501 optimize.vincr[optimize.nparm] = (float)0.5;
01502 }
01503 }
01504
01505 else if( nMatch("KURU",chCard) )
01506 {
01507
01508 optimize.nvarxt[optimize.nparm] = 1;
01509 strcpy( optimize.chVarFmt[optimize.nparm],
01510 "TABLE STAR KURUCZ %f LOG" );
01511 }
01512
01513 else if( nMatch("MIHA",chCard) )
01514 {
01515
01516 optimize.nvarxt[optimize.nparm] = 1;
01517 strcpy( optimize.chVarFmt[optimize.nparm],
01518 "TABLE STAR MIHALAS %f LOG" );
01519 }
01520
01521 else if( nMatch("RAUC",chCard) )
01522 {
01523
01524 optimize.nvarxt[optimize.nparm] = ndim;
01525
01526 strcpy( optimize.chVarFmt[optimize.nparm], "TABLE STAR RAUCH " );
01527
01528 if( nMatch("HYDR",chCard) )
01529 strcat( optimize.chVarFmt[optimize.nparm], "HYDR " );
01530 else if( nMatch("HELI",chCard) )
01531 strcat( optimize.chVarFmt[optimize.nparm], "HELIUM " );
01532 else if( nMatch("H+HE",chCard) )
01533 strcat( optimize.chVarFmt[optimize.nparm], "H+HE " );
01534 else if( lgPG1159 )
01535 strcat( optimize.chVarFmt[optimize.nparm], "PG1159 " );
01536 else if( lgHCa )
01537 strcat( optimize.chVarFmt[optimize.nparm], "H-CA " );
01538
01539 if( ( lgHCa || lgHNi ) && ndim == 2 )
01540 {
01541 if( lgHalo )
01542 strcat( optimize.chVarFmt[optimize.nparm], "HALO " );
01543 else
01544 strcat( optimize.chVarFmt[optimize.nparm], "SOLAR " );
01545 }
01546
01547 strcat( optimize.chVarFmt[optimize.nparm], "%f LOG, LOG(G)= %f" );
01548
01549 if( ndim == 3 )
01550 {
01551 if( nMatch("H+HE",chCard) )
01552 strcat( optimize.chVarFmt[optimize.nparm], ", F(HE)= %f" );
01553 else
01554 strcat( optimize.chVarFmt[optimize.nparm], ", LOG(Z)= %f 3-DIM" );
01555 }
01556
01557 }
01558
01559 if( nMatch("TLUS",chCard) )
01560 {
01561
01562 optimize.nvarxt[optimize.nparm] = ndim;
01563 strcpy( optimize.chVarFmt[optimize.nparm], "TABLE STAR TLUSTY " );
01564 if( nMatch("BSTA",chCard) )
01565 strcat( optimize.chVarFmt[optimize.nparm], "BSTAR " );
01566 else if( nMatch("OSTA",chCard) )
01567 strcat( optimize.chVarFmt[optimize.nparm], "OSTAR " );
01568 else
01569 TotalInsanity();
01570 strcat( optimize.chVarFmt[optimize.nparm], chVaryFlag );
01571 strcat( optimize.chVarFmt[optimize.nparm], " %f LOG, LOG(G)= %f" );
01572
01573 if( ndim == 3 )
01574 strcat( optimize.chVarFmt[optimize.nparm], ", LOG(Z)= %f" );
01575 }
01576
01577 else if( nMatch("WERN",chCard) )
01578 {
01579
01580 optimize.nvarxt[optimize.nparm] = 2;
01581 strcpy( optimize.chVarFmt[optimize.nparm],
01582 "TABLE STAR WERNER %f LOG, LOG(G)= %f" );
01583 }
01584
01585 else if( nMatch("WMBA",chCard) )
01586 {
01587
01588 optimize.nvarxt[optimize.nparm] = 3;
01589 strcpy( optimize.chVarFmt[optimize.nparm],
01590 "TABLE STAR WMBASIC %f LOG, LOG(G)= %f, LOG(Z)= %f" );
01591 }
01592
01593
01594 optimize.nvfpnt[optimize.nparm] = input.nRead;
01595
01596 ASSERT( nval <= LIMEXT );
01597
01598
01599 optimize.vparm[0][optimize.nparm] = (float)log10(val[0]);
01600 for( i=1; i < nval; i++ )
01601 optimize.vparm[i][optimize.nparm] = (float)val[i];
01602
01603
01604 optimize.varang[optimize.nparm][0] = (float)log10(Tlow);
01605 optimize.varang[optimize.nparm][1] = (float)log10(Thigh);
01606
01607
01608 ++optimize.nparm;
01609 }
01610 }
01611
01612 else
01613 {
01614 fprintf( ioQQQ, " There MUST be a keyword on this line. The keys are: AGN, AKN120, CRAB, COOL, DRAINE, HM96, HM05, _ISM, LINE, POWERlaw, READ, RUBIN, and STAR. Sorry.\n" );
01615 puts( "[Stop in ParseTable]" );
01616 cdEXIT(EXIT_FAILURE);
01617 }
01618
01619
01620
01621
01622 if( strcmp(rfield.chSpType[rfield.nspec],"VOLK ") == 0 )
01623 {
01624 ++rfield.nspec;
01625 DEBUG_EXIT( "ParseTable()" );
01626 return;
01627 }
01628
01629
01630
01631 if( lgNoContinuum )
01632 {
01633 DEBUG_EXIT( "ParseTable()" );
01634 return;
01635 }
01636
01637
01638
01639 if( rfield.tNuRyd[rfield.nspec][0] >= 5. )
01640 {
01641 for( i=0; i < (ncont + 1); i++ )
01642 {
01643 rfield.tNuRyd[rfield.nspec][i] =
01644 (float)pow(10.,rfield.tNuRyd[rfield.nspec][i] - 15.51718);
01645 }
01646 }
01647
01648 else if( rfield.tNuRyd[rfield.nspec][0] < 0. )
01649 {
01650
01651 for( i=0; i < (ncont + 1); i++ )
01652 {
01653 rfield.tNuRyd[rfield.nspec][i] =
01654 (float)pow(10.,(double)rfield.tNuRyd[rfield.nspec][i]);
01655 }
01656 }
01657
01658
01659 for( i=0; i < (ncont + 1); i++ )
01660 {
01661 rfield.tFluxLog[rfield.nspec][i] = rfield.tslop[rfield.nspec][i];
01662 }
01663
01664 for( i=0; i < ncont; i++ )
01665 {
01666 rfield.tslop[rfield.nspec][i] =
01667 (float)((rfield.tslop[rfield.nspec][i+1] -
01668 rfield.tslop[rfield.nspec][i])/
01669 log10(rfield.tNuRyd[rfield.nspec][i+1]/
01670 rfield.tNuRyd[rfield.nspec][i]));
01671 }
01672
01673 if( ncont > 0 && (ncont + 2 < rfield.nupper) )
01674 {
01675
01676 for( i=ncont + 1; i < rfield.nupper; i++ )
01677 {
01678 rfield.tNuRyd[rfield.nspec][i] = 0.;
01679 }
01680 }
01681
01682 if( trace.lgConBug && trace.lgTrace )
01683 {
01684 fprintf( ioQQQ, " Table for this continuum; TNU, TFAC, TSLOP\n" );
01685 for( i=0; i < (ncont + 1); i++ )
01686 {
01687 fprintf( ioQQQ, "%12.4e %12.4e %12.4e\n", rfield.tNuRyd[rfield.nspec][i],
01688 rfield.tFluxLog[rfield.nspec][i], rfield.tslop[rfield.nspec][i] );
01689 }
01690 }
01691
01692
01693
01694
01695
01696 lgHit = false;
01697
01698 fac = -DBL_MAX;
01699
01700
01701 for( i=0; i < (ncont + 1) && !lgHit; i++ )
01702 {
01703 if( rfield.tNuRyd[rfield.nspec][i] > 1. )
01704 {
01705 fac = rfield.tFluxLog[rfield.nspec][i];
01706 lgHit = true;
01707 }
01708 }
01709
01710 if( ncont > 0 && lgHit )
01711 {
01712
01713 for( i=0; i < (ncont + 1); i++ )
01714 {
01715 rfield.tFluxLog[rfield.nspec][i] -= (float)fac;
01716 }
01717 }
01718
01719 if( ncont > 0 )
01720 ++rfield.nspec;
01721
01722 DEBUG_EXIT( "ParseTable()" );
01723 return;
01724 }
01725
01726
01727
01728
01729
01730
01731
01732
01733 static void resetBltin( double *tnu , double *fluxlog , bool lgLog )
01734 {
01735
01736
01737 const double RESETFACTOR = 0.98;
01738 double power;
01739
01740 ASSERT( rfield.emm > 0. );
01741
01742 if( lgLog )
01743 {
01744
01745
01746 power = (fluxlog[1] - fluxlog[0] ) / log10( tnu[1]/tnu[0] );
01747
01748 tnu[0] = rfield.emm*RESETFACTOR;
01749 fluxlog[0] = fluxlog[1] + power * log10( tnu[0] /tnu[1] );
01750 }
01751 else
01752 {
01753
01754
01755 power = log10( fluxlog[1]/fluxlog[0]) / log10( tnu[1]/tnu[0] );
01756
01757 tnu[0] = rfield.emm*RESETFACTOR;
01758 fluxlog[0] = log10(fluxlog[1]) + power * log10( tnu[0] /tnu[1] );
01759
01760 fluxlog[0] = pow(10. , fluxlog[0]);
01761 }
01762
01763 return;
01764 }
01765
01766 static void ZeroContin(void)
01767 {
01768
01769 DEBUG_ENTRY( "ZeroContin()" );
01770
01771
01772
01773 tnudrn[0] = 0.3676;
01774 tnudrn[1] = 0.4144;
01775 tnudrn[2] = 0.4558;
01776 tnudrn[3] = 0.5064;
01777 tnudrn[4] = 0.5698;
01778 tnudrn[5] = 0.6511;
01779 tnudrn[6] = 0.7012;
01780 tnudrn[7] = 0.7597;
01781 tnudrn[8] = 0.8220;
01782 tnudrn[9] = 0.9116;
01783 tnudrn[10] = 0.9120;
01784 tnudrn[11] = 0.9306;
01785 tnudrn[12] = 0.9600;
01786 tnudrn[13] = 0.9806;
01787
01788
01789
01790
01791 tnudrn[14] = 0.9999;
01792
01793
01794
01795
01796 {
01797 int i;
01798 i= 0;
01799 tsldrn[i] = -17.8063;
01800 ++i;tsldrn[i] = -17.7575;
01801 ++i;tsldrn[i] = -17.7268;
01802 ++i;tsldrn[i] = -17.7036;
01803 ++i;tsldrn[i] = -17.6953;
01804 ++i;tsldrn[i] = -17.7182;
01805 ++i;tsldrn[i] = -17.7524;
01806 ++i;tsldrn[i] = -17.8154;
01807 ++i;tsldrn[i] = -17.9176;
01808 ++i;tsldrn[i] = -18.1675;
01809 ++i;tsldrn[i] = -18.1690;
01810 ++i;tsldrn[i] = -18.2477;
01811 ++i;tsldrn[i] = -18.4075;
01812 ++i;tsldrn[i] = -18.5624;
01813 ++i;tsldrn[i] = -18.7722;
01814 }
01815
01816 # if 0
01817 tsldrn[0] = -15.8344;
01818 tsldrn[1] = -16.0454;
01819 tsldrn[2] = -16.2217;
01820 tsldrn[3] = -16.4273;
01821 tsldrn[4] = -16.6747;
01822 tsldrn[5] = -16.9875;
01823 tsldrn[6] = -17.1827;
01824 tsldrn[7] = -17.4195;
01825 tsldrn[8] = -17.6929;
01826 tsldrn[9] = -18.1675;
01827 tsldrn[10] = -18.1700;
01828 tsldrn[11] = -18.2925;
01829 tsldrn[12] = -18.5199;
01830 tsldrn[13] = -18.7209;
01831 tsldrn[14] = -18.9730;
01832 # endif
01833
01834
01835
01836
01837 tnuagn[0] = 1e-5;
01838 tnuagn[1] = 9.12e-3;
01839 tnuagn[2] = .206;
01840 tnuagn[3] = 1.743;
01841 tnuagn[4] = 4.13;
01842 tnuagn[5] = 26.84;
01843 tnuagn[6] = 7353.;
01844 tnuagn[7] = 7.4e6;
01845
01846 tslagn[0] = -3.388;
01847 tslagn[1] = 4.0115;
01848 tslagn[2] = 2.6576;
01849 tslagn[3] = 2.194;
01850 tslagn[4] = 1.819;
01851 tslagn[5] = -.6192;
01852 tslagn[6] = -2.326;
01853 tslagn[7] = -7.34;
01854 resetBltin( tnuagn , tslagn , true );
01855
01856
01857
01858
01859 tnucrb[0] = 1.0e-5;
01860 tnucrb[1] = 5.2e-4;
01861 tnucrb[2] = 1.5e-3;
01862 tnucrb[3] = 0.11;
01863 tnucrb[4] = 0.73;
01864 tnucrb[5] = 7.3;
01865 tnucrb[6] = 73.;
01866 tnucrb[7] = 7300.;
01867 tnucrb[8] = 1.5e6;
01868 tnucrb[9] = 7.4e6;
01869
01870 fnucrb[0] = 3.77e-21;
01871 fnucrb[1] = 1.38e-21;
01872 fnucrb[2] = 2.10e-21;
01873 fnucrb[3] = 4.92e-23;
01874 fnucrb[4] = 1.90e-23;
01875 fnucrb[5] = 2.24e-24;
01876 fnucrb[6] = 6.42e-26;
01877 fnucrb[7] = 4.02e-28;
01878 fnucrb[8] = 2.08e-31;
01879 fnucrb[9] = 1.66e-32;
01880 resetBltin( tnucrb , fnucrb , false );
01881
01882
01883
01884
01885 # if 0
01886 tnurbn[0] = 1e-5;
01887 tnurbn[1] = 1.0;
01888 tnurbn[2] = 1.02445;
01889 tnurbn[3] = 1.07266;
01890 tnurbn[4] = 1.12563;
01891 tnurbn[5] = 1.18411;
01892 tnurbn[6] = 1.23881;
01893 tnurbn[7] = 1.29328;
01894 tnurbn[8] = 1.35881;
01895 tnurbn[9] = 1.42463;
01896 tnurbn[10] = 1.48981;
01897 tnurbn[11] = 1.55326;
01898 tnurbn[12] = 1.6166;
01899 tnurbn[13] = 1.68845;
01900 tnurbn[14] = 1.76698;
01901 tnurbn[15] = 1.8019;
01902 tnurbn[16] = 1.8078;
01903 tnurbn[17] = 1.8082;
01904 tnurbn[18] = 1.84567;
01905 tnurbn[19] = 1.9317;
01906 tnurbn[20] = 2.04891;
01907 tnurbn[21] = 2.14533;
01908 tnurbn[22] = 2.19702;
01909 tnurbn[23] = 2.27941;
01910 tnurbn[24] = 2.37438;
01911 tnurbn[25] = 2.43137;
01912 tnurbn[26] = 2.49798;
01913 tnurbn[27] = 2.56113;
01914 tnurbn[28] = 2.59762;
01915 tnurbn[29] = 2.66597;
01916 tnurbn[30] = 2.80543;
01917 tnurbn[31] = 2.95069;
01918 tnurbn[32] = 3.02911;
01919 tnurbn[33] = 3.11182;
01920 tnurbn[34] = 3.22178;
01921 tnurbn[35] = 3.3155;
01922 tnurbn[36] = 3.42768;
01923 tnurbn[37] = 3.50678;
01924 tnurbn[38] = 3.56157;
01925 tnurbn[39] = 3.61811;
01926 tnurbn[40] = 3.75211;
01927 tnurbn[41] = 3.89643;
01928 tnurbn[42] = 4.0;
01929 tnurbn[43] = 4.1;
01930 tnurbn[44] = 1e5;
01931
01932
01933 fnurbn[0] = .181419e-11;
01934 fnurbn[1] = .181419e-01;
01935 fnurbn[2] = .145003e-01;
01936 fnurbn[3] = .129057e-01;
01937 fnurbn[4] = .130125e-01;
01938 fnurbn[5] = .115540e-01;
01939 fnurbn[6] = .114839e-01;
01940 fnurbn[7] = .964582e-02;
01941 fnurbn[8] = .922259e-02;
01942 fnurbn[9] = .829783e-02;
01943 fnurbn[10] = .735761e-02;
01944 fnurbn[11] = .651893e-02;
01945 fnurbn[12] = .617587e-02;
01946 fnurbn[13] = .510496e-02;
01947 fnurbn[14] = .499538e-02;
01948 fnurbn[15] = .364324e-02;
01949 fnurbn[16] = .325440e-02;
01950 fnurbn[17] = .325440e-02;
01951 fnurbn[18] = .162006e-02;
01952 fnurbn[19] = .139964e-02;
01953 fnurbn[20] = .127473e-02;
01954 fnurbn[21] = .100621e-02;
01955 fnurbn[22] = .102095e-02;
01956 fnurbn[23] = .900858e-03;
01957 fnurbn[24] = .460721e-03;
01958 fnurbn[25] = .699557e-03;
01959 fnurbn[26] = .861525e-03;
01960 fnurbn[27] = .751004e-03;
01961 fnurbn[28] = .500242e-03;
01962 fnurbn[29] = .568666e-03;
01963 fnurbn[30] = .418121e-03;
01964 fnurbn[31] = .619107e-04;
01965 fnurbn[32] = .279322e-04;
01966 fnurbn[33] = .404350e-04;
01967 fnurbn[34] = .266258e-04;
01968 fnurbn[35] = .186196e-04;
01969 fnurbn[36] = .146275e-04;
01970 fnurbn[37] = .203668e-05;
01971 fnurbn[38] = .799454e-06;
01972 fnurbn[39] = .868859e-06;
01973 fnurbn[40] = .370180e-06;
01974 fnurbn[41] = .186293e-06;
01975 fnurbn[42] = .450348e-07;
01976 fnurbn[43] = 1e-15;
01977 fnurbn[44] = 1e-20;
01978 # endif
01979 resetBltin( tnurbn , fnurbn , false );
01980
01981
01982 cfle[0] = 0.0000100;
01983 cflf[0] = -0.8046910;
01984 cfle[1] = 0.7354023;
01985 cflf[1] = -0.8046910;
01986 cfle[2] = 1.4708046;
01987 cflf[2] = -0.7436830;
01988 cfle[3] = 2.2062068;
01989 cflf[3] = -0.6818757;
01990 cfle[4] = 2.9416091;
01991 cflf[4] = -0.7168990;
01992 cfle[5] = 3.6770115;
01993 cflf[5] = -0.8068384;
01994 cfle[6] = 4.4124136;
01995 cflf[6] = -0.6722584;
01996 cfle[7] = 5.1478162;
01997 cflf[7] = -0.7626385;
01998 cfle[8] = 5.8832183;
01999 cflf[8] = -1.0396487;
02000 cfle[9] = 6.6186204;
02001 cflf[9] = -0.7972314;
02002 cfle[10] = 7.3540230;
02003 cflf[10] = -0.9883416;
02004 cfle[11] = 14.7080460;
02005 cflf[11] = -1.1675659;
02006 cfle[12] = 22.0620689;
02007 cflf[12] = -1.1985949;
02008 cfle[13] = 29.4160919;
02009 cflf[13] = -1.2263466;
02010 cfle[14] = 36.7701149;
02011 cflf[14] = -1.2918345;
02012 cfle[15] = 44.1241379;
02013 cflf[15] = -1.3510833;
02014 cfle[16] = 51.4781609;
02015 cflf[16] = -1.2715496;
02016 cfle[17] = 58.8321838;
02017 cflf[17] = -1.1098027;
02018 cfle[18] = 66.1862030;
02019 cflf[18] = -1.4315782;
02020 cfle[19] = 73.5402298;
02021 cflf[19] = -1.1327956;
02022 cfle[20] = 147.080459;
02023 cflf[20] = -1.6869649;
02024 cfle[21] = 220.620681;
02025 cflf[21] = -2.0239367;
02026 cfle[22] = 294.160919;
02027 cflf[22] = -2.2130392;
02028 cfle[23] = 367.701141;
02029 cflf[23] = -2.3773901;
02030 cfle[24] = 441.241363;
02031 cflf[24] = -2.5326197;
02032 cfle[25] = 514.7816162;
02033 cflf[25] = -2.5292389;
02034 cfle[26] = 588.3218384;
02035 cflf[26] = -2.8230250;
02036 cfle[27] = 661.8620605;
02037 cflf[27] = -2.9502323;
02038 cfle[28] = 735.4022827;
02039 cflf[28] = -3.0774822;
02040 cfle[29] = 1470.8045654;
02041 cflf[29] = -4.2239799;
02042 cfle[30] = 2206.2067871;
02043 cflf[30] = -5.2547927;
02044 cfle[31] = 2941.6091309;
02045 cflf[31] = -6.2353640;
02046 cfle[32] = 3677.0114746;
02047 cflf[32] = -7.1898708;
02048 cfle[33] = 4412.4135742;
02049 cflf[33] = -8.1292381;
02050 cfle[34] = 5147.8159180;
02051 cflf[34] = -9.0594845;
02052 cfle[35] = 5883.2182617;
02053 cflf[35] = -9.9830370;
02054 cfle[36] = 6618.6206055;
02055 cflf[36] = -10.9028034;
02056 cfle[37] = 7354.0229492;
02057 cflf[37] = -11.8188877;
02058 cfle[38] = 7400.0000000;
02059 cflf[38] = -30.0000000;
02060 cfle[39] = 10000000.0000000;
02061 cflf[39] = -30.0000000;
02062 resetBltin( cfle , cflf , true );
02063
02064
02065
02066 tnuakn[0] = 1e-5;
02067 tnuakn[1] = 1.9e-5;
02068 tnuakn[2] = 3.0e-4;
02069 tnuakn[3] = 2.4e-2;
02070 tnuakn[4] = 0.15;
02071 tnuakn[5] = 0.30;
02072 tnuakn[6] = 0.76;
02073 tnuakn[7] = 2.0;
02074 tnuakn[8] = 76.0;
02075 tnuakn[9] = 760.;
02076 tnuakn[10] = 7.4e6;
02077 fnuakn[0] = 1.5e-16;
02078 fnuakn[1] = 1.6e-16;
02079 fnuakn[2] = 1.4e-13;
02080 fnuakn[3] = 8.0e-15;
02081 fnuakn[4] = 1.6e-15;
02082 fnuakn[5] = 1.8e-15;
02083 fnuakn[6] = 7.1e-16;
02084 fnuakn[7] = 7.9e-17;
02085 fnuakn[8] = 1.1e-18;
02086 fnuakn[9] = 7.1e-20;
02087 fnuakn[10] = 1.3e-24;
02088 resetBltin( fnuakn , fnuakn , false );
02089
02090
02091
02092
02093 tnuism[0] = 6.00;
02094
02095 tnuism[1] = 10.72;
02096 tnuism[2] = 11.00;
02097 tnuism[3] = 11.23;
02098 tnuism[4] = 11.47;
02099 tnuism[5] = 11.55;
02100 tnuism[6] = 11.85;
02101 tnuism[7] = 12.26;
02102 tnuism[8] = 12.54;
02103 tnuism[9] = 12.71;
02104 tnuism[10] = 13.10;
02105 tnuism[11] = 13.64;
02106 tnuism[12] = 14.14;
02107 tnuism[13] = 14.38;
02108 tnuism[14] = 14.63;
02109 tnuism[15] = 14.93;
02110 tnuism[16] = 15.08;
02111 tnuism[17] = 15.36;
02112 tnuism[18] = 15.43;
02113 tnuism[19] = 16.25;
02114 tnuism[20] = 17.09;
02115 tnuism[21] = 18.00;
02116 tnuism[22] = 23.00;
02117
02118 fnuism[0] = -16.708;
02119
02120 fnuism[1] = -2.96;
02121 fnuism[2] = -2.47;
02122 fnuism[3] = -2.09;
02123 fnuism[4] = -2.11;
02124 fnuism[5] = -2.34;
02125 fnuism[6] = -3.66;
02126 fnuism[7] = -2.72;
02127 fnuism[8] = -2.45;
02128 fnuism[9] = -2.57;
02129 fnuism[10] = -3.85;
02130 fnuism[11] = -3.34;
02131 fnuism[12] = -2.30;
02132 fnuism[13] = -1.79;
02133 fnuism[14] = -1.79;
02134 fnuism[15] = -2.34;
02135 fnuism[16] = -2.72;
02136 fnuism[17] = -2.55;
02137 fnuism[18] = -2.62;
02138 fnuism[19] = -5.68;
02139 fnuism[20] = -6.45;
02140 fnuism[21] = -6.30;
02141 fnuism[22] = -11.3;
02142
02143 DEBUG_EXIT( "ZeroContin()" );
02144
02145 return;
02146 }
02147
02148
02149 int lines_table(void)
02150 {
02151 long int n,
02152 miss;
02153
02154 DEBUG_ENTRY( "lines_table()" );
02155
02156 if( !nLINE_TABLE )
02157 return 0;
02158
02159 fprintf( ioQQQ , "lines_table checking lines within data table %s\n", chLINE_LIST );
02160 miss = 0;
02161
02162 for( n=0; n<nLINE_TABLE; ++n )
02163 {
02164 double relative , absolute;
02165 if( (cdLine( chLabel[n], wl[n] , &relative , &absolute ))<=0 )
02166 {
02167 ++miss;
02168 fprintf(ioQQQ,"lines_table in parse_table.c did not find line %4s ",chLabel[n]);
02169 prt_wl(ioQQQ,wl[n]);
02170 fprintf(ioQQQ,"\n");
02171 }
02172 }
02173 if( miss )
02174 {
02175
02176 fprintf( ioQQQ , " BOTCHED ASSERTS!!! Botched Asserts!!! lines_table could not find a total of %li lines\n\n", miss );
02177 }
02178 else
02179 {
02180 fprintf( ioQQQ , "lines_table found all lines\n\n" );
02181 }
02182
02183 DEBUG_EXIT( "lines_table()" );
02184 return miss;
02185
02186 }
02187 #if defined(__HP_aCC)
02188 #pragma OPTIMIZE OFF
02189 #pragma OPTIMIZE ON
02190 #endif