48 #if defined(PRINT_DR) || defined(PRINT_RR)
49 static const char FILE_NAME_OUT[] =
"array.out";
59 long int atomic_number,
61 long int ionic_charge,
69 const double mu = 0.000;
70 const double w = 5.64586;
71 const double x_a0 = 10.1821;
77 const double c = 10.0;
79 double s, snew, x_a, E_c;
81 long int iso_sequence, N_1, N_2;
86 iso_sequence = atomic_number - ionic_charge;
87 ASSERT( iso_sequence >= 0 );
95 realnum ionchar = ionic_charge / 10. ;
100 if( (iso_sequence >= 1) && (iso_sequence <= 2) )
105 else if( (iso_sequence >= 3) && (iso_sequence <= 10) )
110 else if( (iso_sequence >= 11) && (iso_sequence <= 18) )
115 else if( (iso_sequence >= 19) && (iso_sequence <= 36) )
120 else if( (iso_sequence >= 37) && (iso_sequence <= 54) )
125 else if( (iso_sequence >= 55) && (iso_sequence <= 86) )
130 else if( iso_sequence >= 87 )
143 A_N = 12.0 + 10.0 * N_1 + (10.0 * N_1 - 2.0 * N_2) * (iso_sequence - N_1) / (N_1 - N_2);
152 if( iso_sequence == 1 )
157 else if( iso_sequence == 2 )
162 else if( iso_sequence == 3 )
164 E_c = 1.96274 + ionchar*(20.30014 + ionchar*(-0.97103 + ionchar*( 0.85453 + ionchar*( 0.13547 + 0.02401*ionchar))));
167 else if( iso_sequence == 4 )
169 E_c = 5.78908 + ionchar*(34.08270 + ionchar*( 1.51729 + ionchar*(-1.21227 + ionchar*( 0.77559 - 0.00410*ionchar))));
172 else if( iso_sequence == 5 )
177 else if( iso_sequence == 7 )
179 E_c = 11.37092 + ionchar*(36.22053 + ionchar*( 7.08448 + ionchar*(-5.16840 + ionchar*( 2.45056 - 0.16961*ionchar))));
181 else if( iso_sequence == 11 )
183 E_c = 2.24809 + ionchar*(22.27768 + ionchar*(-1.12285 + ionchar*( 0.90267 + ionchar*(-0.03860 + 0.01468*ionchar))));
185 else if( iso_sequence == 12 )
187 E_c = 2.74508 + ionchar*(19.18623 + ionchar*(-0.54317 + ionchar*( 0.78685 + ionchar*(-0.04249 + 0.01357*ionchar))));
189 else if( iso_sequence == 15 )
191 E_c = 1.42762 + ionchar*( 3.90778 + ionchar*( 0.73119 + ionchar*(-1.91404 + ionchar*( 1.05059 - 0.08992*ionchar))));
201 q_0 = 1.0 / sqrt((
double)ionic_charge);
202 q_0 = A_N * q_0 * (1.0 - 0.816497 * q_0);
206 T_0 = 50000.0 * pow( q_0, 2. );
209 x_a = x_a0 + log10( pow( ((
double)ionic_charge/q_0), 7. ) * sqrt( T/T_0 ) );
219 s = ( mu/( 1. + pow((eden-x_a)/w, 2.) ) +
220 (1. - mu) * exp( -
LN_TWO * pow((eden-x_a)/w, 2.) ) );
229 snew = 1. + (s-1.)*exp(-(E_c*
EVDEGK)/(c*T));
231 ASSERT( snew >= 0. && snew <= 1. );
250 int nAtomicNumberCScale,
252 int n_core_e_before_recomb )
255 double RateCoefficient, sum;
259 ASSERT( nAtomicNumberCScale>=0 && nAtomicNumberCScale<
LIMELM );
261 if( nAtomicNumberCScale==
ipIRON && n_core_e_before_recomb>=12 &&
262 n_core_e_before_recomb<=18 )
273 {5.636e-4, 7.390e-3, 3.635e-2, 1.693e-1, 3.315e-2, 2.288e-1, 7.316e-2, 0.},
274 {1.090e-3, 7.801e-3, 1.132e-2, 4.740e-2, 1.990e-1, 3.379e-2, 1.140e-1, 1.250e-1},
275 {3.266e-3, 7.637e-3, 1.005e-2, 2.527e-2, 6.389e-2, 1.564e-1, 0., 0.},
276 {1.074e-3, 6.080e-3, 1.887e-2, 2.540e-2, 7.580e-2, 2.773e-1, 0., 0.},
277 {9.073e-4, 3.777e-3, 1.027e-2, 3.321e-2, 8.529e-2, 2.778e-1, 0., 0.},
278 {5.335e-4, 1.827e-3, 4.851e-3, 2.710e-2, 8.226e-2, 3.147e-1, 0., 0.},
279 {7.421e-4, 2.526e-3, 4.605e-3, 1.489e-2, 5.891e-2, 2.318e-1, 0., 0.}
285 {3.628e3, 2.432e4, 1.226e5, 4.351e5, 1.411e6, 6.589e6, 1.030e7, 0},
286 {1.246e3, 1.063e4, 4.719e4, 1.952e5, 5.637e5, 2.248e6, 7.202e6, 3.999e9},
287 {1.242e3, 1.001e4, 4.466e4, 1.497e5, 3.919e5, 6.853e5, 0. , 0.},
288 {1.387e3, 1.048e4, 3.955e4, 1.461e5, 4.010e5, 7.208e5, 0. , 0.},
289 {1.525e3, 1.071e4, 4.033e4, 1.564e5, 4.196e5, 7.580e5, 0. , 0.},
290 {2.032e3, 1.018e4, 4.638e4, 1.698e5, 4.499e5, 7.880e5, 0. , 0.},
291 {3.468e3, 1.353e4, 3.690e4, 1.957e5, 4.630e5, 8.202e5, 0. , 0.}
294 long int nion = n_core_e_before_recomb - 12;
295 ASSERT( nion>=0 && nion <=6 );
302 sum += (cFe_q[nion][i] *
sexp( EFe_q[nion][i]/
phycon.
te));
307 strcpy(
chDRDataSource[nAtomicNumberCScale][nAtomicNumberCScale-n_core_e_before_recomb] ,
310 return RateCoefficient;
314 else if( nAtomicNumberCScale < n_core_e_before_recomb )
316 RateCoefficient = -2;
319 else if( nAtomicNumberCScale >=
LIMELM )
321 RateCoefficient = -2;
326 RateCoefficient = -1;
334 for(i=0; i<
nDRFitPar[nAtomicNumberCScale][n_core_e_before_recomb]; ++i )
336 sum += (
DRFitParPart1[nAtomicNumberCScale][n_core_e_before_recomb][i] *
340 strcpy(
chDRDataSource[nAtomicNumberCScale][nAtomicNumberCScale-n_core_e_before_recomb] ,
349 RateCoefficient = -99;
352 ASSERT( RateCoefficient < 1e-6 );
354 return RateCoefficient;
363 int nAtomicNumberCScale,
365 int n_core_e_before_recomb )
367 double RateCoefficient;
372 ASSERT( nAtomicNumberCScale>=0 && nAtomicNumberCScale<
LIMELM );
374 if( nAtomicNumberCScale==
ipIRON &&
375 n_core_e_before_recomb>=12 && n_core_e_before_recomb<=18 )
384 double parFeq[7][6] ={
385 {1.179e-9 , 0.7096, 4.508e2, 3.393e7, 0.0154, 3.977e6},
386 {1.050e-9 , 0.6939, 4.568e2, 3.987e7, 0.0066, 5.451e5},
387 {9.832e-10, 0.7146, 3.597e2, 3.808e7, 0.0045, 3.952e5},
388 {8.303e-10, 0.7156, 3.531e2, 3.554e7, 0.0132, 2.951e5},
389 {1.052e-9 , 0.7370, 1.639e2, 2.924e7, 0.0224, 4.291e5},
390 {1.338e-9 , 0.7495, 7.242e1, 2.453e7, 0.0404, 4.199e5},
391 {1.263e-9 , 0.7532, 5.209e1, 2.169e7, 0.0421, 2.917e5}
396 long int nion = n_core_e_before_recomb - 12;
397 ASSERT( nion>=0 && nion <=6 );
400 B = parFeq[nion][1] + parFeq[nion][4]*exp(temp);
401 D = sqrt(
phycon.
te/parFeq[nion][2]);
402 F = sqrt(
phycon.
te/parFeq[nion][3]);
403 RateCoefficient = parFeq[nion][0]/(D*pow((1.+D),(1.-B))*pow((1.+F),(1.+B)));
404 strcpy(
chRRDataSource[nAtomicNumberCScale][nAtomicNumberCScale-n_core_e_before_recomb] ,
"Bad06");
406 return RateCoefficient;
410 else if( nAtomicNumberCScale < n_core_e_before_recomb )
412 RateCoefficient = -2;
415 else if( nAtomicNumberCScale >=
LIMELM )
417 RateCoefficient = -2;
422 RateCoefficient = -1;
433 B =
RRFitPar[nAtomicNumberCScale][n_core_e_before_recomb][1] +
434 RRFitPar[nAtomicNumberCScale][n_core_e_before_recomb][4]*exp(temp);
435 D = sqrt(
phycon.
te/
RRFitPar[nAtomicNumberCScale][n_core_e_before_recomb][2]);
436 F = sqrt(
phycon.
te/
RRFitPar[nAtomicNumberCScale][n_core_e_before_recomb][3]);
437 RateCoefficient =
RRFitPar[nAtomicNumberCScale][n_core_e_before_recomb][0]/(D*pow((1.+D),(1.-B))*pow((1.+F),(1.+B)));
438 strcpy(
chRRDataSource[nAtomicNumberCScale][nAtomicNumberCScale-n_core_e_before_recomb] ,
"Bad06");
443 RateCoefficient = -99;
445 return RateCoefficient;
458 int NuclearCharge=-1, NumberElectrons=-1;
461 int M_state, W_state;
463 const int NBLOCK = 2;
464 int data_begin_line[NBLOCK];
467 const char* chFilename;
471 const int BIGGEST_INDEX_TO_USE = 103;
474 long TheirIndexToOurIndex[BIGGEST_INDEX_TO_USE];
479 long INDX=0,INDP=0,
N=0,
S=0,L=0,J=0,maxINDX=0,loopindex=0,max_N_of_data=-1;
482 static int nCalled = 0;
484 const char* cdDATAFILE[] =
488 "UTA/nrb00_h_he1ic12.dat",
489 "UTA/nrb00_h_li2ic12.dat",
490 "UTA/nrb00_h_be3ic12.dat",
491 "UTA/nrb00_h_b4ic12.dat",
492 "UTA/nrb00_h_c5ic12.dat",
493 "UTA/nrb00_h_n6ic12.dat",
494 "UTA/nrb00_h_o7ic12.dat",
495 "UTA/nrb00_h_f8ic12.dat",
496 "UTA/nrb00_h_ne9ic12.dat",
497 "UTA/nrb00_h_na10ic12.dat",
498 "UTA/nrb00_h_mg11ic12.dat",
499 "UTA/nrb00_h_al12ic12.dat",
500 "UTA/nrb00_h_si13ic12.dat",
501 "UTA/nrb00_h_p14ic12.dat",
502 "UTA/nrb00_h_s15ic12.dat",
503 "UTA/nrb00_h_cl16ic12.dat",
504 "UTA/nrb00_h_ar17ic12.dat",
505 "UTA/nrb00_h_k18ic12.dat",
506 "UTA/nrb00_h_ca19ic12.dat",
507 "UTA/nrb00_h_sc20ic12.dat",
508 "UTA/nrb00_h_ti21ic12.dat",
509 "UTA/nrb00_h_v22ic12.dat",
510 "UTA/nrb00_h_cr23ic12.dat",
511 "UTA/nrb00_h_mn24ic12.dat",
512 "UTA/nrb00_h_fe25ic12.dat",
513 "UTA/nrb00_h_co26ic12.dat",
514 "UTA/nrb00_h_ni27ic12.dat",
515 "UTA/nrb00_h_cu28ic12.dat",
516 "UTA/nrb00_h_zn29ic12.dat"
529 # if defined(PRINT_DR) || defined(PRINT_RR)
535 for(
long nelem=ipISO; nelem <
LIMELM; nelem++ )
542 iso_sp[ipISO][nelem].fb[ipHi].DielecRecombVsTemp[k] = 0.;
554 ioDATA=
open_data( cdDATAFILE[nelem],
"r" );
559 for(
long i=0; i<BIGGEST_INDEX_TO_USE; i++ )
560 TheirIndexToOurIndex[i] = -1;
567 if(
nMatch(
"INDX INDP ",
string) )
572 fprintf(
ioQQQ,
" Badnell data file appears to be corrupted.\n");
579 if(
strcmp(
string,
"\n")==0 )
587 if( INDX >= BIGGEST_INDEX_TO_USE )
594 ASSERT( INDX < BIGGEST_INDEX_TO_USE );
601 if( (i1=
nMatch(
"1S1 ",
string)) > 0 )
612 if( (i1=
nMatch(
" (",
string)) > 0 )
632 ASSERT( J <= ( L + (
int)((
S+1)/2) ) &&
633 J >= ( L - (
int)((
S+1)/2) ) && J >= 0 );
648 if(
N==2 && L==1 &&
S==3 )
651 TheirIndexToOurIndex[INDX] = 3;
653 TheirIndexToOurIndex[INDX] = 4;
657 ASSERT( TheirIndexToOurIndex[INDX] == 5 );
660 max_N_of_data =
MAX2( max_N_of_data,
N );
679 ASSERT( maxINDX < BIGGEST_INDEX_TO_USE );
688 if(
nMatch(
"INDX TE= ",
string) )
695 fprintf(
ioQQQ,
" Badnell data file appears to be corrupted.\n");
703 if(
nMatch(
"PRTF",
string) || INDX >= maxINDX || INDX<0 )
713 if( TheirIndexToOurIndex[INDX] <
iso_sp[
ipHE_LIKE][nelem].numLevels_max &&
714 TheirIndexToOurIndex[INDX] > 0 )
719 for(loopindex=0;loopindex<10;loopindex++)
728 fprintf(
ioQQQ,
" Badnell data file appears to be corrupted.\n");
734 for(loopindex=10;loopindex<19;loopindex++)
747 ASSERT( maxINDX < BIGGEST_INDEX_TO_USE );
748 ASSERT( max_N_of_data > 0 );
757 for(
long i=TheirIndexToOurIndex[maxINDX]+1;
768 for(loopindex=0;loopindex<19;loopindex++)
784 for(loopindex=0;loopindex<19;loopindex++)
796 for(
long i=0; i<NBLOCK; ++i )
799 data_begin_line[i] = INT_MIN;
802 chFilename =
"badnell_dr.dat";
818 data_begin_line[number] = count;
819 ASSERT( number < NBLOCK );
838 for(
long nelem=0; nelem<
LIMELM; nelem++ )
852 for(
long ion=0; ion<nelem+1; ++ion )
880 fseek(ioDATA, 0, SEEK_SET);
884 fprintf(
ioQQQ,
" DISASTER PROBLEM Badnell_rec_init could not read first line of badnell_dr.dat.\n");
890 if( (chs =
strchr_s(chLine,
')'))==NULL )
893 fprintf(
ioQQQ,
" DISASTER PROBLEM Badnell_rec_init data file incorrect format.\n");
898 sscanf(chs,
"%4i%2i%2i",&yr, &mo, &dy);
900 int dr_yr = 2012, dr_mo = 6, dr_dy = 28;
901 if((yr != dr_yr) || (mo != dr_mo) || (dy != dr_dy))
904 "DISASTER PROBLEM Badnell_rec_init The version of %s I found (%i %i %i) is not the current version (%i %i %i).\n",
905 chFilename, yr, mo, dy, dr_yr, dr_mo, dr_dy);
906 fprintf(
ioQQQ,
" The first line of the file is the following\n %s\n", chLine );
913 length_of_line = (int)strlen(chLine);
916 if( count > data_begin_line[0] && count < data_begin_line[1] && length_of_line >3 )
923 sscanf(chLine,
"%i%i%i%i%lf%lf%lf%lf%lf%lf%lf%lf%lf",
924 &NuclearCharge, &NumberElectrons, &M_state, &W_state, &par_C[0], &par_C[1], &par_C[2],
925 &par_C[3], &par_C[4], &par_C[5], &par_C[6], &par_C[7], &par_C[8]);
928 long int NuclearChargeM1 = NuclearCharge-1;
930 if(M_state == 1 && NuclearChargeM1 < LIMELM )
933 ASSERT( NumberElectrons < LIMELM );
934 ASSERT( NuclearChargeM1 < LIMELM );
938 nDRFitPar[NuclearChargeM1][NumberElectrons] = 9;
939 for(
long i=8; i>=0; i-- )
942 --
nDRFitPar[NuclearChargeM1][NumberElectrons];
948 for(
long i=0; i<9; i++ )
949 DRFitParPart1[NuclearChargeM1][NumberElectrons][i] = par_C[i];
955 fseek(ioDATA, 0, SEEK_SET);
960 length_of_line = (int)strlen(chLine);
961 if( count > data_begin_line[1] && length_of_line > 3 )
969 sscanf(chLine,
"%i%i%i%i%lf%lf%lf%lf%lf%lf%lf%lf%lf",
970 &NuclearCharge, &NumberElectrons, &M_state, &W_state, &par_E[0], &par_E[1], &par_E[2],
971 &par_E[3], &par_E[4], &par_E[5], &par_E[6], &par_E[7], &par_E[8]);
973 long int NuclearChargeM1 = NuclearCharge-1;
975 if(M_state == 1 && NuclearChargeM1<LIMELM)
977 ASSERT( NumberElectrons < LIMELM );
978 ASSERT( NuclearChargeM1 < LIMELM );
982 nDRFitPar[NuclearChargeM1][NumberElectrons] = 9;
983 for(
long i=8; i>=0; i-- )
986 --
nDRFitPar[NuclearChargeM1][NumberElectrons];
992 for(
long i=0; i<
nDRFitPar[NuclearChargeM1][NumberElectrons]; i++ )
993 DRFitParPart2[NuclearChargeM1][NumberElectrons][i] = par_E[i];
1002 for(
long nelem=0; nelem<
LIMELM; nelem++ )
1004 for(
int ion=0; ion<nelem+1;++ion )
1008 fprintf(ofp,
"%i %i %e %e %e %e %e %e %e %e %e\n",
1017 for(
long nelem=0; nelem<
LIMELM; nelem++ )
1019 for(
int ion=0; ion<nelem+1; ion++ )
1023 fprintf(ofp,
"%i %i %e %e %e %e %e %e %e %e %e\n",
1037 bool lgDRBadnellBothDefined =
true;
1038 for(
int nelem=0; nelem<
LIMELM; nelem++ )
1040 for(
int ion=0; ion<nelem+1; ion++ )
1046 fprintf(
ioQQQ,
"DR %i, RR %i: %c %c\n", nelem, ion,
1049 fprintf(
ioQQQ,
"PROBLEM ion_recomb_Badnell first and second half of Badnell DR not consistent.\n");
1050 lgDRBadnellBothDefined =
false;
1055 if( !lgDRBadnellBothDefined )
1059 "DISASTER PROBLEM The DR data files are corrupted - part 1 and 2 do not agree.\n");
1060 fprintf(
ioQQQ,
" Start again with a fresh copy of the data directory\n" );
1065 chFilename =
"badnell_rr.dat";
1070 if(
read_whole_line( chLine , (
int)
sizeof(chLine) , ioDATA ) == NULL )
1072 fprintf(
ioQQQ,
" DISASTER PROBLEM Badnell_rec_init could not read first line of badnell_rr.dat.\n");
1076 if( (chs =
strchr_s(chLine,
')'))==NULL )
1079 fprintf(
ioQQQ,
" DISASTER PROBLEM Badnell_rec_init data file incorrect format.\n");
1083 sscanf(chs,
"%4i%2i%2i", &yr, &mo, &dy);
1084 int rr_yr = 2011, rr_mo = 4, rr_dy = 12;
1085 if((yr != rr_yr)||(mo != rr_mo)||(dy != rr_dy))
1087 fprintf(
ioQQQ,
"DISASTER PROBLEM The version of %s I found (%i %i %i) is not the current version (%i %i %i).\n",
1088 chFilename, yr, mo, dy, rr_yr, rr_mo, rr_dy);
1089 fprintf(
ioQQQ,
" The line was as follows:\n %s\n", chLine );
1101 if(chLine[0] !=
'#')
1103 sscanf(chLine,
"%i%i%i%i%lf%lf%lf%lf%lf%lf",
1104 &NuclearCharge, &NumberElectrons, &M_state, &W_state, &temp_par[0], &temp_par[1],
1105 &temp_par[2], &temp_par[3], &temp_par[4], &temp_par[5]);
1106 long NuclearChargeM1 = NuclearCharge-1;
1108 if(M_state == 1 && NuclearChargeM1<LIMELM)
1110 ASSERT( NuclearChargeM1 < LIMELM );
1111 ASSERT( NumberElectrons <= LIMELM );
1116 RRFitPar[NuclearChargeM1][NumberElectrons][i] = temp_par[i];
1124 for(
long nelem=0; nelem<
LIMELM; nelem++ )
1126 for(
long ion=0; ion<nelem+1; ion++ )
1130 fprintf(ofp,
"%li %li %e %e %e %e %e %e\n",
1131 nelem, ion,
RRFitPar[nelem][ion][0],
1139 fprintf(ofp,
"total lines are %i ", count);
1147 enum {DEBUG_LOC=
false};
1152 fprintf(
ioQQQ,
"\nDEBUG rr rec\t%i",nelem);
1153 for(
int ion=0; ion<=nelem; ++ion )
1157 fprintf(
ioQQQ,
"\n");
1158 fprintf(
ioQQQ,
"DEBUG dr rec\t%i",nelem);
1159 for(
int ion=0; ion<=nelem; ++ion )
1163 fprintf(
ioQQQ,
"\n");
1185 for(
long nelem=0; nelem<
LIMELM; ++nelem )
1194 static double TeUsed = -1 , EdenUsed = -1.;
1211 for(
long ion=0; ion < nelem+1; ++ion )
1213 long int n_bnd_elec_before_recom ,
1214 n_bnd_elec_after_recom;
1216 n_bnd_elec_before_recom = nelem-ion;
1217 n_bnd_elec_after_recom = nelem-ion+1;
1232 n_bnd_elec_before_recom )) >= 0. )
1249 n_bnd_elec_after_recom ,
1257 n_bnd_elec_before_recom )) >= 0. )
1273 double Fe_Gu_c[9][6] = {
1274 { 2.50507e-11, 5.60226e-11, 1.85001e-10, 3.57495e-9, 1.66321e-7, 0. },
1275 { 9.19610e-11, 2.92460e-10, 1.02120e-9, 1.14852e-8, 3.25418e-7, 0. },
1276 { 9.02625e-11, 6.22962e-10, 5.77545e-9, 1.78847e-8, 3.40610e-7, 0. },
1277 { 9.04286e-12, 9.68148e-10, 4.83636e-9, 2.48159e-8, 3.96815e-7, 0. },
1278 { 6.77873e-10, 1.47252e-9, 5.31202e-9, 2.54793e-8, 3.47407e-7, 0. },
1279 { 1.29742e-9, 4.10172e-9, 1.23605e-8, 2.33615e-8, 2.97261e-7, 0. },
1280 { 8.78027e-10, 2.31680e-9, 3.49333e-9, 1.16927e-8, 8.18537e-8, 1.54740e-7 },
1281 { 2.23178e-10, 1.87313e-9, 2.86171e-9, 1.38575e-8, 1.17803e-7, 1.06251e-7 },
1282 { 2.17263e-10, 7.35929e-10, 2.81276e-9, 1.32411e-8, 1.15761e-7, 4.80389e-8 }
1286 { 8.30501e-2, 8.52897e-1, 3.40225e0, 2.23053e1, 6.80367e1, 0. },
1287 { 1.44392e-1, 9.23999e-1, 5.45498e0, 2.04301e1, 7.06112e1, 0. },
1288 { 5.79132e-2, 1.27852e0, 3.22439e0, 1.79602e1, 6.96277e1, 0. },
1289 { 1.02421e-1, 1.79393e0, 4.83226e0, 1.91117e1, 6.80858e1, 0. },
1290 { 1.24630e-1, 6.86045e-1, 3.09611e0, 1.44023e1, 6.42820e1, 0. },
1291 { 1.34459e-1, 6.63028e-1, 2.61753e0, 1.30392e1, 6.10222e1, 0. },
1292 { 7.79748e-2, 5.35522e-1, 1.88407e0, 8.38459e0, 3.38613e1, 7.89706e1 },
1293 { 8.83019e-2, 6.12756e-1, 2.36035e0, 9.61736e0, 3.64467e1, 8.72406e1 },
1294 { 1.51322e-1, 5.63155e-1, 2.57013e0, 9.08166e0, 3.69528e1, 1.08067e2 }
1304 for(
long ion=0; ion<9; ion++ )
1310 for(
long i=0; i<6; i++ )
1322 double BadnelDR_RateSave[
LIMELM] =
1324 3.78e-13, 1.70e-12, 8.14e-12, 1.60e-11, 2.38e-11,
1325 6.42e-11, 5.97e-11, 1.47e-10, 1.11e-10, 3.26e-10,
1326 1.88e-10, 2.06e-10, 4.14e-10, 3.97e-10, 2.07e-10,
1327 2.46e-10, 3.38e-10, 3.15e-10, 9.70e-11, 6.49e-11,
1328 6.93e-10, 3.70e-10, 3.29e-11, 4.96e-11, 5.03e-11,
1329 2.91e-12, 4.62e-14, 0.00e+00, 0.00e+00, 0.00e+00
1331 for(
long nelem=0; nelem <
LIMELM; ++nelem )
1334 BadnelDR_RateSave[nelem] *
RecNoise[nelem] *
1341 for(
long ion=0; ion <
ipIRON+1; ++ion )
1352 for(
long nelem=0; nelem <
LIMELM; ++nelem )
1354 for(
long ion=0; ion < nelem+1; ++ion )
1365 for(
long ion=0; ion < nelem-1; ++ion )
1392 fprintf(
ioQQQ,
"\n\n RR recombination data sources \n" );
1394 for(
long loop=0;loop<30;loop+=10)
1396 fprintf(
ioQQQ,
"\n\n ");
1397 for(
long ion=loop; ion<loop+10; ++ion )
1399 fprintf(
ioQQQ,
"&%7li",ion);
1401 fprintf(
ioQQQ,
"\\\\\n" );
1402 for(
long nelem=loop; nelem<
LIMELM; ++nelem )
1405 long limit =
MIN2(nelem+1,loop+10);
1406 for(
long ion=loop; ion<limit; ++ion )
1410 for(
long ion=limit; ion<loop+10; ++ion )
1414 fprintf(
ioQQQ,
"\\\\\n" );
1417 fprintf(
ioQQQ,
"\nData sources\n");
1418 fprintf(
ioQQQ,
"Bad06: Badnell, N., 2006, ApJ, 167, 334B\n");
1419 fprintf(
ioQQQ,
"Verner: Verner & Ferland, 1996, ApJS, 103, 467\n");
1421 fprintf(
ioQQQ,
"\n\n DR recombination data sources \n" );
1423 for(
long loop=0;loop<30;loop+=10)
1425 fprintf(
ioQQQ,
"\n\n ");
1426 for(
long ion=loop; ion<loop+10; ++ion )
1428 fprintf(
ioQQQ,
"&%7li",ion);
1430 fprintf(
ioQQQ,
"\\\\\n" );
1431 for(
long nelem=loop; nelem<
LIMELM; ++nelem )
1433 fprintf(
ioQQQ,
"%2li %5s ",
1435 long limit =
MIN2(nelem+1,loop+10);
1436 for(
long ion=loop; ion<limit; ++ion )
1440 for(
long ion=limit; ion<loop+10; ++ion )
1444 fprintf(
ioQQQ,
"\\\\\n" );
1447 fprintf(
ioQQQ,
"\nData sources\nBadWeb: Badnell web site http://amdpp.phys.strath.ac.uk/tamoc/DR/\n");
1448 fprintf(
ioQQQ,
"Bad06D: Badnell, N., 2006, ApJ, 651, L73\n");
1449 fprintf(
ioQQQ,
"GuPC: Gu, M. private communication\n");
1451 fprintf(
ioQQQ,
"\n\nDEBUG Badnell recombination RR, then DR, T=%.3e\n",
phycon.
te );
1454 fprintf(
ioQQQ,
"nelem=%li %s, RR then DR\n",
1456 for(
long ion=0; ion<nelem+1; ++ion )
1460 fprintf(
ioQQQ,
"\n" );
1461 for(
long ion=0; ion<nelem+1; ++ion )
1465 fprintf(
ioQQQ,
"\n\n" );
1468 fprintf(
ioQQQ,
"mean DR recombination ion mean \n" );
1469 for(
long ion=0; ion<
LIMELM; ++ion )
1471 fprintf(
ioQQQ,
" %2li %.2e \n",
1476 fprintf(
ioQQQ,
"\n\nCollisSuppres finds following dielectronic"
1477 " recom suppression factors, eden=%10.3e\n",
dense.
eden );
1478 fprintf(
ioQQQ,
"nelem ion fac \n" );
1479 for(
long nelem=0; nelem<
LIMELM; ++nelem )
1481 for(
long ion=0; ion < nelem+1; ion++ )
1483 fprintf(
ioQQQ,
"%3ld %4ld %10.3e\n", nelem+1 , ion+1,
1497 fprintf(
ioQQQ,
"\n");
double ** DR_Badnell_rate_coef
double ** RR_Badnell_rate_coef
FILE * open_data(const char *fname, const char *mode, access_scheme scheme)
STATIC double Badnell_DR_rate_eval(int nAtomicNumberCScale, int n_core_e_before_recomb)
double DielecRecombVsTemp[NUM_DR_TEMPS]
NORETURN void TotalInsanity(void)
double ** RR_Verner_rate_coef
static double DR_Badnell_rate_coef_mean_ion[LIMELM]
long nMatch(const char *chKey, const char *chCard)
static bool ** lgDRBadnellDefinedPart2
static const int MAX_FIT_PAR_DR
static bool ** lgDRBadnellDefined
sys_float sexp(sys_float x)
bool lgRecom_Badnell_print
t_elementnames elementnames
t_iso_sp iso_sp[NISO][LIMELM]
static double RecNoise[LIMELM]
STATIC double CollisSuppres(long int atomic_number, long int ionic_charge, double eden, double T)
bool fp_equal(sys_float x, sys_float y, int n=3)
void Badnell_rec_init(void)
long int n_HighestResolved_max
static char chRRDataSource[LIMELM][LIMELM][10]
static double *** DRFitParPart1
double atmdat_dielrec_fe(long int ion, double t)
static char chDRDataSource[LIMELM][LIMELM][10]
double DR_mean_scale[LIMELM]
static bool lgMustMallocRec
const int INPUT_LINE_LENGTH
void ion_recom_calculate(void)
static double *** DRFitParPart2
const char * strchr_s(const char *s, int c)
static double *** RRFitPar
char chElementNameShort[LIMELM][CHARS_ELEMENT_NAME_SHORT]
double RandGauss(double xMean, double s)
multi_arr< long, 3 > QuantumNumbers2Index
int strcmp(const char *s2)
static bool ** lgRRBadnellDefined
double rad_rec(long int iz, long int in, double t)
#define DEBUG_ENTRY(funcname)
STATIC double Badnell_RR_rate_eval(int nAtomicNumberCScale, int n_core_e_before_recomb)
char * read_whole_line(char *chLine, int nChar, FILE *ioIN)
static bool ** lgDR_BadWeb_exist
double ** RR_rate_coef_used
static const int MAX_FIT_PAR_RR
double FFmtRead(const char *chCard, long int *ipnt, long int last, bool *lgEOL)