12 #include "StFtpcMagboltz1.hh"
16 StFtpcMagboltz1::StFtpcMagboltz1()
26 StFtpcMagboltz1::~StFtpcMagboltz1()
31 int StFtpcMagboltz1::magboltz_(
float *e_magni__,
float *b_magni__,
32 float *b_ang__,
float *press,
float *p_ar__,
33 float *p_co2__,
float *p_ne__,
float *p_he__,
float *temper,
34 float *vdr,
float *psiang,
float *efin)
41 static double aold, anew;
42 static int last, itot, iout, j, l, m;
43 static double aconv, anorm;
50 callpars_1.e_magnitude__ = *e_magni__;
51 printf(
"setting e_magnitude to %f\n", callpars_1.e_magnitude__);
52 callpars_1.b_magnitude__ = *b_magni__;
53 callpars_1.b_angle__ = *b_ang__;
54 callpars_1.pressure = *press;
55 callpars_1.perc_ar__ = *p_ar__;
56 callpars_1.perc_co2__ = *p_co2__;
57 callpars_1.perc_ne__ = *p_ne__;
58 callpars_1.perc_he__ = *p_he__;
59 callpars_1.temperature = *temper;
60 inpt_1.efinal = *efin;
66 bfield_(&inpt_1.nstep1);
71 for (l = 1; l <= i__1; ++l) {
75 f0calc_(&c__0, &c__0, &anew, &l);
78 f0calc_(&c__1, &c__0, &anew, &l);
82 anorm = (d__1 = (float)1. - anew / aold, fabs(d__1));
83 printf(
"NEW SUM = %f OLD SUM = %f FRACTIONAL DIFFERENCE = %f ITERATION NUMBER = %d\n", anew, aold, anorm, itot);
85 if (iout == inpt_1.nout) {
88 if (iout == inpt_1.nout) {
91 if (itot > inpt_1.itmax) {
94 if (anorm > inpt_1.conv) {
98 if (inpt_1.idlong == 1) {
102 if (inpt_1.i2type == 1) {
105 if (inpt_1.nitalp == 1 && inpt_1.alpha != (
float)0.) {
116 f0calc_(&c__1, &inpt_1.i2type, &anew, &l);
120 anorm = (d__1 = (float)1. - anew / aold, fabs(d__1));
121 printf(
"NEW SUM = %f OLD SUM = %f FRACTIONAL DIFFERENCE = %f ITERATION NUMBER = %d\n", anew, aold, anorm, itot);
123 if (iout == inpt_1.nout) {
126 if (iout == inpt_1.nout) {
129 if (itot > inpt_1.itmax) {
132 if (anorm >= inpt_1.conv) {
135 if (inpt_1.idlong == 1) {
136 steppr_(&inpt_1.i2type, &l);
147 f0calc_(&c__1, &inpt_1.i2type, &anew, &l);
150 anorm = (d__1 = (float)1. - anew / aold, fabs(d__1));
151 if (anorm < inpt_1.conv) {
152 printf(
"NEW SUM = %f OLD SUM = %f FRACTIONAL DIFFERENCE = %f ITERATION NUMBER = %d\n", anew, aold, anorm, itot);
155 if (itot > inpt_1.itmax) {
158 if (anorm >= inpt_1.conv) {
166 if (inpt_1.alpold == (
float)0.) {
167 inpt_1.alpold = 1e-10;
169 if (inpt_1.alpnew < (
float)700.) {
173 inpt_1.alpnew *= (float).5;
176 inpt_1.alpnax *= (float).5;
179 inpt_1.alpnay *= (float).5;
182 inpt_1.alpnaz *= (float).5;
185 aconv = (d__1 = (float)1. - inpt_1.alpnew / inpt_1.alpold,
187 if (aconv >= inpt_1.conalp) {
190 if (inpt_1.idlong == 1) {
191 steppr_(&inpt_1.i2type, &l);
209 if (inpt_1.idlong == 1) {
210 steppr_(&inpt_1.i2type, &l);
214 for (j = 1; j <= 2002; ++j) {
215 f2c_1.f2[j - 1] = (float)0.;
217 f2c_1.df2[j - 1] = (float)0.;
225 printf(
"NUMBER OF ITERATIONS GREATER THAN ALLOWED = %d\n", itot);
228 if (f0c_1.f[inpt_1.nstep - 1] > (
float)1e-7) {
229 printf(
"Jump 1: %f\n", f0c_1.f[inpt_1.nstep - 1]);
230 inpt_1.efinal *= (float)1.1;
236 }
else if (f0c_1.f[inpt_1.nstep - 1] < (
float)1e-10) {
237 printf(
"Jump 1: %f\n", f0c_1.f[inpt_1.nstep - 1]);
238 inpt_1.efinal *= (float).9;
245 printf(
"********************\n");
246 d__1 = mk_1.velz / (float)1e6;
247 printf(
"Drift velocity == %f\n", d__1);
248 printf(
"Longitudinal diff = %f\n",mk_1.sig_long__);
249 printf(
"Transvers_xx diff = %f\n", mk_1.sig_tranx__);
250 printf(
"Transvers_yy diff = %f\n", mk_1.sig_trany__);
251 printf(
"Lorentz angle == %f\n",mk_1.angle);
252 printf(
"Drift Field = %f\n", mk_1.amk_emag__);
253 printf(
"********************\n");
254 *vdr = mk_1.velz / (float)1e6;
255 *psiang = mk_1.angle;
256 *efin = inpt_1.efinal;
262 int StFtpcMagboltz1::bfield_(
int *nstep1)
269 static double bcos, bsin, emag2;
271 static double en, pi, atheta, ef2, sincos, cos2, sin2;
273 pi =(double) acos(-1.);
274 atheta = mag_1.btheta * pi / 180.;
280 if (mag_1.btheta == (
float)90.) {
283 if (mag_1.btheta == (
float)90.) {
288 sincos = bsin * bcos;
289 emag2 = mag_1.emag * mag_1.emag;
291 for (j = 1; j <= i__1; ++j) {
292 en = mix2_1.e[j - 1];
293 if (en == (
float)0.) {
299 d__2 = mix2_1.qtot[j - 1];
300 mag_1.denom[j - 1] = cnsts_1.echarg * (d__1 * d__1) / (cnsts_1.emass *
301 2e6 * en * (d__2 * d__2));
302 mag_1.sod[j - 1] = ::sqrt(mag_1.denom[j - 1]) * bsin;
303 mag_1.cod2[j - 1] = mag_1.denom[j - 1] * cos2;
304 mag_1.sod2[j - 1] = mag_1.denom[j - 1] * sin2;
305 mag_1.scd[j - 1] = mag_1.denom[j - 1] * sincos;
306 mag_1.cod2[j - 1] += (float)1.;
307 mag_1.sod2[j - 1] += (float)1.;
308 mag_1.denom[j - 1] += (float)1.;
309 mag_1.sod[j - 1] /= mag_1.denom[j - 1];
310 mag_1.sod2[j - 1] /= mag_1.denom[j - 1];
311 mag_1.cod2[j - 1] /= mag_1.denom[j - 1];
312 mag_1.scd[j - 1] /= mag_1.denom[j - 1];
313 ef2 = emag2 * cos2 + emag2 * sin2 / mag_1.denom[j - 1];
314 mag_1.ef[j - 1] = ef2 / mag_1.emag;
315 mag_1.qe[j - 1] = mag_1.ef[j - 1] / mix2_1.qtot[j - 1];
316 mag_1.qef[j - 1] = en / (mix2_1.qtot[j - 1] * (float)3.);
317 mag_1.qfemag[j - 1] = mag_1.qef[j - 1] * mag_1.emag;
318 mag_1.qeef[j - 1] = mag_1.qef[j - 1] * mag_1.ef[j - 1];
320 mag_1.qeeef[j - 1] = ef2 * mag_1.qef[j - 1];
325 int StFtpcMagboltz1::f0calc_(
int *iback,
int *icon,
double *anew,
int *l)
334 static double fmus, ssum, f1sum, f2sum;
335 static int i__, j, m;
336 static double s2sum, z__, f2sum1, f2sum2, fnsum, fnssm1, fnssm2, ai,
337 sfb, f2t1, f2t2, ext, sum;
338 static int min1, min2, min3, min4;
346 printf(
"starting f0calc\n");
353 f0c_1.df[inpt_1.nstep + 1] = (float)0.;
354 f0c_1.f[inpt_1.nstep1 - 1] = 1e-7;
362 for (m = 1; m <= i__1; ++m) {
363 i__ = inpt_1.nstep - m + 2;
366 for (j = 1; j <= i__2; ++j) {
367 mion = mix3_1.lion[j - 1] + i__;
368 if (mion >= inpt_1.nstep1) {
371 z__ = z__ + f0c_1.f[mion - 1] * mix1_1.qion[j + (mion << 2) - 5] /
372 ai + (f0c_1.f[mion] * mix1_1.qion[j + ((mion + 1) << 2) -
373 5] - f0c_1.f[mion - 1] * mix1_1.qion[j + (mion << 2) - 5])
374 * mix3_1.alion[j - 1] / ai;
379 asum = f0c_1.f[i__ - 1] * (mag_1.qef[i__ - 1] * inpt_1.alpnaz *
380 inpt_1.alpnew + mag_1.qeef[i__ - 1] * inpt_1.alpnew *
382 sum = z__ - f0c_1.f[i__ - 1] * mix1_1.qsum[i__ - 1] + asum;
384 if (mix3_1.nin1 == 0) {
388 for (j = 1; j <= i__2; ++j) {
389 min1 = mix3_1.lin1[j - 1] + i__;
390 if (min1 >= inpt_1.nstep1) {
393 sum = sum + f0c_1.f[min1 - 1] * mix1_1.qin1[j + min1 * 24 - 25] +
394 (f0c_1.f[min1] * mix1_1.qin1[j + (min1 + 1) * 24 - 25] -
395 f0c_1.f[min1 - 1] * mix1_1.qin1[j + min1 * 24 - 25]) *
401 if (mix3_1.nin2 == 0) {
405 for (j = 1; j <= i__2; ++j) {
406 min2 = mix3_1.lin2[j - 1] + i__;
407 if (min2 >= inpt_1.nstep1) {
410 sum = sum + f0c_1.f[min2 - 1] * mix1_1.qin2[j + min2 * 24 - 25] +
411 (f0c_1.f[min2] * mix1_1.qin2[j + (min2 + 1) * 24 - 25] -
412 f0c_1.f[min2 - 1] * mix1_1.qin2[j + min2 * 24 - 25]) *
418 if (mix3_1.nin3 == 0) {
422 for (j = 1; j <= i__2; ++j) {
423 min3 = mix3_1.lin3[j - 1] + i__;
424 if (min3 >= inpt_1.nstep1) {
427 sum = sum + f0c_1.f[min3 - 1] * mix1_1.qin3[j + min3 * 24 - 25] +
428 (f0c_1.f[min3] * mix1_1.qin3[j + (min3 + 1) * 24 - 25] -
429 f0c_1.f[min3 - 1] * mix1_1.qin3[j + min3 * 24 - 25]) *
435 if (mix3_1.nin4 == 0) {
439 for (j = 1; j <= i__2; ++j) {
440 min4 = mix3_1.lin4[j - 1] + i__;
441 if (min4 >= inpt_1.nstep1) {
444 sum = sum + f0c_1.f[min4 - 1] * mix1_1.qin4[j + min4 * 24 - 25] +
445 (f0c_1.f[min4] * mix1_1.qin4[j + (min4 + 1) * 24 - 25] -
446 f0c_1.f[min4 - 1] * mix1_1.qin4[j + min4 * 24 - 25]) *
458 type2_(&s2sum, &i__, &inpt_1.nstep1);
462 fnsum *= inpt_1.estep;
466 f2sum1 = inpt_1.alpnaz * (float).4 * inpt_1.alpnew * f2c_1.f2[i__ - 1]
467 * mag_1.qef[j - 1] * inpt_1.estep;
468 f2sum2 = inpt_1.alpnew * (
float).4 * mag_1.qeef[i__ - 1] * (f2c_1.df2[
469 i__ - 1] + f2c_1.f2[i__ - 1] * (float)1.5 / mix2_1.e[i__ - 1])
471 f2sum = f2sum + f2sum1 + f2sum2;
472 f2t1 = mag_1.qeeef[i__ - 1] * (float).4 * (f2c_1.df2[i__ - 1] +
473 f2c_1.f2[i__ - 1] * (
float)1.5 / mix2_1.e[i__ - 1]);
474 f2t2 = mag_1.qfemag[i__ - 1] * (float).4 * inpt_1.alpnaz * f2c_1.f2[
476 if (inpt_1.isfb == 1) {
477 sfb = mag_1.qeeef[i__ - 1] * f0c_1.f[i__ - 1] + ((mix1_1.qelm[i__
478 - 1] + mag_1.qfemag[i__ - 1] * inpt_1.alpnaz) * f0c_1.f[
479 i__ - 1] - ssum) * inpt_1.akt;
481 if (inpt_1.isfb == 0) {
482 sfb = mag_1.qeeef[i__ - 1] * f0c_1.f[i__ - 1] + mix1_1.qelm[i__ -
483 1] * f0c_1.f[i__ - 1] * inpt_1.akt;
485 f0c_1.df[i__ - 1] = (ssum - f0c_1.f[i__ - 1] * (mix1_1.qelm[i__ - 1]
486 + mag_1.qfemag[i__ - 1] * inpt_1.alpnaz) + f2sum - f2t1 -
489 ext = mix1_1.qelm[i__ - 1] * f0c_1.f[i__ - 1] + mix1_1.qelm[i__ - 1] *
490 f0c_1.f[i__ - 1] * f0c_1.df[i__ - 1] * inpt_1.akt;
491 f1c_1.f1[i__ - 1] = (fnssm2 + ext - fnssm1) * (
float)3. / (mag_1.emag
492 * mix2_1.e[i__ - 1]);
493 f1sum = inpt_1.alpnew * (mix2_1.e[i__ - 1] * (float)2. * f1c_1.f1[i__
494 - 1] - mix2_1.e[i__] * f1c_1.f1[i__]) * inpt_1.estep / (float)
497 if (i__ >= inpt_1.nstep1 - 2) {
500 f1c_1.df1[i__ - 1] = (f1c_1.f1[i__ + 1] - f1c_1.f1[i__ - 1]) /
501 inpt_1.estep - f1c_1.df1[i__ + 1];
502 f1c_1.df1[i__] = (f1c_1.f1[i__ + 1] - f1c_1.f1[i__ - 1]) / (
503 inpt_1.estep * (float)2.);
506 if (i__ == inpt_1.nstep1) {
507 f1c_1.df1[i__ - 1] = -f1c_1.f1[inpt_1.nstep1 - 1] / (inpt_1.estep
510 if (i__ == inpt_1.nstep1 - 1) {
511 f1c_1.df1[i__ - 1] = (f1c_1.f1[inpt_1.nstep1 - 1] - f1c_1.f1[
512 inpt_1.nstep1 - 2]) / inpt_1.estep;
514 if (i__ == inpt_1.nstep1 - 2) {
515 f1c_1.df1[i__ - 1] = (f1c_1.f1[inpt_1.nstep1 - 2] - f1c_1.f1[
516 inpt_1.nstep1 - 3]) / inpt_1.estep;
523 f2c_1.f2[i__ - 1] = mag_1.qe[i__ - 1] * (float)-2. * (f1c_1.df1[i__ -
524 1] - f1c_1.f1[i__ - 1] / (mix2_1.e[i__ - 1] * (
float)2.)) / (
525 float)3. - inpt_1.alpnaz * (float)2. * f1c_1.f1[i__ - 1] / (
526 mix2_1.qtot[i__ - 1] * (
float)3.);
527 f2c_1.df2[i__ - 1] = f0c_1.df[i__ - 1] * (float)-2.5 * f0c_1.f[i__ -
528 1] - inpt_1.alpnaz * (
float)2.5 * f0c_1.f[i__ - 1] / mag_1.ef[
529 i__ - 1] - f2c_1.f2[i__ - 1] * (float)1.5 / mix2_1.e[i__ - 1]
530 - inpt_1.alpnaz * f2c_1.f2[i__ - 1] / mag_1.ef[i__ - 1] -
531 f1c_1.f1[i__ - 1] * (
float)2.5 / mag_1.qe[i__ - 1];
532 f2c_1.df2[inpt_1.nstep1] = f2c_1.df2[inpt_1.nstep1 - 1];
533 f2c_1.f2[i__ - 2] = f2c_1.f2[i__ - 1] - inpt_1.estep * (f2c_1.df2[i__
534 - 1] * (float)1.5 - f2c_1.df2[i__] * (
float).5);
535 f2c_1.df2[i__ - 2] = f2c_1.df2[i__ - 1] * (float)2. - f2c_1.df2[i__];
547 f0c_1.f[i__ - 2] = f0c_1.f[i__ - 1] * exp(-(f0c_1.df[i__ - 1] * (
548 float)3. - f0c_1.df[i__]) * (
float).5 * inpt_1.estep);
552 f0c_1.df[0] = (float)0.;
558 f0c_1.f[1] = exp((f0c_1.df[0] + f0c_1.df[1]) * (
float).5 * inpt_1.estep);
559 f0c_1.f[0] = f0c_1.f[1] * exp(-(f0c_1.df[1] * (
float)3. - f0c_1.df[2]) * (
560 float).5 * inpt_1.estep);
561 f0c_1.f[2] = exp(inpt_1.estep * (f0c_1.df[0] + f0c_1.df[1] * (
float)4. +
562 f0c_1.df[2]) / (
float)3.);
563 i__1 = inpt_1.nstep1;
564 for (i__ = 5; i__ <= i__1; i__ += 2) {
566 f0c_1.f[i__ - 1] = f0c_1.f[i__ - 3] * exp(inpt_1.estep * (f0c_1.df[
567 i__ - 3] + f0c_1.df[i__ - 2] * (
float)4. + f0c_1.df[i__ - 1])
571 for (i__ = 4; i__ <= i__1; i__ += 2) {
573 f0c_1.f[i__ - 1] = f0c_1.f[i__ - 3] * exp(inpt_1.estep * (f0c_1.df[
574 i__ - 3] + f0c_1.df[i__ - 2] * (
float)4. + f0c_1.df[i__ - 1])
583 i__1 = inpt_1.nstep1;
584 for (j = 1; j <= i__1; ++j) {
586 sint_1.simf[j - 1] = f0c_1.f[j - 1] * mix2_1.eroot[j - 1];
589 fmus = (float)1. / *anew;
590 i__1 = inpt_1.nstep1;
591 for (j = 1; j <= i__1; ++j) {
592 f0c_1.f[j - 1] *= fmus;
594 f0c_1.df0[j - 1] = f0c_1.df[j - 1] * f0c_1.f[j - 1];
597 printf(
"done with f0calc %f\n", f0c_1.f[inpt_1.nstep - 1]);
602 int StFtpcMagboltz1::fncalc_(
int *lmax)
613 f2c_1.f2[inpt_1.nstep1] = (float)0.;
614 i__1 = inpt_1.nstep1;
615 for (j = 2; j <= i__1; ++j) {
617 f2c_1.f2[j - 1] = -(mag_1.ef[j - 1] * (float)2. * (mix2_1.e[j - 1] *
618 f1c_1.df1[j - 1] - f1c_1.f1[j - 1] / (
float)2.) / (
619 mix2_1.qtot[j - 1] * (float)3. * mix2_1.e[j - 1]) + f1c_1.f1[
620 j - 1] * (float)2. * inpt_1.alpnaz / (mix2_1.qtot[j - 1] * (
623 f2c_1.f2[0] = (float)0.;
625 for (j = 2; j <= i__1; ++j) {
627 f2c_1.df2[j - 1] = (f2c_1.f2[j] - f2c_1.f2[j - 2]) / (inpt_1.estep * (
630 f2c_1.df2[inpt_1.nstep1 - 1] = (f2c_1.f2[inpt_1.nstep1 - 1] - f2c_1.f2[
631 inpt_1.nstep - 1]) / inpt_1.estep;
632 f2c_1.df2[0] = f2c_1.f2[1] / inpt_1.estep;
635 f3c_1.f3[inpt_1.nstep1] = (
float)0.;
636 i__1 = inpt_1.nstep1;
637 for (j = 2; j <= i__1; ++j) {
639 f3c_1.f3[j - 1] = -mag_1.qe[j - 1] * (float).6 * (f2c_1.df2[j - 1] -
640 f2c_1.f2[j - 1] / mix2_1.e[j - 1]) - inpt_1.alpnaz * (float)
641 .6 * f2c_1.f2[j - 1] / mix2_1.qtot[j - 1];
643 f3c_1.f3[0] = (float)0.;
645 for (j = 2; j <= i__1; ++j) {
647 f3c_1.df3[j - 1] = (f3c_1.f3[j] - f3c_1.f3[j - 2]) / (inpt_1.estep * (
650 f3c_1.df3[inpt_1.nstep1 - 1] = (f3c_1.f3[inpt_1.nstep1 - 1] - f3c_1.f3[
651 inpt_1.nstep - 1]) / inpt_1.estep;
652 f3c_1.df3[0] = f3c_1.f3[1] / inpt_1.estep;
656 int StFtpcMagboltz1::g0calc_(
int *icon,
double *gfinal,
double *eg0sum,
int *lmax)
664 static double asum, bsum, ssum, g1sum;
668 static double z__, gssum, gnsum, ai;
669 static double gnssum, vel, ext, sum;
670 static int min1, min2, min3, min4;
671 static double sum1, sum2, sum3, sum4;
673 inpt_1.alpnew = (float)0.;
674 inpt_1.alpnaz = (float)0.;
675 i__1 = inpt_1.nstep1;
676 for (j = 1; j <= i__1; ++j) {
678 sint_1.simf[j - 1] = mix2_1.e[j - 1] * f1c_1.f1[j - 1];
681 vel = sum * mag_1.eovm / (float)3.;
685 g0c_1.g[inpt_1.nstep1 - 1] = *gfinal;
686 g2c_1.g2[inpt_1.nstep1 - 1] = (float)0.;
687 g2c_1.dg2[inpt_1.nstep1 - 1] = (float)0.;
694 for (m = 1; m <= i__1; ++m) {
695 i__ = inpt_1.nstep - m + 2;
698 for (j = 1; j <= i__2; ++j) {
699 mion = mix3_1.lion[j - 1] + i__;
700 if (mion >= inpt_1.nstep1) {
703 z__ = z__ + g0c_1.g[mion - 1] * mix1_1.qion[j + (mion << 2) - 5] /
704 ai + (g0c_1.g[mion] * mix1_1.qion[j + ((mion + 1) << 2) -
705 5] - g0c_1.g[mion - 1] * mix1_1.qion[j + (mion << 2) - 5])
706 * mix3_1.alion[j - 1] / ai;
711 asum = g0c_1.g[i__ - 1] * (mag_1.qef[i__ - 1] * inpt_1.alpnaz *
712 inpt_1.alpnew + mag_1.qeef[i__ - 1] * inpt_1.alpnew *
714 sum = z__ - g0c_1.g[i__ - 1] * mix1_1.qsum[i__ - 1] + asum;
718 bsum = inpt_1.alpnew * (inpt_1.alpnaz * mag_1.qef[i__ - 1] * g2c_1.g2[
719 i__ - 1] + mag_1.qeef[i__ - 1] * (g2c_1.dg2[i__ - 1] +
720 g2c_1.g2[i__ - 1] * (float)1.5 / mix2_1.e[i__ - 1]));
721 sum += bsum * (float).4;
724 if (mix3_1.nin1 == 0) {
728 for (j = 1; j <= i__2; ++j) {
729 min1 = mix3_1.lin1[j - 1] + i__;
730 if (min1 >= inpt_1.nstep1) {
733 sum = sum + g0c_1.g[min1 - 1] * mix1_1.qin1[j + min1 * 24 - 25] +
734 (g0c_1.g[min1] * mix1_1.qin1[j + (min1 + 1) * 24 - 25] -
735 g0c_1.g[min1 - 1] * mix1_1.qin1[j + min1 * 24 - 25]) *
741 if (mix3_1.nin2 == 0) {
745 for (j = 1; j <= i__2; ++j) {
746 min2 = mix3_1.lin2[j - 1] + i__;
747 if (min2 >= inpt_1.nstep1) {
750 sum = sum + g0c_1.g[min2 - 1] * mix1_1.qin2[j + min2 * 24 - 25] +
751 (g0c_1.g[min2] * mix1_1.qin2[j + (min2 + 1) * 24 - 25] -
752 g0c_1.g[min2 - 1] * mix1_1.qin2[j + min2 * 24 - 25]) *
758 if (mix3_1.nin3 == 0) {
762 for (j = 1; j <= i__2; ++j) {
763 min3 = mix3_1.lin3[j - 1] + i__;
764 if (min3 >= inpt_1.nstep1) {
767 sum = sum + g0c_1.g[min3 - 1] * mix1_1.qin3[j + min3 * 24 - 25] +
768 (g0c_1.g[min3] * mix1_1.qin3[j + (min3 + 1) * 24 - 25] -
769 g0c_1.g[min3 - 1] * mix1_1.qin3[j + min3 * 24 - 25]) *
775 if (mix3_1.nin4 == 0) {
779 for (j = 1; j <= i__2; ++j) {
780 min4 = mix3_1.lin4[j - 1] + i__;
781 if (min4 >= inpt_1.nstep1) {
784 sum = sum + g0c_1.g[min4 - 1] * mix1_1.qin4[j + min4 * 24 - 25] +
785 (g0c_1.g[min4] * mix1_1.qin4[j + (min4 + 1) * 24 - 25] -
786 g0c_1.g[min4 - 1] * mix1_1.qin4[j + min4 * 24 - 25]) *
792 sum1 = -mag_1.qef[i__ - 1] * inpt_1.alpnew * (f0c_1.f[i__ - 1] +
793 f2c_1.f2[i__ - 1] * (float).4) + inpt_1.alpnew * mix2_1.eroot[
794 i__ - 1] * vel * f1c_1.f1[i__ - 1] / (mag_1.eovm * (float)3. *
795 mix2_1.qtot[i__ - 1]) + mix2_1.e[i__ - 1] * f1c_1.f1[i__ - 1]
796 / (float)3. - mix2_1.eroot[i__ - 1] * vel * f0c_1.f[i__ - 1]
802 gnsum -= bsum * (float).4;
804 gnsum = gnsum + mix2_1.e[i__ - 1] * f1c_1.f1[i__ - 1] / (float)3. -
805 mix2_1.eroot[i__ - 1] * vel * f0c_1.f[i__ - 1] / mag_1.eovm;
813 type2g_(&s2sum, &i__, &inpt_1.nstep1);
818 gnsum *= inpt_1.estep;
821 sum2 = mag_1.qfemag[i__ - 1] * (f0c_1.f[i__ - 1] + f2c_1.f2[i__ - 1] *
822 (float).4 - vel * f1c_1.f1[i__ - 1] / (mag_1.eovm *
823 mix2_1.eroot[i__ - 1]));
824 sum3 = -g0c_1.g[i__ - 1] * (mix1_1.qelm[i__ - 1] + mag_1.qfemag[i__ -
829 sum4 = (g2c_1.g2[i__ - 1] * inpt_1.alpnaz * mag_1.qfemag[i__ - 1] +
830 mag_1.qeeef[i__ - 1] * (g2c_1.dg2[i__ - 1] + g2c_1.g2[i__ - 1]
831 * (float)1.5 / mix2_1.e[i__ - 1])) * (
float).4;
833 g0c_1.dg0[i__ - 1] = (ssum + sum2 + sum3 - sum4) / (mag_1.qeeef[i__ -
834 1] + mix1_1.qelm[i__ - 1] * inpt_1.akt);
836 ext = g0c_1.g[i__ - 1] * mix1_1.qelm[i__ - 1] + mix1_1.qelm[i__ - 1] *
837 g0c_1.dg0[i__ - 1] * inpt_1.akt;
838 g1c_1.g1[i__ - 1] = (ext + gssum - gnssum) * (
float)3. / (mag_1.emag *
840 g1sum = inpt_1.alpnew * (mix2_1.e[i__ - 1] * (float)2. * g1c_1.g1[i__
841 - 1] - mix2_1.e[i__] * g1c_1.g1[i__]) * inpt_1.estep / (float)
844 if (i__ >= inpt_1.nstep1 - 2) {
847 g1c_1.dg1[i__ - 1] = (g1c_1.g1[i__ + 1] - g1c_1.g1[i__ - 1]) /
848 inpt_1.estep - g1c_1.dg1[i__ + 1];
849 g1c_1.dg1[i__] = (g1c_1.g1[i__ + 1] - g1c_1.g1[i__ - 1]) / (
850 inpt_1.estep * (float)2.);
853 g1c_1.dg1[i__ - 1] = (g1c_1.g1[i__] - g1c_1.g1[i__ - 1]) /
855 if (i__ == inpt_1.nstep1) {
856 g1c_1.dg1[i__ - 1] = -g1c_1.g1[i__ - 1] / (inpt_1.estep * (float)
866 g2c_1.g2[i__ - 1] = f1c_1.f1[i__ - 1] * (float)2. / (
float)3. - vel *
867 f2c_1.f2[i__ - 1] / (mix2_1.eroot[i__ - 1] * mag_1.eovm) -
868 mag_1.ef[i__ - 1] * (
float)2. * (g1c_1.dg1[i__ - 1] -
869 g1c_1.g1[i__ - 1] / (mix2_1.e[i__ - 1] * (float)2.)) / (
float)
870 3. - inpt_1.alpnaz * (float)2. * g1c_1.g1[i__ - 1] / (
float)
871 3. + f3c_1.f3[i__ - 1] * (float)3. / (
float)7.;
872 g2c_1.g2[i__ - 1] /= mix2_1.qtot[i__ - 1];
873 g2c_1.dg2[i__ - 1] = g0c_1.dg0[i__ - 1] * (float)-2.5 - g2c_1.g2[i__
874 - 1] * (
float)1.5 / mix2_1.e[i__ - 1] - inpt_1.alpnaz * (
875 float)2.5 * (g0c_1.g[i__ - 1] + g2c_1.g2[i__ - 1] * (
float).4)
876 / mag_1.ef[i__ - 1] - g1c_1.g1[i__ - 1] * (float)2.5 /
877 mag_1.qe[i__ - 1] + (f0c_1.f[i__ - 1] + f2c_1.f2[i__ - 1] * (
878 float).4) * (float)2.5 / mag_1.ef[i__ - 1] - vel * (
float)2.5
879 * f1c_1.f1[i__ - 1] / (mix2_1.eroot[i__ - 1] * mag_1.eovm *
881 g2c_1.dg2[inpt_1.nstep1] = g2c_1.dg2[inpt_1.nstep1 - 1];
882 g2c_1.g2[i__ - 2] = g2c_1.g2[i__ - 1] - inpt_1.estep * (g2c_1.dg2[i__
883 - 1] * (float)1.5 - g2c_1.dg2[i__] * (
float).5);
884 g2c_1.dg2[i__ - 2] = g2c_1.dg2[i__ - 1] * (float)2. - g2c_1.dg2[i__];
886 g0c_1.g[i__ - 2] = g0c_1.g[i__ - 1] - inpt_1.estep * (g0c_1.dg0[i__ -
887 1] * (
float)1.5 - g0c_1.dg0[i__] * (float).5);
888 g0c_1.dg[i__ - 1] = g0c_1.dg0[i__ - 1] / g0c_1.g[i__ - 1];
891 i__1 = inpt_1.nstep1;
892 for (j = 1; j <= i__1; ++j) {
894 sint_1.simf[j - 1] = g0c_1.g[j - 1] * mix2_1.eroot[j - 1];
903 int StFtpcMagboltz1::gas1_(
double *q,
double *qin,
double *q2ro,
int *nin,
904 int *n2ro,
double *e,
double *ein,
double *e2ro,
char *name__,
905 double *virial,
int *monte,
int name_len)
909 static double xen[34] = { 1.,1.2,1.5,1.7,2.,2.5,3.,4.,4.9,5.,6.,6.67,
910 7.,8.,8.71,9.,10.,11.,12.,13.,13.6,14.,15.,16.,16.5,18.,20.,30.,
911 30.6,50.,54.4,100.,400.,1e3 };
912 static double yxsec[34] = { 1.39,1.66,2.05,2.33,2.7,3.43,4.15,5.65,
913 7.26,7.46,9.32,10.6,11.3,13.1,14.1,14.4,15.4,15.8,15.8,15.4,15.1,
914 14.8,14.1,13.2,13.,11.4,10.2,6.13,6.01,4.17,3.97,2.71,1.3,1. };
915 static double xeni[54] = { 15.7,16.,16.5,17.,17.5,18.,18.5,19.,19.5,
916 20.,20.5,21.,21.5,22.,22.5,23.,23.5,24.,24.5,25.,25.5,26.,28.,30.,
917 32.,34.,36.,38.,40.,50.,60.,70.,80.,90.,100.,110.,120.,130.,140.,
918 150.,160.,180.,200.,250.,300.,350.,400.,450.,500.,600.,700.,800.,
920 static double yxeni[54] = { -.2,.306,.825,1.126,1.326,1.468,1.577,
921 1.663,1.737,1.797,1.853,1.896,1.933,1.97,1.997,2.024,2.048,2.071,
922 2.094,2.115,2.132,2.148,2.204,2.256,2.293,2.325,2.351,2.368,2.379,
923 2.404,2.424,2.443,2.454,2.456,2.455,2.452,2.448,2.441,2.436,2.429,
924 2.419,2.401,2.379,2.337,2.296,2.258,2.225,2.19,2.164,2.115,2.065,
926 static double xin[15] = { 11.55,13.,13.2,13.4,14.,16.,20.,30.,40.,50.,
927 80.,100.,200.,500.,1e3 };
928 static double yxsin[15] = { 0.,.057,.075,.072,.096,.17,.18,.21,.24,
929 .28,.22,.17,.11,.06,.04 };
930 static double yxpin[15] = { 0.,0.,.01,.03,.06,.17,.35,.45,.44,.41,.3,
932 static double yxdin[15] = { 0.,0.,0.,0.,0.,.05,.11,.22,.26,.28,.35,
942 static double sumi, a, b;
943 static int i__, j, ndata;
944 static double e1, aa, dd, ff, ak, en;
945 static int nidata, nxdata;
946 static double an0, an1, an2, api, sum;
957 sprintf(name__,
" ARGON 1988 ");
974 api = (float)3.141592654;
979 e[2] = cnsts_1.emass * (float)2. / (cnsts_1.amu * (
float)39.948);
984 ein[1] = (float)11.55;
989 en = -inpt_1.estep / (float)2.;
991 i__1 = inpt_1.nstep1 + 1;
992 for (i__ = 1; i__ <= i__1; ++i__) {
994 if (en > (
float)1.) {
997 if (en == (
float)0.) {
998 q[i__ * 6 + 2] = (float)7.79e-16;
1000 if (en == (
float)0.) {
1003 ak = ::sqrt(en / inpt_1.ary);
1004 an0 = -aa * ak * (apol * (float)4. / (
float)3. * ak * ak * ::log(ak) + (
1005 float)1.) - api * apol / (float)3. * ak * ak + dd * ak * ak *
1006 ak + ff * ak * ak * ak * ak;
1007 an1 = api / (float)15. * apol * ak * ak * ((
float)1. - ::sqrt(en / e1));
1008 an2 = api * apol * ak * ak / (float)105.;
1013 d__1 = sin(an0 - an1);
1016 d__1 = sin(an1 - an2);
1017 sum += d__1 * d__1 * (float)2.;
1019 for (j = 2; j <= i__2; ++j) {
1020 sumi = (float)6. / ((j * (
float)2. + (float)5.) * (j * (float)2.
1021 + (
float)3.) * (j * (float)2. + (
float)1.) * (j * (float)
1024 d__1 = sin(atan(api * apol * ak * ak * sumi));
1025 sum += (j + (float)1.) * (d__1 * d__1);
1028 q[i__ * 6 + 2] = sum * (float)4. * cnsts_1.pir2 / (ak * ak);
1033 for (j = 2; j <= i__2; ++j) {
1034 if (en <= xen[j - 1]) {
1041 a = (yxsec[j - 1] - yxsec[j - 2]) / (xen[j - 1] - xen[j - 2]);
1042 b = (xen[j - 2] * yxsec[j - 1] - xen[j - 1] * yxsec[j - 2]) / (xen[j
1044 q[i__ * 6 + 2] = (a * en + b) * (
float)1e-16;
1046 q[i__ * 6 + 3] = (float)0.;
1052 for (j = 2; j <= i__2; ++j) {
1053 if (en <= xeni[j - 1]) {
1060 a = (yxeni[j - 1] - yxeni[j - 2]) / (xeni[j - 1] - xeni[j - 2]);
1061 b = (xeni[j - 2] * yxeni[j - 1] - xeni[j - 1] * yxeni[j - 2]) / (xeni[
1062 j - 2] - xeni[j - 1]);
1064 q[i__ * 6 + 3] = ::pow(c_b12, d__1) * (float)1e-18;
1066 q[i__ * 6 + 4] = (float)0.;
1067 q[i__ * 6 + 5] = (float)0.;
1068 q[i__ * 6 + 6] = (float)0.;
1070 qin[i__ * 24 + 1] = (float)0.;
1071 qin[i__ * 24 + 2] = (float)0.;
1072 qin[i__ * 24 + 3] = (float)0.;
1078 for (j = 2; j <= i__2; ++j) {
1079 if (en <= xin[j - 1]) {
1086 a = (yxsin[j - 1] - yxsin[j - 2]) / (xin[j - 1] - xin[j - 2]);
1087 b = (xin[j - 2] * yxsin[j - 1] - xin[j - 1] * yxsin[j - 2]) / (xin[j
1089 qin[i__ * 24 + 1] = (a * en + b) * (
float)1e-16;
1093 a = (yxpin[j - 1] - yxpin[j - 2]) / (xin[j - 1] - xin[j - 2]);
1094 b = (xin[j - 2] * yxpin[j - 1] - xin[j - 1] * yxpin[j - 2]) / (xin[j
1096 qin[i__ * 24 + 2] = (a * en + b) * (
float)1e-16;
1100 a = (yxdin[j - 1] - yxdin[j - 2]) / (xin[j - 1] - xin[j - 2]);
1101 b = (xin[j - 2] * yxdin[j - 1] - xin[j - 1] * yxdin[j - 2]) / (xin[j
1103 qin[i__ * 24 + 3] = (a * en + b) * (
float)1e-16;
1105 q[i__ * 6 + 1] = q[i__ * 6 + 2] + q[i__ * 6 + 3] + qin[i__ * 24 + 1]
1106 + qin[i__ * 24 + 2] + qin[i__ * 24 + 3];
1110 if (inpt_1.efinal <= ein[3]) {
1113 if (inpt_1.efinal <= ein[2]) {
1116 if (inpt_1.efinal <= ein[1]) {
1125 int StFtpcMagboltz1::gas2_(
double *q,
double *qin,
double *q2ro,
int *nin,
1126 int *n2ro,
double *e,
double *ein,
double *e2ro,
char *name__,
1127 double *virial,
int *monte,
int name_len)
1131 static double xmom[54] = { 0.,.001,.002,.003,.005,.007,.0085,.01,.015,
1132 .02,.03,.04,.05,.07,.1,.12,.15,.17,.2,.25,.3,.35,.4,.5,.7,1.,1.2,
1133 1.3,1.5,1.7,1.9,2.1,2.2,2.5,2.8,3.,3.3,3.6,4.,4.5,5.,6.,7.,8.,10.,
1134 12.,15.,17.,20.,25.,30.,50.,75.,100. };
1135 static double yvib4[24] = { 0.,0.,.95,1.7,1.85,2.,2.15,2.2,2.15,2.,
1136 1.85,1.55,1.23,1.,.76,.64,.49,.44,.41,.48,.26,.135,.1,0. };
1137 static double xvib5[12] = { 0.,.339,1.5,1.95,2.5,3.,3.56,4.1,4.5,5.06,
1139 static double yvib5[12] = { 0.,0.,0.,.07,.2,.41,.66,.34,.155,0.,0.,0.
1141 static double xvib6[12] = { 0.,.422,1.5,1.95,2.5,3.,3.56,4.1,4.5,5.06,
1143 static double yvib6[12] = { 0.,0.,0.,0.,0.,.105,.225,.1,0.,0.,0.,0. };
1144 static double xvib7[12] = { 0.,.505,1.5,1.95,2.5,3.,3.56,4.1,4.5,5.06,
1146 static double yvib7[12] = { 0.,0.,0.,0.,0.,.156,.33,.156,0.,0.,0.,0. }
1148 static double xexc1[7] = { 0.,2.5,3.,3.6,4.1,4.5,100. };
1149 static double yexc1[7] = { 0.,0.,.18,.25,.18,0.,0. };
1150 static double xatt[12] = { 0.,3.85,4.3,4.5,5.1,6.6,7.2,8.2,8.4,8.9,
1152 static double ymom[54] = { 600.,540.,380.,307.,237.,200.,182.,170.,
1153 138.,120.,97.,85.,76.,63.,50.,44.,39.,34.,29.,24.,18.,15.,13.,10.,
1154 7.1,5.2,4.8,4.7,4.65,4.65,4.85,5.05,5.2,6.4,7.6,9.,11.5,14.,15.2,
1155 14.8,12.7,10.,10.,10.8,12.1,13.1,14.4,15.,15.8,16.,15.8,12.6,9.5,
1157 static double yatt[12] = { 0.,0.,.0014,.0014,0.,0.,7e-4,.0045,.0042,
1159 static double xexc2[6] = { 0.,7.,8.,8.5,11.,100. };
1160 static double yexc2[6] = { 0.,0.,.6,.6,0.,0. };
1161 static double xexc3[10] = { 0.,10.5,12.,12.7,13.5,15.,17.,20.,40.,
1163 static double yexc3[10] = { 0.,0.,.69,.73,.78,.88,1.04,1.24,3.6,6.3 };
1164 static double xion[12] = { 0.,13.3,14.5,15.,16.,18.,20.,30.,40.,50.,
1166 static double yion[12] = { 0.,0.,.06,.104,.188,.359,.532,1.63,2.28,
1168 static double xvib1[38] = { 0.,.083,.0844,.0862,.0932,.1035,.1208,
1169 .1382,.1726,.207,.275,.345,.5,.7,.9,1.1,1.4,1.6,1.8,2.3,2.6,3.,
1170 3.2,3.4,3.6,3.8,4.,4.2,4.6,5.1,5.5,6.,7.,8.,10.,20.,50.,100. };
1171 static double yvib1[38] = { 0.,0.,.85,1.16,1.85,2.3,2.6,2.68,2.54,2.2,
1172 1.72,1.43,1.08,.8,.66,.57,.45,.42,.44,.7,.93,1.34,1.58,1.75,1.8,
1173 1.79,1.7,1.52,1.05,.57,.51,.5,.48,.45,.2,0.,0.,0. };
1174 static double xvib2[28] = { 0.,.167,.172,.18,.2,.25,.5,1.,1.5,1.9,2.,
1175 2.25,2.5,3.,3.2,3.4,3.55,3.7,3.9,4.1,4.5,4.9,5.2,6.,8.,10.,20.,
1177 static double yvib2[28] = { 0.,0.,.3,.33,.35,.325,.117,.05,.04,.06,
1178 .08,.2,.4,1.28,1.57,1.77,1.78,1.75,1.6,1.28,.88,.39,.33,.27,.25,
1180 static double xvib3[12] = { 0.,.252,1.5,1.95,2.5,3.,3.56,4.1,4.5,5.06,
1182 static double yvib3[12] = { 0.,0.,0.,0.,0.,.32,.54,.34,.16,.044,0.,0.
1184 static double xvib4[24] = { 0.,.291,.3,.31,.32,.33,.35,.38,.4,.45,.5,
1185 .6,.8,1.,1.5,2.,3.,4.5,6.,8.,10.,25.,30.,100. };
1191 static int nion, nmom, natt, nexc1, nvib1, nvib2, nvib3, nvib4, nvib5,
1192 nvib6, nvib7, nexc2, nexc3, i__, j;
1193 static double a, b, en;
1205 sprintf(name__,
"C02 TEST # 2 ");
1222 e[2] = cnsts_1.emass * (float)2. / (cnsts_1.amu * (
float)44.0098);
1227 ein[1] = (float).083;
1228 ein[2] = (float).167;
1229 ein[3] = (float).252;
1230 ein[4] = (float).291;
1231 ein[5] = (float).339;
1232 ein[6] = (float).422;
1233 ein[7] = (float).505;
1234 ein[8] = (float)2.5;
1236 ein[10] = (float)10.5;
1239 en = -inpt_1.estep / (float)2.;
1241 i__1 = inpt_1.nstep1 + 1;
1242 for (i__ = 1; i__ <= i__1; ++i__) {
1246 for (j = 2; j <= i__2; ++j) {
1247 if (en <= xmom[j - 1]) {
1254 a = (ymom[j - 1] - ymom[j - 2]) / (xmom[j - 1] - xmom[j - 2]);
1255 b = (xmom[j - 2] * ymom[j - 1] - xmom[j - 1] * ymom[j - 2]) / (xmom[j
1256 - 2] - xmom[j - 1]);
1257 q[i__ * 6 + 2] = (a * en + b) * (
float)1e-16;
1259 qin[i__ * 24 + 1] = (float)0.;
1264 for (j = 2; j <= i__2; ++j) {
1265 if (en <= xvib1[j - 1]) {
1272 a = (yvib1[j - 1] - yvib1[j - 2]) / (xvib1[j - 1] - xvib1[j - 2]);
1273 b = (xvib1[j - 2] * yvib1[j - 1] - xvib1[j - 1] * yvib1[j - 2]) / (
1274 xvib1[j - 2] - xvib1[j - 1]);
1275 qin[i__ * 24 + 1] = (a * en + b) * (
float)1e-16;
1278 qin[i__ * 24 + 2] = (float)0.;
1283 for (j = 2; j <= i__2; ++j) {
1284 if (en <= xvib2[j - 1]) {
1291 a = (yvib2[j - 1] - yvib2[j - 2]) / (xvib2[j - 1] - xvib2[j - 2]);
1292 b = (xvib2[j - 2] * yvib2[j - 1] - xvib2[j - 1] * yvib2[j - 2]) / (
1293 xvib2[j - 2] - xvib2[j - 1]);
1294 qin[i__ * 24 + 2] = (a * en + b) * (
float)1e-16;
1297 qin[i__ * 24 + 3] = (float)0.;
1302 for (j = 2; j <= i__2; ++j) {
1303 if (en <= xvib3[j - 1]) {
1310 a = (yvib3[j - 1] - yvib3[j - 2]) / (xvib3[j - 1] - xvib3[j - 2]);
1311 b = (xvib3[j - 2] * yvib3[j - 1] - xvib3[j - 1] * yvib3[j - 2]) / (
1312 xvib3[j - 2] - xvib3[j - 1]);
1313 qin[i__ * 24 + 3] = (a * en + b) * (
float)1e-16;
1316 qin[i__ * 24 + 4] = (float)0.;
1321 for (j = 2; j <= i__2; ++j) {
1322 if (en <= xvib4[j - 1]) {
1329 a = (yvib4[j - 1] - yvib4[j - 2]) / (xvib4[j - 1] - xvib4[j - 2]);
1330 b = (xvib4[j - 2] * yvib4[j - 1] - xvib4[j - 1] * yvib4[j - 2]) / (
1331 xvib4[j - 2] - xvib4[j - 1]);
1332 qin[i__ * 24 + 4] = (a * en + b) * (
float)1e-16;
1335 qin[i__ * 24 + 5] = (float)0.;
1340 for (j = 2; j <= i__2; ++j) {
1341 if (en <= xvib5[j - 1]) {
1348 a = (yvib5[j - 1] - yvib5[j - 2]) / (xvib5[j - 1] - xvib5[j - 2]);
1349 b = (xvib5[j - 2] * yvib5[j - 1] - xvib5[j - 1] * yvib5[j - 2]) / (
1350 xvib5[j - 2] - xvib5[j - 1]);
1351 qin[i__ * 24 + 5] = (a * en + b) * (
float)1e-16;
1354 qin[i__ * 24 + 6] = (float)0.;
1359 for (j = 2; j <= i__2; ++j) {
1360 if (en <= xvib6[j - 1]) {
1367 a = (yvib6[j - 1] - yvib6[j - 2]) / (xvib6[j - 1] - xvib6[j - 2]);
1368 b = (xvib6[j - 2] * yvib6[j - 1] - xvib6[j - 1] * yvib6[j - 2]) / (
1369 xvib6[j - 2] - xvib6[j - 1]);
1370 qin[i__ * 24 + 6] = (a * en + b) * (
float)1e-16;
1373 qin[i__ * 24 + 7] = (float)0.;
1378 for (j = 2; j <= i__2; ++j) {
1379 if (en <= xvib7[j - 1]) {
1386 a = (yvib7[j - 1] - yvib7[j - 2]) / (xvib7[j - 1] - xvib7[j - 2]);
1387 b = (xvib7[j - 2] * yvib7[j - 1] - xvib7[j - 1] * yvib7[j - 2]) / (
1388 xvib7[j - 2] - xvib7[j - 1]);
1389 qin[i__ * 24 + 7] = (a * en + b) * (
float)1e-16;
1392 qin[i__ * 24 + 8] = (float)0.;
1397 for (j = 2; j <= i__2; ++j) {
1398 if (en <= xexc1[j - 1]) {
1405 a = (yexc1[j - 1] - yexc1[j - 2]) / (xexc1[j - 1] - xexc1[j - 2]);
1406 b = (xexc1[j - 2] * yexc1[j - 1] - xexc1[j - 1] * yexc1[j - 2]) / (
1407 xexc1[j - 2] - xexc1[j - 1]);
1408 qin[i__ * 24 + 8] = (a * en + b) * (
float)1e-16;
1411 q[i__ * 6 + 4] = (float)0.;
1416 for (j = 2; j <= i__2; ++j) {
1417 if (en <= xatt[j - 1]) {
1424 a = (yatt[j - 1] - yatt[j - 2]) / (xatt[j - 1] - xatt[j - 2]);
1425 b = (xatt[j - 2] * yatt[j - 1] - xatt[j - 1] * yatt[j - 2]) / (xatt[j
1426 - 2] - xatt[j - 1]);
1427 q[i__ * 6 + 4] = (a * en + b) * (
float)1e-16;
1430 qin[i__ * 24 + 9] = (float)0.;
1435 for (j = 2; j <= i__2; ++j) {
1436 if (en <= xexc2[j - 1]) {
1443 a = (yexc2[j - 1] - yexc2[j - 2]) / (xexc2[j - 1] - xexc2[j - 2]);
1444 b = (xexc2[j - 2] * yexc2[j - 1] - xexc2[j - 1] * yexc2[j - 2]) / (
1445 xexc2[j - 2] - xexc2[j - 1]);
1446 qin[i__ * 24 + 9] = (a * en + b) * (
float)1e-16;
1449 qin[i__ * 24 + 10] = (float)0.;
1450 if (en <= ein[10]) {
1454 for (j = 2; j <= i__2; ++j) {
1455 if (en <= xexc3[j - 1]) {
1462 a = (yexc3[j - 1] - yexc3[j - 2]) / (xexc3[j - 1] - xexc3[j - 2]);
1463 b = (xexc3[j - 2] * yexc3[j - 1] - xexc3[j - 1] * yexc3[j - 2]) / (
1464 xexc3[j - 2] - xexc3[j - 1]);
1465 qin[i__ * 24 + 10] = (a * en + b) * (
float)1e-16;
1468 q[i__ * 6 + 3] = (float)0.;
1473 for (j = 2; j <= i__2; ++j) {
1474 if (en <= xion[j - 1]) {
1481 a = (yion[j - 1] - yion[j - 2]) / (xion[j - 1] - xion[j - 2]);
1482 b = (xion[j - 2] * yion[j - 1] - xion[j - 1] * yion[j - 2]) / (xion[j
1483 - 2] - xion[j - 1]);
1484 q[i__ * 6 + 3] = (a * en + b) * (
float)1e-16;
1487 q[i__ * 6 + 1] = q[i__ * 6 + 2] + q[i__ * 6 + 3] + q[i__ * 6 + 4];
1488 q[i__ * 6 + 2] = q[i__ * 6 + 2] - qin[i__ * 24 + 1] - qin[i__ * 24 +
1489 2] - qin[i__ * 24 + 3] - qin[i__ * 24 + 4] - qin[i__ * 24 + 5]
1490 - qin[i__ * 24 + 6] - qin[i__ * 24 + 7] - qin[i__ * 24 + 8]
1491 - qin[i__ * 24 + 9] - qin[i__ * 24 + 10];
1492 q[i__ * 6 + 5] = (float)0.;
1493 q[i__ * 6 + 6] = (float)0.;
1499 if (inpt_1.efinal < ein[10]) {
1502 if (inpt_1.efinal < ein[9]) {
1505 if (inpt_1.efinal < ein[8]) {
1508 if (inpt_1.efinal < ein[7]) {
1511 if (inpt_1.efinal < ein[6]) {
1514 if (inpt_1.efinal < ein[5]) {
1517 if (inpt_1.efinal < ein[4]) {
1520 if (inpt_1.efinal < ein[3]) {
1523 if (inpt_1.efinal < ein[2]) {
1526 if (inpt_1.efinal < ein[1]) {
1533 int StFtpcMagboltz1::gas3_(
double *q,
double *qin,
double *q2ro,
int *nin,
1534 int *n2ro,
double *e,
double *ein,
double *e2ro,
char *name__,
1535 double *virial,
int *monte,
int name_len)
1539 static double xen[37] = { 1.,1.2,1.5,1.8,2.,2.5,3.,4.,5.,6.,7.,8.,
1540 8.71,9.,10.,11.,13.6,15.,16.5,19.6,20.,30.,30.6,50.,54.4,65.,77.,
1541 100.,130.,150.,170.,200.,300.,400.,600.,800.,1e3 };
1542 static double yxsec[37] = { 1.62,1.69,1.75,1.79,1.82,1.86,1.91,1.98,
1543 2.07,2.14,2.21,2.29,2.35,2.37,2.44,2.51,2.66,2.71,2.76,2.83,2.84,
1544 2.83,2.82,2.45,2.36,2.18,1.97,1.56,1.22,1.05,.91,.76,.52,.42,.33,
1546 static double xion[35] = { 21.56,22.,22.5,23.,23.5,24.,24.5,25.,25.5,
1547 26.,27.,28.,29.,30.,32.,34.,36.,40.,45.,50.,55.,60.,70.,80.,90.,
1548 100.,120.,140.,175.,200.,300.,400.,600.,800.,1e3 };
1549 static double yion[35] = { 0.,.0033,.0089,.0146,.02,.026,.032,.038,
1550 .044,.05,.063,.076,.089,.102,.128,.154,.179,.228,.282,.338,.391,
1551 .435,.514,.58,.63,.67,.72,.76,.78,.78,.72,.63,.53,.44,.39 };
1552 static double xexc[35] = { 16.615,16.78,16.97,17.3,18.4,18.7,18.8,
1553 19.8,20.,21.,22.,24.,26.,28.,30.,35.,40.,50.,60.,70.,80.,90.,100.,
1554 120.,150.,200.,250.,300.,400.,500.,600.,700.,800.,900.,1e3 };
1555 static double yexc[35] = { 0.,.0034,.0185,.012,.0181,.0349,.028,.05,
1556 .0523,.0732,.0923,.123,.143,.162,.176,.195,.205,.207,.203,.195,
1557 .187,.179,.171,.157,.138,.117,.102,.091,.075,.064,.057,.051,.047,
1566 static int nexc, lmax, nion;
1567 static double sumi, a, b;
1568 static int i__, j, ndata;
1569 static double a1, b1, a2, aa, dd, ff, ak, en, an0, an1, an2, api, sum;
1581 sprintf(name__,
" NEON 92 ");
1588 e[2] = cnsts_1.emass * (float)2. / (cnsts_1.amu * (
float)20.179);
1589 e[3] = (float)21.56;
1593 ein[1] = (float)16.615;
1594 apol = (float)2.672;
1602 api = (float)3.141592654;
1605 en = -inpt_1.estep / (float)2.;
1607 i__1 = inpt_1.nstep1 + 1;
1608 for (i__ = 1; i__ <= i__1; ++i__) {
1610 if (en > (
float)1.) {
1613 if (en == (
float)0.) {
1614 q[i__ * 6 + 2] = (float)1.61e-17;
1616 if (en == (
float)0.) {
1619 ak = ::sqrt(en / inpt_1.ary);
1620 an0 = -aa * ak * (apol * (float)4. / (
float)3. * ak * ak * ::log(ak) + (
1621 float)1.) - api * apol / (float)3. * ak * ak + dd * ak * ak *
1622 ak + ff * ak * ak * ak * ak;
1623 an1 = (ak * (float).56 * ak - a1 * ak * ak * ak) / (b1 * ak * ak + (
1625 an2 = ak * (float).08 * ak - a2 * ak * ak * ak * ak * ak;
1627 d__1 = sin(an0 - an1);
1630 d__1 = sin(an1 - an2);
1631 sum += d__1 * d__1 * (float)2.;
1633 for (j = 2; j <= i__2; ++j) {
1634 sumi = (float)6. / ((j * (
float)2. + (float)5.) * (j * (float)2.
1635 + (
float)3.) * (j * (float)2. + (
float)1.) * (j * (float)
1638 d__1 = sin(api * apol * ak * ak * sumi);
1639 sum += (j + (float)1.) * (d__1 * d__1);
1642 q[i__ * 6 + 2] = sum * (float)4. * cnsts_1.pir2 / (ak * ak);
1646 for (j = 2; j <= i__2; ++j) {
1647 if (en <= xen[j - 1]) {
1654 a = (yxsec[j - 1] - yxsec[j - 2]) / (xen[j - 1] - xen[j - 2]);
1655 b = (xen[j - 2] * yxsec[j - 1] - xen[j - 1] * yxsec[j - 2]) / (xen[j
1657 q[i__ * 6 + 2] = (a * en + b) * (
float)1e-16;
1659 q[i__ * 6 + 3] = (float)0.;
1664 for (j = 2; j <= i__2; ++j) {
1665 if (en <= xion[j - 1]) {
1672 a = (yion[j - 1] - yion[j - 2]) / (xion[j - 1] - xion[j - 2]);
1673 b = (xion[j - 2] * yion[j - 1] - xion[j - 1] * yion[j - 2]) / (xion[j
1674 - 2] - xion[j - 1]);
1675 q[i__ * 6 + 3] = (a * en + b) * (
float)1e-16;
1677 q[i__ * 6 + 4] = (float)0.;
1678 q[i__ * 6 + 5] = (float)0.;
1679 q[i__ * 6 + 6] = (float)0.;
1681 qin[i__ * 24 + 1] = (float)0.;
1686 for (j = 2; j <= i__2; ++j) {
1687 if (en <= xexc[j - 1]) {
1694 a = (yexc[j - 1] - yexc[j - 2]) / (xexc[j - 1] - xexc[j - 2]);
1695 b = (xexc[j - 2] * yexc[j - 1] - xexc[j - 1] * yexc[j - 2]) / (xexc[j
1696 - 2] - xexc[j - 1]);
1697 qin[i__ * 24 + 1] = (a * en + b) * (
float)1e-16;
1699 q[i__ * 6 + 1] = q[i__ * 6 + 2] + q[i__ * 6 + 3] + qin[i__ * 24 + 1];
1702 if (inpt_1.efinal < ein[1]) {
1708 int StFtpcMagboltz1::gas4_(
double *q,
double *qin,
double *q2ro,
int *nin,
1709 int *n2ro,
double *e,
double *ein,
double *e2ro,
char *name__,
1710 double *virial,
int *monte,
int name_len)
1714 static double xen[63] = { 0.,.008,.009,.01,.013,.017,.02,.025,.03,.04,
1715 .05,.06,.07,.08,.09,.1,.12,.15,.18,.2,.25,.3,.4,.5,.6,.7,.8,.9,1.,
1716 1.2,1.5,1.8,2.,2.5,3.,4.,5.,6.,7.,8.,9.,10.,11.,12.,13.6,16.5,18.,
1717 20.,25.,30.,40.,50.,60.,70.,75.,80.,90.,100.,150.,200.,400.,600.,
1719 static double yxsec[63] = { 4.9,5.18,5.19,5.21,5.26,5.31,5.35,5.41,
1720 5.46,5.54,5.62,5.68,5.74,5.79,5.83,5.86,5.94,6.04,6.12,6.16,6.27,
1721 6.35,6.49,6.59,6.66,6.73,6.77,6.82,6.85,6.91,6.96,6.98,6.99,6.96,
1722 6.89,6.62,6.31,6.,5.68,5.35,5.03,4.72,4.44,4.15,3.83,3.25,2.99,
1723 2.58,1.95,1.51,.98,.7,.5,.4,.34,.31,.25,.21,.104,.063,.02,.01,
1725 static double xion[28] = { 24.59,25.,25.5,26.,26.5,27.,28.,29.,30.,
1726 32.,34.,36.,38.,40.,45.,50.,55.,60.,70.,80.,100.,120.,150.,175.,
1727 200.,300.,500.,1e3 };
1728 static double yion[28] = { 0.,.0052,.0113,.0175,.0236,.03,.043,.055,
1729 .067,.092,.114,.135,.155,.172,.21,.243,.271,.29,.321,.344,.366,
1730 .373,.37,.359,.347,.297,.224,.141 };
1731 static double xexc[21] = { 19.82,20.,25.,30.,40.,50.,60.,70.,75.,80.,
1732 90.,100.,150.,200.,300.,400.,500.,600.,700.,800.,1e3 };
1733 static double yexc[21] = { 0.,.03,.1,.163,.187,.191,.205,.194,.192,
1734 .189,.187,.185,.165,.146,.121,.099,.087,.076,.068,.061,.051 };
1740 static int nexc, nion;
1742 static int i__, j, ndata;
1755 sprintf(name__,
" HELIUM4 ");
1766 e[2] = cnsts_1.emass * (float)2. / (cnsts_1.amu * (
float)4.0026);
1767 e[3] = (float)24.59;
1771 ein[1] = (float)19.82;
1774 en = -inpt_1.estep / (float)2.;
1776 i__1 = inpt_1.nstep1 + 1;
1777 for (i__ = 1; i__ <= i__1; ++i__) {
1780 for (j = 2; j <= i__2; ++j) {
1781 if (en <= xen[j - 1]) {
1788 a = (yxsec[j - 1] - yxsec[j - 2]) / (xen[j - 1] - xen[j - 2]);
1789 b = (xen[j - 2] * yxsec[j - 1] - xen[j - 1] * yxsec[j - 2]) / (xen[j
1791 q[i__ * 6 + 2] = (a * en + b) * (
float)1e-16;
1793 q[i__ * 6 + 3] = (float)0.;
1798 for (j = 2; j <= i__2; ++j) {
1799 if (en <= xion[j - 1]) {
1806 a = (yion[j - 1] - yion[j - 2]) / (xion[j - 1] - xion[j - 2]);
1807 b = (xion[j - 2] * yion[j - 1] - xion[j - 1] * yion[j - 2]) / (xion[j
1808 - 2] - xion[j - 1]);
1809 q[i__ * 6 + 3] = (a * en + b) * (
float)1e-16;
1812 q[i__ * 6 + 4] = (float)0.;
1813 q[i__ * 6 + 5] = (float)0.;
1814 q[i__ * 6 + 6] = (float)0.;
1816 qin[i__ * 24 + 1] = (float)0.;
1821 for (j = 2; j <= i__2; ++j) {
1822 if (en <= xexc[j - 1]) {
1829 a = (yexc[j - 1] - yexc[j - 2]) / (xexc[j - 1] - xexc[j - 2]);
1830 b = (xexc[j - 2] * yexc[j - 1] - xexc[j - 1] * yexc[j - 2]) / (xexc[j
1831 - 2] - xexc[j - 1]);
1832 qin[i__ * 24 + 1] = (a * en + b) * (
float)1e-16;
1833 qin[i__ * 24 + 1] = qin[i__ * 24 + 1];
1836 q[i__ * 6 + 1] = q[i__ * 6 + 2] + qin[i__ * 24 + 1] + q[i__ * 6 + 3];
1840 if (inpt_1.efinal <= ein[1]) {
1847 int StFtpcMagboltz1::h1calc_(
int *l,
double *dhfnal,
double *dxx,
double *dhfrst)
1853 static double ssum0;
1854 static int i__, j, m;
1855 static double termb, termt, sum, sum0, sum1, sum2, sum3, sum4, sum5;
1860 i__1 = inpt_1.nstep1;
1861 for (i__ = 1; i__ <= i__1; ++i__) {
1863 h1c_1.h1[i__ - 1] = (f0c_1.f[i__ - 1] - f2c_1.f2[i__ - 1] * (float).2)
1864 / mix2_1.qtot[i__ - 1];
1866 i__1 = inpt_1.nstep1;
1867 for (j = 2; j <= i__1; ++j) {
1869 h1c_1.dh1[j - 1] = (h1c_1.h1[j] - h1c_1.h1[j - 2]) / (inpt_1.estep * (
1872 h1c_1.dh1[0] = h1c_1.h1[0] / inpt_1.estep;
1876 for (j = 1; j <= 2002; ++j) {
1877 h1c_1.dh1[j - 1] = (float)0.;
1879 h1c_1.h1[j - 1] = (float)0.;
1881 h1c_1.h1[inpt_1.nstep1 - 1] = (float)0.;
1882 h1c_1.dh1[inpt_1.nstep1 - 1] = -(*dhfnal);
1883 h1c_1.h1[inpt_1.nstep - 1] = -inpt_1.estep * h1c_1.dh1[inpt_1.nstep1 - 1];
1884 h1c_1.dh1[inpt_1.nstep - 1] = h1c_1.dh1[inpt_1.nstep1 - 1];
1885 i__1 = inpt_1.nstep - 1;
1886 for (m = 1; m <= i__1; ++m) {
1887 i__ = inpt_1.nstep - m + 1;
1888 sum0 = h1c_1.h1[i__ - 1];
1889 sum1 = (f0c_1.f[i__ - 1] - f2c_1.f2[i__ - 1] * (float).2) /
1890 mix2_1.qtot[i__ - 1];
1891 sum2 = mag_1.qe[i__ - 1] * (float).3 * f1c_1.f1[i__ - 1] / (mix2_1.e[
1892 i__ - 1] * mix2_1.qtot[i__ - 1]);
1893 sum3 = mag_1.qe[i__ - 1] * (float).3 * mag_1.qe[i__ - 1] * h1c_1.dh1[
1894 i__ - 1] / mix2_1.e[i__ - 1];
1895 sum4 = mag_1.qe[i__ - 1] * (
float).15 * mag_1.qe[i__ - 1] * h1c_1.h1[
1896 i__ - 1] / (mix2_1.e[i__ - 1] * mix2_1.e[i__ - 1]);
1897 sum5 = mag_1.qe[i__ - 1] * (float)1.8 * f3c_1.f3[i__ - 1] / (mix2_1.e[
1898 i__ - 1] * mix2_1.qtot[i__ - 1] * (
float)14.);
1899 sum = sum1 - sum0 - sum2 + sum3 - sum4 + sum5;
1900 sum *= inpt_1.estep;
1902 termt = mag_1.qe[i__ - 1] * (float).2 * (f1c_1.f1[i__ - 1] * (
float)
1903 1. / mix2_1.qtot[i__ - 1] + mag_1.qe[i__ - 1] * h1c_1.h1[i__
1904 - 1] / (mix2_1.e[i__ - 1] * (float)2.) - f3c_1.f3[i__ - 1] * (
1905 float)3. / (mix2_1.qtot[i__ - 1] * (
float)7.));
1906 termb = mag_1.qe[i__ - 1] * (float).2 * mag_1.qe[i__ - 1];
1907 h1c_1.dh1[i__ - 1] = (ssum0 + termt) / termb;
1908 h1c_1.dh1[i__ - 1] -= *dhfnal;
1909 h1c_1.h1[i__ - 2] = h1c_1.h1[i__ - 1] - inpt_1.estep * (h1c_1.dh1[i__
1910 - 1] * (float)1.5 - h1c_1.dh1[i__] * (
float).5);
1911 h1c_1.dh1[i__ - 2] = h1c_1.dh1[i__ - 1] * (float)2. - h1c_1.dh1[i__];
1914 *dhfrst = h1c_1.dh1[0];
1915 i__1 = inpt_1.nstep1;
1916 for (j = 1; j <= i__1; ++j) {
1918 sint_1.simf[j - 1] = mix2_1.e[j - 1] * h1c_1.h1[j - 1];
1921 *dxx = sum * mag_1.eovm / (float)3.;
1925 int StFtpcMagboltz1::mixer_()
1931 static double a2ro1, aion, a2ro2, e2ro1[3], e2ro2[3], e2ro3[3], e2ro4[
1932 3], eion[4], qatt[8008] , a2ro3, a2ro4;
1933 static int i__, j, k;
1934 static double e1[6], e2[6], e3[6], e4[6], qdrot[2002], q1[12012]
1935 , q2[12012] , q3[12012]
1936 , q4[12012] , qqrot[
1937 2002], eg, en, ei1[24], ei2[24], ei3[24], ei4[24], virial1,
1938 virial2, virial3, virial4, ain1, ain2, ain3;
1962 sprintf(names_1.name1,
"000000000000000");
1963 sprintf(names_1.name2,
"000000000000000");
1964 sprintf(names_1.name3,
"000000000000000");
1965 sprintf(names_1.name4,
"000000000000000");
1966 for (j = 1; j <= 6; ++j) {
1967 for (i__ = 1; i__ <= 2002; ++i__) {
1968 q1[j + i__ * 6 - 7] = (float)0.;
1969 q2[j + i__ * 6 - 7] = (float)0.;
1970 q3[j + i__ * 6 - 7] = (float)0.;
1971 q4[j + i__ * 6 - 7] = (float)0.;
1974 e1[j - 1] = (float)0.;
1975 e2[j - 1] = (float)0.;
1976 e3[j - 1] = (float)0.;
1978 e4[j - 1] = (float)0.;
1983 gas1_(q1, mix1_1.qin1, mix4_1.q2ro1, &mix3_1.nin1, &mix4_1.n2ro1, e1, ei1,
1984 e2ro1, names_1.name1, &virial1, &c__0, 15L);
1985 if (inpt_1.ngas == 1) {
1988 gas2_(q2, mix1_1.qin2, mix4_1.q2ro2, &mix3_1.nin2, &mix4_1.n2ro2, e2, ei2,
1989 e2ro2, names_1.name2, &virial2, &c__0, 15L);
1990 if (inpt_1.ngas == 2) {
1993 gas3_(q3, mix1_1.qin3, mix4_1.q2ro3, &mix3_1.nin3, &mix4_1.n2ro3, e3, ei3,
1994 e2ro3, names_1.name3, &virial3, &c__0, 15L);
1995 if (inpt_1.ngas == 3) {
1998 gas4_(q4, mix1_1.qin4, mix4_1.q2ro4, &mix3_1.nin4, &mix4_1.n2ro4, e4, ei4,
1999 e2ro4, names_1.name4, &virial4, &c__0, 15L);
2007 i__1 = inpt_1.nstep1 + 1;
2008 for (i__ = 1; i__ <= i__1; ++i__) {
2009 mix2_1.qtot[i__ - 1] = ratio_1.an1 * q1[i__ * 6 - 6] + ratio_1.an2 *
2010 q2[i__ * 6 - 6] + ratio_1.an3 * q3[i__ * 6 - 6] + ratio_1.an4
2012 mix2_1.qel[i__ - 1] = ratio_1.an1 * q1[i__ * 6 - 5] + ratio_1.an2 *
2013 q2[i__ * 6 - 5] + ratio_1.an3 * q3[i__ * 6 - 5] + ratio_1.an4
2015 mix1_1.qelm[i__ - 1] = ratio_1.an1 * q1[i__ * 6 - 5] * e1[1] +
2016 ratio_1.an2 * q2[i__ * 6 - 5] * e2[1] + ratio_1.an3 * q3[i__ *
2017 6 - 5] * e3[1] + ratio_1.an4 * q4[i__ * 6 - 5] * e4[1];
2019 qqrot[i__ - 1] = ratio_1.an1 * q1[i__ * 6 - 2] * e1[4] + ratio_1.an2 *
2020 q2[i__ * 6 - 2] * e2[4] + ratio_1.an3 * q3[i__ * 6 - 2] * e3[
2021 4] + ratio_1.an4 * q4[i__ * 6 - 2] * e4[4];
2022 qqrot[i__ - 1] *= (float)4.;
2024 en = mix2_1.e[i__ - 1] * (float)2.;
2025 if (mix2_1.e[i__ - 1] == (
float)0.) {
2028 qdrot[i__ - 1] = (float)0.;
2029 if (e1[5] == (
float)0.) {
2032 qdrot[i__ - 1] = ratio_1.an1 * q1[i__ * 6 - 1] * (float)2. * e1[5] *
2033 inpt_1.ary * ::log(en / ::sqrt(e1[5] * inpt_1.akt));
2035 if (e2[5] == (
float)0.) {
2038 qdrot[i__ - 1] += ratio_1.an2 * q2[i__ * 6 - 1] * (float)2. * e2[5] *
2039 inpt_1.ary * ::log(en / ::sqrt(e2[5] * inpt_1.akt));
2041 if (e3[5] == (
float)0.) {
2044 qdrot[i__ - 1] += ratio_1.an3 * q3[i__ * 6 - 1] * (float)2. * e3[5] *
2045 inpt_1.ary * ::log(en / ::sqrt(e3[5] * inpt_1.akt));
2047 if (e4[5] == (
float)0.) {
2050 qdrot[i__ - 1] += ratio_1.an4 * q4[i__ * 6 - 1] * (float)2. * e4[5] *
2051 inpt_1.ary * ::log(en / ::sqrt(e4[5] * inpt_1.akt));
2054 mix1_1.qelm[i__ - 1] = mix1_1.qelm[i__ - 1] * mix2_1.e[i__ - 1] *
2055 mix2_1.e[i__ - 1] + qqrot[i__ - 1] * mix2_1.e[i__ - 1] +
2058 mix1_1.qion[(i__ << 2) - 4] = q1[i__ * 6 - 4] * ratio_1.an1 *
2060 mix1_1.qion[(i__ << 2) - 3] = q2[i__ * 6 - 4] * ratio_1.an2 *
2062 mix1_1.qion[(i__ << 2) - 2] = q3[i__ * 6 - 4] * ratio_1.an3 *
2064 mix1_1.qion[(i__ << 2) - 1] = q4[i__ * 6 - 4] * ratio_1.an4 *
2066 qatt[(i__ << 2) - 4] = q1[i__ * 6 - 3] * ratio_1.an1 * mix2_1.e[i__ -
2068 qatt[(i__ << 2) - 3] = q2[i__ * 6 - 3] * ratio_1.an2 * mix2_1.e[i__ -
2070 qatt[(i__ << 2) - 2] = q3[i__ * 6 - 3] * ratio_1.an3 * mix2_1.e[i__ -
2072 qatt[(i__ << 2) - 1] = q4[i__ * 6 - 3] * ratio_1.an4 * mix2_1.e[i__ -
2075 if (mix3_1.nin1 == 0) {
2079 for (j = 1; j <= i__2; ++j) {
2081 mix1_1.qin1[j + i__ * 24 - 25] = mix1_1.qin1[j + i__ * 24 - 25] *
2082 ratio_1.an1 * mix2_1.e[i__ - 1];
2085 if (mix3_1.nin2 == 0) {
2089 for (j = 1; j <= i__2; ++j) {
2091 mix1_1.qin2[j + i__ * 24 - 25] = mix1_1.qin2[j + i__ * 24 - 25] *
2092 ratio_1.an2 * mix2_1.e[i__ - 1];
2095 if (mix3_1.nin3 == 0) {
2099 for (j = 1; j <= i__2; ++j) {
2101 mix1_1.qin3[j + i__ * 24 - 25] = mix1_1.qin3[j + i__ * 24 - 25] *
2102 ratio_1.an3 * mix2_1.e[i__ - 1];
2105 if (mix3_1.nin4 == 0) {
2109 for (j = 1; j <= i__2; ++j) {
2111 mix1_1.qin4[j + i__ * 24 - 25] = mix1_1.qin4[j + i__ * 24 - 25] *
2112 ratio_1.an4 * mix2_1.e[i__ - 1];
2116 for (k = 1; k <= 2; ++k) {
2117 if (mix4_1.n2ro1 == 0) {
2120 i__2 = mix4_1.n2ro1;
2121 for (j = 1; j <= i__2; ++j) {
2123 mix4_1.q2ro1[k + ((j + i__ * 3) << 1) - 9] = mix4_1.q2ro1[k + (
2124 (j + i__ * 3) << 1) - 9] * ratio_1.an1 * mix2_1.e[i__ -
2128 if (mix4_1.n2ro2 == 0) {
2131 i__2 = mix4_1.n2ro2;
2132 for (j = 1; j <= i__2; ++j) {
2134 mix4_1.q2ro2[k + ((j + i__ * 3) << 1) - 9] = mix4_1.q2ro2[k + (
2135 (j + i__ * 3) << 1) - 9] * ratio_1.an2 * mix2_1.e[i__ -
2139 if (mix4_1.n2ro3 == 0) {
2142 i__2 = mix4_1.n2ro3;
2143 for (j = 1; j <= i__2; ++j) {
2145 mix4_1.q2ro3[k + ((j + i__ * 3) << 1) - 9] = mix4_1.q2ro3[k + (
2146 (j + i__ * 3) << 1) - 9] * ratio_1.an3 * mix2_1.e[i__ -
2150 if (mix4_1.n2ro4 == 0) {
2153 i__2 = mix4_1.n2ro4;
2154 for (j = 1; j <= i__2; ++j) {
2156 mix4_1.q2ro4[k + ((j + i__ * 3) << 1) - 9] = mix4_1.q2ro4[k + (
2157 (j + i__ * 3) << 1) - 9] * ratio_1.an4 * mix2_1.e[i__ -
2165 mix2_1.qrel[i__ - 1] = (float)0.;
2166 mix1_1.qsatt[i__ - 1] = (float)0.;
2167 mix1_1.qsum[i__ - 1] = (float)0.;
2169 for (j = 1; j <= i__2; ++j) {
2170 mix1_1.qsum[i__ - 1] = mix1_1.qsum[i__ - 1] + mix1_1.qion[j + (
2171 i__ << 2) - 5] + qatt[j + (i__ << 2) - 5];
2172 mix1_1.qsatt[i__ - 1] += qatt[j + (i__ << 2) - 5];
2174 mix2_1.qrel[i__ - 1] = mix2_1.qrel[i__ - 1] + mix1_1.qion[j + (
2175 i__ << 2) - 5] - qatt[j + (i__ << 2) - 5];
2178 if (mix3_1.nin1 == 0) {
2182 for (j = 1; j <= i__2; ++j) {
2184 mix1_1.qsum[i__ - 1] += mix1_1.qin1[j + i__ * 24 - 25];
2187 if (mix3_1.nin2 == 0) {
2191 for (j = 1; j <= i__2; ++j) {
2193 mix1_1.qsum[i__ - 1] += mix1_1.qin2[j + i__ * 24 - 25];
2196 if (mix3_1.nin3 == 0) {
2200 for (j = 1; j <= i__2; ++j) {
2202 mix1_1.qsum[i__ - 1] += mix1_1.qin3[j + i__ * 24 - 25];
2205 if (mix3_1.nin4 == 0) {
2209 for (j = 1; j <= i__2; ++j) {
2211 mix1_1.qsum[i__ - 1] += mix1_1.qin4[j + i__ * 24 - 25];
2214 eg = mix2_1.e[i__ - 1];
2215 if (mix2_1.e[i__ - 1] == (
float)0.) {
2218 mix2_1.qinel[i__ - 1] = mix1_1.qsum[i__ - 1] / eg;
2228 for (j = 1; j <= i__1; ++j) {
2229 aion = eion[j - 1] / inpt_1.estep;
2230 mix3_1.lion[j - 1] = (int) aion;
2232 mix3_1.alion[j - 1] = aion - mix3_1.lion[j - 1];
2235 if (mix3_1.nin1 == 0) {
2239 for (j = 1; j <= i__1; ++j) {
2240 ain1 = ei1[j - 1] / inpt_1.estep;
2241 mix3_1.lin1[j - 1] = (int) ain1;
2243 mix3_1.alin1[j - 1] = ain1 - mix3_1.lin1[j - 1];
2246 if (mix3_1.nin2 == 0) {
2250 for (j = 1; j <= i__1; ++j) {
2251 ain2 = ei2[j - 1] / inpt_1.estep;
2252 mix3_1.lin2[j - 1] = (int) ain2;
2254 mix3_1.alin2[j - 1] = ain2 - mix3_1.lin2[j - 1];
2257 if (mix3_1.nin3 == 0) {
2261 for (j = 1; j <= i__1; ++j) {
2262 ain3 = ei3[j - 1] / inpt_1.estep;
2263 mix3_1.lin3[j - 1] = (int) ain3;
2265 mix3_1.alin3[j - 1] = ain3 - mix3_1.lin3[j - 1];
2268 if (mix3_1.nin4 == 0) {
2272 for (j = 1; j <= i__1; ++j) {
2273 ain4 = ei4[j - 1] / inpt_1.estep;
2274 mix3_1.lin4[j - 1] = (int) ain4;
2276 mix3_1.alin4[j - 1] = ain4 - mix3_1.lin4[j - 1];
2280 if (mix4_1.n2ro1 == 0) {
2283 i__1 = mix4_1.n2ro1;
2284 for (j = 1; j <= i__1; ++j) {
2285 a2ro1 = e2ro1[j - 1] / inpt_1.estep;
2286 mix4_1.l2ro1[j - 1] = (int) a2ro1;
2288 mix4_1.al2ro1[j - 1] = a2ro1 - mix4_1.l2ro1[j - 1];
2291 if (mix4_1.n2ro2 == 0) {
2294 i__1 = mix4_1.n2ro2;
2295 for (j = 1; j <= i__1; ++j) {
2296 a2ro2 = e2ro2[j - 1] / inpt_1.estep;
2297 mix4_1.l2ro2[j - 1] = (int) a2ro2;
2299 mix4_1.al2ro2[j - 1] = a2ro2 - mix4_1.l2ro2[j - 1];
2302 if (mix4_1.n2ro3 == 0) {
2305 i__1 = mix4_1.n2ro3;
2306 for (j = 1; j <= i__1; ++j) {
2307 a2ro3 = e2ro3[j - 1] / inpt_1.estep;
2308 mix4_1.l2ro3[j - 1] = (int) a2ro3;
2310 mix4_1.al2ro3[j - 1] = a2ro3 - mix4_1.l2ro3[j - 1];
2313 if (mix4_1.n2ro4 == 0) {
2316 i__1 = mix4_1.n2ro4;
2317 for (j = 1; j <= i__1; ++j) {
2318 a2ro4 = e2ro4[j - 1] / inpt_1.estep;
2319 mix4_1.l2ro4[j - 1] = (int) a2ro4;
2321 mix4_1.al2ro4[j - 1] = a2ro4 - mix4_1.l2ro4[j - 1];
2327 int StFtpcMagboltz1::nalpha_()
2334 static double velx, vely, velz, vtot, velx1, vely1, velz1;
2336 static double vtot1, ratei, cjk, dss, dxx, sum, dyy, dzz;
2339 inpt_1.alpold = inpt_1.alpnew;
2340 inpt_1.alpoax = inpt_1.alpnax;
2341 inpt_1.alpoay = inpt_1.alpnay;
2342 inpt_1.alpoaz = inpt_1.alpnaz;
2343 i__1 = inpt_1.nstep1;
2344 for (j = 1; j <= i__1; ++j) {
2346 sint_1.simf[j - 1] = mix2_1.e[j - 1] * f0c_1.f[j - 1] / (mag_1.denom[
2347 j - 1] * mix2_1.qtot[j - 1]);
2350 dxx = sum * mag_1.eovm / (float)3.;
2351 i__1 = inpt_1.nstep1;
2352 for (j = 1; j <= i__1; ++j) {
2354 sint_1.simf[j - 1] = mix2_1.e[j - 1] * f0c_1.f[j - 1] * mag_1.sod2[j
2355 - 1] / mix2_1.qtot[j - 1];
2358 dyy = sum * mag_1.eovm / (float)3.;
2359 i__1 = inpt_1.nstep1;
2360 for (j = 1; j <= i__1; ++j) {
2362 sint_1.simf[j - 1] = mix2_1.e[j - 1] * f0c_1.f[j - 1] * mag_1.cod2[j
2363 - 1] / mix2_1.qtot[j - 1];
2366 dzz = sum * mag_1.eovm / (float)3.;
2367 dss = (dzz + dyy + dxx) / (
float)3.;
2368 i__1 = inpt_1.nstep1;
2369 for (j = 1; j <= i__1; ++j) {
2371 sint_1.simf[j - 1] = mag_1.cod2[j - 1] * mag_1.qfemag[j - 1] *
2372 f0c_1.df[j - 1] * f0c_1.f[j - 1];
2375 velz1 = -sum * mag_1.eovm;
2376 i__1 = inpt_1.nstep1;
2377 for (j = 1; j <= i__1; ++j) {
2379 sint_1.simf[j - 1] = mag_1.scd[j - 1] * mag_1.qfemag[j - 1] *
2380 f0c_1.df[j - 1] * f0c_1.f[j - 1];
2383 vely1 = -sum * mag_1.eovm;
2384 i__1 = inpt_1.nstep1;
2385 for (j = 1; j <= i__1; ++j) {
2387 sint_1.simf[j - 1] = mag_1.sod[j - 1] * mag_1.qfemag[j - 1] *
2388 f0c_1.df[j - 1] * f0c_1.f[j - 1];
2391 velx1 = -sum * mag_1.eovm;
2392 vtot1 = ::sqrt(velx1 * velx1 + vely1 * vely1 + velz1 * velz1);
2393 i__1 = inpt_1.nstep1;
2394 for (j = 1; j <= i__1; ++j) {
2396 sint_1.simf[j - 1] = mix2_1.qrel[j - 1] * f0c_1.f[j - 1];
2399 ratei = sum * mag_1.eovm;
2401 d__1 = vtot1 / (dss * (float)2.);
2402 cjk = d__1 * d__1 - ratei / dss;
2403 if (cjk < (
float)0.) {
2406 inpt_1.alpnew = vtot1 / (dss * (float)2.) - ::sqrt(cjk);
2409 inpt_1.alpnew = ratei / vtot1;
2411 i__1 = inpt_1.nstep1;
2412 for (j = 1; j <= i__1; ++j) {
2414 sint_1.simf[j - 1] = mag_1.cod2[j - 1] * (mag_1.qfemag[j - 1] *
2415 f0c_1.df[j - 1] - mag_1.qef[j - 1] * inpt_1.alpnew) * f0c_1.f[
2419 velz = -sum * mag_1.eovm;
2420 i__1 = inpt_1.nstep1;
2421 for (j = 1; j <= i__1; ++j) {
2423 sint_1.simf[j - 1] = mag_1.scd[j - 1] * (mag_1.qfemag[j - 1] *
2424 f0c_1.df[j - 1] - mag_1.qef[j - 1] * inpt_1.alpnew) * f0c_1.f[
2428 vely = -sum * mag_1.eovm;
2429 i__1 = inpt_1.nstep1;
2430 for (j = 1; j <= i__1; ++j) {
2432 sint_1.simf[j - 1] = mag_1.sod[j - 1] * (mag_1.qfemag[j - 1] *
2433 f0c_1.df[j - 1] - mag_1.qef[j - 1] * inpt_1.alpnew) * f0c_1.f[
2437 velx = -sum * mag_1.eovm;
2438 vtot = ::sqrt(velx * velx + vely * vely + velz * velz);
2439 if (cjk < (
float)0.) {
2440 printf(
"WARNING NALPHA DID NOT CONVERGE (SUBROUTINE NALPHA)\n");
2442 inpt_1.alpnax = velx1 * inpt_1.alpnew / vtot1;
2443 inpt_1.alpnay = vely1 * inpt_1.alpnew / vtot1;
2444 inpt_1.alpnaz = velz1 * inpt_1.alpnew / vtot1;
2445 printf(
"NEW ALPHA =%f / CM. OLD ALPHA =%f /CM. VELZ =%f VTOT =%f CM./SEC.\n",inpt_1.alpnew,inpt_1.alpold,velz,vtot);
2450 int StFtpcMagboltz1::output_(
int *n)
2459 static double velx, vely, vtot, velx1, vely1, velz1;
2461 static double vtot1, vtot2, fudge, ratei, dovmb, rteel, vtot12, dl,
2462 ri, wm, select, erootf[2002], colrte, rteinl, ratatt, alpatt,
2463 dlovmb, fac, cjk, dss, dxx, sum, dyy, dyz, dzz, dxz;
2467 i__1 = inpt_1.nstep1;
2468 for (j = 1; j <= i__1; ++j) {
2470 sint_1.simf[j - 1] = mag_1.cod2[j - 1] * (mag_1.qfemag[j - 1] *
2471 f0c_1.df[j - 1] * f0c_1.f[j - 1] + mag_1.emag * (float).4 * (
2472 mix2_1.e[j - 1] * f2c_1.df2[j - 1] + f2c_1.f2[j - 1] * (
float)
2473 1.5) / (mix2_1.qtot[j - 1] * (float)3.));
2476 velz1 = -sum * mag_1.eovm;
2477 if (*n == 0 && inpt_1.i2type == 1) {
2478 printf(
"COLLISIONS OF 2ND KIND INCLUDED.\n");
2481 printf(
"INTERMEDIATE VALUE FOR DRIFT VELOCITY = %f\n",velz1);
2486 i__1 = inpt_1.nstep1;
2487 for (j = 1; j <= i__1; ++j) {
2489 sint_1.simf[j - 1] = mix2_1.e[j - 1] * f0c_1.f[j - 1] / (mag_1.denom[
2490 j - 1] * mix2_1.qtot[j - 1]);
2493 dxx = sum * mag_1.eovm / (float)3.;
2494 i__1 = inpt_1.nstep1;
2495 for (j = 1; j <= i__1; ++j) {
2497 sint_1.simf[j - 1] = mix2_1.e[j - 1] * f0c_1.f[j - 1] * mag_1.sod2[j
2498 - 1] / mix2_1.qtot[j - 1];
2501 dyy = sum * mag_1.eovm / (float)3.;
2502 i__1 = inpt_1.nstep1;
2503 for (j = 1; j <= i__1; ++j) {
2505 sint_1.simf[j - 1] = mix2_1.e[j - 1] * f0c_1.f[j - 1] * mag_1.cod2[j
2506 - 1] / mix2_1.qtot[j - 1];
2509 dzz = sum * mag_1.eovm / (float)3.;
2510 dss = (dzz + dyy + dxx) / (
float)3.;
2511 i__1 = inpt_1.nstep1;
2512 for (j = 1; j <= i__1; ++j) {
2514 sint_1.simf[j - 1] = mix2_1.qrel[j - 1] * f0c_1.f[j - 1];
2517 ratei = sum * mag_1.eovm;
2518 i__1 = inpt_1.nstep1;
2519 for (j = 1; j <= i__1; ++j) {
2521 sint_1.simf[j - 1] = mag_1.cod2[j - 1] * (mag_1.qfemag[j - 1] *
2522 f0c_1.df[j - 1] * f0c_1.f[j - 1] + mag_1.emag * (float).4 * (
2523 mix2_1.e[j - 1] * f2c_1.df2[j - 1] + f2c_1.f2[j - 1] * (
float)
2524 1.5) / (mix2_1.qtot[j - 1] * (float)3.));
2527 velz1 = -sum * mag_1.eovm;
2528 i__1 = inpt_1.nstep1;
2529 for (j = 1; j <= i__1; ++j) {
2531 sint_1.simf[j - 1] = mag_1.scd[j - 1] * (mag_1.qfemag[j - 1] *
2532 f0c_1.df[j - 1] * f0c_1.f[j - 1] + mag_1.emag * (float).4 * (
2533 mix2_1.e[j - 1] * f2c_1.df2[j - 1] + f2c_1.f2[j - 1] * (
float)
2534 1.5) / (mix2_1.qtot[j - 1] * (float)3.));
2537 vely1 = -sum * mag_1.eovm;
2538 i__1 = inpt_1.nstep1;
2539 for (j = 1; j <= i__1; ++j) {
2541 sint_1.simf[j - 1] = mag_1.sod[j - 1] * (mag_1.qfemag[j - 1] *
2542 f0c_1.df[j - 1] * f0c_1.f[j - 1] + mag_1.emag * (float).4 * (
2543 mix2_1.e[j - 1] * f2c_1.df2[j - 1] + f2c_1.f2[j - 1] * (
float)
2544 1.5) / (mix2_1.qtot[j - 1] * (float)3.));
2547 velx1 = -sum * mag_1.eovm;
2548 vtot12 = velx1 * velx1 + vely1 * vely1 + velz1 * velz1;
2549 vtot1 = ::sqrt(vtot12);
2551 d__1 = vtot1 / (dss * (float)2.);
2552 cjk = d__1 * d__1 - ratei / dss;
2553 if (cjk < (
float)0.) {
2554 printf(
"WARNING ALPHA DID NOT CONVERGE USED ALPHA = RATE/VEL0CITY\n");
2556 if (cjk < (
float)0. || ratei == (
float)0.) {
2559 inpt_1.alpha = vtot1 / (dss * (float)2.) - ::sqrt(cjk);
2562 inpt_1.alpha = ratei / vtot1;
2564 i__1 = inpt_1.nstep1;
2565 for (j = 1; j <= i__1; ++j) {
2567 sint_1.simf[j - 1] = mag_1.cod2[j - 1] * (mag_1.qfemag[j - 1] *
2568 f0c_1.df[j - 1] * f0c_1.f[j - 1] + mag_1.emag * (float).4 * (
2569 mix2_1.e[j - 1] * f2c_1.df2[j - 1] + f2c_1.f2[j - 1] * (
float)
2570 1.5) / (mix2_1.qtot[j - 1] * (float)3.) - mag_1.qef[j - 1] *
2571 inpt_1.alpha * (f0c_1.f[j - 1] + f2c_1.f2[j - 1] * (float).4))
2575 mk_1.velz = -sum * mag_1.eovm;
2576 i__1 = inpt_1.nstep1;
2577 for (j = 1; j <= i__1; ++j) {
2579 sint_1.simf[j - 1] = mag_1.scd[j - 1] * (mag_1.qfemag[j - 1] *
2580 f0c_1.df[j - 1] * f0c_1.f[j - 1] + mag_1.emag * (float).4 * (
2581 mix2_1.e[j - 1] * f2c_1.df2[j - 1] + f2c_1.f2[j - 1] * (
float)
2582 1.5) / (mix2_1.qtot[j - 1] * (float)3.) - mag_1.qef[j - 1] *
2583 inpt_1.alpha * (f0c_1.f[j - 1] + f2c_1.f2[j - 1] * (float).4))
2587 vely = -sum * mag_1.eovm;
2588 i__1 = inpt_1.nstep1;
2589 for (j = 1; j <= i__1; ++j) {
2591 sint_1.simf[j - 1] = mag_1.sod[j - 1] * (mag_1.qfemag[j - 1] *
2592 f0c_1.df[j - 1] * f0c_1.f[j - 1] + mag_1.emag * (float).4 * (
2593 mix2_1.e[j - 1] * f2c_1.df2[j - 1] + f2c_1.f2[j - 1] * (
float)
2594 1.5) / (mix2_1.qtot[j - 1] * (float)3.) - mag_1.qef[j - 1] *
2595 inpt_1.alpha * (f0c_1.f[j - 1] + f2c_1.f2[j - 1] * (float).4))
2599 velx = -sum * mag_1.eovm;
2600 vtot2 = velx * velx + vely * vely + mk_1.velz * mk_1.velz;
2601 vtot = ::sqrt(vtot2);
2602 ri = inpt_1.alpha * vtot1;
2603 i__1 = inpt_1.nstep1;
2604 for (j = 1; j <= i__1; ++j) {
2606 sint_1.simf[j - 1] = mix2_1.e[j - 1] * h1c_1.h1[j - 1] / mag_1.denom[
2610 dxx = sum * mag_1.eovm / (float)3.;
2611 i__1 = inpt_1.nstep1;
2612 for (j = 1; j <= i__1; ++j) {
2614 sint_1.simf[j - 1] = mix2_1.e[j - 1] * h1c_1.h1[j - 1] * mag_1.sod2[j
2618 dyy = sum * mag_1.eovm / (float)3.;
2619 i__1 = inpt_1.nstep1;
2620 for (j = 1; j <= i__1; ++j) {
2622 sint_1.simf[j - 1] = mix2_1.e[j - 1] * h1c_1.h1[j - 1] * mag_1.cod2[j
2626 dzz = sum * mag_1.eovm / (float)3.;
2627 i__1 = inpt_1.nstep1;
2628 for (j = 1; j <= i__1; ++j) {
2630 sint_1.simf[j - 1] = mix2_1.e[j - 1] * h1c_1.h1[j - 1] * (float)2. *
2634 dyz = sum * mag_1.eovm / (float)3.;
2635 i__1 = inpt_1.nstep1;
2636 for (j = 1; j <= i__1; ++j) {
2638 sint_1.simf[j - 1] = mix2_1.e[j - 1] * h1c_1.h1[j - 1] * (float)2. *
2642 dxz = sum * mag_1.eovm / (float)3.;
2643 i__1 = inpt_1.nstep1;
2644 for (j = 1; j <= i__1; ++j) {
2646 sint_1.simf[j - 1] = mix2_1.e[j - 1] * mix2_1.eroot[j - 1] * f0c_1.f[
2651 i__1 = inpt_1.nstep1;
2652 for (j = 1; j <= i__1; ++j) {
2654 sint_1.simf[j - 1] = mix2_1.eroot[j - 1] * f0c_1.f[j - 1] /
2659 i__1 = inpt_1.nstep1;
2660 for (j = 1; j <= i__1; ++j) {
2662 sint_1.simf[j - 1] = mix2_1.qtot[j - 1] * mix2_1.e[j - 1] * f0c_1.f[j
2666 colrte = sum * mag_1.eovm;
2668 d__1 = mag_1.wb / colrte;
2669 faci = (float)1. / (d__1 * d__1 + (
float)1.);
2670 i__1 = inpt_1.nstep1;
2671 for (j = 1; j <= i__1; ++j) {
2673 erootf[j - 1] = mix2_1.eroot[j - 1] * f0c_1.f[j - 1];
2675 i__1 = inpt_1.nstep1;
2676 for (j = 1; j <= i__1; ++j) {
2678 sint_1.simf[j - 1] = mix2_1.qinel[j - 1] * mix2_1.e[j - 1] * f0c_1.f[
2682 rteinl = sum * mag_1.eovm;
2683 i__1 = inpt_1.nstep1;
2684 for (j = 1; j <= i__1; ++j) {
2686 sint_1.simf[j - 1] = mix2_1.qel[j - 1] * mix2_1.e[j - 1] * f0c_1.f[j
2690 rteel = sum * mag_1.eovm;
2691 i__1 = inpt_1.nstep1;
2692 for (j = 1; j <= i__1; ++j) {
2694 sint_1.simf[j - 1] = g1c_1.g1[j - 1] * mix2_1.e[j - 1];
2697 dl = sum * mag_1.eovm / (float)3.;
2699 i__1 = inpt_1.nstep1;
2700 for (j = 1; j <= i__1; ++j) {
2702 sint_1.simf[j - 1] = f0c_1.f[j - 1] * (mix1_1.qin1[j * 24 - 22] +
2703 mix1_1.qin1[j * 24 - 23]);
2706 select = sum * mag_1.eovm;
2707 printf(
"SELECTED INELASTIC FREQUENCY= %f\n", select);
2708 i__1 = inpt_1.nstep1;
2709 for (j = 1; j <= i__1; ++j) {
2711 sint_1.simf[j - 1] = f0c_1.f[j - 1] * mix1_1.qsatt[j - 1];
2714 ratatt = sum * mag_1.eovm;
2715 alpatt = ratatt / vtot1;
2717 if (mag_1.bmag > (
float)0.) {
2718 wm = velx * mag_1.emag * (float)1e5 / (mk_1.velz * mag_1.bmag);
2720 dovmb = (dzz + dyy + dxx) * mag_1.emag / (vtot1 * (
float)3.);
2721 dlovmb = dl * mag_1.emag / vtot1;
2722 mk_1.angle = atan(velx / mk_1.velz) * (float)180. / acos(-1.);
2723 printf(
"-----------------------------------------------------------------------------------------------------------------------");
2725 printf(
"FINAL VALUES WITHOUT COLLISIONS OF 2ND KIND. LORENTZ SOLUTION (L=1).\n");
2728 printf(
"FINAL VALUES WITH L=2 TERM FULLY INCLUDED IN CALCULATION.\n");
2731 printf(
"FINAL VALUES WITH COLLISIONS OF 2ND KIND. \n");
2734 printf(
"FINAL VALUES CONVERGED ON ALPHA TO ALL ORDERS. \n");
2737 printf(
"FINAL VALUES WITH HIGHER MULTIPOLE. (L=2 TERM) HIGHER TERM ONLY TO FIRST ORDER .\n");
2740 printf(
"FINAL VALUES WITH HIGHER MULTIPOLE. (L=3 TERM) HIGHER TERM ONLY TO FIRST ORDER .\n");
2742 printf(
"N.B. LORENTZ ANGLE = VELX/VELZ =%f DEGREES.\n", mk_1.angle);
2743 printf(
"VELZ =%f VELY =%f VELX =%f VTOT =%f CM./SEC. ( WITH IONISATION )\n",mk_1.velz,vely,velx,vtot);
2744 printf(
"VELZ1 =%f VELY1 =%f VELX1 =%f VTOT1 =%f CM./SEC. ( WITHOUT IONISATION )\n",velz1,vely1,velx1,vtot1);
2745 printf(
" DZZ =%f DYY =%f DXX =%f DYZ =%f DXZ =%f CM.**2/SEC.",dzz,dyy,dxx,dyz,dxz);
2746 printf(
"MEAN ELECTRON ENERGY =%f EV. DIFFUSIONMOBILITY =%f EV. = CHARACTERISTIC ENERGY.\n",mk_1.emean,dovmb);
2747 printf(
"NET ( IONISATION - ATTACHMENT ) RATE =%f / CM. =%f /SEC. ATTACHMENT RATE =%f / CM.\n",inpt_1.alpha,ratei,alpatt);
2748 printf(
"CYCLOTRON FREQUENCY =%f RADS./SEC. TOTAL COLLISION FREQUENCY =%f /SEC. 1/(1+(CYCLOTRON FREQ./COLL.FREQ.)**2) = K FACTOR =%f TRUE K FACTOR =%f\n",mag_1.wb,colrte,faci,fac);
2749 printf(
"MAGNETIC DRIFT VELOCITY =%f CM/SEC. (ONLY VALID FOR E AND B AT 90 DEGREES TO EACH OTHER.)\n",wm);
2750 printf(
"INELASTIC COLLISION FREQUENCY =%f /SEC. ELASTIC COLLISION FREQUENCY =%f /SEC.\n",rteinl,rteel);
2751 printf(
" F0 =%f AT FINAL ENERGY OF %f EV.\n",f0c_1.f[inpt_1.nstep1 - 1],inpt_1.efinal);
2752 printf(
"LONGITUDINAL DIFFUSION =%f CM.**2/SEC. = %f EV. \n",dl,dlovmb);
2757 mk_1.sig_long__ = ::sqrt(dl * (
float)2. * (
float)1e6 / mk_1.velz) * (float)
2759 mk_1.sig_tranx__ = ::sqrt(dxx * (
float)2. * (
float)1e6 / mk_1.velz) * (
2761 mk_1.sig_trany__ = ::sqrt(dyy * (
float)2. * (
float)1e6 / mk_1.velz) * (
2764 mk_1.btheta_mk__ = mag_1.btheta;
2765 mk_1.bmag_mk__ = mag_1.bmag;
2766 printf(
"PULSED TOWNSEND OR TOF IONISATION RATE=%f /SEC.\n",ri);
2787 mk_1.amk_emag__ = mag_1.emag;
2788 printf(
"MK-EMAG %f\n", mk_1.amk_emag__);
2797 int StFtpcMagboltz1::prnter_()
2799 printf(
"BOLTZMAN SOLUTION FOR MIXTURE OF %d GASES.\n------------------------------------------------------\n",inpt_1.ngas);
2800 printf(
" GASES REQUESTED = %s %s %s %s\n",gasn_1.ngas1,gasn_1.ngas2,gasn_1.ngas3,gasn_1.ngas4);
2801 printf(
" GASES USED = %s %s %s %s\n",names_1.name1,names_1.name2,names_1.name3,names_1.name4);
2802 printf(
" PERCENTAGE USED = %f %f %f %f\n",ratio_1.frac1,ratio_1.frac2,ratio_1.frac3,ratio_1.frac4);
2803 printf(
"GAS TEMPERATURE =%f DEGREES CENTIGRADE. GAS PRESSURE = %f TORR.\n",inpt_1.tempc,inpt_1.torr);
2804 printf(
" INTEGRATION FROM 0.0 TO %f EV. IN %d STEPS. CONVERGENCE ERROR LESS THAN %f\n",inpt_1.efinal,inpt_1.nstep,inpt_1.conv);
2805 if (inpt_1.i2type == 1) {
2806 printf(
"COLLISIONS OF SECOND TYPE INCLUDED.\n");
2808 if (inpt_1.idlong == 1) {
2811 printf(
"PRINTOUT EVERY %d ITERATIONS. MAXIMUM NUMBER OF ITERATIONS ALLOWED =%d\nLONGITUDINAL DIFF. NOT CALCULATED.\n",inpt_1.nout,inpt_1.itmax);
2814 printf(
"PRINTOUT EVERY %d ITERATIONS. MAXIMUM NUMBER OF ITERATIONS ALLOWED =%d\nLONGITUDINAL DIFFUSION CALCULATED.\n",inpt_1.nout,inpt_1.itmax);
2816 printf(
" ELECTRIC FIELD =%f VOLTS/CM. MAGNETIC FIELD =%f KGAUSS. \nANGLE BETWEEN MAGNETIC AND ELECTRIC FIELD = %f DEGREES.\n",mag_1.emag,mag_1.bmag,mag_1.btheta);
2817 if (inpt_1.isfb == 0) {
2818 printf(
" STANDARD PARAMETERISATION OF KT TERM.\n");
2820 if (inpt_1.isfb == 1) {
2821 printf(
" INELASTIC LEVELS IN KT TERM.\n");
2823 printf(
" N.B. MULTIPLY DIFFUSION COEFFICIENTS BELOW BY :- DZZ=DZZ*FUDGE, DYZ=DYZ*SQRT(FUDGE), DXZ=DXZ*SQRT(FUDGE). USE (FUDGE) FACTOR = RATIO OF LONGITUDINAL/TRANSVERSE DIFFUSION COEFFICIENTS IN ZERO MAGNETIC FIELD.\n");
2827 int StFtpcMagboltz1::setup_(
int *last)
2832 static double boltz, aj, alosch, awb;
2838 inpt_1.ary = (float)13.6056981;
2839 cnsts_1.pir2 = 8.79735669e-17;
2840 cnsts_1.echarg = 1.60217733e-19;
2841 cnsts_1.emass = 9.1093897e-31;
2842 cnsts_1.amu = 1.6605402e-27;
2843 boltz = 8.617343e-5;
2845 alosch = 2.686763e19;
2846 mag_1.eovm = ::sqrt(cnsts_1.echarg * (
float)2. / cnsts_1.emass) * (float)
2854 inpt_1.conv = (float)5e-4;
2855 inpt_1.nstep = 2000;
2857 inpt_1.conalp = (float).01;
2859 inpt_1.itmax = 1200;
2871 printf(
"************************\n");
2872 printf(
"Here comes the final E: %f\n", inpt_1.efinal);
2873 printf(
"************************\n");
2874 if (inpt_1.ngas == 0) {
2877 inpt_1.nstep1 = inpt_1.nstep + 1;
2878 inpt_1.estep = inpt_1.efinal / inpt_1.nstep;
2879 for (i__ = 1; i__ <= 2002; ++i__) {
2882 mix2_1.e[i__ - 1] = aj * inpt_1.estep;
2884 mix2_1.eroot[i__ - 1] = ::sqrt(mix2_1.e[i__ - 1]);
2886 mix2_1.eroot[0] = 1e-10;
2891 sprintf(gasn_1.ngas1,
"Ar");
2892 sprintf(gasn_1.ngas1,
"CO2");
2893 sprintf(gasn_1.ngas1,
"Ne");
2894 sprintf(gasn_1.ngas1,
"He");
2895 ratio_1.frac1 = callpars_1.perc_ar__;
2896 ratio_1.frac2 = callpars_1.perc_co2__;
2897 ratio_1.frac3 = callpars_1.perc_ne__;
2898 ratio_1.frac4 = callpars_1.perc_he__;
2899 inpt_1.tempc = callpars_1.temperature;
2900 inpt_1.torr = callpars_1.pressure;
2902 corr = inpt_1.torr * (float)2.7316 / ((inpt_1.tempc + (
float)273.16) * (
2904 ratio_1.an1 = ratio_1.frac1 * corr * alosch;
2905 ratio_1.an2 = ratio_1.frac2 * corr * alosch;
2906 ratio_1.an3 = ratio_1.frac3 * corr * alosch;
2907 ratio_1.an4 = ratio_1.frac4 * corr * alosch;
2908 inpt_1.akt = (inpt_1.tempc + (float)273.16) * boltz;
2909 ratio_1.an = corr * (float)100. * alosch;
2913 mag_1.emag = callpars_1.e_magnitude__;
2914 mag_1.bmag = callpars_1.b_magnitude__;
2915 mag_1.btheta = callpars_1.b_angle__;
2919 mag_1.wb = awb * mag_1.bmag;
2920 for (j = 1; j <= 2002; ++j) {
2921 f1c_1.f1[j - 1] = (float)0.;
2922 f1c_1.df1[j - 1] = (float)0.;
2923 f2c_1.f2[j - 1] = (float)0.;
2924 f2c_1.df2[j - 1] = (float)0.;
2925 f3c_1.f3[j - 1] = (float)0.;
2926 f3c_1.df3[j - 1] = (float)0.;
2927 h1c_1.h1[j - 1] = (float)0.;
2928 h1c_1.dh1[j - 1] = (float)0.;
2929 g2c_1.g2[j - 1] = (float)0.;
2930 g2c_1.dg2[j - 1] = (float)0.;
2931 g1c_1.g1[j - 1] = (float)0.;
2932 g1c_1.dg1[j - 1] = (float)0.;
2933 g0c_1.g[j - 1] = (float)0.;
2934 g0c_1.dg0[j - 1] = (float)0.;
2935 g0c_1.dg[j - 1] = (float)0.;
2936 f0c_1.f[j - 1] = (float)0.;
2937 f0c_1.df0[j - 1] = (float)0.;
2939 f0c_1.df[j - 1] = (float)0.;
2941 inpt_1.alpnew = (float)0.;
2942 inpt_1.alpold = (float)0.;
2943 inpt_1.alpnax = (float)0.;
2944 inpt_1.alpnay = (float)0.;
2945 inpt_1.alpnaz = (float)0.;
2946 inpt_1.alpoax = (float)0.;
2947 inpt_1.alpoay = (float)0.;
2948 inpt_1.alpoaz = (float)0.;
2949 inpt_1.alpha = (float)0.;
2956 int StFtpcMagboltz1::simp_(
double *sum)
2962 static double aodd, even;
2967 i__1 = inpt_1.nstep;
2968 for (i__ = 2; i__ <= i__1; i__ += 2) {
2970 aodd += sint_1.simf[i__ - 1];
2972 n0 = inpt_1.nstep - 1;
2974 for (i__ = 3; i__ <= i__1; i__ += 2) {
2976 even += sint_1.simf[i__ - 1];
2978 *sum = inpt_1.estep * (sint_1.simf[0] + sint_1.simf[inpt_1.nstep] + aodd *
2979 (float)4. + even * (
float)2.) / (float)3.;
2982 int StFtpcMagboltz1::stepph_(
int *l)
2990 static double accur, dxold;
2992 static double dhfrs1, dhfrs2, h01, dhfnal, dhlast, dhstep, dhfrst;
2994 static double dum, dxx;
2999 h1calc_(&c__1, &dum, &dum, &dum);
3009 dhstep = (float)100.;
3010 dhfnal = (float)1.0000000000000011e-10;
3012 h1calc_(&c__2, &dhfnal, &dxx, &dhfrst);
3021 h1calc_(&c__2, &dhfnal, &dxx, &dhfrst);
3023 if (dhfrs1 / dhfrs2 <= (
float)0.) {
3029 if (fabs(dhfrs1) > fabs(dhfrs2)) {
3032 dhstep = (float)1. / dhstep;
3036 if (dhstep > (
float)1.) {
3040 dhstep = h01 * (float).5;
3045 h1calc_(&c__2, &dhfnal, &dxx, &dhfrst);
3046 if (dhlast == dhfrst) {
3051 frac = (d__1 = (dxx - dxold) / dxx, fabs(d__1));
3057 if (dhfrs1 / dhfrs2 <= (
float)0.) {
3063 dhstep *= (float).5;
3070 printf(
" WARNING TRANSVERSE DIFFUSION DID NOT CONVERGE IN %d ITERATIONS . LAST VALUE DXX=%f\n REMEDY:INCREASE COMPUTER PRECISION. IF FAIL AT FLOAT*8 THEN REDUCE UPPER INTEGRATION ENERGY LIMIT.\n",kstep,dxx);
3071 for (k = 1; k <= 2002; ++k) {
3073 h1c_1.h1[k - 1] = (float)0.;
3077 printf(
"TRANSVERSE DIFFUSION CONVERGED AFTER %d ITERATIONS.\n",kstep);
3080 if (dhfnal < (
float)0.) {
3083 dhfnal = (float)-1.0000000000000011e-10;
3084 dhstep = (float)100.;
3088 printf(
" WARNING TRANSVERSE DIFFUSION DID NOT APPROACH CONVGENCE.\n");
3092 int StFtpcMagboltz1::steppr_(
int *itype,
int *lmax)
3102 static double accur, dlold, gstep;
3104 static double eg0sum, egsum1, egsum2, g01, dl, gfinal, sum;
3107 accur = (float).003;
3112 gfinal = (float).010000000000000002;
3113 g0calc_(&c__0, &gfinal, &eg0sum, lmax);
3122 g0calc_(&c__0, &gfinal, &eg0sum, lmax);
3124 if (egsum1 / egsum2 <= (
float)0.) {
3136 g0calc_(itype, &gfinal, &eg0sum, lmax);
3140 i__1 = inpt_1.nstep1;
3141 for (j = 1; j <= i__1; ++j) {
3143 sint_1.simf[j - 1] = g1c_1.g1[j - 1] * mix2_1.e[j - 1];
3146 dl = sum * mag_1.eovm / (float)3.;
3148 frac = (d__1 = (dl - dlold) / dl, fabs(d__1));
3153 if (egsum1 / egsum2 <= (
float)0.) {
3160 printf(
" WARNING LONGITUDINAL DIFFUSION DID NOT CONVERGE IN %d ITERATIONS . LAST VALUE DL =%f\n",kstep,dl);
3161 for (k = 1; k <= 2002; ++k) {
3163 g1c_1.g1[k - 1] = (float)0.;
3167 printf(
"LONGITUDINAL DIFFUSION CONVERGED AFTER %d ITERATIONS.\n",kstep);
3170 printf(
" WARNING LONGITUDINAL DIFFUSION DID NOT APPROACH CONVERGENCE.\n");
3175 int StFtpcMagboltz1::type2_(
double *s2sum,
int *i__,
int *nstep1)
3181 static double s1sum;
3182 static int j, ldn, lup;
3187 if (mix4_1.n2ro1 == 0) {
3190 i__1 = mix4_1.n2ro1;
3191 for (j = 1; j <= i__1; ++j) {
3192 s1sum += f0c_1.f[*i__ - 1] * (mix4_1.q2ro1[((j + *i__ * 3) << 1) - 8] +
3193 mix4_1.q2ro1[((j + *i__ * 3) << 1) - 7]);
3194 lup = *i__ + mix4_1.l2ro1[j - 1];
3195 if (lup >= *nstep1) {
3198 *s2sum = *s2sum + f0c_1.f[lup - 1] * mix4_1.q2ro1[((j + lup * 3) << 1)
3199 - 8] + (f0c_1.f[lup] * mix4_1.q2ro1[((j + (lup + 1) * 3) << 1)
3200 - 8] - f0c_1.f[lup - 1] * mix4_1.q2ro1[((j + lup * 3) << 1) - 8]
3201 ) * mix4_1.al2ro1[j - 1];
3205 i__1 = mix4_1.n2ro1;
3206 for (j = 2; j <= i__1; ++j) {
3207 ldn = *i__ - mix4_1.l2ro1[j - 2];
3211 *s2sum = *s2sum + f0c_1.f[ldn - 1] * mix4_1.q2ro1[((j + ldn * 3) << 1)
3212 - 7] + (f0c_1.f[ldn] * mix4_1.q2ro1[((j + (ldn + 1) * 3) << 1)
3213 - 7] - f0c_1.f[ldn - 1] * mix4_1.q2ro1[((j + ldn * 3) << 1) - 7]
3214 ) * mix4_1.al2ro1[j - 1];
3219 if (mix4_1.n2ro2 == 0) {
3222 i__1 = mix4_1.n2ro2;
3223 for (j = 1; j <= i__1; ++j) {
3224 s1sum += f0c_1.f[*i__ - 1] * (mix4_1.q2ro2[((j + *i__ * 3) << 1) - 8] +
3225 mix4_1.q2ro2[((j + *i__ * 3) << 1) - 7]);
3226 lup = *i__ + mix4_1.l2ro2[j - 1];
3227 if (lup >= *nstep1) {
3230 *s2sum = *s2sum + f0c_1.f[lup - 1] * mix4_1.q2ro2[((j + lup * 3) << 1)
3231 - 8] + (f0c_1.f[lup] * mix4_1.q2ro2[((j + (lup + 1) * 3) << 1)
3232 - 8] - f0c_1.f[lup - 1] * mix4_1.q2ro2[((j + lup * 3) << 1) - 8]
3233 ) * mix4_1.al2ro2[j - 1];
3237 i__1 = mix4_1.n2ro2;
3238 for (j = 2; j <= i__1; ++j) {
3239 ldn = *i__ - mix4_1.l2ro2[j - 2];
3243 *s2sum = *s2sum + f0c_1.f[ldn - 1] * mix4_1.q2ro2[((j + ldn * 3) << 1)
3244 - 7] + (f0c_1.f[ldn] * mix4_1.q2ro2[((j + (ldn + 1) * 3) << 1)
3245 - 7] - f0c_1.f[ldn - 1] * mix4_1.q2ro2[((j + ldn * 3) << 1) - 7]
3246 ) * mix4_1.al2ro2[j - 1];
3251 if (mix4_1.n2ro3 == 0) {
3254 i__1 = mix4_1.n2ro3;
3255 for (j = 1; j <= i__1; ++j) {
3256 s1sum += f0c_1.f[*i__ - 1] * (mix4_1.q2ro3[((j + *i__ * 3) << 1) - 8] +
3257 mix4_1.q2ro3[((j + *i__ * 3) << 1) - 7]);
3258 lup = *i__ + mix4_1.l2ro3[j - 1];
3259 if (lup >= *nstep1) {
3262 *s2sum = *s2sum + f0c_1.f[lup - 1] * mix4_1.q2ro3[((j + lup * 3) << 1)
3263 - 8] + (f0c_1.f[lup] * mix4_1.q2ro3[((j + (lup + 1) * 3) << 1)
3264 - 8] - f0c_1.f[lup - 1] * mix4_1.q2ro3[((j + lup * 3) << 1) - 8]
3265 ) * mix4_1.al2ro3[j - 1];
3269 i__1 = mix4_1.n2ro3;
3270 for (j = 2; j <= i__1; ++j) {
3271 ldn = *i__ - mix4_1.l2ro3[j - 2];
3275 *s2sum = *s2sum + f0c_1.f[ldn - 1] * mix4_1.q2ro3[((j + ldn * 3) << 1)
3276 - 7] + (f0c_1.f[ldn] * mix4_1.q2ro3[((j + (ldn + 1) * 3) << 1)
3277 - 7] - f0c_1.f[ldn - 1] * mix4_1.q2ro3[((j + ldn * 3) << 1) - 7]
3278 ) * mix4_1.al2ro3[j - 1];
3283 if (mix4_1.n2ro4 == 0) {
3286 i__1 = mix4_1.n2ro4;
3287 for (j = 1; j <= i__1; ++j) {
3288 s1sum += f0c_1.f[*i__ - 1] * (mix4_1.q2ro4[((j + *i__ * 3) << 1) - 8] +
3289 mix4_1.q2ro4[((j + *i__ * 3) << 1) - 7]);
3290 lup = *i__ + mix4_1.l2ro4[j - 1];
3291 if (lup >= *nstep1) {
3294 *s2sum = *s2sum + f0c_1.f[lup - 1] * mix4_1.q2ro4[((j + lup * 3) << 1)
3295 - 8] + (f0c_1.f[lup] * mix4_1.q2ro4[((j + (lup + 1) * 3) << 1)
3296 - 8] - f0c_1.f[lup - 1] * mix4_1.q2ro4[((j + lup * 3) << 1) - 8]
3297 ) * mix4_1.al2ro4[j - 1];
3301 i__1 = mix4_1.n2ro4;
3302 for (j = 2; j <= i__1; ++j) {
3303 ldn = *i__ - mix4_1.l2ro4[j - 2];
3307 *s2sum = *s2sum + f0c_1.f[ldn - 1] * mix4_1.q2ro4[((j + ldn * 3) << 1)
3308 - 7] + (f0c_1.f[ldn] * mix4_1.q2ro4[((j + (ldn + 1) * 3) << 1)
3309 - 7] - f0c_1.f[ldn - 1] * mix4_1.q2ro4[((j + ldn * 3) << 1) - 7]
3310 ) * mix4_1.al2ro4[j - 1];
3319 int StFtpcMagboltz1::type2g_(
double *s2sum,
int *i__,
int *nstep1)
3325 static double s1sum;
3326 static int j, ldn, lup;
3331 if (mix4_1.n2ro1 == 0) {
3334 i__1 = mix4_1.n2ro1;
3335 for (j = 1; j <= i__1; ++j) {
3336 s1sum += g0c_1.g[*i__ - 1] * (mix4_1.q2ro1[((j + *i__ * 3) << 1) - 8] +
3337 mix4_1.q2ro1[((j + *i__ * 3) << 1) - 7]);
3338 lup = *i__ + mix4_1.l2ro1[j - 1];
3339 if (lup >= *nstep1) {
3342 *s2sum = *s2sum + g0c_1.g[lup - 1] * mix4_1.q2ro1[((j + lup * 3) << 1)
3343 - 8] + (g0c_1.g[lup] * mix4_1.q2ro1[((j + (lup + 1) * 3) << 1)
3344 - 8] - g0c_1.g[lup - 1] * mix4_1.q2ro1[((j + lup * 3) << 1) - 8]
3345 ) * mix4_1.al2ro1[j - 1];
3349 i__1 = mix4_1.n2ro1;
3350 for (j = 2; j <= i__1; ++j) {
3351 ldn = *i__ - mix4_1.l2ro1[j - 2];
3355 *s2sum = *s2sum + g0c_1.g[ldn - 1] * mix4_1.q2ro1[((j + ldn * 3) << 1)
3356 - 7] + (g0c_1.g[ldn] * mix4_1.q2ro1[((j + (ldn + 1) * 3) << 1)
3357 - 7] - g0c_1.g[ldn - 1] * mix4_1.q2ro1[((j + ldn * 3) << 1) - 7]
3358 ) * mix4_1.al2ro1[j - 1];
3363 if (mix4_1.n2ro2 == 0) {
3366 i__1 = mix4_1.n2ro2;
3367 for (j = 1; j <= i__1; ++j) {
3368 s1sum += g0c_1.g[*i__ - 1] * (mix4_1.q2ro2[((j + *i__ * 3) << 1) - 8] +
3369 mix4_1.q2ro2[((j + *i__ * 3) << 1) - 7]);
3370 lup = *i__ + mix4_1.l2ro2[j - 1];
3371 if (lup >= *nstep1) {
3374 *s2sum = *s2sum + g0c_1.g[lup - 1] * mix4_1.q2ro2[((j + lup * 3) << 1)
3375 - 8] + (g0c_1.g[lup] * mix4_1.q2ro2[((j + (lup + 1) * 3) << 1)
3376 - 8] - g0c_1.g[lup - 1] * mix4_1.q2ro2[((j + lup * 3) << 1) - 8]
3377 ) * mix4_1.al2ro2[j - 1];
3381 i__1 = mix4_1.n2ro2;
3382 for (j = 2; j <= i__1; ++j) {
3383 ldn = *i__ - mix4_1.l2ro2[j - 2];
3387 *s2sum = *s2sum + g0c_1.g[ldn - 1] * mix4_1.q2ro2[((j + ldn * 3) << 1)
3388 - 7] + (g0c_1.g[ldn] * mix4_1.q2ro2[((j + (ldn + 1) * 3 )<< 1)
3389 - 7] - g0c_1.g[ldn - 1] * mix4_1.q2ro2[((j + ldn * 3) << 1) - 7]
3390 ) * mix4_1.al2ro2[j - 1];
3395 if (mix4_1.n2ro3 == 0) {
3398 i__1 = mix4_1.n2ro3;
3399 for (j = 1; j <= i__1; ++j) {
3400 s1sum += g0c_1.g[*i__ - 1] * (mix4_1.q2ro3[((j + *i__ * 3) << 1) - 8] +
3401 mix4_1.q2ro3[((j + *i__ * 3) << 1) - 7]);
3402 lup = *i__ + mix4_1.l2ro3[j - 1];
3403 if (lup >= *nstep1) {
3406 *s2sum = *s2sum + g0c_1.g[lup - 1] * mix4_1.q2ro3[((j + lup * 3) << 1)
3407 - 8] + (g0c_1.g[lup] * mix4_1.q2ro3[((j + (lup + 1) * 3) << 1)
3408 - 8] - g0c_1.g[lup - 1] * mix4_1.q2ro3[((j + lup * 3) << 1) - 8]
3409 ) * mix4_1.al2ro3[j - 1];
3413 i__1 = mix4_1.n2ro3;
3414 for (j = 2; j <= i__1; ++j) {
3415 ldn = *i__ - mix4_1.l2ro3[j - 2];
3419 *s2sum = *s2sum + g0c_1.g[ldn - 1] * mix4_1.q2ro3[((j + ldn * 3) << 1)
3420 - 7] + (g0c_1.g[ldn] * mix4_1.q2ro3[((j + (ldn + 1) * 3) << 1)
3421 - 7] - g0c_1.g[ldn - 1] * mix4_1.q2ro3[((j + ldn * 3) << 1) - 7]
3422 ) * mix4_1.al2ro3[j - 1];
3427 if (mix4_1.n2ro4 == 0) {
3430 i__1 = mix4_1.n2ro4;
3431 for (j = 1; j <= i__1; ++j) {
3432 s1sum += g0c_1.g[*i__ - 1] * (mix4_1.q2ro4[((j + *i__ * 3) << 1) - 8] +
3433 mix4_1.q2ro4[((j + *i__ * 3) << 1) - 7]);
3434 lup = *i__ + mix4_1.l2ro4[j - 1];
3435 if (lup >= *nstep1) {
3438 *s2sum = *s2sum + g0c_1.g[lup - 1] * mix4_1.q2ro4[((j + lup * 3) << 1)
3439 - 8] + (g0c_1.g[lup] * mix4_1.q2ro4[((j + (lup + 1) * 3) << 1)
3440 - 8] - g0c_1.g[lup - 1] * mix4_1.q2ro4[((j + lup * 3) << 1) - 8]
3441 ) * mix4_1.al2ro4[j - 1];
3445 i__1 = mix4_1.n2ro4;
3446 for (j = 2; j <= i__1; ++j) {
3447 ldn = *i__ - mix4_1.l2ro4[j - 2];
3451 *s2sum = *s2sum + g0c_1.g[ldn - 1] * mix4_1.q2ro4[((j + ldn * 3) << 1)
3452 - 7] + (g0c_1.g[ldn] * mix4_1.q2ro4[((j + (ldn + 1) * 3) << 1)
3453 - 7] - g0c_1.g[ldn - 1] * mix4_1.q2ro4[((j + ldn * 3) << 1) - 7]
3454 ) * mix4_1.al2ro4[j - 1];