46 if(
nMatch(
"FFMT",chCard) )
50 fprintf(
ioQQQ,
" FFmtRead ParseDrive entered. Enter number.\n" );
56 fprintf(
ioQQQ,
" ParseDrive.dat error getting magic number\n" );
63 fprintf(
ioQQQ,
" FFmtRead hit the EOL with no value, return=%10.2e\n",
73 fprintf(
ioQQQ,
" FFmtRead returned with value%11.4e\n",
76 fprintf(
ioQQQ,
" Enter 0 to stop, or another value.\n" );
78 fprintf(
ioQQQ,
" FFmtRead ParseDrive exits.\n" );
81 else if(
nMatch(
"CASE",chCard) )
87 else if(
nMatch(
"CDLI",chCard) )
93 else if(
nMatch(
" E1 ",chCard) )
98 double tau = pow( 10. , ((
double)i/4. - 5.) );
99 fprintf(
ioQQQ,
"tau\t%.3e\t exp-tau\t%.5e\t e1 tau\t%.5e \t ee2 tau\t%.5e \n",
105 else if(
nMatch(
"ESCA",chCard) )
111 else if(
nMatch(
"HYAS",chCard) )
117 else if(
nMatch(
"GAUN",chCard) )
123 else if(
nMatch(
"POIN",chCard) )
126 fprintf(
ioQQQ,
" Define entire model first, later I will ask for energies.\n" );
130 else if(
nMatch(
"PUMP",chCard) )
134 fprintf(
ioQQQ,
" Continuum pump ParseDrive entered - Enter log tau\n" );
139 fprintf(
ioQQQ,
" ParseDrive.dat error getting magic number\n" );
148 fprintf(
ioQQQ,
" Tau =%11.4e\n", fac );
151 fprintf(
ioQQQ,
" ContPump =%11.4e\n", fac );
152 fprintf(
ioQQQ,
" Enter null to stop, or another value.\n" );
154 fprintf(
ioQQQ,
" ContPump ParseDrive exits.\n" );
157 else if(
nMatch(
"STAR",chCard) )
161 for( i=0; i < 40; i++ )
163 zed = ((double)i+1.)/4. + 0.01;
164 sprintf( chInput,
"starburst, zed=%10.4f", zed );
166 fprintf(
ioQQQ,
"%8.1e", zed );
169 fprintf(
ioQQQ,
"\n" );
176 " Unrecognized key; keys are FFmtRead, CASE, GAUNT, HYAS, POINT, MOLE, STAR, "
177 "PUMP, and ESCApe. Sorry.\n" );
195 fprintf(
ioQQQ,
" Enter the log of the one-sided optical depth; line with no number to stop.\n" );
213 fprintf(
ioQQQ,
"tau was %e\n", tau );
241 fprintf(
ioQQQ,
" I will get needed H data files. This will take a second.\n");
247 enum {DEBUG_LOC=
false};
251 double xLyman , alpha;
256 for( ipHi=3; ipHi<25; ++ipHi )
258 double photons = (1./
POW2(ipHi-1.)-1./
POW2((
double)ipHi) ) /(1.-1./ipHi/ipHi );
260 alpha =
atmdat_HS_caseB(ipHi-1,ipHi, nelem,Temperature , Density ,
'A' );
261 fprintf(
ioQQQ,
"%li\t%.3e\t%.3e\n", ipHi, xLyman/alpha*photons, photons );
272 fprintf(
ioQQQ,
" Enter atomic number of species, either 1(H) or 2(He).\n" );
275 fprintf(
ioQQQ,
" error getting species \n" );
281 if( lgEOL || nelem< 1 || nelem > 2 )
283 fprintf(
ioQQQ,
" must be either 1 or 2!\n" );
291 fprintf(
ioQQQ,
" In the following temperatures <10 are log, >=10 linear.\n");
292 fprintf(
ioQQQ,
" The density is always a log.\n");
293 fprintf(
ioQQQ,
" The order of the quantum numbers do not matter.\n");
294 fprintf(
ioQQQ,
" The smallest must not be smaller than 2,\n");
295 fprintf(
ioQQQ,
" and the largest must not be larger than 25.\n");
296 fprintf(
ioQQQ,
" Units of emissivity are erg cm^3 s^-1\n\n");
297 fprintf(
ioQQQ,
" The limits of the HS tables are 2 <= n <= 25.\n");
303 fprintf(
ioQQQ,
" Enter 4 numbers, temperature, density, 2 quantum numbers, null line stop.\n" );
306 fprintf(
ioQQQ,
" Thanks for interpolating on the Hummer & Storey data set!\n" );
314 fprintf(
ioQQQ,
" error getting temperature!\n" );
319 if( Temperature < 10. )
321 Temperature = pow(10., Temperature );
323 fprintf(
ioQQQ,
" Temperature is %g\n", Temperature );
328 fprintf(
ioQQQ,
" error getting density!\n" );
331 Density = pow(10., Density );
332 fprintf(
ioQQQ,
" Density is %g\n", Density );
338 fprintf(
ioQQQ,
" error getting quantum number!\n" );
345 fprintf(
ioQQQ,
" error getting quantum number!\n" );
349 if(
MAX2( n1 , n2 ) > 25 )
351 fprintf(
ioQQQ,
" The limits of the HS tables are 2 <= n <= 25. Sorry.\n");
356 " 4pJ(%ld,%ld)/n_e n_p=%11.3e\n",
364 double tempTable[33] = {
365 11870.,12490.,12820.,
366 11060.,17740.,12560.,
367 16390.,16700.,11360.,
368 10240.,20740.,12030.,
369 14450.,19510.,12550.,
370 16470.,16560.,12220.,
371 15820.,12960.,10190.,
372 12960.,14060.,12560.,
373 11030.,10770.,13360.,
374 10780.,11410.,11690.,
375 12500.,13190.,21120. };
376 double edenTable[33] = {
377 10.,270.,80.,10.,70.,
378 110.,200.,10.,40.,90.,
379 340.,80.,60.,340.,30.,
380 120.,10.,50.,450.,30.,
381 180.,20.,170.,60.,20.,
382 40.,30.,20.,100.,130.,
386 for( j=0; j<33; j++ )
388 double halpha, hbeta, hgamma;
394 fprintf(
ioQQQ,
"%e\t%e\t%e\t%e\n",
404 fprintf(
ioQQQ,
" Thanks for interpolating on the Hummer & Storey data set!\n" );
414 long int i, nHi, lHi, nLo, lLo;
425 fprintf(
ioQQQ,
" Enter four quantum numbers (n, l, n', l'), null line to stop.\n" );
428 fprintf(
ioQQQ,
" error getting drvhyas \n" );
440 fprintf(
ioQQQ,
" must be four numbers!\n" );
446 fprintf(
ioQQQ,
" l must be less than n!\n" );
453 fprintf(
ioQQQ,
" must be four numbers!\n" );
460 fprintf(
ioQQQ,
" must be four numbers!\n" );
466 fprintf(
ioQQQ,
" l must be less than n!\n" );
483 fprintf(
ioQQQ,
" A(%3ld,%3ld->%3ld,%3ld)=%11.3e\n",
488 fprintf(
ioQQQ,
" Driver exits, enter next line.\n" );
504 double loggamma2, logu;
513 fprintf(
ioQQQ,
" Enter 0 to input temp, energy, and net charge, or 1 for u and gamma**2.\n" );
516 fprintf(
ioQQQ,
" dgaunt error getting magic number\n" );
524 fprintf(
ioQQQ,
" Enter the temperature (log if <=10), energy (Ryd), and net charge. Null line to stop.\n" );
532 fprintf(
ioQQQ,
" dgaunt error getting magic number\n" );
540 fprintf(
ioQQQ,
" Gaunt driver exits, enter next line.\n" );
556 if( lgEOL || enerlin[0] == 0. )
558 fprintf(
ioQQQ,
" Sorry, but there should be two more numbers, energy and charge.\n" );
562 if( lgEOL || z == 0. )
564 fprintf(
ioQQQ,
" Sorry, but there should be a third number, charge.\n" );
570 fprintf(
ioQQQ,
" Using my routine, Gff= \t" );
571 fprintf(
ioQQQ,
"%11.3e\n", mygaunt );
580 fprintf(
ioQQQ,
" Enter log u and log gamma2. Null line to stop.\n" );
586 fprintf(
ioQQQ,
" dgaunt error getting magic number\n" );
594 fprintf(
ioQQQ,
" Gaunt driver exits, enter next line.\n" );
601 fprintf(
ioQQQ,
" Sorry, but there should be another numbers, log gamma2.\n" );
609 fprintf(
ioQQQ,
" Using my routine, Gaunt factor is" );
610 fprintf(
ioQQQ,
"%11.3e\n", mygaunt );