59 long int atomic_number,
61 long int ionic_charge,
72 const double mu = 0.000;
73 const double w = 5.64586;
74 const double x_a0 = 10.1821;
80 const double c = 10.0;
82 double s, snew, x_a, E_c;
84 long int iso_sequence, N_1, N_2;
89 iso_sequence = atomic_number - ionic_charge;
90 ASSERT( iso_sequence >= 0 );
98 realnum ionchar = ionic_charge / 10. ;
103 if( (iso_sequence >= 1) && (iso_sequence <= 2) )
108 else if( (iso_sequence >= 3) && (iso_sequence <= 10) )
113 else if( (iso_sequence >= 11) && (iso_sequence <= 18) )
118 else if( (iso_sequence >= 19) && (iso_sequence <= 36) )
123 else if( (iso_sequence >= 37) && (iso_sequence <= 54) )
128 else if( (iso_sequence >= 55) && (iso_sequence <= 86) )
133 else if( iso_sequence >= 87 )
146 A_N = 12.0 + 10.0 * N_1 + (10.0 * N_1 - 2.0 * N_2) * (iso_sequence - N_1) / (N_1 - N_2);
155 if( iso_sequence == 1 )
160 else if( iso_sequence == 2 )
165 else if( iso_sequence == 3 )
167 E_c = 1.96274 + ionchar*(20.30014 + ionchar*(-0.97103 + ionchar*( 0.85453 + ionchar*( 0.13547 + 0.02401*ionchar))));
170 else if( iso_sequence == 4 )
172 E_c = 5.78908 + ionchar*(34.08270 + ionchar*( 1.51729 + ionchar*(-1.21227 + ionchar*( 0.77559 - 0.00410*ionchar))));
175 else if( iso_sequence == 5 )
180 else if( iso_sequence == 7 )
182 E_c = 11.37092 + ionchar*(36.22053 + ionchar*( 7.08448 + ionchar*(-5.16840 + ionchar*( 2.45056 - 0.16961*ionchar))));
184 else if( iso_sequence == 11 )
186 E_c = 2.24809 + ionchar*(22.27768 + ionchar*(-1.12285 + ionchar*( 0.90267 + ionchar*(-0.03860 + 0.01468*ionchar))));
188 else if( iso_sequence == 12 )
190 E_c = 2.74508 + ionchar*(19.18623 + ionchar*(-0.54317 + ionchar*( 0.78685 + ionchar*(-0.04249 + 0.01357*ionchar))));
192 else if( iso_sequence == 15 )
194 E_c = 1.42762 + ionchar*( 3.90778 + ionchar*( 0.73119 + ionchar*(-1.91404 + ionchar*( 1.05059 - 0.08992*ionchar))));
202 if( iso_sequence <= 5 )
204 double Tscal = T/
pow2(
double(ionic_charge));
205 A_N *= 2./(1.+exp(-
pow3(25000./Tscal)));
211 q_0 = 1.0 / sqrt((
double)ionic_charge);
212 q_0 = A_N * q_0 * (1.0 - 0.816497 * q_0);
216 T_0 = 50000.0 * pow( q_0, 2. );
219 x_a = x_a0 + log10( pow( ((
double)ionic_charge/q_0), 7. ) * sqrt( T/T_0 ) );
229 s = ( mu/( 1. + pow((eden-x_a)/w, 2.) ) +
230 (1. - mu) * exp( -
LN_TWO * pow((eden-x_a)/w, 2.) ) );
239 snew = 1. + (s-1.)*exp(-(E_c*
EVDEGK)/(c*T));
241 ASSERT( snew >= 0. && snew <= 1. );
260 int nAtomicNumberCScale,
262 int n_core_e_before_recomb )
265 double RateCoefficient, sum;
269 ASSERT( nAtomicNumberCScale>=0 && nAtomicNumberCScale<
LIMELM );
271 if( nAtomicNumberCScale==
ipIRON && n_core_e_before_recomb>=12 &&
272 n_core_e_before_recomb<=18 )
283 {5.636e-4, 7.390e-3, 3.635e-2, 1.693e-1, 3.315e-2, 2.288e-1, 7.316e-2, 0.},
284 {1.090e-3, 7.801e-3, 1.132e-2, 4.740e-2, 1.990e-1, 3.379e-2, 1.140e-1, 1.250e-1},
285 {3.266e-3, 7.637e-3, 1.005e-2, 2.527e-2, 6.389e-2, 1.564e-1, 0., 0.},
286 {1.074e-3, 6.080e-3, 1.887e-2, 2.540e-2, 7.580e-2, 2.773e-1, 0., 0.},
287 {9.073e-4, 3.777e-3, 1.027e-2, 3.321e-2, 8.529e-2, 2.778e-1, 0., 0.},
288 {5.335e-4, 1.827e-3, 4.851e-3, 2.710e-2, 8.226e-2, 3.147e-1, 0., 0.},
289 {7.421e-4, 2.526e-3, 4.605e-3, 1.489e-2, 5.891e-2, 2.318e-1, 0., 0.}
295 {3.628e3, 2.432e4, 1.226e5, 4.351e5, 1.411e6, 6.589e6, 1.030e7, 0},
296 {1.246e3, 1.063e4, 4.719e4, 1.952e5, 5.637e5, 2.248e6, 7.202e6, 3.999e9},
297 {1.242e3, 1.001e4, 4.466e4, 1.497e5, 3.919e5, 6.853e5, 0. , 0.},
298 {1.387e3, 1.048e4, 3.955e4, 1.461e5, 4.010e5, 7.208e5, 0. , 0.},
299 {1.525e3, 1.071e4, 4.033e4, 1.564e5, 4.196e5, 7.580e5, 0. , 0.},
300 {2.032e3, 1.018e4, 4.638e4, 1.698e5, 4.499e5, 7.880e5, 0. , 0.},
301 {3.468e3, 1.353e4, 3.690e4, 1.957e5, 4.630e5, 8.202e5, 0. , 0.}
304 long int nion = n_core_e_before_recomb - 12;
305 ASSERT( nion>=0 && nion <=6 );
312 sum += (cFe_q[nion][i] *
sexp( EFe_q[nion][i]/
phycon.te));
316 RateCoefficient = sum /
phycon.te32;
317 strcpy(
chDRDataSource[nAtomicNumberCScale][nAtomicNumberCScale-n_core_e_before_recomb] ,
320 return RateCoefficient;
324 else if( nAtomicNumberCScale < n_core_e_before_recomb )
326 RateCoefficient = -2;
329 else if( nAtomicNumberCScale >=
LIMELM )
331 RateCoefficient = -2;
336 RateCoefficient = -1;
344 for(i=0; i<
nDRFitPar[nAtomicNumberCScale][n_core_e_before_recomb]; ++i )
346 sum += (
DRFitParPart1[nAtomicNumberCScale][n_core_e_before_recomb][i] *
350 strcpy(
chDRDataSource[nAtomicNumberCScale][nAtomicNumberCScale-n_core_e_before_recomb] ,
354 RateCoefficient = sum /
phycon.te32;
359 RateCoefficient = -99;
362 ASSERT( RateCoefficient < 1e-6 );
364 return RateCoefficient;
373 int nAtomicNumberCScale,
375 int n_core_e_before_recomb )
377 double RateCoefficient;
382 ASSERT( nAtomicNumberCScale>=0 && nAtomicNumberCScale<
LIMELM );
384 if( nAtomicNumberCScale==
ipIRON &&
385 n_core_e_before_recomb>=12 && n_core_e_before_recomb<=18 )
394 double parFeq[7][6] ={
395 {1.179e-9 , 0.7096, 4.508e2, 3.393e7, 0.0154, 3.977e6},
396 {1.050e-9 , 0.6939, 4.568e2, 3.987e7, 0.0066, 5.451e5},
397 {9.832e-10, 0.7146, 3.597e2, 3.808e7, 0.0045, 3.952e5},
398 {8.303e-10, 0.7156, 3.531e2, 3.554e7, 0.0132, 2.951e5},
399 {1.052e-9 , 0.7370, 1.639e2, 2.924e7, 0.0224, 4.291e5},
400 {1.338e-9 , 0.7495, 7.242e1, 2.453e7, 0.0404, 4.199e5},
401 {1.263e-9 , 0.7532, 5.209e1, 2.169e7, 0.0421, 2.917e5}
406 long int nion = n_core_e_before_recomb - 12;
407 ASSERT( nion>=0 && nion <=6 );
409 temp = -parFeq[nion][5]/
phycon.te;
410 B = parFeq[nion][1] + parFeq[nion][4]*exp(temp);
411 D = sqrt(
phycon.te/parFeq[nion][2]);
412 F = sqrt(
phycon.te/parFeq[nion][3]);
413 RateCoefficient = parFeq[nion][0]/(D*pow((1.+D),(1.-B))*pow((1.+F),(1.+B)));
414 strcpy(
chRRDataSource[nAtomicNumberCScale][nAtomicNumberCScale-n_core_e_before_recomb] ,
"Bad06");
416 return RateCoefficient;
420 else if( nAtomicNumberCScale < n_core_e_before_recomb )
422 RateCoefficient = -2;
425 else if( nAtomicNumberCScale >=
LIMELM )
427 RateCoefficient = -2;
432 RateCoefficient = -1;
442 temp = -
RRFitPar[nAtomicNumberCScale][n_core_e_before_recomb][5]/
phycon.te;
443 B =
RRFitPar[nAtomicNumberCScale][n_core_e_before_recomb][1] +
444 RRFitPar[nAtomicNumberCScale][n_core_e_before_recomb][4]*exp(temp);
445 D = sqrt(
phycon.te/
RRFitPar[nAtomicNumberCScale][n_core_e_before_recomb][2]);
446 F = sqrt(
phycon.te/
RRFitPar[nAtomicNumberCScale][n_core_e_before_recomb][3]);
447 RateCoefficient =
RRFitPar[nAtomicNumberCScale][n_core_e_before_recomb][0]/(D*pow((1.+D),(1.-B))*pow((1.+F),(1.+B)));
448 strcpy(
chRRDataSource[nAtomicNumberCScale][nAtomicNumberCScale-n_core_e_before_recomb] ,
"Bad06");
453 RateCoefficient = -99;
455 return RateCoefficient;
468 int NuclearCharge=-1, NumberElectrons=-1;
471 int M_state, W_state;
473 const int NBLOCK = 2;
474 int data_begin_line[NBLOCK];
477 const char* chFilename;
481 const int BIGGEST_INDEX_TO_USE = 103;
484 long TheirIndexToOurIndex[BIGGEST_INDEX_TO_USE];
489 long INDX=0,INDP=0,
N=0,
S=0,L=0,J=0,maxINDX=0,loopindex=0,max_N_of_data=-1;
492 static int nCalled = 0;
494 const char* cdDATAFILE[] =
498 "UTA/nrb00_h_he1ic12.dat",
499 "UTA/nrb00_h_li2ic12.dat",
500 "UTA/nrb00_h_be3ic12.dat",
501 "UTA/nrb00_h_b4ic12.dat",
502 "UTA/nrb00_h_c5ic12.dat",
503 "UTA/nrb00_h_n6ic12.dat",
504 "UTA/nrb00_h_o7ic12.dat",
505 "UTA/nrb00_h_f8ic12.dat",
506 "UTA/nrb00_h_ne9ic12.dat",
507 "UTA/nrb00_h_na10ic12.dat",
508 "UTA/nrb00_h_mg11ic12.dat",
509 "UTA/nrb00_h_al12ic12.dat",
510 "UTA/nrb00_h_si13ic12.dat",
511 "UTA/nrb00_h_p14ic12.dat",
512 "UTA/nrb00_h_s15ic12.dat",
513 "UTA/nrb00_h_cl16ic12.dat",
514 "UTA/nrb00_h_ar17ic12.dat",
515 "UTA/nrb00_h_k18ic12.dat",
516 "UTA/nrb00_h_ca19ic12.dat",
517 "UTA/nrb00_h_sc20ic12.dat",
518 "UTA/nrb00_h_ti21ic12.dat",
519 "UTA/nrb00_h_v22ic12.dat",
520 "UTA/nrb00_h_cr23ic12.dat",
521 "UTA/nrb00_h_mn24ic12.dat",
522 "UTA/nrb00_h_fe25ic12.dat",
523 "UTA/nrb00_h_co26ic12.dat",
524 "UTA/nrb00_h_ni27ic12.dat",
525 "UTA/nrb00_h_cu28ic12.dat",
526 "UTA/nrb00_h_zn29ic12.dat"
539# if defined(PRINT_DR) || defined(PRINT_RR)
545 for(
long nelem=ipISO; nelem <
LIMELM; nelem++ )
547 if( nelem < 2 ||
dense.lgElmtOn[nelem] )
549 for(
long ipHi=0; ipHi <
iso_sp[ipISO][nelem].numLevels_max; ipHi++ )
552 iso_sp[ipISO][nelem].fb[ipHi].DielecRecombVsTemp[k] = 0.;
562 if( nelem < 2 ||
dense.lgElmtOn[nelem] )
564 ioDATA=
open_data( cdDATAFILE[nelem],
"r" );
569 for(
long i=0; i<BIGGEST_INDEX_TO_USE; i++ )
570 TheirIndexToOurIndex[i] = -1;
577 if(
nMatch(
"INDX INDP ",
string) )
582 fprintf(
ioQQQ,
" Badnell data file appears to be corrupted.\n");
589 if( strcmp(
string,
"\n")==0 )
596 INDX=(long)
FFmtRead(
string,&i1,
sizeof(
string),&lgEOL);
597 if( INDX >= BIGGEST_INDEX_TO_USE )
604 ASSERT( INDX < BIGGEST_INDEX_TO_USE );
606 INDP=(long)
FFmtRead(
string,&i1,
sizeof(
string),&lgEOL);
611 if( (i1=
nMatch(
"1S1 ",
string)) > 0 )
614 N=(long)
FFmtRead(
string,&i1,
sizeof(
string),&lgEOL);
622 if( (i1=
nMatch(
" (",
string)) > 0 )
625 S=(long)
FFmtRead(
string,&i1,
sizeof(
string),&lgEOL);
636 L=(long)
FFmtRead(
string,&i1,
sizeof(
string),&lgEOL);
641 J=(long)
FFmtRead(
string,&i1,
sizeof(
string),&lgEOL);
642 ASSERT( J <= ( L + (
int)((
S+1)/2) ) &&
643 J >= ( L - (
int)((
S+1)/2) ) && J >= 0 );
647 TheirIndexToOurIndex[INDX] =
iso_sp[
ipHE_LIKE][nelem].QuantumNumbers2Index[
N][L][
S];
658 if(
N==2 && L==1 &&
S==3 )
661 TheirIndexToOurIndex[INDX] = 3;
663 TheirIndexToOurIndex[INDX] = 4;
667 ASSERT( TheirIndexToOurIndex[INDX] == 5 );
670 max_N_of_data =
MAX2( max_N_of_data,
N );
689 ASSERT( maxINDX < BIGGEST_INDEX_TO_USE );
698 if(
nMatch(
"INDX TE= ",
string) )
705 fprintf(
ioQQQ,
" Badnell data file appears to be corrupted.\n");
713 if(
nMatch(
"PRTF",
string) || INDX >= maxINDX || INDX<0 )
717 INDX=(long)
FFmtRead(
string,&i1,
sizeof(
string),&lgEOL);
723 if( TheirIndexToOurIndex[INDX] <
iso_sp[
ipHE_LIKE][nelem].numLevels_max &&
724 TheirIndexToOurIndex[INDX] > 0 )
729 for(loopindex=0;loopindex<10;loopindex++)
731 value=(double)
FFmtRead(
string,&i1,
sizeof(
string),&lgEOL);
738 fprintf(
ioQQQ,
" Badnell data file appears to be corrupted.\n");
744 for(loopindex=10;loopindex<19;loopindex++)
746 value=(double)
FFmtRead(
string,&i1,
sizeof(
string),&lgEOL);
757 ASSERT( maxINDX < BIGGEST_INDEX_TO_USE );
758 ASSERT( max_N_of_data > 0 );
767 for(
long i=TheirIndexToOurIndex[maxINDX]+1;
777 indexOfMaxN =
iso_sp[
ipHE_LIKE][nelem].QuantumNumbers2Index[max_N_of_data][L][
S];
778 for(loopindex=0;loopindex<19;loopindex++)
781 iso_sp[
ipHE_LIKE][nelem].fb[indexOfMaxN].DielecRecombVsTemp[loopindex] *
794 for(loopindex=0;loopindex<19;loopindex++)
797 iso_sp[
ipHE_LIKE][nelem].fb[indexOfMaxN].DielecRecombVsTemp[loopindex] *
806 for(
long i=0; i<NBLOCK; ++i )
809 data_begin_line[i] = INT_MIN;
812 chFilename =
"badnell_dr.dat";
828 data_begin_line[number] = count;
829 ASSERT( number < NBLOCK );
848 for(
long nelem=0; nelem<
LIMELM; nelem++ )
862 for(
long ion=0; ion<nelem+1; ++ion )
890 fseek(ioDATA, 0, SEEK_SET);
894 fprintf(
ioQQQ,
" DISASTER PROBLEM Badnell_rec_init could not read first line of badnell_dr.dat.\n");
900 if( (chs =
strchr_s(chLine,
')'))==NULL )
903 fprintf(
ioQQQ,
" DISASTER PROBLEM Badnell_rec_init data file incorrect format.\n");
908 sscanf(chs,
"%4i%2i%2i",&yr, &mo, &dy);
910 int dr_yr = 2012, dr_mo = 6, dr_dy = 28;
911 if((yr != dr_yr) || (mo != dr_mo) || (dy != dr_dy))
914 "DISASTER PROBLEM Badnell_rec_init The version of %s I found (%i %i %i) is not the current version (%i %i %i).\n",
915 chFilename, yr, mo, dy, dr_yr, dr_mo, dr_dy);
916 fprintf(
ioQQQ,
" The first line of the file is the following\n %s\n", chLine );
923 length_of_line = (int)strlen(chLine);
926 if( count > data_begin_line[0] && count < data_begin_line[1] && length_of_line >3 )
933 sscanf(chLine,
"%i%i%i%i%lf%lf%lf%lf%lf%lf%lf%lf%lf",
934 &NuclearCharge, &NumberElectrons, &M_state, &W_state, &par_C[0], &par_C[1], &par_C[2],
935 &par_C[3], &par_C[4], &par_C[5], &par_C[6], &par_C[7], &par_C[8]);
938 long int NuclearChargeM1 = NuclearCharge-1;
940 if(M_state == 1 && NuclearChargeM1 <
LIMELM )
948 nDRFitPar[NuclearChargeM1][NumberElectrons] = 9;
949 for(
long i=8; i>=0; i-- )
952 --
nDRFitPar[NuclearChargeM1][NumberElectrons];
958 for(
long i=0; i<9; i++ )
959 DRFitParPart1[NuclearChargeM1][NumberElectrons][i] = par_C[i];
965 fseek(ioDATA, 0, SEEK_SET);
970 length_of_line = (int)strlen(chLine);
971 if( count > data_begin_line[1] && length_of_line > 3 )
979 sscanf(chLine,
"%i%i%i%i%lf%lf%lf%lf%lf%lf%lf%lf%lf",
980 &NuclearCharge, &NumberElectrons, &M_state, &W_state, &par_E[0], &par_E[1], &par_E[2],
981 &par_E[3], &par_E[4], &par_E[5], &par_E[6], &par_E[7], &par_E[8]);
983 long int NuclearChargeM1 = NuclearCharge-1;
985 if(M_state == 1 && NuclearChargeM1<
LIMELM)
992 nDRFitPar[NuclearChargeM1][NumberElectrons] = 9;
993 for(
long i=8; i>=0; i-- )
996 --
nDRFitPar[NuclearChargeM1][NumberElectrons];
1002 for(
long i=0; i<
nDRFitPar[NuclearChargeM1][NumberElectrons]; i++ )
1003 DRFitParPart2[NuclearChargeM1][NumberElectrons][i] = par_E[i];
1012 for(
long nelem=0; nelem<
LIMELM; nelem++ )
1014 for(
int ion=0; ion<nelem+1;++ion )
1018 fprintf(ofp,
"%i %i %e %e %e %e %e %e %e %e %e\n",
1027 for(
long nelem=0; nelem<
LIMELM; nelem++ )
1029 for(
int ion=0; ion<nelem+1; ion++ )
1033 fprintf(ofp,
"%i %i %e %e %e %e %e %e %e %e %e\n",
1047 bool lgDRBadnellBothDefined =
true;
1048 for(
int nelem=0; nelem<
LIMELM; nelem++ )
1050 for(
int ion=0; ion<nelem+1; ion++ )
1056 fprintf(
ioQQQ,
"DR %i, RR %i: %c %c\n", nelem, ion,
1059 fprintf(
ioQQQ,
"PROBLEM ion_recomb_Badnell first and second half of Badnell DR not consistent.\n");
1060 lgDRBadnellBothDefined =
false;
1065 if( !lgDRBadnellBothDefined )
1069 "DISASTER PROBLEM The DR data files are corrupted - part 1 and 2 do not agree.\n");
1070 fprintf(
ioQQQ,
" Start again with a fresh copy of the data directory\n" );
1075 chFilename =
"badnell_rr.dat";
1080 if(
read_whole_line( chLine , (
int)
sizeof(chLine) , ioDATA ) == NULL )
1082 fprintf(
ioQQQ,
" DISASTER PROBLEM Badnell_rec_init could not read first line of badnell_rr.dat.\n");
1086 if( (chs =
strchr_s(chLine,
')'))==NULL )
1089 fprintf(
ioQQQ,
" DISASTER PROBLEM Badnell_rec_init data file incorrect format.\n");
1093 sscanf(chs,
"%4i%2i%2i", &yr, &mo, &dy);
1094 int rr_yr = 2011, rr_mo = 4, rr_dy = 12;
1095 if((yr != rr_yr)||(mo != rr_mo)||(dy != rr_dy))
1097 fprintf(
ioQQQ,
"DISASTER PROBLEM The version of %s I found (%i %i %i) is not the current version (%i %i %i).\n",
1098 chFilename, yr, mo, dy, rr_yr, rr_mo, rr_dy);
1099 fprintf(
ioQQQ,
" The line was as follows:\n %s\n", chLine );
1111 if(chLine[0] !=
'#')
1113 sscanf(chLine,
"%i%i%i%i%lf%lf%lf%lf%lf%lf",
1114 &NuclearCharge, &NumberElectrons, &M_state, &W_state, &temp_par[0], &temp_par[1],
1115 &temp_par[2], &temp_par[3], &temp_par[4], &temp_par[5]);
1116 long NuclearChargeM1 = NuclearCharge-1;
1118 if(M_state == 1 && NuclearChargeM1<
LIMELM)
1126 RRFitPar[NuclearChargeM1][NumberElectrons][i] = temp_par[i];
1134 for(
long nelem=0; nelem<
LIMELM; nelem++ )
1136 for(
long ion=0; ion<nelem+1; ion++ )
1140 fprintf(ofp,
"%li %li %e %e %e %e %e %e\n",
1141 nelem, ion,
RRFitPar[nelem][ion][0],
1149 fprintf(ofp,
"total lines are %i ", count);
1157 enum {DEBUG_LOC=
false};
1162 fprintf(
ioQQQ,
"\nDEBUG rr rec\t%i",nelem);
1163 for(
int ion=0; ion<=nelem; ++ion )
1167 fprintf(
ioQQQ,
"\n");
1168 fprintf(
ioQQQ,
"DEBUG dr rec\t%i",nelem);
1169 for(
int ion=0; ion<=nelem; ++ion )
1173 fprintf(
ioQQQ,
"\n");
1181 if(
ionbal.guess_noise !=0. )
1195 for(
long nelem=0; nelem<
LIMELM; ++nelem )
1204 static double TeUsed = -1 , EdenUsed = -1.;
1216 EdenUsed =
dense.eden;
1221 for(
long ion=0; ion < nelem+1; ++ion )
1223 long int n_bnd_elec_before_recom ,
1224 n_bnd_elec_after_recom;
1226 n_bnd_elec_before_recom = nelem-ion;
1227 n_bnd_elec_after_recom = nelem-ion+1;
1230 ionbal.DR_Badnell_rate_coef[nelem][ion] = -1.;
1231 ionbal.RR_rate_coef_used[nelem][ion] = 0.;
1236 if( (
ionbal.DR_Badnell_rate_coef[nelem][ion] =
1242 n_bnd_elec_before_recom )) >= 0. )
1254 ionbal.RR_Verner_rate_coef[nelem][ion] =
1259 n_bnd_elec_after_recom ,
1267 n_bnd_elec_before_recom )) >= 0. )
1269 ionbal.RR_rate_coef_used[nelem][ion] =
ionbal.RR_Badnell_rate_coef[nelem][ion];
1274 ionbal.RR_rate_coef_used[nelem][ion] =
ionbal.RR_Verner_rate_coef[nelem][ion];
1278 ionbal.DR_Badnell_rate_coef[nelem][nelem] = 0.;
1283 double Fe_Gu_c[9][6] = {
1284 { 2.50507e-11, 5.60226e-11, 1.85001e-10, 3.57495e-9, 1.66321e-7, 0. },
1285 { 9.19610e-11, 2.92460e-10, 1.02120e-9, 1.14852e-8, 3.25418e-7, 0. },
1286 { 9.02625e-11, 6.22962e-10, 5.77545e-9, 1.78847e-8, 3.40610e-7, 0. },
1287 { 9.04286e-12, 9.68148e-10, 4.83636e-9, 2.48159e-8, 3.96815e-7, 0. },
1288 { 6.77873e-10, 1.47252e-9, 5.31202e-9, 2.54793e-8, 3.47407e-7, 0. },
1289 { 1.29742e-9, 4.10172e-9, 1.23605e-8, 2.33615e-8, 2.97261e-7, 0. },
1290 { 8.78027e-10, 2.31680e-9, 3.49333e-9, 1.16927e-8, 8.18537e-8, 1.54740e-7 },
1291 { 2.23178e-10, 1.87313e-9, 2.86171e-9, 1.38575e-8, 1.17803e-7, 1.06251e-7 },
1292 { 2.17263e-10, 7.35929e-10, 2.81276e-9, 1.32411e-8, 1.15761e-7, 4.80389e-8 }
1296 { 8.30501e-2, 8.52897e-1, 3.40225e0, 2.23053e1, 6.80367e1, 0. },
1297 { 1.44392e-1, 9.23999e-1, 5.45498e0, 2.04301e1, 7.06112e1, 0. },
1298 { 5.79132e-2, 1.27852e0, 3.22439e0, 1.79602e1, 6.96277e1, 0. },
1299 { 1.02421e-1, 1.79393e0, 4.83226e0, 1.91117e1, 6.80858e1, 0. },
1300 { 1.24630e-1, 6.86045e-1, 3.09611e0, 1.44023e1, 6.42820e1, 0. },
1301 { 1.34459e-1, 6.63028e-1, 2.61753e0, 1.30392e1, 6.10222e1, 0. },
1302 { 7.79748e-2, 5.35522e-1, 1.88407e0, 8.38459e0, 3.38613e1, 7.89706e1 },
1303 { 8.83019e-2, 6.12756e-1, 2.36035e0, 9.61736e0, 3.64467e1, 8.72406e1 },
1304 { 1.51322e-1, 5.63155e-1, 2.57013e0, 9.08166e0, 3.69528e1, 1.08067e2 }
1314 for(
long ion=0; ion<9; ion++ )
1320 for(
long i=0; i<6; i++ )
1322 fitSum += Fe_Gu_c[ion][i] *
sexp( Fe_Gu_E[ion][i]/
phycon.te_eV );
1326 ionbal.DR_Badnell_rate_coef[
ipIRON][ion+5] = fitSum / te_eV32;
1332 double BadnelDR_RateSave[
LIMELM] =
1334 3.78e-13, 1.70e-12, 8.14e-12, 1.60e-11, 2.38e-11,
1335 6.42e-11, 5.97e-11, 1.47e-10, 1.11e-10, 3.26e-10,
1336 1.88e-10, 2.06e-10, 4.14e-10, 3.97e-10, 2.07e-10,
1337 2.46e-10, 3.38e-10, 3.15e-10, 9.70e-11, 6.49e-11,
1338 6.93e-10, 3.70e-10, 3.29e-11, 4.96e-11, 5.03e-11,
1339 2.91e-12, 4.62e-14, 0.00e+00, 0.00e+00, 0.00e+00
1341 for(
long nelem=0; nelem <
LIMELM; ++nelem )
1344 BadnelDR_RateSave[nelem] *
RecNoise[nelem] *
1346 ionbal.DR_mean_scale[nelem];
1351 for(
long ion=0; ion <
ipIRON+1; ++ion )
1362 for(
long nelem=0; nelem <
LIMELM; ++nelem )
1364 for(
long ion=0; ion < nelem+1; ++ion )
1365 if(
ionbal.DR_Badnell_rate_coef[nelem][ion] < 0. )
1375 for(
long ion=0; ion < nelem-1; ++ion )
1399 if(
ionbal.lgRecom_Badnell_print )
1402 fprintf(
ioQQQ,
"\n\n RR recombination data sources \n" );
1404 for(
long loop=0;loop<30;loop+=10)
1406 fprintf(
ioQQQ,
"\n\n ");
1407 for(
long ion=loop; ion<loop+10; ++ion )
1409 fprintf(
ioQQQ,
"&%7li",ion);
1411 fprintf(
ioQQQ,
"\\\\\n" );
1412 for(
long nelem=loop; nelem<
LIMELM; ++nelem )
1415 long limit =
MIN2(nelem+1,loop+10);
1416 for(
long ion=loop; ion<limit; ++ion )
1420 for(
long ion=limit; ion<loop+10; ++ion )
1424 fprintf(
ioQQQ,
"\\\\\n" );
1427 fprintf(
ioQQQ,
"\nData sources\n");
1428 fprintf(
ioQQQ,
"Bad06: Badnell, N., 2006, ApJ, 167, 334B\n");
1429 fprintf(
ioQQQ,
"Verner: Verner & Ferland, 1996, ApJS, 103, 467\n");
1431 fprintf(
ioQQQ,
"\n\n DR recombination data sources \n" );
1433 for(
long loop=0;loop<30;loop+=10)
1435 fprintf(
ioQQQ,
"\n\n ");
1436 for(
long ion=loop; ion<loop+10; ++ion )
1438 fprintf(
ioQQQ,
"&%7li",ion);
1440 fprintf(
ioQQQ,
"\\\\\n" );
1441 for(
long nelem=loop; nelem<
LIMELM; ++nelem )
1443 fprintf(
ioQQQ,
"%2li %5s ",
1445 long limit =
MIN2(nelem+1,loop+10);
1446 for(
long ion=loop; ion<limit; ++ion )
1450 for(
long ion=limit; ion<loop+10; ++ion )
1454 fprintf(
ioQQQ,
"\\\\\n" );
1457 fprintf(
ioQQQ,
"\nData sources\nBadWeb: Badnell web site http://amdpp.phys.strath.ac.uk/tamoc/DR/\n");
1458 fprintf(
ioQQQ,
"Bad06D: Badnell, N., 2006, ApJ, 651, L73\n");
1459 fprintf(
ioQQQ,
"GuPC: Gu, M. private communication\n");
1461 fprintf(
ioQQQ,
"\n\nDEBUG Badnell recombination RR, then DR, T=%.3e\n",
phycon.te );
1464 fprintf(
ioQQQ,
"nelem=%li %s, RR then DR\n",
1466 for(
long ion=0; ion<nelem+1; ++ion )
1468 fprintf(
ioQQQ,
" %.2e",
ionbal.RR_rate_coef_used[nelem][ion] );
1470 fprintf(
ioQQQ,
"\n" );
1471 for(
long ion=0; ion<nelem+1; ++ion )
1473 fprintf(
ioQQQ,
" %.2e",
ionbal.DR_Badnell_rate_coef[nelem][ion] );
1475 fprintf(
ioQQQ,
"\n\n" );
1478 fprintf(
ioQQQ,
"mean DR recombination ion mean \n" );
1479 for(
long ion=0; ion<
LIMELM; ++ion )
1481 fprintf(
ioQQQ,
" %2li %.2e \n",
1486 fprintf(
ioQQQ,
"\n\nCollisSuppres finds following dielectronic"
1487 " recom suppression factors, eden=%10.3e\n",
dense.eden );
1488 fprintf(
ioQQQ,
"nelem ion fac \n" );
1489 for(
long nelem=0; nelem<
LIMELM; ++nelem )
1491 for(
long ion=0; ion < nelem+1; ion++ )
1493 fprintf(
ioQQQ,
"%3ld %4ld %10.3e\n", nelem+1 , ion+1,
1507 fprintf(
ioQQQ,
"\n");