48          const char chFile[] );
 
   52         fprintf( 
ioQQQ, 
"%-10s -> '%s'\t Energy Ang= %.4e\t Ryd= %.4e\t Fine= %ld\t fine_ener= %.4e\n",
 
   64         static int nCalled = 0;
 
   81                         fprintf( 
ioQQQ, 
" ContCreatePointers called, not evaluating.\n" );
 
   87                         fprintf( 
ioQQQ, 
" ContCreatePointers called first time.\n" );
 
  101         for( 
long nelem=0; nelem<
LIMELM; ++nelem )
 
  105                         for( 
long ion=0; ion<
LIMELM; ++ion )
 
  107                                 for( 
long nshells=0; nshells<7; ++nshells )
 
  109                                         for( 
long j=0; j<3; ++j )
 
  135                 for( 
long nelem=ipISO; nelem < 2; nelem++ )
 
  138                         string chLab = 
chIonLbl( nelem+1, nelem+1-ipISO );
 
  148                                 for( 
long ipLo=0; ipLo < ipHi; ipLo++ )
 
  163                                                 iso_sp[ipISO][nelem].
fb[ipLo].ipIsoLevNIonCon);
 
  168                                         if( 
iso_sp[ipISO][nelem].trans(ipHi,ipLo).Emis().ipFine() > 0 )
 
  180                                                 ASSERT( fabs(anuCoarse - anuFine) / anuCoarse < 
 
  258         fixit(
"need to generalize ionization energy and label!");
 
  260                 (*diatom)->ip_photo_opac_thresh = 
ipContEnergy( 15.4/EVRYD , 
"H2  ");
 
  371         for( 
long nelem=2; nelem<
LIMELM; ++nelem )
 
  378                         for( 
long j=0; j<=nelem; ++j )
 
  382                         for( 
long j=0; j<nelem; ++j )
 
  390         for( 
long nelem=0; nelem<
LIMELM; ++nelem )
 
  394                         for( 
long ion=0; ion<nelem+1; ++ion )
 
  431                 fprintf( 
ioQQQ, 
"   ContCreatePointers:%ld energy cells used. N(1R):%4ld N(1.8):%4ld  N(4Ryd):%4ld N(O3)%4ld  N(x-ray):%5ld N(rcoil)%5ld\n", 
 
  441                 fprintf( 
ioQQQ, 
"   ContCreatePointers: ipEnerGammaRay: %5ld IPPRpari produc%5ld\n", 
 
  445                 for( 
long i=0; i <= 6; i++ )
 
  453                 for( 
long i=1; i <= 8; i++ )
 
  486         for (
int ipSpecies=0; ipSpecies < 
nSpecies; ++ipSpecies)
 
  494                           em != 
dBaseTrans[ipSpecies].Emis().end(); ++em)
 
  497                         (*em).dampXvel() = (
realnum)(1./
 
  498                                         dBaseStates[ipSpecies][em->Tran().ipHi()].lifetime()/em->Tran().EnergyWN()/PI4);
 
  499                         (*em).damp() = -1000.0;
 
  503                         static const double minAul = 1e-29;
 
  504                         if( (*em).Aul() > minAul )
 
  506                                 (*em).Tran().ipCont() = 
ipLineEnergy((*em).Tran().EnergyRyd(), chLab ,0);
 
  507                                 (*em).ipFine() = 
ipFineCont((*em).Tran().EnergyRyd() );
 
  511                                 (*em).Tran().ipCont() = -1;
 
  518                         if ((*em).gf() <= 0.0)
 
  520                                 (*em).Tran().ipCont() = -1;
 
  527                                                                          (*(*em).Tran().Lo()).g()));
 
  534                 (*diatom)->H2_ContPoint();
 
  539                 for( 
long nelem=2; nelem < 
LIMELM; nelem++ )
 
  543                                 string chLab = 
chIonLbl( nelem+1, nelem+1-ipISO );
 
  546                                 iso_sp[ipISO][nelem].
fb[0].ipIsoLevNIonCon = 
 
  555                                         for( 
long ipLo=0; ipLo < ipHi; ipLo++ )
 
  570                                                         iso_sp[ipISO][nelem].
fb[ipLo].ipIsoLevNIonCon);
 
  582                 for( 
long nelem=ipISO; nelem < 
LIMELM; nelem++ )
 
  592                                         strncpy(chLab,
"LyEx",
NCHLAB-1);
 
  597                                                 iso_sp[ipISO][nelem].
fb[ipLo].ipIsoLevNIonCon);
 
  599                                         (*tr).Emis().ipFine() = 
 
  609                                                 strncpy(chLab,
"SatL",
NCHLAB-1);
 
  623         fixit(
"is this redundant?");
 
  628                 for( 
long nelem=ipISO; nelem < 
LIMELM; nelem++ )
 
  634                                         for( 
long ipLo=0; ipLo < ipHi; ipLo++ )
 
  670                                 enum{ DEBUG_LOC = 
false };
 
  671                                 if( DEBUG_LOC && 
UTALines[i].chLabel() == 
"Ar 7 43.5239A" )
 
  749                 for( 
long nelem=ipISO; nelem<
LIMELM; ++nelem )
 
  755                                 const int TwoS = (1+ipISO);
 
  759                                         Aul =  8.226*
powi((
double)(nelem+1.),6);
 
  766                                         fixit(
"where is 51.02 from? Value is 51.3 from the Derevianko & Johnson paper cited above.");
 
  767                                         const double As2nuFrom1S[29] = {51.02,1940.,1.82E+04,9.21E+04,3.30E+05,9.44E+05,2.31E+06,5.03E+06,1.00E+07,
 
  768                                         1.86E+07,3.25E+07,5.42E+07,8.69E+07,1.34E+08,2.02E+08,2.96E+08,4.23E+08,5.93E+08,8.16E+08,
 
  769                                         1.08E+09,1.43E+09,1.88E+09,2.43E+09,3.25E+09,3.95E+09,4.96E+09,6.52E+09,7.62E+09,9.94E+09};
 
  770                                         Aul =  As2nuFrom1S[nelem-1];
 
  775                                         iso_sp[ipISO][nelem].trans(TwoS,0),
 
  784                 for( 
long nelem=ipISO; nelem<
LIMELM; ++nelem )
 
  794                                 const double As2nuFrom3S[29] = {4.09e-9,1.25E-06,5.53E-05,8.93E-04,8.05E-03,4.95E-02,2.33E-01,8.94E-01,2.95E+00,
 
  795                                         8.59E+00,2.26E+01,5.49E+01,1.24E+02,2.64E+02,5.33E+02,1.03E+03,1.91E+03,3.41E+03,5.91E+03,
 
  796                                         9.20E+03,1.50E+04,2.39E+04,3.72E+04,6.27E+04,8.57E+04,1.27E+05,2.04E+05,2.66E+05,4.17E+05};
 
  799                                         As2nuFrom3S[nelem-1],
 
  808                 enum {DEBUG_LOC=
false};
 
  813                           0.,     0.03738,  0.07506,  0.1124,  0.1498,  0.1875,
 
  814                           0.225,  0.263,    0.300,    0.3373,  0.375,   0.4127,
 
  815                           0.4500, 0.487,    0.525,    0.5625,  0.6002,  0.6376,
 
  816                           0.6749, 0.7126,   0.75};
 
  824                         for( 
long i=0; i < nCRS; i++ )
 
  832                         for( 
long i=0; i < limit; i++ )
 
  839                                 xnew += tnu.
As2nu[i];
 
  847                 enum {DEBUG_LOC=
false};
 
  850                         for( 
long i=0; i<11; ++i )
 
  862                 fprintf( 
ioQQQ, 
"       WL(Ang)   E(RYD)   IP   gl  gu      gf       A        damp     abs K\n" );
 
  865                 for (
int ipSpecies=0; ipSpecies < 
nSpecies; ++ipSpecies)
 
  868                                   em != 
dBaseTrans[ipSpecies].Emis().end(); ++em)
 
  870                                 long iWL_Ang = (long)(*em).Tran().WLAng();
 
  872                                 if( iWL_Ang > 1000000 )
 
  876                                 else if( iWL_Ang > 10000 )
 
  880                                 fprintf( 
ioQQQ, 
" %10.10s%5ld%10.3e %4li%4ld%4ld%10.2e%10.2e%10.2e%10.2e\n", 
 
  881                                                         chLineLbl((*em).Tran()).c_str(), iWL_Ang, RYDLAM/(*em).Tran().WLAng(), 
 
  882                                                         (*em).Tran().ipCont(), (long)((*(*em).Tran().Lo()).g()), 
 
  883                                                         (
long)((*(*em).Tran().Hi()).g()),(*em).gf(), 
 
  884                                                         (*em).Aul(),(*em).dampXvel(), 
 
  891                         long iWL_Ang = (long)
TauLine2[i].WLAng();
 
  893                         if( iWL_Ang > 1000000 )
 
  897                         else if( iWL_Ang > 10000 )
 
  901                         fprintf( 
ioQQQ, 
" %10.10s%5ld%10.3e %4li%4ld%4ld%10.2e%10.2e%10.2e%10.2e\n", 
 
  910                         long iWL_Ang = (long)
HFLines[i].WLAng();
 
  912                         if( iWL_Ang > 1000000 )
 
  916                         else if( iWL_Ang > 10000 )
 
  920                         fprintf( 
ioQQQ, 
" %10.10s%5ld%10.3e %4li%4ld%4ld%10.2e%10.2e%10.2e%10.2e\n", 
 
  933                 for (
int ipSpecies=0; ipSpecies < 
nSpecies; ++ipSpecies)
 
  936                                   em != 
dBaseTrans[ipSpecies].Emis().end(); ++em)
 
  938                                 if((*em).Tran().EnergyWN() < 10000. )
 
  940                                         (*em).opacity() = 0.;
 
  972         double thresh=-DBL_MAX;
 
  988         for( ion=0; ion < nelem; ion++ )
 
  990                 string chLab = 
chIonLbl( nelem+1, ion+1 );
 
  993                 long int ipISO = nelem-ion;
 
 1003                 for( nshell=0; nshell < imax; nshell++ )
 
 1006                         thresh = (double)(
t_ADfA::Inst().
ph1(nshell,nelec-1,nelem,0)/EVRYD* 0.9998787);
 
 1033                                         LimitSh(ion+1,  nshell+1,nelem+1);
 
 1038                 ASSERT( imax > 0 && imax <= 7 );
 
 1094                 for( ion=0; ion < (nelem+1); ion++ )
 
 1096                         fprintf( 
ioQQQ, 
"Ion:%3ld%3ld %2.2s%2.2s total shells:%3ld\n", 
 
 1101                                 fprintf( 
ioQQQ, 
" shell%3ld %2.2s range eV%10.2e-%8.2e\n", 
 
 1128         else if( nshell == 2 )
 
 1136         else if( nshell == 3 )
 
 1144         else if( nshell == 4 )
 
 1152         else if( nshell == 5 )
 
 1160         else if( nshell == 6 )
 
 1168         else if( nshell == 7 )
 
 1189                 fprintf( 
ioQQQ, 
" LimitSh cannot handle nshell as large as%4ld\n", 
 
 1193         return( LimitSh_v );
 
 1201          const char chFile[] )
 
 1204         const char* chFilename;
 
 1225         chFilename = ( strlen(chFile) == 0 ) ? 
"continuum_bands.ini" : chFile;
 
 1230                 fprintf( 
ioQQQ, 
" ContBandsCreate opening %s:", chFilename );
 
 1239         if( 
read_whole_line( chLine , (
int)
sizeof(chLine) , ioDATA ) == NULL )
 
 1241                 fprintf( 
ioQQQ, 
" ContBandsCreate could not read first line of %s.\n", chFilename );
 
 1244         while( 
read_whole_line( chLine , (
int)
sizeof(chLine) , ioDATA ) != NULL )
 
 1248                 if( chLine[0] != 
'#')
 
 1253         if( fseek( ioDATA , 0 , SEEK_SET ) != 0 )
 
 1255                 fprintf( 
ioQQQ, 
" ContBandsCreate could not rewind %s.\n", chFilename );
 
 1274         if( 
read_whole_line( chLine , (
int)
sizeof(chLine) , ioDATA ) == NULL )
 
 1276                 fprintf( 
ioQQQ, 
" ContBandsCreate could not read first line of %s.\n", chFilename );
 
 1282                 long int m1 , m2 , m3,
 
 1284                         myr = 11, mmo = 9, mdy = 10;
 
 1287                 m1 = (long)
FFmtRead(chLine,&i,
sizeof(chLine),&lgEOL);
 
 1288                 m2 = (long)
FFmtRead(chLine,&i,
sizeof(chLine),&lgEOL);
 
 1289                 m3 = (long)
FFmtRead(chLine,&i,
sizeof(chLine),&lgEOL);
 
 1290                 if( ( m1 != myr ) ||
 
 1295                                 " ContBandsCreate: the version of the data file %s I found (%li %li %li)is not the current version (%li %li %li).\n", 
 
 1300                                 " ContBandsCreate: you need to update this file.\n");
 
 1307         while( 
read_whole_line( chLine , (
int)
sizeof(chLine) , ioDATA ) != NULL )
 
 1311                 if( chLine[0] != 
'#')
 
 1331                         double xHi = 
FFmtRead(chLine,&i,
sizeof(chLine),&lgEOL)*1e4;
 
 1332                         double xLow = 
FFmtRead(chLine,&i,
sizeof(chLine),&lgEOL)*1e4;
 
 1335                                 fprintf( 
ioQQQ, 
" There should have been 3 numbers on this band line.   Sorry.\n" );
 
 1341                                 enum {DEBUG_LOC=
false};
 
 1354                                         "edges are in improper order.\n" ,k);
 
 1368                                 fprintf( 
ioQQQ, 
" ContBandWavelength band %li central " 
 1369                                         "wavelength not within band.\n" ,k);
 
 1405                                         "     band %ld label %s low wl= %.3e low ipnt= %li " 
 1406                                         " hi wl= %.3e hi ipnt= %li \n", 
 
 1436                         fprintf( 
ioQQQ, 
" ContBandWavelength band %li has non-positive entry.\n",i );
 
long int & ipFine() const 
void prt_wl(FILE *ioOUT, realnum wl)
FILE * open_data(const char *fname, const char *mode, access_scheme scheme)
long int ipElement[LIMELM][LIMELM][7][3]
string chIonLbl(const TransitionProxy &t)
TransitionList UTALines("UTALines",&AnonStates)
const int FILENAME_PATH_LENGTH_2
string chLineLbl(const TransitionProxy &t)
char chIonStage[LIMELM+1][CHARS_ION_STAGE]
double widflx(size_t i) const 
multi_arr< int, 3 > ipSatelliteLines
double abscf(double gf, double enercm, double gl)
realnum ph1(int i, int j, int k, int l) const 
vector< string > chContLabel
void set_ipoint(long n, long val)
double eina(double gf, double enercm, double gup)
realnum xLyaHeavy[LIMELM][LIMELM]
TransitionList HFLines("HFLines",&AnonStates)
long ipFineCont(double energy_ryd)
TransitionList TauLine2("TauLine2",&AnonStates)
double anu(size_t i) const 
t_elementnames elementnames
t_iso_sp iso_sp[NISO][LIMELM]
long int nflux_with_check
STATIC long LimitSh(long int ion, long int nshell, long int nelem)
realnum EnergyAng() const 
vector< two_photon > TwoNu
long ipoint(double energy_ryd)
void ContCreatePointers(void)
long int nsShells[LIMELM][LIMELM]
long ipContEnergy(double energy, const char *chLabel)
double energy(const genericState &gs)
void checkTransitionListOfLists(vector< TransitionList > &list)
EmissionList::reference Emis() const 
multi_arr< int, 3 > ipExtraLymanLines
long ipLineEnergy(double energy, const char *chLabel, long ipIonEnergy)
STATIC void print_emline_fine(const char *LineGroup, const TransitionProxy &tr)
STATIC void ipShells(long int nelem)
vector< diatomics * > diatoms
realnum * ContBandWavelength
double powi(double, long int)
double anu2(size_t i) const 
vector< vector< TransitionList > > SatelliteLines
vector< string > chLineLabel
double anumin(size_t i) const 
TransitionProxy trans(const long ipHi, const long ipLo)
char chElementSym[LIMELM][CHARS_ELEMENT_SYM]
long int ipLyHeavy[LIMELM][LIMELM-1]
long int ipBalHeavy[LIMELM][LIMELM-1]
void TwoPhotonSetup(vector< two_photon > &tnu_vec, const long &ipHi, const long &ipLo, const double &Aul, const TransitionProxy &tr, const long ipISO, const long nelem)
vector< vector< TransitionList > > ExtraLymanLines
realnum * BandEdgeCorrLow
double Valence_IP_Ryd[LIMELM][LIMELM]
#define DEBUG_ENTRY(funcname)
vector< qList > dBaseStates
STATIC void ContBandsCreate(const char chFile[])
vector< species > dBaseSpecies
int fprintf(const Output &stream, const char *format,...)
vector< TransitionList > AllTransitions
char * read_whole_line(char *chLine, int nChar, FILE *ioIN)
double anumax(size_t i) const 
t_secondaries secondaries
vector< TransitionList > dBaseTrans
double atmdat_2phot_shapefunction(double EbyE2nu, long ipISO, long nelem)
long int nLyman_malloc[NISO]
vector< diatomics * >::iterator diatom_iter
long int ipHeavy[LIMELM][LIMELM]
double FFmtRead(const char *chCard, long int *ipnt, long int last, bool *lgEOL)