140 bitset<IS_TOP> Skip);
143inline int irsl2ind(vector<t_BadnellLevel>& level,
int irsl);
177 static bool lgFirstCall =
true;
185 bool lgTooBig =
false;
193 fprintf(
ioQQQ,
" This is the second or later calculation in a grid.\n");
194 fprintf(
ioQQQ,
" The number of zones has been increased beyond what it was on the first calculation.\n");
195 fprintf(
ioQQQ,
" This can\'t be done since space has already been allocated.\n");
196 fprintf(
ioQQQ,
" Have the first calculation do the largest number of zones so that an increase is not needed.\n");
197 fprintf(
ioQQQ,
" Sorry.\n");
289 for( ipZ=0; ipZ<
LIMELM;++ipZ )
298 for( ipZ=0; ipZ<
LIMELM;++ipZ )
304 for( ion=0; ion < (
LIMELM+1); ++ion )
317 for(
long ion=0; ion<nelem+1; ion++ )
319 long ipISO = nelem-ion;
372 fprintf(
ioQQQ,
" atmdat_readin reading level1.dat\n");
379 fprintf(
ioQQQ,
" atmdat_readin could not read first line of level1.dat.\n");
386 while(
read_whole_line( chLine , (
int)
sizeof(chLine) , ioDATA ) != NULL )
390 if( chLine[0] !=
'#')
407 if( fseek( ioDATA , 0 , SEEK_SET ) != 0 )
409 fprintf(
ioQQQ,
" atmdat_readin could not rewind level1.dat.\n");
416 fprintf(
ioQQQ,
" atmdat_readin could not read first line of level1.dat.\n");
421 nelem = (long)
FFmtRead(chLine,&i,
sizeof(chLine),&lgEOL);
422 nelec = (long)
FFmtRead(chLine,&i,
sizeof(chLine),&lgEOL);
423 ion = (long)
FFmtRead(chLine,&i,
sizeof(chLine),&lgEOL);
427 int nYr=12, nMonth=1, nDay=13;
428 if( ( nelem != nYr ) || ( nelec != nMonth ) || ( ion != nDay ) )
431 " atmdat_readin: the version of level1.dat is not the current version.\n" );
433 " Please obtain the current version from the Cloudy web site.\n" );
435 " I expected to find the number %i %i %i and got %2.2li %2.2li %2.2li instead.\n" ,
437 nelem , nelec , ion );
438 fprintf(
ioQQQ,
"Here is the line image:\n==%s==\n", chLine );
445 while(
read_whole_line( chLine , (
int)
sizeof(chLine) , ioDATA ) != NULL )
451 if( chLine[0] !=
'#')
459 strncpy( chS2 , chLine , 2);
477 " atmdat_readin could not identify chem symbol on this level 1line:\n");
478 fprintf(
ioQQQ,
"%s\n", chLine );
479 fprintf(
ioQQQ,
"looking for this string==%2s==\n",chS2 );
484 (*
TauLines[i].Hi()).nelem() = (int)ipZ;
488 (*
TauLines[i].Hi()).IonStg() = (int)
FFmtRead(chLine,&j,
sizeof(chLine),&lgEOL);
491 fprintf(
ioQQQ,
" There should have been a number on this level1 line 1. Sorry.\n" );
492 fprintf(
ioQQQ,
"string==%s==\n" ,chLine );
502 fprintf(
ioQQQ,
" There should have been a number on this level1 line 2. Sorry.\n" );
503 fprintf(
ioQQQ,
"string==%s==\n" ,chLine );
510 fprintf(
ioQQQ,
" There should have been a number on this level1 line 3. Sorry.\n" );
511 fprintf(
ioQQQ,
"string==%s==\n" ,chLine );
518 fprintf(
ioQQQ,
" There should have been a number on this level1 line 4. Sorry.\n" );
519 fprintf(
ioQQQ,
"string==%s==\n" ,chLine );
526 fprintf(
ioQQQ,
" There should have been a number on this level1 line 5. Sorry.\n" );
527 fprintf(
ioQQQ,
"string==%s==\n" ,chLine );
535 fprintf(
ioQQQ,
" There should have been a number on this level1 line 6. Sorry.\n" );
536 fprintf(
ioQQQ,
"string==%s==\n" ,chLine );
547 fprintf(
ioQQQ,
" There should have been a number on this level1 line 7. Sorry.\n" );
548 fprintf(
ioQQQ,
"string==%s==\n" ,chLine );
557 fprintf(
ioQQQ,
" There should have been a number on this level1 line 8. Sorry.\n" );
558 fprintf(
ioQQQ,
"string==%s==\n" ,chLine );
573 fprintf(
ioQQQ,
" reading level1.dat OK\n" );
609 fprintf(
ioQQQ,
" atmdat_readin reading level2.dat\n");
616 fprintf(
ioQQQ,
" level2.dat error getting magic number\n" );
622 nelem = (long)
FFmtRead(chLine,&i,
sizeof(chLine),&lgEOL);
623 nelec = (long)
FFmtRead(chLine,&i,
sizeof(chLine),&lgEOL);
624 ion = (long)
FFmtRead(chLine,&i,
sizeof(chLine),&lgEOL);
628 if( lgEOL || ( nelem != 9 ) || ( nelec != 11 ) || ( ion != 18 ) )
631 " atmdat_readin: the version of level2.dat is not the current version.\n" );
633 " I expected to find the number 09 11 18 and got %2.2li %2.2li %2.2li instead.\n" ,
634 nelem , nelec , ion );
635 fprintf(
ioQQQ,
"Here is the line image:\n==%s==\n", chLine );
636 fprintf(
ioQQQ,
"Please obtain the correct version.\n");
648 fprintf(
ioQQQ,
" level2.dat error getting line %li\n", i );
655 sscanf( chLine ,
"%lf %lf %lf %lf %lf %lf %lf " ,
665 (*
TauLine2[i].Hi()).nelem() = (int)tt[0];
666 (*
TauLine2[i].Hi()).IonStg() = (int)tt[1];
678 fprintf(
ioQQQ,
" level2.dat error getting last magic number\n" );
681 sscanf( chLine ,
"%ld" , &magic2 );
684 fprintf(
ioQQQ,
" level2.dat ends will wrong magic number=%ld \n",
690 fprintf(
ioQQQ,
" reading level2.dat OK\n");
702 const char* chElmSymLC[] =
703 {
"h",
"he",
"li",
"be",
"b",
"c",
"n",
"o",
"f",
"ne",
"na",
"mg",
"al",
"si",
"p",
704 "s",
"cl",
"ar",
"k",
"ca",
"sc",
"ti",
"v",
"cr",
"mn",
"fe",
"co",
"ni",
"cu",
"zn" };
708 for(
long nelem=0; nelem <
LIMELM; ++nelem )
709 for(
long ion=0; ion <= nelem; ++ion )
710 strcpy( chUTA_ref[nelem][ion] ,
"" );
715 for( nelem=ipISO; nelem <
LIMELM; ++nelem )
718 long ion = nelem - ipISO;
719 strcat( chUTA_ref[nelem][ion] ,
"B" );
727 oss <<
"UTA/nrb00_" << chElmSymLC[ipISO-1] <<
"_";
729 oss << chElmSymLC[nelem] << ion+1 <<
"ic1-2.dat";
738 oss <<
"UTA/nrb00_" << chElmSymLC[ipISO-1] <<
"_";
739 oss << chElmSymLC[nelem] << ion+1 <<
"ic1-3.dat";
751 oss2 <<
"UTA/nrb00_" << chElmSymLC[ipISO-1] <<
"_";
752 oss2 << chElmSymLC[nelem] << ion+1 <<
"ic2-3.dat";
759 const realnum StatWeightGroundLevelIron[] =
760 { 9.f, 10.f, 9.f, 6.f, 1.f, 4.f, 5.f, 4.f, 1.f, 4.f, 5.f, 4.f, 1.f,
761 2.f, 1.f, 2.f, 1.f, 4.f, 5.f, 4.f, 1.f, 2.f, 1.f, 2.f, 1.f, 2.f };
764 qList BlankStates(1);
775 fprintf(
ioQQQ,
" atmdat_readin reading UTA_Gu06.dat\n");
777 FILE *ioGU06 =
open_data(
"UTA/UTA_Gu06.dat",
"r" );
782 while(
read_whole_line( chLine , (
int)
sizeof(chLine) , ioGU06 ) != NULL )
786 if( chLine[0] !=
'#')
790 sscanf( chLine,
"%li %li %li", &nelem, &nelec, &ion );
794 if( nelem != 2007 || nelec != 1 || ion != 23 )
797 " atmdat_readin: the version of UTA_Gu06.dat is not the current version.\n" );
799 " I expected to find the number 2007 1 23 and got %li %li %li instead.\n" ,
800 nelem , nelec , ion );
801 fprintf(
ioQQQ,
"Here is the line image:\n==%s==\n", chLine );
805 int nelemGu =-1, ionGu=-1;
806 while(
read_whole_line( chLine, (
int)
sizeof(chLine), ioGU06 ) != NULL )
808 if( chLine[0] !=
'#' )
811 double WLAng, Aul, oscill, Aauto;
813 sscanf( chLine,
"%4li%5li%8lf%13lf%12lf",
814 &ion, &i2, &WLAng, &Aul, &Aauto );
815 sscanf( &chLine[54],
"%13lf", &oscill );
822 if( ipISO <= ipThres )
836 if(
ipIRON!=nelemGu || ion!=ionGu )
841 strcat( chUTA_ref[
ipIRON][ion-1] ,
"G" );
846 if(
strstr_s( chLine,
"(J=1/2)" ) != NULL )
848 else if(
strstr_s( chLine,
"(J=1)" ) != NULL )
850 else if(
strstr_s( chLine,
"(J=3/2)" ) != NULL )
852 else if(
strstr_s( chLine,
"(J=2)" ) != NULL )
854 else if(
strstr_s( chLine,
"(J=5/2)" ) != NULL )
856 else if(
strstr_s( chLine,
"(J=3)" ) != NULL )
858 else if(
strstr_s( chLine,
"(J=7/2)" ) != NULL )
860 else if(
strstr_s( chLine,
"(J=4)" ) != NULL )
862 else if(
strstr_s( chLine,
"(J=9/2)" ) != NULL )
864 else if(
strstr_s( chLine,
"(J=5)" ) != NULL )
866 else if(
strstr_s( chLine,
"(J=11/2)" ) != NULL )
877 double frac_ioniz = Aauto/(Aul + Aauto);
878 ASSERT( frac_ioniz >= 0. && frac_ioniz <= 1. );
908 fprintf(
ioQQQ,
" reading UTA_Gu06.dat OK\n" );
915 fprintf(
ioQQQ,
" atmdat_readin reading UTA_Behar.dat\n");
917 FILE *ioBEHAR =
open_data(
"UTA/UTA_Behar.dat",
"r" );
922 sscanf( chLine,
"%li %li %li", &nelem, &nelec, &ion );
926 if( nelem != 2002 || nelec != 10 || ion != 22 )
929 " atmdat_readin: the version of UTA_Behar.dat is not the current version.\n" );
931 " I expected to find the number 2002 10 22 and got %li %li %li instead.\n" ,
932 nelem , nelec , ion );
933 fprintf(
ioQQQ,
"Here is the line image:\n==%s==\n", chLine );
938 int nelemBehar=-1, ionBehar=-1;
939 while(
read_whole_line( chLine, (
int)
sizeof(chLine), ioBEHAR ) != NULL )
941 if( chLine[0] !=
'#' )
944 double f1, f2, oscill;
947 sscanf( chLine ,
"%li\t%li\t%li\t%lf\t%lf\t%lf\t%lf",
948 &i1,&i2,&i3,&f1,&f2,&frac_relax,&oscill );
959 if( ipISO <= ipThres )
973 if(
ipIRON!=nelemBehar || i1!=ionBehar )
978 strcat( chUTA_ref[
ipIRON][i1] ,
"b" );
1009 ASSERT( frac_relax >= 0.f && frac_relax <= 1.f );
1017 fprintf(
ioQQQ,
" reading UTA_Behar.dat OK\n" );
1025 fprintf(
ioQQQ,
" atmdat_readin reading UTA_Kisielius.dat\n");
1027 FILE *ioROMAS =
open_data(
"UTA/UTA_Kisielius.dat",
"r" );
1030 while(
read_whole_line( chLine , (
int)
sizeof(chLine) , ioROMAS ) != NULL )
1033 if( chLine[0] !=
'#')
1036 sscanf( chLine,
"%li %li %li", &nelem, &nelec, &ion );
1037 if( nelem != 11 || nelec != 8 || ion != 25 )
1040 " atmdat_readin: the version of UTA_Kisielius.dat is not the current version.\n" );
1042 " I expected to find the number 11 8 25 and got %li %li %li instead.\n" ,
1043 nelem , nelec , ion );
1044 fprintf(
ioQQQ,
"Here is the line image:\n==%s==\n", chLine );
1048 long int nRomasUsed = 0 , nRomasTotal = 0;
1049 int nelemRomas=-1 , ionRomas=-1;
1051 bool lgSaveRomasUsed =
false;
1052 if( lgSaveRomasUsed )
1054 if( (ioROMASused=fopen(
"RomasUsed.txt",
"w"))==NULL)
1056 fprintf(
ioQQQ,
"could not open RomasUsed.txt\n");
1060 while(
read_whole_line( chLine, (
int)
sizeof(chLine), ioROMAS ) != NULL )
1063 if( chLine[0] !=
'#' )
1065 long int i1, i2, i3;
1066 double f1, f2, oscill;
1070 sscanf( chLine,
"%li\t%li\t%li\t%lf\t%lf\t%lf\t%lf",
1071 &i1,&i2,&i3,&f1,&f2,&frac_relax,&oscill );
1079 if( lgSaveRomasUsed )
1080 fprintf(ioROMASused ,
"%s" , chLine);
1086 const bool lgAllowSplitFe14 =
false;
1087 if( lgAllowSplitFe14 || i2 == StatWeightGroundLevelIron[i1] )
1107 if( lgAllowSplitFe14 &&
fudge(-1) )
1109 if( i2 == StatWeightGroundLevelIron[i1] )
1116 if( i2 == StatWeightGroundLevelIron[i1] )
1122 if(
ipIRON!=nelemRomas || i1!=ionRomas )
1127 strcat( chUTA_ref[
ipIRON][i1] ,
"K" );
1138 if( i1==13 && f1>15.35 && f1<15.55)
1140 fprintf(
ioQQQ,
"DEBUG %li\t%.5f\t%.3e\n",i2, f1 , oscill * facpop);
1155 ASSERT( frac_relax >= 0.f && frac_relax <= 1.f );
1170 if( lgSaveRomasUsed )
1171 fclose( ioROMASused );
1174 fprintf(
ioQQQ,
" reading UTA_Kisielius.dat OK,used %li lines from a total of %li\n" , nRomasUsed , nRomasTotal );
1182 fprintf(
ioQQQ,
"\nUTA data sources; B=Badnell 05; G==Gu 06, b=Behar, K=2011 paper\n");
1183 fprintf(
ioQQQ,
" ion ");
1184 for(
long ion=0; ion<=
LIMELM; ++ion )
1185 fprintf(
ioQQQ,
"%4li",ion);
1186 fprintf(
ioQQQ,
"\n");
1187 for(
long nelem=0; nelem<
LIMELM; ++nelem )
1190 for(
long ion=0; ion<=nelem; ++ion )
1192 fprintf(
ioQQQ,
"%4s",chUTA_ref[nelem][ion] );
1194 fprintf(
ioQQQ,
"\n");
1196 fprintf(
ioQQQ,
" ion ");
1197 for(
long ion=0; ion<=
LIMELM; ++ion )
1198 fprintf(
ioQQQ,
"%4li",ion);
1199 fprintf(
ioQQQ,
"\n\n");
1204 for( i=0; i <
nUTA; ++i )
1205 dprintf(
ioQQQ,
"%5ld %s %2ld wavl %7.3f glo %2g gup %2g Aul %.2e gf %.2e ai branch %.3f\n",
1249 fprintf(
ioQQQ,
" atmdat_readin reading mewe_gbar.dat\n");
1251 ioDATA =
open_data(
"mewe_gbar.dat",
"r" );
1254 if(
read_whole_line( chLine , (
int)
sizeof(chLine) , ioDATA ) == NULL )
1256 fprintf(
ioQQQ,
" mewe_gbar.dat error getting magic number\n" );
1260 sscanf( chLine ,
"%ld" , &magic1 );
1261 if( magic1 != 9101 )
1263 fprintf(
ioQQQ,
" mewe_gbar.dat starts with wrong magic number=%ld \n",
1269 for( i=1; i < 210; i++ )
1271 if(
read_whole_line( chLine , (
int)
sizeof(chLine) , ioDATA ) == NULL )
1273 fprintf(
ioQQQ,
" mewe_gbar.dat error getting line %li\n", i );
1278 sscanf( chLine,
"%lf %lf %lf %lf ", &help[0], &help[1], &help[2], &help[3] );
1279 for(
int l=0; l < 4; ++l )
1284 if(
read_whole_line( chLine , (
int)
sizeof(chLine) , ioDATA ) == NULL )
1286 fprintf(
ioQQQ,
" mewe_gbar.dat error getting last magic number\n" );
1290 sscanf( chLine ,
"%ld" , &magic2 );
1292 if( magic1 != magic2 )
1294 fprintf(
ioQQQ,
" mewe_gbar.dat ends will wrong magic number=%ld \n",
1302 fprintf(
ioQQQ,
" reading mewe_gbar.dat OK \n");
1307 for( nelem=0; nelem <
LIMELM; nelem++ )
1308 for( ion=0; ion <
LIMELM; ion++ )
1315 for( nelem=2; nelem <
LIMELM; nelem++ )
1318 for( ion=0; ion <= nelem; ion++ )
1321 nelec = nelem - ion + 1;
1331 ASSERT( imax > 0 && imax <= 10 );
1357 for( ipZ=0; ipZ<
HS_NZ; ++ipZ )
1360 if( ipZ>1 && ipZ<5 )
continue;
1362 for( iCase=0; iCase<2; ++iCase )
1369 sprintf( chFilename,
"HS_e%ld%c.dat", ipZ+1, ( iCase == 0 ) ?
'a' :
'b' );
1372 fprintf(
ioQQQ,
" atmdat_readin reading Hummer Storey emission file %s\n",chFilename );
1378 i = fscanf( ioDATA,
"%li %li ",
1387 for( ipTemp=0; ipTemp <
atmdat.
ntemp[iCase][ipZ]; ipTemp++ )
1391 long int junk, junk2 , ne;
1392 i = fscanf( ioDATA,
" %lf %li %lf %c %li %ld ",
1399 for( j=0; j < ne; j++ )
1401 i = fscanf( ioDATA,
"%lf ",
1410 fprintf(
ioQQQ,
" reading %s OK\n", chFilename );
1418 fprintf(
ioQQQ,
"\n");
1419 for( ipTemp=0; ipTemp<
atmdat.
ntemp[iCase][ipZ]; ipTemp++ )
1423 fprintf(
ioQQQ,
"\n");
1457 const int ipNUM_FILES = 10;
1459 char chFileNames[ipNUM_FILES][10] = {
1478 for(
long in = 1; in<=25; in++ )
1483 for(
long il = 0; il<
MIN2(5,in); il++ )
1496 strcpy( chDirectory,
"sh98_he1\\pi\\" );
1498 strcpy( chDirectory,
"sh98_he1/pi/" );
1503 for(
long ipFile=0; ipFile<ipNUM_FILES; ipFile++ )
1505 long S, L, index,
N=0;
1508 strcpy( chPath, chDirectory );
1509 strcat( chPath, chFileNames[ipFile] );
1512 while(
read_whole_line( chLine , (
int)
sizeof(chLine) , ioDATA ) != NULL )
1519 i1 = (long)
FFmtRead( chLine, &i,
sizeof(chLine), &lgEOL );
1520 i2 = (long)
FFmtRead( chLine, &i,
sizeof(chLine), &lgEOL );
1521 i3 = (long)
FFmtRead( chLine, &i,
sizeof(chLine), &lgEOL );
1522 if( i1==0 && i2==0 && i3==0 )
1532 S = (long)
FFmtRead( chLine, &i,
sizeof(chLine), &lgEOL );
1533 L = (long)
FFmtRead( chLine, &i,
sizeof(chLine), &lgEOL );
1534 P = (long)
FFmtRead( chLine, &i,
sizeof(chLine), &lgEOL );
1535 index = (long)
FFmtRead( chLine, &i,
sizeof(chLine), &lgEOL );
1562 FFmtRead( chLine, &i,
sizeof(chLine), &lgEOL );
1563 numDataPoints = (long)
FFmtRead( chLine, &i,
sizeof(chLine), &lgEOL );
1599 char chFileName[23] =
"helike_pcs_topbase.dat";
1602 const int MaxN = 10;
1627 for(
long in = 1; in<=MaxN; in++ )
1633 for(
long il = 0; il<in; il++ )
1659 for(
long i=0; i<3; i++)
1661 if(
read_whole_line( chLine , (
int)
sizeof(chLine) , ioDATA ) == NULL )
1663 fprintf(
ioQQQ,
"PROBLEM corruption in TOPbase Helike pcs datafile.\nSorry\n" );
1668 while(
read_whole_line( chLine , (
int)
sizeof(chLine) , ioDATA ) != NULL )
1672 long i1, i2, i3, i4, i5, i7;
1675 i1 = (long)
FFmtRead( chLine, &i,
sizeof(chLine), &lgEOL );
1676 i2 = (long)
FFmtRead( chLine, &i,
sizeof(chLine), &lgEOL );
1677 i3 = (long)
FFmtRead( chLine, &i,
sizeof(chLine), &lgEOL );
1678 i4 = (long)
FFmtRead( chLine, &i,
sizeof(chLine), &lgEOL );
1679 i5 = (long)
FFmtRead( chLine, &i,
sizeof(chLine), &lgEOL );
1680 i6 = (double)
FFmtRead( chLine, &i,
sizeof(chLine), &lgEOL );
1681 i7 = (long)
FFmtRead( chLine, &i,
sizeof(chLine), &lgEOL );
1685 fprintf(
ioQQQ,
"PROBLEM corruption in TOPbase Helike pcs datafile.\nSorry\n" );
1690 if( i1==i2 && i1==i3 && i1==i4 && i1==i5 && i1==i7 && i1==-1 )
1695 ASSERT( i1>0 && i1==(last_i1 + 1) && i1<=795 );
1702 ASSERT( i4>=100 && i4<400 );
1707 l = (i4 - (2*s+1)*100)/10;
1711 ASSERT( i5>=1 && i5<=10 );
1733 for(
long k=0; k<i7; k++ )
1748 FFmtRead( chLine, &i,
sizeof(chLine), &lgEOL );
1767 for(
int ns=0; ns < 7; ns++ )
1770 for(
int nelec=0; nelec < 10; nelec++ )
1784 const char* chFilename;
1813 chFilename =
"mewe_nelectron.dat";
1816 fprintf(
ioQQQ,
" init_yield reading %s\n", chFilename );
1836 while( ch1 ==
'#' || ch1 ==
'*' )
1840 fprintf(
ioQQQ,
" %s error getting line %i\n", chFilename, ns );
1846 sscanf( chLine,
"%lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf",
1847 &temp[0], &temp[1], &temp[2], &temp[3], &temp[4],
1848 &temp[5], &temp[6], &temp[7], &temp[8], &temp[9],
1849 &temp[10],&temp[11],&temp[12],&temp[13],&temp[14] );
1855 for(
int j=0; j < 10; j++ )
1872 fprintf(
ioQQQ,
" Auger yields will be killed.\n");
1873 fprintf(
ioQQQ,
" reading %s OK\n", chFilename );
1878 chFilename =
"mewe_fluor.dat";
1881 fprintf(
ioQQQ,
" init_yield reading %s\n", chFilename );
1893 fprintf(
ioQQQ,
" %s error getting line %i\n", chFilename, 0 );
1897 while( chLine[0] ==
'#' );
1905 int nDima[NKM] = { 0, 1, 2, 2, 3, 4, 4, 5, 5, 6 };
1912 sscanf( chLine,
"%lf %lf %lf %lf %lf %lf %lf",
1913 &temp[0], &temp[1], &temp[2], &temp[3], &temp[4],
1914 &temp[5], &temp[6] );
1931 nAuger = (int)temp[3];
1956 while( chLine[0]==
'#' && !lgEOL );
1962 fprintf(
ioQQQ,
" reading %s OK\n", chFilename );
1970 bitset<IS_TOP> Skip)
1975 fprintf(
ioQQQ,
" ReadBadnellAIData reading %s\n", fnam.c_str() );
1981 getline( ioDATA, line );
1982 ASSERT( line.substr(0,4) ==
"SEQ=" );
1983 getline( ioDATA, line );
1984 getline( ioDATA, line );
1986 ASSERT( line.substr(3,21) ==
"PARENT LEVEL INDEXING" );
1988 istringstream iss( line.substr(65,4) );
1991 int nMulti = (nParent+5)/6;
1992 for(
int i=0; i < nParent+5; ++i )
1993 getline( ioDATA, line );
1996 ASSERT( line.substr(3,26) ==
"IC RESOLVED LEVEL INDEXING" );
1998 istringstream iss2( line.substr(63,6) );
2001 for(
int i=0; i < 3; ++i )
2002 getline( ioDATA, line );
2005 vector<t_BadnellLevel> level( nLevel );
2006 for(
int i=0; i < nLevel; ++i )
2008 getline( ioDATA, line );
2009 istringstream iss3( line );
2011 iss3 >> indx >> irsl;
2012 level[indx-1].irsl = irsl;
2013 level[indx-1].config = line.substr(16,20);
2014 istringstream iss4( line.substr(37,1) );
2015 iss4 >> level[indx-1].S;
2016 istringstream iss5( line.substr(39,1) );
2017 iss5 >> level[indx-1].L;
2018 istringstream iss6( line.substr(41,4) );
2021 level[indx-1].g =
nint(2.*J + 1.);
2022 istringstream iss7( line.substr(46,11) );
2023 iss7 >> level[indx-1].energy;
2026 level[indx-1].lgAutoIonizing = ( line[57] ==
'*' );
2027 if( level[indx-1].lgAutoIonizing )
2029 if( level[indx-1].config.find(
"1S1" ) != string::npos )
2031 else if( level[indx-1].config.find(
"2S1" ) != string::npos )
2033 else if( level[indx-1].config.find(
"2P5" ) != string::npos )
2040 level[indx-1].WhichShell =
IS_NONE;
2046 while( getline( ioDATA, line ) )
2048 if( line.find(
"IRSL IRSL" ) != string::npos )
2052 for(
int i=0; i < nMulti-1; ++i )
2053 getline( ioDATA, line );
2056 qList BlankStates(1);
2059 (*BlankLine).Junk();
2062 while( getline( ioDATA, line ) )
2065 if( line.size() < 10 )
2070 if( line.size() < 50 )
2076 int irsl_lo, irsl_hi, dum;
2077 double edif, Bij, Rji, Aai;
2078 istringstream iss8( line );
2085 iss8 >> irsl_lo >> irsl_hi >> dum >> dum >> edif >> Bij >> Rji >> Aai;
2087 int ind_lo =
irsl2ind( level, irsl_lo );
2088 int ind_hi =
irsl2ind( level, irsl_hi );
2089 ASSERT( level[ind_hi].lgAutoIonizing );
2091 for(
int i=0; i < nMulti-1; ++i )
2092 getline( ioDATA, line );
2095 if( ind_lo == 0 && !Skip[level[ind_hi].WhichShell] )
2101 (*UTA.
back().
Hi()).nelem() = nelem+1;
2102 (*UTA.
back().
Hi()).IonStg() = ion+1;
2114 double frac_ioniz = Aai/(Rji + Aai);
2115 ASSERT( frac_ioniz >= 0. && frac_ioniz <= 1. );
2139 getline( ioDATA, line );
2140 ASSERT( line.substr(3,7) ==
"NRSLMX=" );
2145 fprintf(
ioQQQ,
" reading %s OK\n", fnam.c_str() );
2155inline int irsl2ind(vector<t_BadnellLevel>& level,
int irsl)
2157 for(
unsigned int i=0; i < level.size(); ++i )
2159 if( level[i].irsl == irsl )
double ***** OP_Helike_Xsectn
double **** HS_He1_Xsectn
double **** HS_He1_Energy
long **** OP_Helike_NumPts
double ***** OP_Helike_Energy
void atmdat_outer_shell(long int iz, long int in, long int *imax, long int *ig0, long int *ig1)
#define NUM_HS98_DATA_POINTS
void atmdat_2phot_setSplineCoefs()
STATIC void ReadBadnellAIData(const string &fnam, long nelem, long ion, TransitionList &UTA, bitset< IS_TOP > Skip)
void InitTransition(const TransitionProxy &t)
int irsl2ind(vector< t_BadnellLevel > &level, int irsl)
STATIC void read_SH98_He1_cross_sections(void)
STATIC void read_Helike_cross_sections(void)
long ipNI_pumpDirect[NI_NDP]
void HyperfineCreate(void)
const int FILENAME_PATH_LENGTH_2
double fudge(long int ipnt)
int dprintf(FILE *fp, const char *format,...)
double FFmtRead(const char *chCard, long int *ipnt, long int last, bool *lgEOL)
const char * strstr_s(const char *haystack, const char *needle)
bool fp_equal(sys_float x, sys_float y, int n=3)
char * read_whole_line(char *chLine, int nChar, FILE *ioIN)
NORETURN void TotalInsanity(void)
#define DEBUG_ENTRY(funcname)
bool fp_equal_tol(sys_float x, sys_float y, sys_float tol)
realnum & AutoIonizFrac() const
realnum & dampXvel() const
void resize(size_t newsize)
void push_back(const TransitionProxy &tr)
void reserve(size_t newsize)
const TransitionProxy back(void)
void AddLine2Stack() const
realnum & EnergyWN() const
qList::iterator Lo() const
qList::iterator Hi() const
EmissionList::reference Emis() const
bool lgInnerShell_Kisielius
int nfl_ion_emit[MEWE_FLUOR]
long int n_elec_eject[30][30][7]
int nfl_nshell[MEWE_FLUOR]
int nfl_nLine[MEWE_FLUOR]
realnum fl_yield[MEWE_FLUOR]
realnum fl_energy[MEWE_FLUOR]
int nfl_nelem[MEWE_FLUOR]
realnum frac_elec_eject[30][30][7][10]
FILE * open_data(const char *fname, const char *mode, access_scheme scheme)
const ios_base::openmode mode_r
void DynaCreateArrays(void)
t_elementnames elementnames
t_iso_sp iso_sp[NISO][LIMELM]
double eina(double gf, double enercm, double gup)
double GetGF(double trans_prob, double enercm, double gup)
t_mole_global mole_global
UNUSED const double RYD_INF
UNUSED const double EVRYD
void database_readin(void)
long int nsShells[LIMELM][LIMELM]
double ElecTemp[2][HS_NZ][NHSDIM]
long int nDensity[2][HS_NZ]
double Emiss[2][HS_NZ][NHSDIM][NHSDIM][NLINEHS]
double Density[2][HS_NZ][NHSDIM]
char chElementSym[LIMELM][CHARS_ELEMENT_SYM]
realnum * pres_radiation_lines_curr
realnum * AccelTotalOutward
TransitionList UTALines("UTALines", &AnonStates)
TransitionList TauLine2("TauLine2", &AnonStates)
TransitionList TauLines("TauLines", &AnonStates)
vector< TransitionList > AllTransitions