51 const char chFile[] );
54 #define TwoS (1+ipISO)
76 static int nCalled = 0;
92 fprintf(
ioQQQ,
" ContCreatePointers called, not evaluating.\n" );
98 fprintf(
ioQQQ,
" ContCreatePointers called first time.\n" );
112 for( nelem=0; nelem<
LIMELM; ++nelem )
116 for( ion=0; ion<
LIMELM; ++ion )
118 for( nshells=0; nshells<7; ++nshells )
145 for( nelem=ipISO; nelem < 2; nelem++ )
158 for( ipLo=0; ipLo < ipHi; ipLo++ )
174 Transitions[ipISO][nelem][ipHi][ipLo].Emis->ipFine =
178 if(
Transitions[ipISO][nelem][ipHi][ipLo].Emis->ipFine > 0 )
190 ASSERT( fabs(anuCoarse - anuFine) / anuCoarse <
217 fprintf(
ioQQQ,
" insanity heii pointer fix contcreatepointers\n");
416 for( nelem=2; nelem<
LIMELM; ++nelem )
423 for( j=0; j<=nelem; ++j )
427 for( j=0; j<nelem; ++j )
435 for( nelem=0; nelem<
LIMELM; ++nelem )
439 for( ion=0; ion<nelem+1; ++ion )
487 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",
497 fprintf(
ioQQQ,
" ContCreatePointers: ipEnerGammaRay: %5ld IPPRpari produc%5ld\n",
500 fprintf(
ioQQQ,
" ContCreatePointers: H pointers;" );
501 for( i=0; i <= 6; i++ )
505 fprintf(
ioQQQ,
"\n" );
507 fprintf(
ioQQQ,
" ContCreatePointers: Oxy pnters;" );
509 for( i=1; i <= 8; i++ )
513 fprintf(
ioQQQ,
"\n" );
563 else if(
TauLines[i].Emis->Aul > 0. )
573 fprintf(
ioQQQ,
" level 1 line does not have valid gf or A\n" );
574 fprintf(
ioQQQ,
" This is ContCreatePointers\n" );
610 strncpy(chLab,
atmolEmis[i].tran->Hi->chLabel,4);
635 for( nelem=2; nelem <
LIMELM; nelem++ )
653 for( ipLo=0; ipLo < ipHi; ipLo++ )
669 Transitions[ipISO][nelem][ipHi][ipLo].Emis->ipFine =
680 for( nelem=ipISO; nelem <
LIMELM; nelem++ )
686 for( ipHi=2; ipHi <
iso.
nLyman[ipISO]; ipHi++ )
720 for( nelem=ipISO; nelem <
LIMELM; nelem++ )
736 for( nelem=ipISO; nelem <
LIMELM; nelem++ )
746 for( ipLo=0; ipLo < ipHi; ipLo++ )
748 if(
Transitions[ipISO][nelem][ipHi][ipLo].ipCont <= 0 )
755 Transitions[ipISO][nelem][ipHi][ipLo].Emis->ipFine = -1;
808 fprintf(
ioQQQ,
" 12CO line does not have valid gf or A\n" );
809 fprintf(
ioQQQ,
" This is ContCreatePointers\n" );
830 fprintf(
ioQQQ,
" 13CO line does not have valid gf or A\n" );
831 fprintf(
ioQQQ,
" This is ContCreatePointers\n" );
857 for( i=0; i<
nUTA; ++i )
996 for( nelem=ipISO; nelem<
LIMELM; ++nelem )
1027 for( nelem=ipISO; nelem<
LIMELM; ++nelem )
1033 double SumShapeFunction = 0., Renorm= 0.;
1057 double ShapeFunction;
1062 SumShapeFunction += ShapeFunction;
1071 Renorm = 1./SumShapeFunction;
1079 ASSERT( fabs( SumShapeFunction*Renorm - 1. ) < 0.00001 );
1086 enum {DEBUG_LOC=
false};
1090 double limit,ener[
NCRS]={
1091 0., 0.03738, 0.07506, 0.1124, 0.1498, 0.1875,
1092 0.225, 0.263, 0.300, 0.3373, 0.375, 0.4127,
1093 0.4500, 0.487, 0.525, 0.5625, 0.6002, 0.6376,
1094 0.6749, 0.7126, 0.75};
1101 for( i=0; i <
NCRS; i++ )
1103 fprintf(
ioQQQ,
"%.3e\t%.3e\n", ener[i] ,
1109 for( i=0; i < limit; i++ )
1112 fprintf(
ioQQQ,
"%.3e\t%.3e\t%.3e\n",
1116 xnew +=
iso.
As2nu[ipISO][nelem][i];
1118 fprintf(
ioQQQ,
" sum is %.3e\n", xnew );
1125 enum {DEBUG_LOC=
false};
1128 for( i=0; i<11; ++i )
1142 fprintf(
ioQQQ,
" WL(Ang) E(RYD) IP gl gu gf A damp abs K\n" );
1147 if( iWL_Ang > 1000000 )
1151 else if( iWL_Ang > 10000 )
1156 fprintf(
ioQQQ,
" %10.10s%5ld%10.3e %4li%4ld%4ld%10.2e%10.2e%10.2e%10.2e\n",
1169 iWL_Ang = (long)
atmolEmis[i].tran->WLAng;
1171 if( iWL_Ang > 1000000 )
1175 else if( iWL_Ang > 10000 )
1179 fprintf(
ioQQQ,
" %10.10s%5ld%10.3e %4li%4ld%4ld%10.2e%10.2e%10.2e%10.2e\n",
1194 if( iWL_Ang > 1000000 )
1198 else if( iWL_Ang > 10000 )
1202 fprintf(
ioQQQ,
" %10.10s%5ld%10.3e %4li%4ld%4ld%10.2e%10.2e%10.2e%10.2e\n",
1217 if( iWL_Ang > 1000000 )
1221 else if( iWL_Ang > 10000 )
1225 fprintf(
ioQQQ,
" %10.10s%5ld%10.3e %4li%4ld%4ld%10.2e%10.2e%10.2e%10.2e\n",
1239 if( iWL_Ang > 1000000 )
1243 else if( iWL_Ang > 10000 )
1247 fprintf(
ioQQQ,
" %10.10s%5ld%10.3e %4li%4ld%4ld%10.2e%10.2e%10.2e%10.2e\n",
1258 iWL_Ang = (long)
HFLines[i].WLAng;
1260 if( iWL_Ang > 1000000 )
1264 else if( iWL_Ang > 10000 )
1268 fprintf(
ioQQQ,
" %10.10s%5ld%10.3e %4li%4ld%4ld%10.2e%10.2e%10.2e%10.2e\n",
1282 if(
TauLines[i].EnergyWN < 10000. )
1291 if(
atmolEmis[i].tran->EnergyWN < 10000. )
1332 if( fabs( Elo/exact - 1. ) < 0.001 )
1370 double thresh=-DBL_MAX;
1386 for( ion=0; ion < nelem; ion++ )
1396 long int ipISO = nelem-ion;
1406 for( nshell=0; nshell < imax; nshell++ )
1436 LimitSh(ion+1, nshell+1,nelem+1);
1441 ASSERT( imax > 0 && imax <= 7 );
1497 for( ion=0; ion < (nelem+1); ion++ )
1499 fprintf(
ioQQQ,
"Ion:%3ld%3ld %2.2s%2.2s total shells:%3ld\n",
1504 fprintf(
ioQQQ,
" shell%3ld %2.2s range eV%10.2e-%8.2e\n",
1531 else if( nshell == 2 )
1539 else if( nshell == 3 )
1547 else if( nshell == 4 )
1555 else if( nshell == 5 )
1563 else if( nshell == 6 )
1571 else if( nshell == 7 )
1592 fprintf(
ioQQQ,
" LimitSh cannot handle nshell as large as%4ld\n",
1596 return( LimitSh_v );
1604 const char chFile[] )
1607 const char* chFilename;
1628 chFilename = ( strlen(chFile) == 0 ) ?
"bands_continuum.dat" : chFile;
1633 fprintf(
ioQQQ,
" ContBandsCreate opening %s:", chFilename );
1642 if(
read_whole_line( chLine , (
int)
sizeof(chLine) , ioDATA ) == NULL )
1644 fprintf(
ioQQQ,
" ContBandsCreate could not read first line of %s.\n", chFilename );
1647 while(
read_whole_line( chLine , (
int)
sizeof(chLine) , ioDATA ) != NULL )
1651 if( chLine[0] !=
'#')
1656 if( fseek( ioDATA , 0 , SEEK_SET ) != 0 )
1658 fprintf(
ioQQQ,
" ContBandsCreate could not rewind %s.\n", chFilename );
1675 if(
read_whole_line( chLine , (
int)
sizeof(chLine) , ioDATA ) == NULL )
1677 fprintf(
ioQQQ,
" ContBandsCreate could not read first line of %s.\n", chFilename );
1684 long int m1 , m2 , m3,
1692 if( ( m1 != myr ) ||
1697 " ContBandsCreate: the version of the data file %s I found (%li %li %li)is not the current version (%li %li %li).\n",
1702 " ContBandsCreate: you need to update this file.\n");
1709 while(
read_whole_line( chLine , (
int)
sizeof(chLine) , ioDATA ) != NULL )
1713 if( chLine[0] !=
'#')
1737 fprintf(
ioQQQ,
" There should have been 3 numbers on this band line. Sorry.\n" );
1738 fprintf(
ioQQQ,
" string==%s==\n" ,chLine );
1745 fprintf(
ioQQQ,
" ContBandWavelength band %li has improper bounds.\n" ,i);
1762 fprintf(
ioQQQ,
" ContCreatePointer trace bands\n");
1764 " band %ld label %s low wl= %.3e low ipnt= %li "
1765 " hi wl= %.3e hi ipnt= %li \n",
1790 fprintf(
ioQQQ,
" ContBandWavelength band %li has non-positive entry.\n",i );