45 fprintf(
ioQQQ,
" FFmtRead ParseDrive entered. Enter number.\n" );
51 fprintf(
ioQQQ,
" ParseDrive.dat error getting magic number\n" );
55 fac =
FFmtRead(chInput,&i,
sizeof(chInput),&lgEOL);
58 fprintf(
ioQQQ,
" FFmtRead hit the EOL with no value, return=%10.2e\n",
71 fprintf(
ioQQQ,
" Enter 0 to stop, or another value.\n" );
76 else if( p.
nMatch(
"CDLI") )
82 else if( p.
nMatch(
" E1 ") )
89 fprintf(
ioQQQ,
"tau\t%.3e\t exp-tau\t%.5e\t e1 tau\t%.5e \t e2 "
90 "\t%.5e \te2n %.5e \t e3\t%.5e \t e4\t%.5e \n",
93 tau =
exp10( ((
double)i/4. - 9.) );
98 else if( p.
nMatch(
"ESCA") )
121 else if( p.
nMatch(
"HYAS") )
127 else if( p.
nMatch(
"GAUN") )
138 if( Z <= 0. || Z >
LIMELM )
140 fprintf(
ioQQQ,
" invalid value for charge %ld\n",
long(Z) );
150 else if( p.
nMatch(
"PUMP") )
164 fprintf(
ioQQQ,
" Continuum pump ParseDrive entered - Enter log tau\n" );
169 fprintf(
ioQQQ,
" Parse Drive error getting optical depth\n" );
174 double tau =
FFmtRead(chInput,&i,
sizeof(chInput),&lgEOL);
182 fprintf(
ioQQQ,
" Enter null to stop, or another value.\n" );
187 else if( p.
nMatch(
"STAR") )
191 for( i=0; i < 40; i++ )
193 zed = ((double)i+1.)/4. + 0.01;
194 sprintf( chInput,
"starburst, zed=%10.4f", zed );
204 else if( p.
nMatch(
"VOIGT") )
207 bool hasstr = ( p.
GetQuote(file) == 0 );
208 FILE *ioVOIGT =
ioQQQ;
216 const realnum DampLogMin = -4., DampLogMax = 4.01;
217 for(
realnum damplog=DampLogMin; damplog<DampLogMax; ++damplog)
221 for(
realnum x=-2.; x<5.;x+=0.05)
225 for(
realnum damplog=DampLogMin; damplog<DampLogMax; ++damplog)
232 fprintf(ioVOIGT ,
"\t%.3e",yval[0]);
243 fprintf( ioVOIGT,
" The damping constant must appear on the print voigt command. Sorry.\n" );
247 const long NVOIGT=100;
248 realnum xprofile[NVOIGT], profileVoigtH[NVOIGT];
249 for(
long i=0; i<NVOIGT; ++i )
252 VoigtH( damp, xprofile, profileVoigtH, NVOIGT );
254 fprintf(ioVOIGT,
"\n x VoigtH\n");
255 for(
long int i=0; i<NVOIGT; ++i )
257 fprintf(ioVOIGT,
"%.4e %.4e\n", xprofile[i], profileVoigtH[i] );
261 if (ioVOIGT !=
ioQQQ)
269 " Unrecognized key; keys are CDLIne, E1, ESCApe, FFMTread, GAUNt, "
270 "HYAS, PUMP, STAR, and VOIGt. Sorry.\n" );
288 fprintf(
ioQQQ,
" Enter the log of the one-sided optical depth; line with no number to stop.\n" );
299 tau =
FFmtRead(chCard,&i,
sizeof(chCard),&lgEOL);
320 long int i, nHi, lHi, nLo, lLo;
331 fprintf(
ioQQQ,
" Enter four quantum numbers (n, l, n', l'), null line to stop.\n" );
339 nHi = (
long int)
FFmtRead(chCard,&i,
sizeof(chCard),&lgEOL);
343 lHi = (
long int)
FFmtRead(chCard,&i,
sizeof(chCard),&lgEOL);
356 nLo = (
long int)
FFmtRead(chCard,&i,
sizeof(chCard),&lgEOL);
363 lLo = (
long int)
FFmtRead(chCard,&i,
sizeof(chCard),&lgEOL);
410 fprintf(
ioQQQ,
" Enter 0 to input temp, energy, and net charge, or 1 for u, gamma**2, and net charge.\n" );
417 int inputflag = (int)
FFmtRead(chCard,&i,
sizeof(chCard),&lgEOL);
421 fprintf(
ioQQQ,
" Enter the temperature (log if <=10), energy (Ryd), and net charge. Null line to stop.\n" );
433 double alogte =
FFmtRead(chCard,&i,
sizeof(chCard),&lgEOL);
437 fprintf(
ioQQQ,
" Gaunt driver exits, enter next line.\n" );
445 TeNew =
exp10(alogte);
447 double enerlin =
FFmtRead(chCard,&i,
sizeof(chCard),&lgEOL);
448 if( lgEOL || enerlin == 0. )
449 fprintf(
ioQQQ,
" Sorry, but there should be two more numbers, energy and charge.\n" );
451 double z =
FFmtRead(chCard,&i,
sizeof(chCard),&lgEOL);
452 if( lgEOL || z == 0. )
453 fprintf(
ioQQQ,
" Sorry, but there should be a third number, charge.\n" );
457 fprintf(
ioQQQ,
" Using my routine, Gff= %.4e\n", mygaunt );
465 fprintf(
ioQQQ,
" Enter log u, log gamma2, and net charge. Null line to stop.\n" );
475 double logu =
FFmtRead(chCard,&i,
sizeof(chCard),&lgEOL);
479 fprintf(
ioQQQ,
" Gaunt driver exits, enter next line.\n" );
483 double loggamma2 =
FFmtRead(chCard,&i,
sizeof(chCard),&lgEOL);
485 fprintf(
ioQQQ,
" Sorry, but there should be two more numbers, log gamma2 and charge.\n" );
487 double z =
FFmtRead(chCard,&i,
sizeof(chCard),&lgEOL);
489 fprintf(
ioQQQ,
" Sorry, but there should be another number, charge.\n" );
494 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
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)
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)