48 fprintf(
ioQQQ,
" FFmtRead ParseDrive entered. Enter number.\n" );
54 fprintf(
ioQQQ,
" ParseDrive.dat error getting magic number\n" );
58 fac =
FFmtRead(chInput,&i,
sizeof(chInput),&lgEOL);
61 fprintf(
ioQQQ,
" FFmtRead hit the EOL with no value, return=%10.2e\n",
74 fprintf(
ioQQQ,
" Enter 0 to stop, or another value.\n" );
79 else if( p.
nMatch(
"CASE") )
85 else if( p.
nMatch(
"CDLI") )
91 else if( p.
nMatch(
" E1 ") )
98 fprintf(
ioQQQ,
"tau\t%.3e\t exp-tau\t%.5e\t e1 tau\t%.5e \t e2 "
99 "\t%.5e \te2n %.5e \t e3\t%.5e \t e4\t%.5e \n",
102 tau =
exp10( ((
double)i/4. - 9.) );
107 else if( p.
nMatch(
"ESCA") )
130 else if( p.
nMatch(
"HYAS") )
136 else if( p.
nMatch(
"GAUN") )
147 if( Z <= 0. || Z >
LIMELM )
149 fprintf(
ioQQQ,
" invalid value for charge %ld\n",
long(Z) );
159 else if( p.
nMatch(
"PUMP") )
173 fprintf(
ioQQQ,
" Continuum pump ParseDrive entered - Enter log tau\n" );
178 fprintf(
ioQQQ,
" Parse Drive error getting optical depth\n" );
183 double tau =
FFmtRead(chInput,&i,
sizeof(chInput),&lgEOL);
191 fprintf(
ioQQQ,
" Enter null to stop, or another value.\n" );
196 else if( p.
nMatch(
"STAR") )
200 for( i=0; i < 40; i++ )
202 zed = ((double)i+1.)/4. + 0.01;
203 sprintf( chInput,
"starburst, zed=%10.4f", zed );
213 else if( p.
nMatch(
"VOIGT") )
216 bool hasstr = ( p.
GetQuote(file) == 0 );
217 FILE *ioVOIGT =
ioQQQ;
225 const realnum DampLogMin = -4., DampLogMax = 4.01;
226 for(
realnum damplog=DampLogMin; damplog<DampLogMax; ++damplog)
230 for(
realnum x=-2.; x<5.;x+=0.05)
234 for(
realnum damplog=DampLogMin; damplog<DampLogMax; ++damplog)
241 fprintf(ioVOIGT ,
"\t%.3e",yval[0]);
252 fprintf( ioVOIGT,
" The damping constant must appear on the print voigt command. Sorry.\n" );
256 const long NVOIGT=100;
257 realnum xprofile[NVOIGT], profileVoigtH[NVOIGT];
258 for(
long i=0; i<NVOIGT; ++i )
261 VoigtH( damp, xprofile, profileVoigtH, NVOIGT );
263 fprintf(ioVOIGT,
"\n x VoigtH\n");
264 for(
long int i=0; i<NVOIGT; ++i )
266 fprintf(ioVOIGT,
"%.4e %.4e\n", xprofile[i], profileVoigtH[i] );
270 if (ioVOIGT !=
ioQQQ)
278 " Unrecognized key; keys are CASE, CDLIne, E1 , ESCApe, FFMTread, GAUNt, "
279 "HYAS, PUMP, STAR, and VOIGt. Sorry.\n" );
297 fprintf(
ioQQQ,
" Enter the log of the one-sided optical depth; line with no number to stop.\n" );
308 tau =
FFmtRead(chCard,&i,
sizeof(chCard),&lgEOL);
343 fprintf(
ioQQQ,
" I will get needed H data files. This will take a second.\n");
349 enum {DEBUG_LOC=
false};
353 double xLyman , alpha;
358 for( ipHi=3; ipHi<25; ++ipHi )
360 double photons = (1./
POW2(ipHi-1.)-1./
POW2((
double)ipHi) ) /(1.-1./ipHi/ipHi );
362 alpha =
atmdat_HS_caseB(ipHi-1,ipHi, nelem,Temperature , Density ,
'A' );
363 fprintf(
ioQQQ,
"%li\t%.3e\t%.3e\n", ipHi, xLyman/alpha*photons, photons );
374 fprintf(
ioQQQ,
" Enter atomic number of species, either 1(H) or 2(He).\n" );
382 nelem = (
long int)
FFmtRead(chCard,&i,
sizeof(chCard),&lgEOL);
383 if( lgEOL || nelem< 1 || nelem > 2 )
393 fprintf(
ioQQQ,
" In the following temperatures <10 are log, >=10 linear.\n");
395 fprintf(
ioQQQ,
" The order of the quantum numbers do not matter.\n");
396 fprintf(
ioQQQ,
" The smallest must not be smaller than 2,\n");
397 fprintf(
ioQQQ,
" and the largest must not be larger than 25.\n");
398 fprintf(
ioQQQ,
" Units of emissivity are erg cm^3 s^-1\n\n");
399 fprintf(
ioQQQ,
" The limits of the HS tables are 2 <= n <= 25.\n");
405 fprintf(
ioQQQ,
" Enter 4 numbers, temperature, density, 2 quantum numbers, null line stop.\n" );
408 fprintf(
ioQQQ,
" Thanks for interpolating on the Hummer & Storey data set!\n" );
413 Temperature =
FFmtRead(chCard,&i,
sizeof(chCard),&lgEOL);
421 if( Temperature < 10. )
423 Temperature =
exp10( Temperature );
427 Density =
FFmtRead(chCard,&i,
sizeof(chCard),&lgEOL);
433 Density =
exp10( Density );
437 n1 = (long)
FFmtRead(chCard,&i,
sizeof(chCard),&lgEOL);
444 n2 = (long)
FFmtRead(chCard,&i,
sizeof(chCard),&lgEOL);
451 if(
MAX2( n1 , n2 ) > 25 )
453 fprintf(
ioQQQ,
" The limits of the HS tables are 2 <= n <= 25. Sorry.\n");
458 " 4pJ(%ld,%ld)/n_e n_p=%11.3e\n",
466 double tempTable[33] = {
467 11870.,12490.,12820.,
468 11060.,17740.,12560.,
469 16390.,16700.,11360.,
470 10240.,20740.,12030.,
471 14450.,19510.,12550.,
472 16470.,16560.,12220.,
473 15820.,12960.,10190.,
474 12960.,14060.,12560.,
475 11030.,10770.,13360.,
476 10780.,11410.,11690.,
477 12500.,13190.,21120. };
478 double edenTable[33] = {
479 10.,270.,80.,10.,70.,
480 110.,200.,10.,40.,90.,
481 340.,80.,60.,340.,30.,
482 120.,10.,50.,450.,30.,
483 180.,20.,170.,60.,20.,
484 40.,30.,20.,100.,130.,
488 for( j=0; j<33; j++ )
490 double halpha, hbeta, hgamma;
506 fprintf(
ioQQQ,
" Thanks for interpolating on the Hummer & Storey data set!\n" );
516 long int i, nHi, lHi, nLo, lLo;
527 fprintf(
ioQQQ,
" Enter four quantum numbers (n, l, n', l'), null line to stop.\n" );
535 nHi = (
long int)
FFmtRead(chCard,&i,
sizeof(chCard),&lgEOL);
539 lHi = (
long int)
FFmtRead(chCard,&i,
sizeof(chCard),&lgEOL);
552 nLo = (
long int)
FFmtRead(chCard,&i,
sizeof(chCard),&lgEOL);
559 lLo = (
long int)
FFmtRead(chCard,&i,
sizeof(chCard),&lgEOL);
606 fprintf(
ioQQQ,
" Enter 0 to input temp, energy, and net charge, or 1 for u, gamma**2, and net charge.\n" );
613 int inputflag = (int)
FFmtRead(chCard,&i,
sizeof(chCard),&lgEOL);
617 fprintf(
ioQQQ,
" Enter the temperature (log if <=10), energy (Ryd), and net charge. Null line to stop.\n" );
629 double alogte =
FFmtRead(chCard,&i,
sizeof(chCard),&lgEOL);
633 fprintf(
ioQQQ,
" Gaunt driver exits, enter next line.\n" );
641 TeNew =
exp10(alogte);
643 double enerlin =
FFmtRead(chCard,&i,
sizeof(chCard),&lgEOL);
644 if( lgEOL || enerlin == 0. )
645 fprintf(
ioQQQ,
" Sorry, but there should be two more numbers, energy and charge.\n" );
647 double z =
FFmtRead(chCard,&i,
sizeof(chCard),&lgEOL);
648 if( lgEOL || z == 0. )
649 fprintf(
ioQQQ,
" Sorry, but there should be a third number, charge.\n" );
653 fprintf(
ioQQQ,
" Using my routine, Gff= %.4e\n", mygaunt );
661 fprintf(
ioQQQ,
" Enter log u, log gamma2, and net charge. Null line to stop.\n" );
671 double logu =
FFmtRead(chCard,&i,
sizeof(chCard),&lgEOL);
675 fprintf(
ioQQQ,
" Gaunt driver exits, enter next line.\n" );
679 double loggamma2 =
FFmtRead(chCard,&i,
sizeof(chCard),&lgEOL);
681 fprintf(
ioQQQ,
" Sorry, but there should be two more numbers, log gamma2 and charge.\n" );
683 double z =
FFmtRead(chCard,&i,
sizeof(chCard),&lgEOL);
685 fprintf(
ioQQQ,
" Sorry, but there should be another number, charge.\n" );
690 fprintf(
ioQQQ,
" Using my routine, Gff= %.4e\n", mygaunt );
bool nMatch(const char *chKey) const
FILE * open_data(const char *fname, const char *mode, access_scheme scheme)
STATIC void DrvEscP(void)
void setline(const char *const card)
double DrvContPump(double tau, double damp)
void DrivePump(double tau)
int GetQuote(string &chLabel)
void dgaunt_check(double Z)
sys_float sexp(sys_float x)
double expn(int n, double x)
void mc_escape(double tau_in, double a, double beta)
const int INPUT_LINE_LENGTH
double atmdat_HS_caseB(long int iHi, long int iLo, long int iZ, double TempIn, double DenIn, char chCase)
void ParseDrive(Parser &p)
double esc_PRD_1side(double tau, double a)
double gauntff(long Z, double Te, double anu)
#define DEBUG_ENTRY(funcname)
STATIC void DrvHyas(void)
STATIC void DrvCaseBHS(void)
int fprintf(const Output &stream, const char *format,...)
void abund_starburst(Parser &p)
char * read_whole_line(char *chLine, int nChar, FILE *ioIN)
double esca0k2(double taume)
double esc_CRDwing_1side(double tau, double a)
double H_Einstein_A(long int n, long int l, long int np, long int lp, long int iz)
void VoigtH(realnum a, const realnum v[], realnum y[], int n)
double FFmtRead(const char *chCard, long int *ipnt, long int last, bool *lgEOL)