50 const char chFile[] );
60 static int nCalled = 0;
77 fprintf(
ioQQQ,
" ContCreatePointers called, not evaluating.\n" );
83 fprintf(
ioQQQ,
" ContCreatePointers called first time.\n" );
97 for(
long nelem=0; nelem<
LIMELM; ++nelem )
101 for(
long ion=0; ion<
LIMELM; ++ion )
103 for(
long nshells=0; nshells<7; ++nshells )
105 for(
long j=0; j<3; ++j )
130 for(
long nelem=ipISO; nelem < 2; nelem++ )
143 for(
long ipLo=0; ipLo < ipHi; ipLo++ )
158 iso_sp[ipISO][nelem].fb[ipLo].ipIsoLevNIonCon);
163 if(
iso_sp[ipISO][nelem].trans(ipHi,ipLo).Emis().ipFine() > 0 )
175 ASSERT( fabs(anuCoarse - anuFine) / anuCoarse <
203 fprintf(
ioQQQ,
" insanity heii pointer fix contcreatepointers\n");
397 for(
long nelem=2; nelem<
LIMELM; ++nelem )
404 for(
long j=0; j<=nelem; ++j )
408 for(
long j=0; j<nelem; ++j )
416 for(
long nelem=0; nelem<
LIMELM; ++nelem )
420 for(
long ion=0; ion<nelem+1; ++ion )
468 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",
478 fprintf(
ioQQQ,
" ContCreatePointers: ipEnerGammaRay: %5ld IPPRpari produc%5ld\n",
481 fprintf(
ioQQQ,
" ContCreatePointers: H pointers;" );
482 for(
long i=0; i <= 6; i++ )
486 fprintf(
ioQQQ,
"\n" );
488 fprintf(
ioQQQ,
" ContCreatePointers: Oxy pnters;" );
490 for(
long i=1; i <= 8; i++ )
494 fprintf(
ioQQQ,
"\n" );
523 for(
long i=1; i <=
nLevel1; i++ )
545 else if(
TauLines[i].Emis().Aul() > 0. )
555 fprintf(
ioQQQ,
" level 1 line does not have valid gf or A\n" );
556 fprintf(
ioQQQ,
" This is ContCreatePointers\n" );
576 for (
int ipSpecies=0; ipSpecies <
nSpecies; ++ipSpecies)
579 em !=
dBaseTrans[ipSpecies].Emis().end(); ++em)
582 (*em).dampXvel() = (
realnum)(1./
583 dBaseStates[ipSpecies][em->Tran().ipHi()].lifetime()/em->Tran().EnergyWN()/
PI4);
584 (*em).damp() = -1000.0;
587 strncpy(chLab,(*(*em).Tran().Hi()).chLabel(),4);
590 static const double minAul = 1e-29;
591 if( (*em).Aul() > minAul )
593 (*em).Tran().ipCont() =
ipLineEnergy((*em).Tran().EnergyRyd(), chLab ,0);
594 (*em).ipFine() =
ipFineCont((*em).Tran().EnergyRyd() );
598 (*em).Tran().ipCont() = -1;
604 (*(*em).Tran().Lo()).g()));
611 (*diatom)->H2_ContPoint();
616 for(
long nelem=2; nelem <
LIMELM; nelem++ )
623 iso_sp[ipISO][nelem].
fb[0].ipIsoLevNIonCon =
632 for(
long ipLo=0; ipLo < ipHi; ipLo++ )
647 iso_sp[ipISO][nelem].fb[ipLo].ipIsoLevNIonCon);
659 for(
long nelem=ipISO; nelem <
LIMELM; nelem++ )
672 iso_sp[ipISO][nelem].
fb[ipLo].ipIsoLevNIonCon);
674 (*tr).Emis().ipFine() =
702 for(
long nelem=ipISO; nelem <
LIMELM; nelem++ )
708 for(
long ipLo=0; ipLo < ipHi; ipLo++ )
727 for(
long i=0; i<
nUTA; ++i )
831 for(
long nelem=ipISO; nelem<
LIMELM; ++nelem )
837 const int TwoS = (1+ipISO);
841 Aul = 8.226*pow((
double)(nelem+1.),6.);
849 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,
850 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,
851 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};
852 Aul = As2nuFrom1S[nelem-1];
857 iso_sp[ipISO][nelem].trans(TwoS,0),
866 for(
long nelem=ipISO; nelem<
LIMELM; ++nelem )
876 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,
877 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,
878 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};
881 As2nuFrom3S[nelem-1],
890 enum {DEBUG_LOC=
false};
895 0., 0.03738, 0.07506, 0.1124, 0.1498, 0.1875,
896 0.225, 0.263, 0.300, 0.3373, 0.375, 0.4127,
897 0.4500, 0.487, 0.525, 0.5625, 0.6002, 0.6376,
898 0.6749, 0.7126, 0.75};
906 for(
long i=0; i < nCRS; i++ )
908 fprintf(
ioQQQ,
"%.3e\t%.3e\n", ener[i] ,
914 for(
long i=0; i < limit; i++ )
917 fprintf(
ioQQQ,
"%.3e\t%.3e\t%.3e\n",
921 xnew += tnu.
As2nu[i];
923 fprintf(
ioQQQ,
" sum is %.3e\n", xnew );
929 enum {DEBUG_LOC=
false};
932 for(
long i=0; i<11; ++i )
935 (*TauDummy).WLAng() = (
realnum)(
PI * pow(10.,(
double)i));
937 fprintf(
ioQQQ,
"%.2f\t%s\n", (*TauDummy).WLAng() , chLsav );
946 fprintf(
ioQQQ,
" WL(Ang) E(RYD) IP gl gu gf A damp abs K\n" );
947 for(
long i=1; i <=
nLevel1; i++ )
950 long iWL_Ang = (long)
TauLines[i].WLAng();
951 if( iWL_Ang > 1000000 )
955 else if( iWL_Ang > 10000 )
960 fprintf(
ioQQQ,
" %10.10s%5ld%10.3e %4li%4ld%4ld%10.2e%10.2e%10.2e%10.2e\n",
969 for (
int ipSpecies=0; ipSpecies <
nSpecies; ++ipSpecies)
972 em !=
dBaseTrans[ipSpecies].Emis().end(); ++em)
976 long iWL_Ang = (long)(*em).Tran().WLAng();
978 if( iWL_Ang > 1000000 )
982 else if( iWL_Ang > 10000 )
986 fprintf(
ioQQQ,
" %10.10s%5ld%10.3e %4li%4ld%4ld%10.2e%10.2e%10.2e%10.2e\n",
987 chLab, iWL_Ang,
RYDLAM/(*em).Tran().WLAng(),
988 (*em).Tran().ipCont(), (
long)((*(*em).Tran().Lo()).g()),
989 (
long)((*(*em).Tran().Hi()).g()),(*em).gf(),
990 (*em).Aul(),(*em).dampXvel(),
999 long iWL_Ang = (long)
TauLine2[i].WLAng();
1001 if( iWL_Ang > 1000000 )
1005 else if( iWL_Ang > 10000 )
1009 fprintf(
ioQQQ,
" %10.10s%5ld%10.3e %4li%4ld%4ld%10.2e%10.2e%10.2e%10.2e\n",
1020 long iWL_Ang = (long)
HFLines[i].WLAng();
1022 if( iWL_Ang > 1000000 )
1026 else if( iWL_Ang > 10000 )
1030 fprintf(
ioQQQ,
" %10.10s%5ld%10.3e %4li%4ld%4ld%10.2e%10.2e%10.2e%10.2e\n",
1035 HFLines[i].Emis().opacity() );
1042 for(
long i=1; i <=
nLevel1; i++ )
1044 if(
TauLines[i].EnergyWN() < 10000. )
1051 for (
int ipSpecies=0; ipSpecies <
nSpecies; ++ipSpecies)
1054 em !=
dBaseTrans[ipSpecies].Emis().end(); ++em)
1056 if((*em).Tran().EnergyWN() < 10000. )
1058 (*em).opacity() = 0.;
1100 if( fabs( Elo/exact - 1. ) < 0.001 )
1138 double thresh=-DBL_MAX;
1154 for( ion=0; ion < nelem; ion++ )
1164 long int ipISO = nelem-ion;
1174 for( nshell=0; nshell < imax; nshell++ )
1204 LimitSh(ion+1, nshell+1,nelem+1);
1209 ASSERT( imax > 0 && imax <= 7 );
1265 for( ion=0; ion < (nelem+1); ion++ )
1267 fprintf(
ioQQQ,
"Ion:%3ld%3ld %2.2s%2.2s total shells:%3ld\n",
1272 fprintf(
ioQQQ,
" shell%3ld %2.2s range eV%10.2e-%8.2e\n",
1299 else if( nshell == 2 )
1307 else if( nshell == 3 )
1315 else if( nshell == 4 )
1323 else if( nshell == 5 )
1331 else if( nshell == 6 )
1339 else if( nshell == 7 )
1360 fprintf(
ioQQQ,
" LimitSh cannot handle nshell as large as%4ld\n",
1364 return( LimitSh_v );
1372 const char chFile[] )
1375 const char* chFilename;
1396 chFilename = ( strlen(chFile) == 0 ) ?
"continuum_bands.ini" : chFile;
1401 fprintf(
ioQQQ,
" ContBandsCreate opening %s:", chFilename );
1410 if(
read_whole_line( chLine , (
int)
sizeof(chLine) , ioDATA ) == NULL )
1412 fprintf(
ioQQQ,
" ContBandsCreate could not read first line of %s.\n", chFilename );
1415 while(
read_whole_line( chLine , (
int)
sizeof(chLine) , ioDATA ) != NULL )
1419 if( chLine[0] !=
'#')
1424 if( fseek( ioDATA , 0 , SEEK_SET ) != 0 )
1426 fprintf(
ioQQQ,
" ContBandsCreate could not rewind %s.\n", chFilename );
1445 if(
read_whole_line( chLine , (
int)
sizeof(chLine) , ioDATA ) == NULL )
1447 fprintf(
ioQQQ,
" ContBandsCreate could not read first line of %s.\n", chFilename );
1453 long int m1 , m2 , m3,
1455 myr = 11, mmo = 9, mdy = 10;
1458 m1 = (long)
FFmtRead(chLine,&i,
sizeof(chLine),&lgEOL);
1459 m2 = (long)
FFmtRead(chLine,&i,
sizeof(chLine),&lgEOL);
1460 m3 = (long)
FFmtRead(chLine,&i,
sizeof(chLine),&lgEOL);
1461 if( ( m1 != myr ) ||
1466 " ContBandsCreate: the version of the data file %s I found (%li %li %li)is not the current version (%li %li %li).\n",
1471 " ContBandsCreate: you need to update this file.\n");
1478 while(
read_whole_line( chLine , (
int)
sizeof(chLine) , ioDATA ) != NULL )
1482 if( chLine[0] !=
'#')
1502 double xHi =
FFmtRead(chLine,&i,
sizeof(chLine),&lgEOL)*1e4;
1503 double xLow =
FFmtRead(chLine,&i,
sizeof(chLine),&lgEOL)*1e4;
1506 fprintf(
ioQQQ,
" There should have been 3 numbers on this band line. Sorry.\n" );
1507 fprintf(
ioQQQ,
" string==%s==\n" ,chLine );
1512 enum {DEBUG_LOC=
false};
1515 fprintf(
ioQQQ,
"READ:%s\n", chLine );
1524 fprintf(
ioQQQ,
" ContBandWavelength band %li "
1525 "edges are in improper order.\n" ,k);
1526 fprintf(
ioQQQ,
"band: %s %.3e %.3e %.3e \n",
1539 fprintf(
ioQQQ,
" ContBandWavelength band %li central "
1540 "wavelength not within band.\n" ,k);
1541 fprintf(
ioQQQ,
"band: %s %.3e %li %li \n",
1576 fprintf(
ioQQQ,
" ContCreatePointer trace bands\n");
1578 " band %ld label %s low wl= %.3e low ipnt= %li "
1579 " hi wl= %.3e hi ipnt= %li \n",
1594 fprintf(
ioQQQ,
" & ");
1596 fprintf(
ioQQQ,
" -- ");
1598 fprintf(
ioQQQ,
"\\\\ \n");
1609 fprintf(
ioQQQ,
" ContBandWavelength band %li has non-positive entry.\n",i );
double atmdat_2phot_shapefunction(double EbyE2nu, long ipISO, long nelem)
const int FILENAME_PATH_LENGTH_2
double FFmtRead(const char *chCard, long int *ipnt, long int last, bool *lgEOL)
char * read_whole_line(char *chLine, int nChar, FILE *ioIN)
#define DEBUG_ENTRY(funcname)
long int & ipFine() const
static t_fe2ovr_la & Inst()
EmissionList::reference Emis() const
realnum ph1(int i, int j, int k, int l) const
TransitionProxy trans(const long ipHi, const long ipLo)
vector< two_photon > TwoNu
long int nLyman_malloc[NISO]
void set_ipoint(long n, long val)
int ion_emit(long n) const
STATIC void fiddle(long int ipnt, double exact)
STATIC void ipShells(long int nelem)
STATIC long LimitSh(long int ion, long int nshell, long int nelem)
STATIC void ContBandsCreate(const char chFile[])
void ContCreatePointers(void)
long ipFineCont(double energy_ryd)
long ipoint(double energy_ryd)
long ipLineEnergy(double energy, const char *chLabel, long ipIonEnergy)
long ipContEnergy(double energy, const char *chLabel)
FILE * open_data(const char *fname, const char *mode, access_scheme scheme)
t_elementnames elementnames
vector< diatomics * > diatoms
vector< diatomics * >::iterator diatom_iter
t_iso_sp iso_sp[NISO][LIMELM]
double eina(double gf, double enercm, double gup)
double abscf(double gf, double enercm, double gl)
double GetGF(double trans_prob, double enercm, double gup)
UNUSED const double SPEEDLIGHT
UNUSED const double ELECTRON_MASS
UNUSED const double EN1RYD
UNUSED const double EVRYD
UNUSED const double RYDLAM
void prt_wl(FILE *ioOUT, realnum wl)
t_secondaries secondaries
long int ipLyHeavy[LIMELM][LIMELM-1]
long int nsShells[LIMELM][LIMELM]
long int ipBalHeavy[LIMELM][LIMELM-1]
double Valence_IP_Ryd[LIMELM][LIMELM]
realnum xLyaHeavy[LIMELM][LIMELM]
long int ipHeavy[LIMELM][LIMELM]
realnum * BandEdgeCorrLow
realnum * ContBandWavelength
char chIonStage[LIMELM+1][CHARS_ION_STAGE]
char chElementSym[LIMELM][CHARS_ELEMENT_SYM]
long int ipElement[LIMELM][LIMELM][7][3]
vector< vector< TransitionList > > SatelliteLines
vector< qList > dBaseStates
vector< vector< TransitionList > > ExtraLymanLines
TransitionList UTALines("UTALines", &AnonStates)
TransitionList TauLine2("TauLine2", &AnonStates)
vector< TransitionList > dBaseTrans
TransitionProxy::iterator TauDummy
TransitionList HFLines("HFLines", &AnonStates)
multi_arr< int, 3 > ipSatelliteLines
multi_arr< int, 3 > ipExtraLymanLines
TransitionList TauLines("TauLines", &AnonStates)
void checkTransitionListOfLists(vector< TransitionList > &list)
vector< TransitionList > AllTransitions
void chIonLbl(char *chIonLbl_v, const TransitionProxy &t)
char * chLineLbl(const TransitionProxy &t)
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)