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))));
199 if( (iso_sequence <= 5) && (T <= 25000.0 * ionic_charge*ionic_charge) )
205 q_0 = 1.0 / sqrt((
double)ionic_charge);
206 q_0 = A_N * q_0 * (1.0 - 0.816497 * q_0);
210 T_0 = 50000.0 * pow( q_0, 2. );
213 x_a = x_a0 + log10( pow( ((
double)ionic_charge/q_0), 7. ) * sqrt( T/T_0 ) );
223 s = ( mu/( 1. + pow((eden-x_a)/w, 2.) ) +
224 (1. - mu) * exp( -
LN_TWO * pow((eden-x_a)/w, 2.) ) );
233 snew = 1. + (s-1.)*exp(-(E_c*
EVDEGK)/(c*T));
235 ASSERT( snew >= 0. && snew <= 1. );
254 int nAtomicNumberCScale,
256 int n_core_e_before_recomb )
259 double RateCoefficient, sum;
263 ASSERT( nAtomicNumberCScale>=0 && nAtomicNumberCScale<
LIMELM );
265 if( nAtomicNumberCScale==
ipIRON && n_core_e_before_recomb>=12 &&
266 n_core_e_before_recomb<=18 )
277 {5.636e-4, 7.390e-3, 3.635e-2, 1.693e-1, 3.315e-2, 2.288e-1, 7.316e-2, 0.},
278 {1.090e-3, 7.801e-3, 1.132e-2, 4.740e-2, 1.990e-1, 3.379e-2, 1.140e-1, 1.250e-1},
279 {3.266e-3, 7.637e-3, 1.005e-2, 2.527e-2, 6.389e-2, 1.564e-1, 0., 0.},
280 {1.074e-3, 6.080e-3, 1.887e-2, 2.540e-2, 7.580e-2, 2.773e-1, 0., 0.},
281 {9.073e-4, 3.777e-3, 1.027e-2, 3.321e-2, 8.529e-2, 2.778e-1, 0., 0.},
282 {5.335e-4, 1.827e-3, 4.851e-3, 2.710e-2, 8.226e-2, 3.147e-1, 0., 0.},
283 {7.421e-4, 2.526e-3, 4.605e-3, 1.489e-2, 5.891e-2, 2.318e-1, 0., 0.}
289 {3.628e3, 2.432e4, 1.226e5, 4.351e5, 1.411e6, 6.589e6, 1.030e7, 0},
290 {1.246e3, 1.063e4, 4.719e4, 1.952e5, 5.637e5, 2.248e6, 7.202e6, 3.999e9},
291 {1.242e3, 1.001e4, 4.466e4, 1.497e5, 3.919e5, 6.853e5, 0. , 0.},
292 {1.387e3, 1.048e4, 3.955e4, 1.461e5, 4.010e5, 7.208e5, 0. , 0.},
293 {1.525e3, 1.071e4, 4.033e4, 1.564e5, 4.196e5, 7.580e5, 0. , 0.},
294 {2.032e3, 1.018e4, 4.638e4, 1.698e5, 4.499e5, 7.880e5, 0. , 0.},
295 {3.468e3, 1.353e4, 3.690e4, 1.957e5, 4.630e5, 8.202e5, 0. , 0.}
298 long int nion = n_core_e_before_recomb - 12;
299 ASSERT( nion>=0 && nion <=6 );
306 sum += (cFe_q[nion][i] *
sexp( EFe_q[nion][i]/
phycon.
te));
311 strcpy(
chDRDataSource[nAtomicNumberCScale][nAtomicNumberCScale-n_core_e_before_recomb] ,
314 return RateCoefficient;
318 else if( nAtomicNumberCScale < n_core_e_before_recomb )
320 RateCoefficient = -2;
323 else if( nAtomicNumberCScale >=
LIMELM )
325 RateCoefficient = -2;
330 RateCoefficient = -1;
338 for(i=0; i<
nDRFitPar[nAtomicNumberCScale][n_core_e_before_recomb]; ++i )
340 sum += (
DRFitParPart1[nAtomicNumberCScale][n_core_e_before_recomb][i] *
344 strcpy(
chDRDataSource[nAtomicNumberCScale][nAtomicNumberCScale-n_core_e_before_recomb] ,
353 RateCoefficient = -99;
356 ASSERT( RateCoefficient < 1e-6 );
358 return RateCoefficient;
367 int nAtomicNumberCScale,
369 int n_core_e_before_recomb )
371 double RateCoefficient;
376 ASSERT( nAtomicNumberCScale>=0 && nAtomicNumberCScale<
LIMELM );
378 if( nAtomicNumberCScale==
ipIRON &&
379 n_core_e_before_recomb>=12 && n_core_e_before_recomb<=18 )
388 double parFeq[7][6] ={
389 {1.179e-9 , 0.7096, 4.508e2, 3.393e7, 0.0154, 3.977e6},
390 {1.050e-9 , 0.6939, 4.568e2, 3.987e7, 0.0066, 5.451e5},
391 {9.832e-10, 0.7146, 3.597e2, 3.808e7, 0.0045, 3.952e5},
392 {8.303e-10, 0.7156, 3.531e2, 3.554e7, 0.0132, 2.951e5},
393 {1.052e-9 , 0.7370, 1.639e2, 2.924e7, 0.0224, 4.291e5},
394 {1.338e-9 , 0.7495, 7.242e1, 2.453e7, 0.0404, 4.199e5},
395 {1.263e-9 , 0.7532, 5.209e1, 2.169e7, 0.0421, 2.917e5}
400 long int nion = n_core_e_before_recomb - 12;
401 ASSERT( nion>=0 && nion <=6 );
404 B = parFeq[nion][1] + parFeq[nion][4]*exp(temp);
405 D = sqrt(
phycon.
te/parFeq[nion][2]);
406 F = sqrt(
phycon.
te/parFeq[nion][3]);
407 RateCoefficient = parFeq[nion][0]/(D*pow((1.+D),(1.-B))*pow((1.+F),(1.+B)));
408 strcpy(
chRRDataSource[nAtomicNumberCScale][nAtomicNumberCScale-n_core_e_before_recomb] ,
"Bad06");
410 return RateCoefficient;
414 else if( nAtomicNumberCScale < n_core_e_before_recomb )
416 RateCoefficient = -2;
419 else if( nAtomicNumberCScale >=
LIMELM )
421 RateCoefficient = -2;
426 RateCoefficient = -1;
437 B =
RRFitPar[nAtomicNumberCScale][n_core_e_before_recomb][1] +
438 RRFitPar[nAtomicNumberCScale][n_core_e_before_recomb][4]*exp(temp);
439 D = sqrt(
phycon.
te/
RRFitPar[nAtomicNumberCScale][n_core_e_before_recomb][2]);
440 F = sqrt(
phycon.
te/
RRFitPar[nAtomicNumberCScale][n_core_e_before_recomb][3]);
441 RateCoefficient =
RRFitPar[nAtomicNumberCScale][n_core_e_before_recomb][0]/(D*pow((1.+D),(1.-B))*pow((1.+F),(1.+B)));
442 strcpy(
chRRDataSource[nAtomicNumberCScale][nAtomicNumberCScale-n_core_e_before_recomb] ,
"Bad06");
447 RateCoefficient = -99;
449 return RateCoefficient;
462 int NuclearCharge=-1, NumberElectrons=-1;
465 int M_state, W_state;
467 const int NBLOCK = 2;
468 int data_begin_line[NBLOCK];
471 const char* chFilename;
475 const int BIGGEST_INDEX_TO_USE = 103;
478 long TheirIndexToOurIndex[BIGGEST_INDEX_TO_USE];
483 long INDX=0,INDP=0,
N=0,
S=0,L=0,J=0,maxINDX=0,loopindex=0,max_N_of_data=-1;
486 static int nCalled = 0;
488 const char* cdDATAFILE[] =
492 "UTA/nrb00_h_he1ic12.dat",
493 "UTA/nrb00_h_li2ic12.dat",
494 "UTA/nrb00_h_be3ic12.dat",
495 "UTA/nrb00_h_b4ic12.dat",
496 "UTA/nrb00_h_c5ic12.dat",
497 "UTA/nrb00_h_n6ic12.dat",
498 "UTA/nrb00_h_o7ic12.dat",
499 "UTA/nrb00_h_f8ic12.dat",
500 "UTA/nrb00_h_ne9ic12.dat",
501 "UTA/nrb00_h_na10ic12.dat",
502 "UTA/nrb00_h_mg11ic12.dat",
503 "UTA/nrb00_h_al12ic12.dat",
504 "UTA/nrb00_h_si13ic12.dat",
505 "UTA/nrb00_h_p14ic12.dat",
506 "UTA/nrb00_h_s15ic12.dat",
507 "UTA/nrb00_h_cl16ic12.dat",
508 "UTA/nrb00_h_ar17ic12.dat",
509 "UTA/nrb00_h_k18ic12.dat",
510 "UTA/nrb00_h_ca19ic12.dat",
511 "UTA/nrb00_h_sc20ic12.dat",
512 "UTA/nrb00_h_ti21ic12.dat",
513 "UTA/nrb00_h_v22ic12.dat",
514 "UTA/nrb00_h_cr23ic12.dat",
515 "UTA/nrb00_h_mn24ic12.dat",
516 "UTA/nrb00_h_fe25ic12.dat",
517 "UTA/nrb00_h_co26ic12.dat",
518 "UTA/nrb00_h_ni27ic12.dat",
519 "UTA/nrb00_h_cu28ic12.dat",
520 "UTA/nrb00_h_zn29ic12.dat"
533 # if defined(PRINT_DR) || defined(PRINT_RR)
539 for(
long nelem=ipISO; nelem <
LIMELM; nelem++ )
546 iso_sp[ipISO][nelem].fb[ipHi].DielecRecombVsTemp[k] = 0.;
558 ioDATA=
open_data( cdDATAFILE[nelem],
"r" );
563 for(
long i=0; i<BIGGEST_INDEX_TO_USE; i++ )
564 TheirIndexToOurIndex[i] = -1;
571 if(
nMatch(
"INDX INDP ",
string) )
576 fprintf(
ioQQQ,
" Badnell data file appears to be corrupted.\n");
583 if(
strcmp(
string,
"\n")==0 )
591 if( INDX >= BIGGEST_INDEX_TO_USE )
598 ASSERT( INDX < BIGGEST_INDEX_TO_USE );
605 if( (i1=
nMatch(
"1S1 ",
string)) > 0 )
616 if( (i1=
nMatch(
" (",
string)) > 0 )
636 ASSERT( J <= ( L + (
int)((
S+1)/2) ) &&
637 J >= ( L - (
int)((
S+1)/2) ) && J >= 0 );
652 if(
N==2 && L==1 &&
S==3 )
655 TheirIndexToOurIndex[INDX] = 3;
657 TheirIndexToOurIndex[INDX] = 4;
661 ASSERT( TheirIndexToOurIndex[INDX] == 5 );
664 max_N_of_data =
MAX2( max_N_of_data,
N );
683 ASSERT( maxINDX < BIGGEST_INDEX_TO_USE );
692 if(
nMatch(
"INDX TE= ",
string) )
699 fprintf(
ioQQQ,
" Badnell data file appears to be corrupted.\n");
707 if(
nMatch(
"PRTF",
string) || INDX >= maxINDX || INDX<0 )
717 if( TheirIndexToOurIndex[INDX] <
iso_sp[
ipHE_LIKE][nelem].numLevels_max &&
718 TheirIndexToOurIndex[INDX] > 0 )
723 for(loopindex=0;loopindex<10;loopindex++)
732 fprintf(
ioQQQ,
" Badnell data file appears to be corrupted.\n");
738 for(loopindex=10;loopindex<19;loopindex++)
751 ASSERT( maxINDX < BIGGEST_INDEX_TO_USE );
752 ASSERT( max_N_of_data > 0 );
761 for(
long i=TheirIndexToOurIndex[maxINDX]+1;
772 for(loopindex=0;loopindex<19;loopindex++)
788 for(loopindex=0;loopindex<19;loopindex++)
800 for(
long i=0; i<NBLOCK; ++i )
803 data_begin_line[i] = INT_MIN;
806 chFilename =
"badnell_dr.dat";
822 data_begin_line[number] = count;
823 ASSERT( number < NBLOCK );
842 for(
long nelem=0; nelem<
LIMELM; nelem++ )
856 for(
long ion=0; ion<nelem+1; ++ion )
884 fseek(ioDATA, 0, SEEK_SET);
888 fprintf(
ioQQQ,
" DISASTER PROBLEM Badnell_rec_init could not read first line of badnell_dr.dat.\n");
894 if( (chs =
strchr_s(chLine,
')'))==NULL )
897 fprintf(
ioQQQ,
" DISASTER PROBLEM Badnell_rec_init data file incorrect format.\n");
902 sscanf(chs,
"%4i%2i%2i",&yr, &mo, &dy);
904 int dr_yr = 2012, dr_mo = 6, dr_dy = 28;
905 if((yr != dr_yr) || (mo != dr_mo) || (dy != dr_dy))
908 "DISASTER PROBLEM Badnell_rec_init The version of %s I found (%i %i %i) is not the current version (%i %i %i).\n",
909 chFilename, yr, mo, dy, dr_yr, dr_mo, dr_dy);
910 fprintf(
ioQQQ,
" The first line of the file is the following\n %s\n", chLine );
917 length_of_line = (int)strlen(chLine);
920 if( count > data_begin_line[0] && count < data_begin_line[1] && length_of_line >3 )
927 sscanf(chLine,
"%i%i%i%i%lf%lf%lf%lf%lf%lf%lf%lf%lf",
928 &NuclearCharge, &NumberElectrons, &M_state, &W_state, &par_C[0], &par_C[1], &par_C[2],
929 &par_C[3], &par_C[4], &par_C[5], &par_C[6], &par_C[7], &par_C[8]);
932 long int NuclearChargeM1 = NuclearCharge-1;
934 if(M_state == 1 && NuclearChargeM1 < LIMELM )
937 ASSERT( NumberElectrons < LIMELM );
938 ASSERT( NuclearChargeM1 < LIMELM );
942 nDRFitPar[NuclearChargeM1][NumberElectrons] = 9;
943 for(
long i=8; i>=0; i-- )
946 --
nDRFitPar[NuclearChargeM1][NumberElectrons];
952 for(
long i=0; i<9; i++ )
953 DRFitParPart1[NuclearChargeM1][NumberElectrons][i] = par_C[i];
959 fseek(ioDATA, 0, SEEK_SET);
964 length_of_line = (int)strlen(chLine);
965 if( count > data_begin_line[1] && length_of_line > 3 )
973 sscanf(chLine,
"%i%i%i%i%lf%lf%lf%lf%lf%lf%lf%lf%lf",
974 &NuclearCharge, &NumberElectrons, &M_state, &W_state, &par_E[0], &par_E[1], &par_E[2],
975 &par_E[3], &par_E[4], &par_E[5], &par_E[6], &par_E[7], &par_E[8]);
977 long int NuclearChargeM1 = NuclearCharge-1;
979 if(M_state == 1 && NuclearChargeM1<LIMELM)
981 ASSERT( NumberElectrons < LIMELM );
982 ASSERT( NuclearChargeM1 < LIMELM );
986 nDRFitPar[NuclearChargeM1][NumberElectrons] = 9;
987 for(
long i=8; i>=0; i-- )
990 --
nDRFitPar[NuclearChargeM1][NumberElectrons];
996 for(
long i=0; i<
nDRFitPar[NuclearChargeM1][NumberElectrons]; i++ )
997 DRFitParPart2[NuclearChargeM1][NumberElectrons][i] = par_E[i];
1006 for(
long nelem=0; nelem<
LIMELM; nelem++ )
1008 for(
int ion=0; ion<nelem+1;++ion )
1012 fprintf(ofp,
"%i %i %e %e %e %e %e %e %e %e %e\n",
1021 for(
long nelem=0; nelem<
LIMELM; nelem++ )
1023 for(
int ion=0; ion<nelem+1; ion++ )
1027 fprintf(ofp,
"%i %i %e %e %e %e %e %e %e %e %e\n",
1041 bool lgDRBadnellBothDefined =
true;
1042 for(
int nelem=0; nelem<
LIMELM; nelem++ )
1044 for(
int ion=0; ion<nelem+1; ion++ )
1050 fprintf(
ioQQQ,
"DR %i, RR %i: %c %c\n", nelem, ion,
1053 fprintf(
ioQQQ,
"PROBLEM ion_recomb_Badnell first and second half of Badnell DR not consistent.\n");
1054 lgDRBadnellBothDefined =
false;
1059 if( !lgDRBadnellBothDefined )
1063 "DISASTER PROBLEM The DR data files are corrupted - part 1 and 2 do not agree.\n");
1064 fprintf(
ioQQQ,
" Start again with a fresh copy of the data directory\n" );
1069 chFilename =
"badnell_rr.dat";
1074 if(
read_whole_line( chLine , (
int)
sizeof(chLine) , ioDATA ) == NULL )
1076 fprintf(
ioQQQ,
" DISASTER PROBLEM Badnell_rec_init could not read first line of badnell_rr.dat.\n");
1080 if( (chs =
strchr_s(chLine,
')'))==NULL )
1083 fprintf(
ioQQQ,
" DISASTER PROBLEM Badnell_rec_init data file incorrect format.\n");
1087 sscanf(chs,
"%4i%2i%2i", &yr, &mo, &dy);
1088 int rr_yr = 2011, rr_mo = 4, rr_dy = 12;
1089 if((yr != rr_yr)||(mo != rr_mo)||(dy != rr_dy))
1091 fprintf(
ioQQQ,
"DISASTER PROBLEM The version of %s I found (%i %i %i) is not the current version (%i %i %i).\n",
1092 chFilename, yr, mo, dy, rr_yr, rr_mo, rr_dy);
1093 fprintf(
ioQQQ,
" The line was as follows:\n %s\n", chLine );
1105 if(chLine[0] !=
'#')
1107 sscanf(chLine,
"%i%i%i%i%lf%lf%lf%lf%lf%lf",
1108 &NuclearCharge, &NumberElectrons, &M_state, &W_state, &temp_par[0], &temp_par[1],
1109 &temp_par[2], &temp_par[3], &temp_par[4], &temp_par[5]);
1110 long NuclearChargeM1 = NuclearCharge-1;
1112 if(M_state == 1 && NuclearChargeM1<LIMELM)
1114 ASSERT( NuclearChargeM1 < LIMELM );
1115 ASSERT( NumberElectrons <= LIMELM );
1120 RRFitPar[NuclearChargeM1][NumberElectrons][i] = temp_par[i];
1128 for(
long nelem=0; nelem<
LIMELM; nelem++ )
1130 for(
long ion=0; ion<nelem+1; ion++ )
1134 fprintf(ofp,
"%li %li %e %e %e %e %e %e\n",
1135 nelem, ion,
RRFitPar[nelem][ion][0],
1143 fprintf(ofp,
"total lines are %i ", count);
1151 enum {DEBUG_LOC=
false};
1156 fprintf(
ioQQQ,
"\nDEBUG rr rec\t%i",nelem);
1157 for(
int ion=0; ion<=nelem; ++ion )
1161 fprintf(
ioQQQ,
"\n");
1162 fprintf(
ioQQQ,
"DEBUG dr rec\t%i",nelem);
1163 for(
int ion=0; ion<=nelem; ++ion )
1167 fprintf(
ioQQQ,
"\n");
1189 for(
long nelem=0; nelem<
LIMELM; ++nelem )
1198 static double TeUsed = -1 , EdenUsed = -1.;
1215 for(
long ion=0; ion < nelem+1; ++ion )
1217 long int n_bnd_elec_before_recom ,
1218 n_bnd_elec_after_recom;
1220 n_bnd_elec_before_recom = nelem-ion;
1221 n_bnd_elec_after_recom = nelem-ion+1;
1236 n_bnd_elec_before_recom )) >= 0. )
1253 n_bnd_elec_after_recom ,
1261 n_bnd_elec_before_recom )) >= 0. )
1277 double Fe_Gu_c[9][6] = {
1278 { 2.50507e-11, 5.60226e-11, 1.85001e-10, 3.57495e-9, 1.66321e-7, 0. },
1279 { 9.19610e-11, 2.92460e-10, 1.02120e-9, 1.14852e-8, 3.25418e-7, 0. },
1280 { 9.02625e-11, 6.22962e-10, 5.77545e-9, 1.78847e-8, 3.40610e-7, 0. },
1281 { 9.04286e-12, 9.68148e-10, 4.83636e-9, 2.48159e-8, 3.96815e-7, 0. },
1282 { 6.77873e-10, 1.47252e-9, 5.31202e-9, 2.54793e-8, 3.47407e-7, 0. },
1283 { 1.29742e-9, 4.10172e-9, 1.23605e-8, 2.33615e-8, 2.97261e-7, 0. },
1284 { 8.78027e-10, 2.31680e-9, 3.49333e-9, 1.16927e-8, 8.18537e-8, 1.54740e-7 },
1285 { 2.23178e-10, 1.87313e-9, 2.86171e-9, 1.38575e-8, 1.17803e-7, 1.06251e-7 },
1286 { 2.17263e-10, 7.35929e-10, 2.81276e-9, 1.32411e-8, 1.15761e-7, 4.80389e-8 }
1290 { 8.30501e-2, 8.52897e-1, 3.40225e0, 2.23053e1, 6.80367e1, 0. },
1291 { 1.44392e-1, 9.23999e-1, 5.45498e0, 2.04301e1, 7.06112e1, 0. },
1292 { 5.79132e-2, 1.27852e0, 3.22439e0, 1.79602e1, 6.96277e1, 0. },
1293 { 1.02421e-1, 1.79393e0, 4.83226e0, 1.91117e1, 6.80858e1, 0. },
1294 { 1.24630e-1, 6.86045e-1, 3.09611e0, 1.44023e1, 6.42820e1, 0. },
1295 { 1.34459e-1, 6.63028e-1, 2.61753e0, 1.30392e1, 6.10222e1, 0. },
1296 { 7.79748e-2, 5.35522e-1, 1.88407e0, 8.38459e0, 3.38613e1, 7.89706e1 },
1297 { 8.83019e-2, 6.12756e-1, 2.36035e0, 9.61736e0, 3.64467e1, 8.72406e1 },
1298 { 1.51322e-1, 5.63155e-1, 2.57013e0, 9.08166e0, 3.69528e1, 1.08067e2 }
1308 for(
long ion=0; ion<9; ion++ )
1314 for(
long i=0; i<6; i++ )
1326 double BadnelDR_RateSave[
LIMELM] =
1328 3.78e-13, 1.70e-12, 8.14e-12, 1.60e-11, 2.38e-11,
1329 6.42e-11, 5.97e-11, 1.47e-10, 1.11e-10, 3.26e-10,
1330 1.88e-10, 2.06e-10, 4.14e-10, 3.97e-10, 2.07e-10,
1331 2.46e-10, 3.38e-10, 3.15e-10, 9.70e-11, 6.49e-11,
1332 6.93e-10, 3.70e-10, 3.29e-11, 4.96e-11, 5.03e-11,
1333 2.91e-12, 4.62e-14, 0.00e+00, 0.00e+00, 0.00e+00
1335 for(
long nelem=0; nelem <
LIMELM; ++nelem )
1338 BadnelDR_RateSave[nelem] *
RecNoise[nelem] *
1345 for(
long ion=0; ion <
ipIRON+1; ++ion )
1356 for(
long nelem=0; nelem <
LIMELM; ++nelem )
1358 for(
long ion=0; ion < nelem+1; ++ion )
1369 for(
long ion=0; ion < nelem-1; ++ion )
1396 fprintf(
ioQQQ,
"\n\n RR recombination data sources \n" );
1398 for(
long loop=0;loop<30;loop+=10)
1400 fprintf(
ioQQQ,
"\n\n ");
1401 for(
long ion=loop; ion<loop+10; ++ion )
1403 fprintf(
ioQQQ,
"&%7li",ion);
1405 fprintf(
ioQQQ,
"\\\\\n" );
1406 for(
long nelem=loop; nelem<
LIMELM; ++nelem )
1409 long limit =
MIN2(nelem+1,loop+10);
1410 for(
long ion=loop; ion<limit; ++ion )
1414 for(
long ion=limit; ion<loop+10; ++ion )
1418 fprintf(
ioQQQ,
"\\\\\n" );
1421 fprintf(
ioQQQ,
"\nData sources\n");
1422 fprintf(
ioQQQ,
"Bad06: Badnell, N., 2006, ApJ, 167, 334B\n");
1423 fprintf(
ioQQQ,
"Verner: Verner & Ferland, 1996, ApJS, 103, 467\n");
1425 fprintf(
ioQQQ,
"\n\n DR recombination data sources \n" );
1427 for(
long loop=0;loop<30;loop+=10)
1429 fprintf(
ioQQQ,
"\n\n ");
1430 for(
long ion=loop; ion<loop+10; ++ion )
1432 fprintf(
ioQQQ,
"&%7li",ion);
1434 fprintf(
ioQQQ,
"\\\\\n" );
1435 for(
long nelem=loop; nelem<
LIMELM; ++nelem )
1437 fprintf(
ioQQQ,
"%2li %5s ",
1439 long limit =
MIN2(nelem+1,loop+10);
1440 for(
long ion=loop; ion<limit; ++ion )
1444 for(
long ion=limit; ion<loop+10; ++ion )
1448 fprintf(
ioQQQ,
"\\\\\n" );
1451 fprintf(
ioQQQ,
"\nData sources\nBadWeb: Badnell web site http://amdpp.phys.strath.ac.uk/tamoc/DR/\n");
1452 fprintf(
ioQQQ,
"Bad06D: Badnell, N., 2006, ApJ, 651, L73\n");
1453 fprintf(
ioQQQ,
"GuPC: Gu, M. private communication\n");
1455 fprintf(
ioQQQ,
"\n\nDEBUG Badnell recombination RR, then DR, T=%.3e\n",
phycon.
te );
1458 fprintf(
ioQQQ,
"nelem=%li %s, RR then DR\n",
1460 for(
long ion=0; ion<nelem+1; ++ion )
1464 fprintf(
ioQQQ,
"\n" );
1465 for(
long ion=0; ion<nelem+1; ++ion )
1469 fprintf(
ioQQQ,
"\n\n" );
1472 fprintf(
ioQQQ,
"mean DR recombination ion mean \n" );
1473 for(
long ion=0; ion<
LIMELM; ++ion )
1475 fprintf(
ioQQQ,
" %2li %.2e \n",
1480 fprintf(
ioQQQ,
"\n\nCollisSuppres finds following dielectronic"
1481 " recom suppression factors, eden=%10.3e\n",
dense.
eden );
1482 fprintf(
ioQQQ,
"nelem ion fac \n" );
1483 for(
long nelem=0; nelem<
LIMELM; ++nelem )
1485 for(
long ion=0; ion < nelem+1; ion++ )
1487 fprintf(
ioQQQ,
"%3ld %4ld %10.3e\n", nelem+1 , ion+1,
1501 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)