eosfxt.f
Go to the documentation of this file.
1 
2 c..routine eosfxt computes a stellar eos assuming complete ionozation
3 c..routine etages makes a good guess for the chemical potential
4 c..routine xneroot gets the thermodynamics of the electrons and positrons
5 
6 
7 
8 
9 
10 
11 
12  subroutine eosfxt
13  include 'implno.dek'
14  include 'const.dek'
15  include 'vector_eos.dek'
16 
17 c..given a temperature temp [K], density den [g/cm**3], and a
18 composition
19 c..characterized by abar (average weight) and zbar (average charge),
20 c..this routine returns all the other thermodynamic quantities.
21 
22 c..of interest is the pressure [erg/cm**3], specific thermal energy [erg/gr],
23 c..the entropy [erg/g/K], with their derivatives with respect to temperature,
24 c..density, abar, and zbar.
25 
26 c..other quantites such the normalized chemical potential eta (plus its
27 c..derivatives), number density of electrons and positron pair (along
28 c..with their derivatives), adiabatic indices, specific heats, and
29 c..relativistically correct sound speed are also returned.
30 
31 c..this routine assumes planckian photons, an ideal gas of ions,
32 c..and an electron-positron gas with an arbitrary degree of relativity
33 c..and degeneracy. the full fermi-dirac integrals and their derivatives
34 c..with respect to eta and beta are computed to machine precision, and
35 c..all other derivatives are analytic.
36 
37 c..references: cox & giuli (c&g) chapter 24,
38 c.. timmes & arnett, apj supp. 125, 277, 1999
39 c.. timmes & swesty, apj supp. 126, 501, 2000
40 
41 
42 
43 
44 c..a dictionary of terms used:
45 c..this routine has now been pipelined.
46 c..all the input and output variables are in the file vector_eos.dek.
47 c..the vector name is the scaler name appended with an "_row",
48 c..for example, temp_row(i), den_row(i), and so on.
49 
50 
51 
52 c..input:
53 c..temp = temperature
54 c..den = density
55 c..abar = average number of nucleons per nuclei
56 c..zbar = average number of protons per nuclei
57 
58 
59 c..output:
60 
61 c..pres = total pressure
62 c..dpresdd = derivative of total pressure with respect to density
63 c..dpresdt = derivative of total pressure with respect to temperature
64 c..dpresda = derivative of total pressure with respect to abar
65 c..dpresdz = derivative of total pressure with respect to zbar
66 
67 c..ener = total internal energy
68 c..denerdd = derivative of total energy with respect to density
69 c..denerdt = derivative of total energy with respect to temperature
70 c..denerda = derivative of total energy with respect to abar
71 c..denerdz = derivative of total energy with respect to zbar
72 
73 c..entr = total entropy
74 c..dentrdd = derivative of total entropy with respect to density
75 c..dentrdt = derivative of total entropy with respect to temperature
76 c..dentrda = derivative of total entropy with respect to abar
77 c..dentrdz = derivative of total entropy with respect to zbar
78 
79 
80 
81 c..prad = radiation pressure
82 c..dpraddd = derivative of the radiation pressure with density
83 c..dpraddt = derivative of the radiation pressure with temperature
84 c..dpradda = derivative of the radiation pressure with abar
85 c..dpraddz = derivative of the radiation pressure with zbar
86 
87 c..erad = radiation energy
88 c..deraddd = derivative of the radiation energy with density
89 c..deraddt = derivative of the radiation energy with temperature
90 c..deradda = derivative of the radiation energy with abar
91 c..deraddz = derivative of the radiation energy with zbar
92 
93 c..srad = radiation entropy
94 c..dsraddd = derivative of the radiation entropy with density
95 c..dsraddt = derivative of the radiation entropy with temperature
96 c..dsradda = derivative of the radiation entropy with abar
97 c..dsraddz = derivative of the radiation entropy with zbar
98 
99 c..radmult = radiation multiplier (useful for turning radiation off/on)
100 
101 
102 
103 
104 c..xni = number density of ions
105 c..dxnidd = derivative of the ion number density with density
106 c..dxnidt = derivative of the ion number density with temperature
107 c..dxnida = derivative of the ion number density with abar
108 c..dxnidz = derivative of the ion number density with zbar
109 
110 c..pion = ion pressure
111 c..dpiondd = derivative of the ion pressure with density
112 c..dpiondt = derivative of the ion pressure with temperature
113 c..dpionda = derivative of the ion pressure with abar
114 c..dpiondz = derivative of the ion pressure with zbar
115 
116 c..eion = ion energy
117 c..deiondd = derivative of the ion energy with density
118 c..deiondt = derivative of the ion energy with temperature
119 c..deionda = derivative of the ion energy with abar
120 c..deiondz = derivative of the ion energy with zbar
121 
122 c..sion = ion entropy
123 c..dsiondd = derivative of the ion entropy with density
124 c..dsiondt = derivative of the ion entropy with temperature
125 c..dsionda = derivative of the ion entropy with abar
126 c..dsiondz = derivative of the ion entropy with zbar
127 
128 c..ionmult = ion multiplier (useful for turning ions off/on)
129 
130 
131 c..etaele = electron chemical potential
132 c..detadd = derivative of the electron chem potential with density
133 c..detadt = derivative of the electron chem potential with temperature
134 c..detada = derivative of the electron chem potential with abar
135 c..detadz = derivative of the electron chem potential with zbar
136 
137 c..etapos = positron degeneracy parameter
138 
139 
140 
141 
142 c..xne = number density of electrons
143 c..dxnedd = derivative of the electron number density with density
144 c..dxnedt = derivative of the electron number density with temperature
145 c..dxneda = derivative of the electron number density with abar
146 c..dxnedz = derivative of the electron number density with zbar
147 
148 c..xnefer = fermi integral electron number density
149 c..dxneferdd = derivative of the fermi electron number density with density
150 c..dxneferdt = derivative of the fermi electron number density with temperature
151 c..dxneferda = derivative of the fermi electron number density with abar
152 c..dxneferdz = derivative of the fermi electron number density with zbar
153 
154 c..xnpfer = fermi integral positron number density
155 c..dxnpferdd = derivative of the fermi positron number density with density
156 c..dxnpferdt = derivative of the fermi positron number density with temperature
157 c..dxnpferda = derivative of the fermi positron number density with abar
158 c..dxnpferdz = derivative of the fermi positron number density with zbar
159 
160 c..pele = electron pressure
161 c..dpeledd = derivative of the electron pressure with density
162 c..dpeledt = derivative of the electron pressure with temperature
163 c..dpeleda = derivative of the electron pressure with abar
164 c..dpeledz = derivative of the electron pressure with zbar
165 
166 c..eele = electron energy
167 c..deeledd = derivative of the electron energy with density
168 c..deeledt = derivative of the electron energy with temperature
169 c..deeleda = derivative of the electron energy with abar
170 c..deeledz = derivative of the electron energy with zbar
171 
172 c..sele = electron entropy
173 c..dseledd = derivative of the electron entropy with density
174 c..dseledt = derivative of the electron entropy with temperature
175 c..dseleda = derivative of the electron entropy with abar
176 c..dseledz = derivative of the electron entropy with zbar
177 
178 
179 c..ppos = positron pressure
180 c..dpposdd = derivative of the positron pressure with density
181 c..dpposdt = derivative of the positron pressure with temperature
182 c..dpposda = derivative of the positron pressure with abar
183 c..dpposdz = derivative of the positron pressure with zbar
184 
185 c..epos = electron energy
186 c..deposdd = derivative of the positron energy with density
187 c..deposdt = derivative of the positron energy with temperature
188 c..deposda = derivative of the positron energy with abar
189 c..deposdz = derivative of the positron energy with zbar
190 
191 c..spos = electron entropy
192 c..dsposdd = derivative of the positron entropy with density
193 c..dsposdt = derivative of the positron entropy with temperature
194 c..dsposda = derivative of the positron entropy with abar
195 c..dsposdz = derivative of the positron entropy with zbar
196 
197 c..pep = electron + positron pressure
198 c..dpepdd = derivative of the electron+positron pressure with density
199 c..dpepdt = derivative of the electron+positron pressure with temperature
200 c..dpepda = derivative of the electron+positron pressure with abar
201 c..dpepdz = derivative of the electron+positron pressure with zbar
202 
203 c..eep = electron + ositron energy
204 c..deepdd = derivative of the electron+positron energy with density
205 c..deepdt = derivative of the electron+positron energy with temperature
206 c..deepda = derivative of the electron+positron energy with abar
207 c..deepdz = derivative of the electron+positron energy with zbar
208 
209 c..sep = electron + positron entropy
210 c..dsepdd = derivative of the electron+positron entropy with density
211 c..dsepdt = derivative of the electron+positron entropy with temperature
212 c..dsepda = derivative of the electron+positron entropy with abar
213 c..dsepdz = derivative of the electron+positron entropy with zbar
214 
215 c..elemult = electron multiplier (useful for turning e-e+ off/on)
216 
217 
218 c..eip = ionization potential ennergy
219 c..deipdd = derivative of ionization energy with density
220 c..deipdt = derivative of ionization energy with temperature
221 c..deipda = derivative of ionization energy with abar
222 c..deipdz = derivative of ionization energy with zbar
223 
224 
225 c..sip = ionization potential ennergy
226 c..dsipdd = derivative of ionization energy with density
227 c..dsipdt = derivative of ionization energy with temperature
228 c..dsipda = derivative of ionization energy with abar
229 c..dsipdz = derivative of ionization energy with zbar
230 
231 c..potmult = ionization energy multiplier (useful for turning off ionization additions)
232 
233 
234 
235 c..pcoul = coulomb pressure correction
236 c..coulmult = coulomb component multiplier
237 c..dpcouldd = derivative of the coulomb pressure with density
238 c..dpcouldt = derivative of the coulomb pressure with temperature
239 c..dpcoulda = derivative of the coulomb pressure with abar
240 c..dpcouldz = derivative of the coulomb pressure with zbar
241 
242 c..ecoul = coulomb energy correction
243 c..decouldd = derivative of the coulomb energy with density
244 c..decouldt = derivative of the coulomb energy with temperature
245 c..decoulda = derivative of the coulomb energy with abar
246 c..decouldz = derivative of the coulomb energy with zbar
247 
248 c..scoul = coulomb entropy correction
249 c..dscouldd = derivative of the coulomb entropy with density
250 c..dscouldt = derivative of the coulomb entropy with temperature
251 c..dscoulda = derivative of the coulomb entropy with abar
252 c..dscouldz = derivative of the coulomb entropy with zbar
253 
254 
255 c..kt = kerg * temperature
256 c..beta = dimensionless ratio of kerg*temp/me*c^2
257 
258 c..chit = temperature exponent in the pressure equation of state
259 c..chid = density exponent in the pressure equation of state
260 c..cv = specific heat at constant volume
261 c..cp = specific heat at constant pressure
262 c..gam1 = first adiabatic exponent
263 c..gam2 = second adiabatic exponent
264 c..gam3 = third adiabatic exponent
265 c..nabad = adiabatic gradient
266 c..sound = relativistically correct adiabatic sound speed
267 c..plasg = ratio of electrostatic to thermal energy
268 
269 
270 c..dse = thermodynamic consistency check de/dt = t*ds/dt
271 c..dpe = thermodynamic consistency check p = d**2 de/dd + t*dpdt
272 c..dsp = thermodynamic consistency check dp/dt = - d**2 ds/dd
273 
274 
275 
276 
277 
278 c..declare the input
279  double precision temp,den,zbar,abar
280 
281 
282 c..declare everything else
283 c..totals
284  double precision pres,ener,entr,
285  1 dpresdd,dpresdt,dpresda,dpresdz,
286  2 denerdd,denerdt,denerda,denerdz,
287  3 dentrdd,dentrdt,dentrda,dentrdz
288 
289 
290 c..radiation
291  integer radmult
292  double precision prad,erad,srad,
293  1 dpraddd,dpraddt,dpradda,dpraddz,
294  2 deraddd,deraddt,deradda,deraddz,
295  3 dsraddd,dsraddt,dsradda,dsraddz
296 
297 
298 c..ions
299  integer ionmult
300  double precision pion,eion,sion,xni,etaion,
301  1 dpiondd,dpiondt,dpionda,dpiondz,
302  2 deiondd,deiondt,deionda,deiondz,
303  3 dsiondd,dsiondt,dsionda,dsiondz,
304  4 dxnidd,dxnidt,dxnida,dxnidz,
305  5 detaiondd,detaiondt,detaionda,detaiondz
306 
307 
308 c..electron-positrons
309  integer elemult
310  double precision etaele,detadd,detadt,detada,detadz,
311  1 etapos,zeff,
312  2 xne,dxnedd,dxnedt,dxneda,dxnedz,
313  3 xnefer,dxneferdd,dxneferdt,dxneferda,dxneferdz,
314  4 xnpfer,dxnpferdd,dxnpferdt,dxnpferda,dxnpferdz,
315  5 pele,dpeledd,dpeledt,dpeleda,dpeledz,
316  6 ppos,dpposdd,dpposdt,dpposda,dpposdz,
317  7 pep,dpepdd,dpepdt,dpepda,dpepdz,
318  8 eele,deeledd,deeledt,deeleda,deeledz,
319  9 epos,deposdd,deposdt,deposda,deposdz,
320  1 eep,deepdd,deepdt,deepda,deepdz,
321  2 sele,dseledd,dseledt,dseleda,dseledz,
322  3 spos,dsposdd,dsposdt,dsposda,dsposdz,
323  4 sep,dsepdd,dsepdt,dsepda,dsepdz
324 
325 
326 c..ionization contributions
327  integer ionized,potmult
328  double precision eip,deipdd,deipdt,deipda,deipdz,
329  1 sip,dsipdd,dsipdt,dsipda,dsipdz
330 
331 
332 c..coulomb corrections
333  integer coulmult
334  double precision plasg,
335  1 pcoul,dpcouldd,dpcouldt,dpcoulda,dpcouldz,
336  2 ecoul,decouldd,decouldt,decoulda,decouldz,
337  3 scoul,dscouldd,dscouldt,dscoulda,dscouldz
338 
339 
340 
341 c..various physical quantities based on derivatives
342  double precision chit,chid,cv,cp,gam1,gam2,gam3,nabad,sound
343 
344 
345 c..for the maxwell relations
346  double precision dse,dpe,dsp
347 
348 
349 c..miscelaneous local variables
350  integer i,j,niter,mode
351  double precision kt,ktinv,x,y,z,xx,yy,zz,ages,agesav,agesnew,
352  1 ratio,ytot1,f,df,deninv,tempinv
353 
354 
355 c..various derived constants
356  double precision third,sifac,eostol,fpmin
357  parameter(third = 1.0d0/3.0d0,
358  1 sifac = 8.6322745944370191d-45,
359  2 eostol = 1.0d-13,
360  3 fpmin = 1.0d-14)
361 
362 c..note: sifac = h**3/(2.0d0*pi*amu)**1.5d0
363 
364 
365 
366 
367 
368 c..popular format statements for debugging
369 01 format(1x,5(a,1pe24.16))
370 02 format(1x,5(a,1pe16.8))
371 03 format(1x,1p5e16.8)
372 
373 
374 
375 c..set the on/off switches
376  radmult = 1
377  ionmult = 1
378  ionized = 1
379  elemult = 1
380  coulmult = 1
381  potmult = 1
382 
383 
384 
385 c..start pipeline loop
386  do j=jlo_eos,jhi_eos
387 
388  if (temp_row(j) .le. 0.0) stop 'temp less than 0 in eosfxt'
389  if (den_row(j) .le. 0.0) stop 'den less than 0 in eosfxt'
390 
391  temp = temp_row(j)
392  den = den_row(j)
393  abar = abar_row(j)
394  zbar = zbar_row(j)
395  ytot1 = 1.0d0/abar
396 
397 
398 c..initialize
399  prad = 0.0d0
400  dpraddd = 0.0d0
401  dpraddt = 0.0d0
402  dpradda = 0.0d0
403  dpraddz = 0.0d0
404 
405  erad = 0.0d0
406  deraddd = 0.0d0
407  deraddt = 0.0d0
408  deradda = 0.0d0
409  deraddz = 0.0d0
410 
411  srad = 0.0d0
412  dsraddd = 0.0d0
413  dsraddt = 0.0d0
414  dsradda = 0.0d0
415  dsraddz = 0.0d0
416 
417  xni = 0.0d0
418  dxnidd = 0.0d0
419  dxnidt = 0.0d0
420  dxnida = 0.0d0
421  dxnidz = 0.0d0
422 
423  pion = 0.0d0
424  dpiondd = 0.0d0
425  dpiondt = 0.0d0
426  dpionda = 0.0d0
427  dpiondz = 0.0d0
428 
429  eion = 0.0d0
430  deiondd = 0.0d0
431  deiondt = 0.0d0
432  deionda = 0.0d0
433  deiondz = 0.0d0
434 
435  sion = 0.0d0
436  dsiondd = 0.0d0
437  dsiondt = 0.0d0
438  dsionda = 0.0d0
439  dsiondz = 0.0d0
440 
441  xne = 0.0d0
442  dxnedd = 0.0d0
443  dxnedt = 0.0d0
444  dxneda = 0.0d0
445  dxnedz = 0.0d0
446 
447  etaele = 0.0d0
448  detadd = 0.0d0
449  detadt = 0.0d0
450  detada = 0.0d0
451  detadz = 0.0d0
452  etapos = 0.0d0
453 
454  xnefer = 0.0d0
455  dxneferdd = 0.0d0
456  dxneferdt = 0.0d0
457  dxneferda = 0.0d0
458  dxneferdz = 0.0d0
459 
460  xnpfer = 0.0d0
461  dxnpferdd = 0.0d0
462  dxnpferdt = 0.0d0
463  dxnpferda = 0.0d0
464  dxnpferdz = 0.0d0
465 
466  pele = 0.0d0
467  dpeledd = 0.0d0
468  dpeledt = 0.0d0
469  dpeleda = 0.0d0
470  dpeledz = 0.0d0
471 
472  eele = 0.0d0
473  deeledd = 0.0d0
474  deeledt = 0.0d0
475  deeleda = 0.0d0
476  deeledz = 0.0d0
477 
478  sele = 0.0d0
479  dseledd = 0.0d0
480  dseledt = 0.0d0
481  dseleda = 0.0d0
482  dseledz = 0.0d0
483 
484  ppos = 0.0d0
485  dpposdd = 0.0d0
486  dpposdt = 0.0d0
487  dpposda = 0.0d0
488  dpeledz = 0.0d0
489 
490  epos = 0.0d0
491  deposdd = 0.0d0
492  deposdt = 0.0d0
493  deposda = 0.0d0
494  deeledz = 0.0d0
495 
496  spos = 0.0d0
497  dsposdd = 0.0d0
498  dsposdt = 0.0d0
499  dsposda = 0.0d0
500  dseledz = 0.0d0
501 
502  pep = 0.0d0
503  dpepdd = 0.0d0
504  dpepdt = 0.0d0
505  dpepda = 0.0d0
506  dpepdz = 0.0d0
507 
508  eep = 0.0d0
509  deepdd = 0.0d0
510  deepdt = 0.0d0
511  deepda = 0.0d0
512  deepdz = 0.0d0
513 
514  sep = 0.0d0
515  dsepdd = 0.0d0
516  dsepdt = 0.0d0
517  dsepda = 0.0d0
518  dsepdz = 0.0d0
519 
520  eip = 0.0d0
521  deipdd = 0.0d0
522  deipdt = 0.0d0
523  deipda = 0.0d0
524  deipdz = 0.0d0
525 
526  sip = 0.0d0
527  dsipdd = 0.0d0
528  dsipdt = 0.0d0
529  dsipda = 0.0d0
530  dsipdz = 0.0d0
531 
532  pcoul = 0.0d0
533  dpcouldd = 0.0d0
534  dpcouldt = 0.0d0
535  dpcoulda = 0.0d0
536  dpcouldz = 0.0d0
537 
538  ecoul = 0.0d0
539  decouldd = 0.0d0
540  decouldt = 0.0d0
541  decoulda = 0.0d0
542  decouldz = 0.0d0
543 
544  scoul = 0.0d0
545  dscouldd = 0.0d0
546  dscouldt = 0.0d0
547  dscoulda = 0.0d0
548  dscouldz = 0.0d0
549 
550 
551  kt = kerg * temp
552  ktinv = 1.0d0/kt
553  deninv = 1.0d0/den
554  tempinv = 1.0d0/temp
555 
556 
557 
558 
559 c..radiation section:
560  if (radmult .ne. 0) then
561 
562 c..pressure in erg/cm**3
563  prad = asol * third * temp * temp * temp * temp
564  dpraddd = 0.0d0
565  dpraddt = 4.0d0 * prad/temp
566  dpradda = 0.0d0
567  dpraddz = 0.0d0
568 
569 c..energy in erg/gr
570  erad = 3.0d0 * prad * deninv
571  deraddd = -erad * deninv
572  deraddt = 3.0d0 * dpraddt * deninv
573  deradda = 0.0d0
574  deraddz = 0.0d0
575 
576 c..entropy in erg/g/kelvin
577  srad = (prad*deninv + erad) * tempinv
578  dsraddd = (dpraddd*deninv - prad*deninv**2 + deraddd) * tempinv
579  dsraddt = (dpraddt*deninv + deraddt - srad) * tempinv
580  dsradda = 0.0d0
581  dsraddz = 0.0d0
582  end if
583 
584 
585 
586 
587 c..ion section:
588 
589 c..number density in 1/cm**3,
590  xni = avo * ytot1 * den
591  dxnidd = avo * ytot1
592  dxnidt = 0.0d0
593  dxnida = -xni * ytot1
594  dxnidz = 0.0d0
595 
596  if (ionmult .ne. 0) then
597 
598 c..pressure in erg/cm**3
599  pion = xni * kt
600  dpiondd = dxnidd * kt
601  dpiondt = xni * kerg
602  dpionda = -pion * ytot1
603  dpiondz = 0.0d0
604 
605 c.. energy in erg/gr
606  eion = 1.5d0 * pion*deninv
607  deiondd = (1.5d0 * dpiondd - eion)*deninv
608  deiondt = 1.5d0 * dpiondt*deninv
609  deionda = 1.5d0 * dpionda*deninv
610  deiondz = 0.0d0
611 
612 
613 c..ion degeneracy parameter (c&g 9.60)
614  y = 1.0d0/(abar*kt)
615  yy = y * sqrt(y)
616  z = xni * sifac * yy
617  etaion = log(z)
618  xx = 1.0d0/xni
619  detaiondd = dxnidd*xx
620  detaiondt = dxnidt*xx - 1.5d0*tempinv
621  detaionda = dxnida*xx - 1.5d0*ytot1
622  detaiondz = dxnidz*xx
623 
624 
625 c..entropy in erg/gr/kelvin
626 c..the last term is the usual etaion * kerg * xni/den
627 c..sometimes called the sacker-tetrode equation
628 
629  sion = (eion + pion*deninv)*tempinv - etaion * kerg*avo*ytot1
630  if (sion.lt.0.0d0) then
631 c~ write(*,*) "Warning: Negative entropy of ions!"
632 c~ write(*,*) sion
633  sion = 0.0d0
634  end if
635 
636  dsiondd = (deiondd + dpiondd*deninv - pion*deninv**2)*tempinv
637  1 - detaiondd * kerg * avo*ytot1
638 
639  dsiondt = (deiondt + dpiondt*deninv)*tempinv
640  1 - (eion + pion*deninv)*tempinv**2
641  2 - detaiondt * kerg * avo*ytot1
642 
643  dsionda = (deionda + dpionda*deninv)*tempinv
644  1 - detaionda * kerg * avo*ytot1
645  2 + etaion * kerg * avo * ytot1**2
646 
647  dsiondz = 0.0d0
648  end if
649 
650 
651 
652 
653 
654 
655 
656 
657 
658 c..electron-positron section:
659  if (elemult .ne. 0) then
660 
661 c..make a good guess at the the electron degeneracy parameter eta
662  call etages(xni,zbar,temp,ages)
663  agesav = ages
664 
665 
666 c..newton-raphson to get the electron/positron quantities
667  eosfail = .false.
668  mode = 0
669  do i=1,100
670 
671  call xneroot(mode,den,temp,abar,zbar,ionized,
672  1 ages,f,df,
673  2 etaele,detadd,detadt,detada,detadz,
674  3 etapos,zeff,
675  4 xne,dxnedd,dxnedt,dxneda,dxnedz,
676  5 xnefer,dxneferdd,dxneferdt,dxneferda,dxneferdz,
677  6 xnpfer,dxnpferdd,dxnpferdt,dxnpferda,dxnpferdz,
678  7 pele,dpeledd,dpeledt,dpeleda,dpeledz,
679  8 ppos,dpposdd,dpposdt,dpposda,dpposdz,
680  9 pep,dpepdd,dpepdt,dpepda,dpepdz,
681  & eele,deeledd,deeledt,deeleda,deeledz,
682  1 epos,deposdd,deposdt,deposda,deposdz,
683  2 eep,deepdd,deepdt,deepda,deepdz,
684  3 sele,dseledd,dseledt,dseleda,dseledz,
685  4 spos,dsposdd,dsposdt,dsposda,dsposdz,
686  5 sep,dsepdd,dsepdt,dsepda,dsepdz,
687  6 potmult,
688  7 eip,deipdd,deipdt,deipda,deipdz,
689  8 sip,dsipdd,dsipdt,dsipda,dsipdz)
690 
691 
692  if (df .eq. 0.0) goto 11
693  ratio = f/df
694  agesnew = ages - ratio
695  z = abs((agesnew - ages)/ages)
696  ages = agesnew
697  niter = i
698  if (z .lt. eostol .or. abs(ratio) .le. fpmin) goto 20
699  enddo
700 
701 11 write(6,*)
702  write(6,*) 'newton-raphson failed in routine eosfxt'
703  write(6,01) 'temp =',temp,' den =',den
704  write(6,01) 'z =',z,' ages=',ages, ' agesav=',agesav
705  write(6,01) 'eostol=',eostol
706  write(6,01) 'f/df =',f/df,' f =',f, ' df =',df
707  write(6,01) 'fpmin =',fpmin
708  write(6,*)
709  call flush(6)
710  eosfail = .true.
711  return
712 20 continue
713 
714 
715 
716 c..with the converged values, get the energy, pressure, and entropy
717  mode = 1
718  call xneroot(mode,den,temp,abar,zbar,ionized,
719  1 ages,f,df,
720  2 etaele,detadd,detadt,detada,detadz,
721  3 etapos,zeff,
722  4 xne,dxnedd,dxnedt,dxneda,dxnedz,
723  5 xnefer,dxneferdd,dxneferdt,dxneferda,dxneferdz,
724  6 xnpfer,dxnpferdd,dxnpferdt,dxnpferda,dxnpferdz,
725  7 pele,dpeledd,dpeledt,dpeleda,dpeledz,
726  8 ppos,dpposdd,dpposdt,dpposda,dpposdz,
727  9 pep,dpepdd,dpepdt,dpepda,dpepdz,
728  & eele,deeledd,deeledt,deeleda,deeledz,
729  1 epos,deposdd,deposdt,deposda,deposdz,
730  2 eep,deepdd,deepdt,deepda,deepdz,
731  3 sele,dseledd,dseledt,dseleda,dseledz,
732  4 spos,dsposdd,dsposdt,dsposda,dsposdz,
733  5 sep,dsepdd,dsepdt,dsepda,dsepdz,
734  6 potmult,
735  7 eip,deipdd,deipdt,deipda,deipdz,
736  8 sip,dsipdd,dsipdt,dsipda,dsipdz)
737 
738  end if
739 
740 
741 
742 
743 
744 c..coulomb corretions section:
745  if (coulmult .ne. 0) then
746 
747  call coulomb(den,temp,abar,zbar,
748  1 pion,dpiondd,dpiondt,dpionda,dpiondz,
749  2 xne,dxnedd,dxnedt,dxneda,dxnedz,
750  3 plasg,
751  4 pcoul,dpcouldd,dpcouldt,dpcoulda,dpcouldz,
752  5 ecoul,decouldd,decouldt,decoulda,decouldz,
753  6 scoul,dscouldd,dscouldt,dscoulda,dscouldz)
754 
755 
756 c..bomb proof the cooulomb correctins
757  x = prad + pion + pele + ppos + pcoul
758  if (x .le. 0.0) then
759 
760 c write(6,*)
761 c write(6,*) 'coulomb corrections are causing a negative pressure'
762 c write(6,*) 'setting all coulomb corrections to zero'
763 c write(6,*)
764 
765  pcoul = 0.0d0
766  dpcouldd = 0.0d0
767  dpcouldt = 0.0d0
768  dpcoulda = 0.0d0
769  dpcouldz = 0.0d0
770  ecoul = 0.0d0
771  decouldd = 0.0d0
772  decouldt = 0.0d0
773  decoulda = 0.0d0
774  decouldz = 0.0d0
775  scoul = 0.0d0
776  dscouldd = 0.0d0
777  dscouldt = 0.0d0
778  dscoulda = 0.0d0
779  dscouldz = 0.0d0
780  end if
781  end if
782 
783 
784 
785 c..sum all the components
786  pres = prad + pion + pele + ppos + pcoul
787  ener = erad + eion + eele + epos + ecoul + eip
788  entr = srad + sion + sele + spos + scoul + sip
789 
790  dpresdd = dpraddd + dpiondd + dpepdd + dpcouldd
791  dpresdt = dpraddt + dpiondt + dpepdt + dpcouldt
792  dpresda = dpradda + dpionda + dpepda + dpcoulda
793  dpresdz = dpraddz + dpiondz + dpepdz + dpcouldz
794 
795  denerdd = deraddd + deiondd + deepdd + decouldd + deipdd
796  denerdt = deraddt + deiondt + deepdt + decouldt + deipdt
797  denerda = deradda + deionda + deepda + decoulda + deipda
798  denerdz = deraddz + deiondz + deepdz + decouldz + deipdz
799 
800  dentrdd = dsraddd + dsiondd + dsepdd + dscouldd + dsipdd
801  dentrdt = dsraddt + dsiondt + dsepdt + dscouldt + dsipdt
802  dentrda = dsradda + dsionda + dsepda + dscoulda + dsipda
803  dentrdz = dsraddz + dsiondz + dsepdz + dscouldz + dsipdz
804 
805 
806 
807 
808 
809 c..the temperature and density exponents (c&g 9.81 9.82)
810 c..the specific heat at constant volume (c&g 9.92)
811 c..the third adiabatic exponent (c&g 9.93)
812 c..the first adiabatic exponent (c&g 9.97)
813 c..the second adiabatic exponent (c&g 9.105)
814 c..the specific heat at constant pressure (c&g 9.98)
815 c..and relativistic formula for the sound speed (c&g 14.29)
816 
817  zz = pres/den
818  chit = temp/pres * dpresdt
819  chid = dpresdd/zz
820  cv = denerdt
821  x = zz * chit/(temp * cv)
822  gam3 = x + 1.0d0
823  gam1 = chit*x + chid
824  nabad = x/gam1
825  gam2 = 1.0d0/(1.0d0 - nabad)
826  cp = cv * gam1/chid
827  z = 1.0d0 + (ener + clight*clight)/zz
828  sound = clight * sqrt(gam1/z)
829 
830 
831 
832 
833 c..maxwell relations; each is zero if the consistency is perfect
834 c..delicate subtraction in very degenerate regions causes roundoff error
835 
836  dse = temp*dentrdt/denerdt - 1.0d0
837 
838  dpe = (denerdd*den**2 + temp*dpresdt)/pres - 1.0d0
839 
840  dsp = -dentrdd*(den**2/dpresdt) - 1.0d0
841 
842 
843 
844 
845 c..store this row
846  ptot_row(j) = pres
847  dpt_row(j) = dpresdt
848  dpd_row(j) = dpresdd
849  dpa_row(j) = dpresda
850  dpz_row(j) = dpresdz
851 
852  etot_row(j) = ener
853  det_row(j) = denerdt
854  ded_row(j) = denerdd
855  dea_row(j) = denerda
856  dez_row(j) = denerdz
857 
858  stot_row(j) = entr
859  dst_row(j) = dentrdt
860  dsd_row(j) = dentrdd
861  dsa_row(j) = dentrda
862  dsz_row(j) = dentrdz
863 
864  prad_row(j) = prad
865  erad_row(j) = erad
866  srad_row(j) = srad
867 
868  pion_row(j) = pion
869  dpiont_row(j) = dpiondt
870  eion_row(j) = eion
871  sion_row(j) = sion
872 
873  xni_row(j) = xni
874 
875  pele_row(j) = pele
876  ppos_row(j) = ppos
877  dpept_row(j) = dpepdt
878  dpepd_row(j) = dpepdd
879  dpepa_row(j) = dpepda
880  dpepz_row(j) = dpepdz
881 
882  eele_row(j) = eele
883  epos_row(j) = epos
884  deept_row(j) = deepdt
885  deepd_row(j) = deepdd
886  deepa_row(j) = deepda
887  deepz_row(j) = deepdz
888 
889  sele_row(j) = sele
890  spos_row(j) = spos
891  dsept_row(j) = dsepdt
892  dsepd_row(j) = dsepdd
893  dsepa_row(j) = dsepda
894  dsepz_row(j) = dsepdz
895 
896  xnem_row(j) = xne
897  xne_row(j) = xnefer
898  dxnet_row(j) = dxneferdt + dxnpferdt
899  dxned_row(j) = dxneferdd + dxnpferdd
900  dxnea_row(j) = dxneferda + dxnpferda
901  dxnez_row(j) = dxneferdz + dxnpferdz
902  xnp_row(j) = xnpfer
903  zeff_row(j) = zeff
904 
905  etaele_row(j) = etaele
906  detat_row(j) = detadt
907  detad_row(j) = detadd
908  detaa_row(j) = detada
909  detaz_row(j) = detadz
910  etapos_row(j) = etapos
911 
912  eip_row(j) = eip
913  sip_row(j) = sip
914 
915  pcou_row(j) = pcoul
916  ecou_row(j) = ecoul
917  scou_row(j) = scoul
918  plasg_row(j) = plasg
919 
920  dse_row(j) = dse
921  dpe_row(j) = dpe
922  dsp_row(j) = dsp
923 
924  cv_row(j) = cv
925  cp_row(j) = cp
926  gam1_row(j) = gam1
927  gam2_row(j) = gam2
928  gam3_row(j) = gam3
929  cs_row(j) = sound
930 
931 
932 c..for debugging
933 c crap1_row(j) = etaele
934 c dcrap1d_row(j) = detadd
935 c dcrap1t_row(j) = detadt
936 c dcrap1a_row(j) = detada
937 c dcrap1z_row(j) = detadz
938 
939 
940 c..end of pipeline loop
941  enddo
942  return
943  end subroutine
944 
945 
946 
947 
948 
949 
950 
951 
952  subroutine xneroot(mode,den,temp,abar,zbar,ionized,
953  1 aa,f,df,
954  2 etaele,detadd,detadt,detada,detadz,
955  3 etapos,zeff,
956  4 xne,dxnedd,dxnedt,dxneda,dxnedz,
957  5 xnefer,dxneferdd,dxneferdt,dxneferda,dxneferdz,
958  6 xnpfer,dxnpferdd,dxnpferdt,dxnpferda,dxnpferdz,
959  7 pele,dpeledd,dpeledt,dpeleda,dpeledz,
960  8 ppos,dpposdd,dpposdt,dpposda,dpposdz,
961  9 pep,dpepdd,dpepdt,dpepda,dpepdz,
962  & eele,deeledd,deeledt,deeleda,deeledz,
963  1 epos,deposdd,deposdt,deposda,deposdz,
964  2 eep,deepdd,deepdt,deepda,deepdz,
965  3 sele,dseledd,dseledt,dseleda,dseledz,
966  4 spos,dsposdd,dsposdt,dsposda,dsposdz,
967  5 sep,dsepdd,dsepdt,dsepda,dsepdz,
968  6 potmult,
969  7 eip,deipdd,deipdt,deipda,deipdz,
970  8 sip,dsipdd,dsipdt,dsipda,dsipdz)
971 
972  include 'implno.dek'
973  include 'const.dek'
974 
975 
976 c..this routine is called by a root finder to find the degeneracy parameter aa
977 c..where the number density from a saha equation equals the number
978 c..density as computed by the fermi-dirac integrals.
979 
980 c..input is the mode (0 = root find mode, 1 = full calculation),
981 c..temperature temp, density dem, average weight abar, average charge zbar,
982 c..and the degeneracy parameter (chemical potential/kerg*temp) aa.
983 
984 c..everything else is output. see the calling routine for the definitions
985 c..of the variables
986 
987 
988 
989 c..declare the pass
990  integer mode,ionized,potmult
991  double precision den,temp,abar,zbar,
992  1 aa,f,df,
993  2 etaele,detadd,detadt,detada,detadz,
994  3 etapos,zeff,
995  4 xne,dxnedd,dxnedt,dxneda,dxnedz,
996  5 xnefer,dxneferdd,dxneferdt,dxneferda,dxneferdz,
997  6 xnpfer,dxnpferdd,dxnpferdt,dxnpferda,dxnpferdz,
998  7 pele,dpeledd,dpeledt,dpeleda,dpeledz,
999  8 ppos,dpposdd,dpposdt,dpposda,dpposdz,
1000  9 pep,dpepdd,dpepdt,dpepda,dpepdz,
1001  & eele,deeledd,deeledt,deeleda,deeledz,
1002  1 epos,deposdd,deposdt,deposda,deposdz,
1003  2 eep,deepdd,deepdt,deepda,deepdz,
1004  3 sele,dseledd,dseledt,dseleda,dseledz,
1005  4 spos,dsposdd,dsposdt,dsposda,dsposdz,
1006  5 sep,dsepdd,dsepdt,dsepda,dsepdz,
1007  6 eip,deipdd,deipdt,deipda,deipdz,
1008  7 sip,dsipdd,dsipdt,dsipda,dsipdz
1009 
1010 
1011 
1012 
1013 c..local variables
1014  double precision kt,beta,beta12,beta32,beta52,
1015  1 chi,chifac,saha,sfac,
1016  2 xni,dxnidd,dxnidt,dxnida,dxnidz,
1017  3 f12,f12eta,f12beta,
1018  4 f32,f32eta,f32beta,
1019  5 f52,f52eta,f52beta,
1020  6 dzeff_deta,dzeffdd,dzeffdt,dzeffda,dzeffdz,
1021  7 dxne_deta,dxnefer_deta,dxnefer_dbeta,
1022  8 detap_deta,detap_dbeta,
1023  9 dxnpfer_detap,dxnpfer_deta,dxnpfer_dbeta,
1024  & dxep_deta,dxep_dbeta,
1025  1 dpele_deta,dpele_dbeta,deele_deta,deele_dbeta,
1026  2 dppos_detap,dppos_deta,dppos_dbeta,
1027  3 depos_detap,depos_deta,depos_dbeta,
1028  4 dsfac_deta,ytot1,zz,y,yy,ww,denion
1029 
1030 
1031 
1032  double precision xconst,pconst,econst,mecc,dbetadt,safe
1033  parameter (xconst = 2.4883740912221807d30,
1034  1 pconst = 1.3581730208282635d24,
1035  2 econst = 2.0372595312423953d24,
1036  3 mecc = me * clight * clight,
1037  4 dbetadt = kerg/mecc,
1038  5 safe = 0.005d0)
1039 
1040 
1041 c..note:
1042 c..xconst = 8.0d0 * pi * sqrt(2.0d0) * (me/h)**3 * c**3
1043 c..pconst = xconst * 2.0d0/3.0d0 * me * clight**2
1044 c..econst = xconst * me * clight**2
1045 
1046 
1047 
1048 
1049 c..some common factors
1050  ytot1 = 1.0d0/abar
1051  kt = kerg * temp
1052  beta = kt/mecc
1053  beta12 = sqrt(beta)
1054  beta32 = beta * beta12
1055  xni = avo * ytot1 * den
1056  etaele = aa
1057 
1058 
1059 c..ion number density in 1/cm**3,
1060  xni = avo * ytot1 * den
1061  dxnidd = avo * ytot1
1062  dxnidt = 0.0d0
1063  dxnida = -xni * ytot1
1064  dxnidz = 0.0d0
1065 
1066 
1067 
1068 
1069 
1070 c..get the number density of free electrons
1071 c..saha is the ratio of the ground state to the ionized state
1072 c..this model is exact for a pure hydrogen composition
1073 c..denion is a crude pressure ionization model
1074 
1075  if (ionized .eq. 0) then
1076 
1077  denion = 0.1d0
1078  chi = hion * ev2erg * zbar
1079 
1080  chifac = chi/kt
1081  yy = chifac - den/denion
1082 
1083  if (yy .gt. 200.0) then
1084  saha = 1.0d90
1085  f = 0.0d0
1086  df = 1.0d0
1087  etaele = -100.0d0
1088  if (mode .eq. 0) return
1089 
1090  else if (yy .lt. -200.0) then
1091  saha = 0.0d0
1092 
1093  else
1094  ww = min(200.0d0,chifac + etaele - den/denion)
1095  saha = 2.0d0 * exp(ww)
1096  end if
1097 
1098 
1099 c..assume fully ionized
1100  else
1101  denion = 1.0e30
1102  chi = 0.0d0
1103  chifac = 0.0d0
1104  saha = 0.0d0
1105  end if
1106 
1107 
1108 
1109 c..the saha factor, effective charge, and
1110 c..the number density of free electrons
1111 
1112  sfac = 1.0d0/(1.0d0 + saha)
1113  dsfac_deta = -sfac*sfac*saha
1114 
1115  zeff = zbar * sfac
1116  dzeff_deta = zbar * dsfac_deta
1117 
1118  xne = xni * zeff
1119  dxne_deta = xni * dzeff_deta
1120 
1121 
1122 
1123 
1124 
1125 c..get the fermi-dirac integral electron contribution
1126  call dfermi(0.5d0, etaele, beta, f12, f12eta, f12beta)
1127  call dfermi(1.5d0, etaele, beta, f32, f32eta, f32beta)
1128 
1129  zz = xconst * beta32
1130  yy = f12 + beta * f32
1131  xnefer = zz * yy
1132  dxnefer_deta = zz * (f12eta + beta * f32eta)
1133  dxnefer_dbeta = xconst * beta12 * (1.5d0 * yy
1134  1 + beta * (f12beta + f32 + beta * f32beta))
1135 
1136 
1137 
1138 c..if the temperature is not too low, get the positron contributions
1139 c..chemical equilibrium means etaele + etapos = eta_photon = 0.
1140  etapos = 0.0d0
1141  detap_deta = 0.0d0
1142  detap_dbeta = 0.0d0
1143  xnpfer = 0.0d0
1144  dxnpfer_detap = 0.0d0
1145  dxnpfer_dbeta = 0.0d0
1146 
1147  if (beta .gt. 0.02) then
1148  etapos = -aa - 2.0d0/beta
1149  detap_deta = -1.0d0
1150  detap_dbeta = 2.0d0/beta**2
1151  call dfermi(0.5d0, etapos, beta, f12, f12eta, f12beta)
1152  call dfermi(1.5d0, etapos, beta, f32, f32eta, f32beta)
1153  xnpfer = zz * (f12 + beta * f32)
1154  dxnpfer_detap = zz * (f12eta + beta * f32eta)
1155  dxnpfer_dbeta = xconst * beta12 * (1.5d0 * (f12 + beta * f32)
1156  1 + beta * (f12beta + f32 + beta * f32beta))
1157  end if
1158 
1159 
1160 
1161 c..charge neutrality means ne_ionizat = ne_elect - ne_posit
1162  f = xnefer - xnpfer - xne
1163 
1164 
1165 c..derivative of f with eta for newton-like root finders
1166  df = dxnefer_deta - dxnpfer_detap * detap_deta - dxne_deta
1167 
1168 
1169 
1170 c..if we are in root finder mode, return
1171 
1172 
1173  if (mode .eq. 0) return
1174 
1175 
1176 
1177 
1178 
1179 c..if we are not in root finder mode, polish off the calculation
1180 
1181 
1182 c..all the derivatives are in terms of eta and beta.
1183 c..we want to convert to temperature, density, abar and zbar derivatives.
1184 c..so, after the root find above on eta we have: xne = xnefer - xnpfer
1185 c..taking the derivative of this and solving for the unknown eta derivatives
1186 c..leads to these expressions:
1187 
1188 
1189  dxnpfer_deta = dxnpfer_detap * detap_deta
1190  dxnpfer_dbeta = dxnpfer_dbeta + dxnpfer_detap * detap_dbeta
1191  dxep_deta = dxnefer_deta - dxnpfer_deta
1192  dxep_dbeta = dxnefer_dbeta - dxnpfer_dbeta
1193 
1194 
1195  y = 1.0d0/(dxep_deta - dxne_deta)
1196 
1197  detadd = (xne/den - dxne_deta/denion) * y
1198  detadt = -(dxne_deta*chifac/temp + dxep_dbeta*dbetadt) * y
1199  detada = -xne/abar * y
1200  detadz = (xne/zbar + dxne_deta * chifac/zbar)*y
1201 
1202 
1203 
1204 c..derivatives of the effective charge
1205  dzeffdd = dzeff_deta * (detadd - 1.0d0/denion)
1206  dzeffdt = dzeff_deta * (detadt - chifac/temp)
1207  dzeffda = dzeff_deta * detada
1208  dzeffdz = sfac + dzeff_deta * (detadz + chifac/zbar)
1209 
1210 
1211 c..derivatives of the electron number density
1212  dxnedd = dxnidd * zeff + xni * dzeffdd
1213  dxnedt = dxnidt * zeff + xni * dzeffdt
1214  dxneda = dxnida * zeff + xni * dzeffda
1215  dxnedz = dxnidz * zeff + xni * dzeffdz
1216 
1217 
1218 
1219 c..derivatives of the fermi integral electron number densities
1220  dxneferdd = dxnefer_deta * detadd
1221  dxneferdt = dxnefer_deta * detadt + dxnefer_dbeta * dbetadt
1222  dxneferda = dxnefer_deta * detada
1223  dxneferdz = dxnefer_deta * detadz
1224 
1225 
1226 c..derivatives of the fermi integral positron number densities
1227  dxnpferdd = dxnpfer_deta * detadd
1228  dxnpferdt = dxnpfer_deta * detadt + dxnpfer_dbeta * dbetadt
1229  dxnpferda = dxnpfer_deta * detada
1230  dxnpferdz = dxnpfer_deta * detadz
1231 
1232 
1233 
1234 
1235 
1236 c..now get the pressure and energy
1237 c..for the electrons
1238 
1239  beta52 = beta * beta32
1240  yy = pconst * beta52
1241  zz = econst * beta52
1242 
1243  call dfermi(1.5d0, etaele, beta, f32, f32eta, f32beta)
1244  call dfermi(2.5d0, etaele, beta, f52, f52eta, f52beta)
1245 
1246  pele = yy * (f32 + 0.5d0 * beta * f52)
1247  dpele_deta = yy * (f32eta + 0.5d0 * beta * f52eta)
1248  dpele_dbeta = pconst * beta32 * (2.5d0 * (f32 + 0.5d0*beta* f52)
1249  1 + beta* (f32beta + 0.5d0*f52 + 0.5d0*beta*f52beta))
1250 
1251  eele = zz * (f32 + beta * f52)
1252  deele_deta = zz * (f32eta + beta * f52eta)
1253  deele_dbeta = econst * beta32 * (2.5d0 * (f32 + beta * f52)
1254  1 + beta * (f32beta + f52 + beta * f52beta))
1255 
1256 
1257 c..for the positrons
1258  ppos = 0.0d0
1259  dppos_detap = 0.0d0
1260  dppos_dbeta = 0.0d0
1261  epos = 0.0d0
1262  depos_detap = 0.0d0
1263  depos_dbeta = 0.0d0
1264 
1265  if (beta .gt. 0.02) then
1266  call dfermi(1.5d0, etapos, beta, f32, f32eta, f32beta)
1267  call dfermi(2.5d0, etapos, beta, f52, f52eta, f52beta)
1268 
1269  ppos = yy * (f32 + 0.5d0 * beta * f52)
1270  dppos_detap = yy * (f32eta + 0.5d0*beta *f52eta)
1271  dppos_dbeta = pconst * beta32 * (2.5d0 * (f32 + 0.5d0*beta*f52)
1272  1 + beta*(f32beta + 0.5d0*f52 + 0.5d0*beta*f52beta))
1273 
1274  epos = zz * (f32 + beta * f52)
1275  depos_detap = zz * (f32eta + beta * f52eta)
1276  depos_dbeta = econst * beta32 * (2.5d0 * (f32 + beta * f52)
1277  1 + beta * (f32beta + f52 + beta * f52beta))
1278  end if
1279 
1280 
1281 c..derivatives of the electron pressure
1282  dpeledd = dpele_deta * detadd
1283  dpeledt = dpele_deta * detadt + dpele_dbeta * dbetadt
1284  dpeleda = dpele_deta * detada
1285  dpeledz = dpele_deta * detadz
1286 
1287 
1288 c..derivatives of the electron energy
1289  deeledd = deele_deta * detadd
1290  deeledt = deele_deta * detadt + deele_dbeta * dbetadt
1291  deeleda = deele_deta * detada
1292  deeledz = deele_deta * detadz
1293 
1294 
1295 c..derivatives of the positron pressure
1296  dppos_deta = dppos_detap * detap_deta
1297  dppos_dbeta = dppos_dbeta + dppos_detap * detap_dbeta
1298  dpposdd = dppos_deta * detadd
1299  dpposdt = dppos_deta * detadt + dppos_dbeta * dbetadt
1300  dpposda = dppos_deta * detada
1301  dpposdz = dppos_deta * detadz
1302 
1303 
1304 c..derivatives of the positron energy
1305  depos_deta = depos_detap * detap_deta
1306  depos_dbeta = depos_dbeta + depos_detap * detap_dbeta
1307  deposdd = depos_deta * detadd
1308  deposdt = depos_deta * detadt + depos_dbeta * dbetadt
1309  deposda = depos_deta * detada
1310  deposdz = depos_deta * detadz
1311 
1312 
1313 
1314 c..electron+positron pressure and its derivatives
1315 c..note: at high temperatures and low densities, dpepdd is very small
1316 c..and can go negative, so limit it to be positive definite
1317  pep = pele + ppos
1318  dpepdd = max(dpeledd + dpposdd, 1.0d-30)
1319  dpepdt = dpeledt + dpposdt
1320  dpepda = dpeleda + dpposda
1321  dpepdz = dpeledz + dpposdz
1322 
1323 
1324 c..electron+positron thermal energy and its derivatives
1325  eep = eele + epos
1326  deepdd = deeledd + deposdd
1327  deepdt = deeledt + deposdt
1328  deepda = deeleda + deposda
1329  deepdz = deeledz + deposdz
1330 
1331 
1332 
1333 
1334  114 format(1x,1p5e24.16)
1335 
1336 
1337 c..electron entropy in erg/gr/kelvin and its derivatives
1338  y = kerg/den
1339 
1340  sele = ((pele + eele)/kt - etaele*xnefer) * y
1341 
1342  dseledd = ((dpeledd + deeledd)/kt
1343  1 - detadd*xnefer)*y
1344  2 - etaele*dxneferdd*y
1345  3 - sele/den
1346 
1347  dseledt = ((dpeledt + deeledt)/kt
1348  1 - detadt*xnefer
1349  2 - etaele*dxneferdt
1350  3 - (pele + eele)/(kt*temp))*y
1351 
1352  dseleda = ((dpeleda + deeleda)/kt - detada*xnefer
1353  1 - etaele*dxneferda)*y
1354 
1355  dseledz = ((dpeledz + deeledz)/kt - detadz*xnefer
1356  1 - etaele*dxneferdz)*y
1357 
1358 
1359 
1360 c..positron entropy in erg/gr/kelvin and its derivatives
1361  spos = ((ppos + epos)/kt - etapos*xnpfer) * y
1362 
1363  dsposdd = ((dpposdd + deposdd)/kt
1364  1 - detap_deta*detadd*xnpfer
1365  2 - etapos*dxnpferdd)*y - spos/den
1366 
1367  dsposdt = ((dpposdt + deposdt)/kt
1368  1 - (detap_deta*detadt + detap_dbeta*dbetadt)*xnpfer
1369  2 - etapos*dxnpferdt
1370  3 - (ppos + epos)/(kt*temp))*y
1371 
1372  dsposda = ((dpposda + deposda)/kt
1373  1 - detap_deta*detada*xnpfer
1374  2 - etapos*dxnpferda)*y
1375 
1376  dsposdz = ((dpposdz + deposdz)/kt - detap_deta*detadz*xnpfer
1377  1 - etapos*dxnpferdz)*y
1378 
1379 
1380 c..and their sum
1381  sep = sele + spos
1382  dsepdd = dseledd + dsposdd
1383  dsepdt = dseledt + dsposdt
1384  dsepda = dseleda + dsposda
1385  dsepdz = dseledz + dsposdz
1386 
1387 
1388 
1389 c..adjust for the rest mass energy of the positrons
1390  y = 2.0d0 * mecc
1391  epos = epos + y * xnpfer
1392  deposdd = deposdd + y * dxnpferdd
1393  deposdt = deposdt + y * dxnpferdt
1394  deposda = deposda + y * dxnpferda
1395  deposdz = deposdz + y * dxnpferdz
1396 
1397 
1398 c..and resum
1399  deepdd = deeledd + deposdd
1400  deepdt = deeledt + deposdt
1401  deepda = deeleda + deposda
1402  deepdz = deeledz + deposdz
1403 
1404 
1405 c..convert the electron-positron thermal energy in erg/cm**3 to
1406 c..a specific thermal energy in erg/gr
1407 
1408  eele = eele/den
1409  deeledd = deeledd/den - eele/den
1410  deeledt = deeledt/den
1411  deeleda = deeleda/den
1412  deeledz = deeledz/den
1413 
1414  epos = epos/den
1415  deposdd = deposdd/den - epos/den
1416  deposdt = deposdt/den
1417  deposda = deposda/den
1418  deposdz = deposdz/den
1419 
1420 
1421 c..and resum
1422  deepdd = deeledd + deposdd
1423  deepdt = deeledt + deposdt
1424  deepda = deeleda + deposda
1425  deepdz = deeledz + deposdz
1426 
1427 
1428 
1429 
1430 c..and take care of the ionization potential contributions
1431  if (potmult .eq. 0) then
1432  eip = 0.0d0
1433  deipdd = 0.0d0
1434  deipdt = 0.0d0
1435  deipda = 0.0d0
1436  deipdz = 0.0d0
1437  sip = 0.0d0
1438  dsipdd = 0.0d0
1439  dsipdt = 0.0d0
1440  dsipda = 0.0d0
1441  dsipdz = 0.0d0
1442  else
1443 
1444  eip = chi * xne
1445  deipdd = chi * dxnedd
1446  deipdt = chi * dxnedt
1447  deipda = chi * dxneda
1448  deipdz = chi * dxnedz + hion*ev2erg*xne
1449 
1450 c..the ionization entropy in erg/gr/kelvin and its derivatives
1451  y = kerg/den
1452 
1453 c sip = (eip/kt - etaele*xne) * y
1454 
1455 c dsipdd = (deipdd/kt
1456 c 1 - detadd*xne)*y
1457 c 2 - etaele*dxnedd*y
1458 c 3 - sip/den
1459 
1460 c dsipdt = (deipdt/kt
1461 c 1 - detadt*xne
1462 c 2 - etaele*dxnedt
1463 c 3 - eip/(kt*temp))*y
1464 
1465 
1466  sip = eip/kt * y
1467 
1468  dsipdd = deipdd/kt*y - sip/den
1469 
1470  dsipdt = (deipdt/kt - eip/(kt*temp))*y
1471 
1472  dsipda = deipda/kt*y
1473 
1474  dsipdz = deipdz/kt*y
1475 
1476 
1477 c..convert the ionization energy from erg/cm**3 to erg/gr
1478 
1479  eip = eip/den
1480  deipdd = deipdd/den - eip/den
1481  deipdt = deipdt/den
1482  deipda = deipda/den
1483  deipdz = deipdz/den
1484 
1485  end if
1486 
1487  return
1488  end subroutine xneroot
1489 
1490 
1491 
1492 
1493 
1494  subroutine coulomb(den,temp,abar,zbar,
1495  1 pion,dpiondd,dpiondt,dpionda,dpiondz,
1496  2 xne,dxnedd,dxnedt,dxneda,dxnedz,
1497  3 plasg,
1498  4 pcoul,dpcouldd,dpcouldt,dpcoulda,dpcouldz,
1499  5 ecoul,decouldd,decouldt,decoulda,decouldz,
1500  6 scoul,dscouldd,dscouldt,dscoulda,dscouldz)
1501  include 'implno.dek'
1502  include 'const.dek'
1503 
1504 
1505 c..this routine implments coulomb corrections
1506 c..see yakovlev & shalybkov 1989, uniform background corrections
1507 
1508 c..input
1509 
1510 
1511 c..declare the pass
1512  double precision den,temp,abar,zbar,
1513  1 pion,dpiondd,dpiondt,dpionda,dpiondz,
1514  2 xne,dxnedd,dxnedt,dxneda,dxnedz,
1515  3 plasg,
1516  4 pcoul,dpcouldd,dpcouldt,dpcoulda,dpcouldz,
1517  5 ecoul,decouldd,decouldt,decoulda,decouldz,
1518  6 scoul,dscouldd,dscouldt,dscoulda,dscouldz
1519 
1520 
1521 c..local variables
1522 c..for the uniform background coulomb correction
1523  double precision ytot1,kt,ktinv,
1524  1 s,dsdd,dsdt,dsda,dsdz,sinv,
1525  2 aele,daeledd,daeledt,daeleda,daeledz,aeleinv,
1526  3 eplasg,eplasgdd,eplasgdt,eplasgda,eplasgdz,
1527  4 aion,
1528 c 5 lami,inv_lami,lamidd,lamida,lamidz,
1529  6 plasgdd,plasgdt,plasgda,plasgdz,
1530  7 x,y,z
1531 
1532 
1533  double precision u0,a1,b1,c1,d1,e1,a2,b2,c2
1534  parameter (a1 = -0.898004d0,
1535  1 b1 = 0.96786d0,
1536  2 c1 = 0.220703d0,
1537  3 d1 = -0.86097d0,
1538  4 e1 = 2.5269d0,
1539  5 a2 = 0.29561d0,
1540  6 b2 = 1.9885d0,
1541  7 c2 = 0.288675d0)
1542 
1543 
1544 c..various derived constants
1545  double precision third,forth,fiveth,esqu,forthpi
1546  parameter (third = 1.0d0/3.0d0,
1547  1 forth = 4.0d0/3.0d0,
1548  2 fiveth = 5.0d0/3.0d0,
1549  3 esqu = qe*qe,
1550  4 forthpi = forth * pi)
1551 
1552 
1553 
1554 c..common variables
1555  ytot1 = 1.0d0/abar
1556  kt = kerg * temp
1557  ktinv = 1.0d0/kt
1558 
1559 
1560 
1561 c..yakovlev & shalybkov eqs 5, 9 and 10
1562  s = forthpi * xne
1563  dsdd = forthpi * dxnedd
1564  dsdt = forthpi * dxnedt
1565  dsda = forthpi * dxneda
1566  dsdz = forthpi * dxnedz
1567  sinv = 1.0d0/s
1568 
1569 c..electron-sphere radius aele
1570  aele = sinv**third
1571  z = -third * aele * sinv
1572  daeledd = z * dsdd
1573  daeledt = z * dsdt
1574  daeleda = z * dsda
1575  daeledz = z * dsdz
1576  aeleinv = 1.0d0/aele
1577 
1578 c..electron coupling parameter eplasg
1579  eplasg = esqu * ktinv * aeleinv
1580  z = -eplasg * aeleinv
1581  eplasgdd = z * daeledd
1582  eplasgdt = z * daeledt - eplasg*ktinv*kerg
1583  eplasgda = z * daeleda
1584  eplasgdz = z * daeledz
1585 
1586 c..ion-sphere radius aion
1587  x = zbar**third
1588  aion = x * aele
1589 
1590 c..ion coupling parameter plasg
1591  z = x*x*x*x*x
1592  plasg = z * eplasg
1593  plasgdd = z * eplasgdd
1594  plasgdt = z * eplasgdt
1595  plasgda = z * eplasgda
1596  plasgdz = z * eplasgdz + fiveth*x*x * eplasg
1597 
1598 c write(6,*)
1599 c write(6,112) aion,aele
1600 c write(6,112) plasg,plasgdd,plasgdt,plasgda,plasgdz
1601 c write(6,*)
1602 
1603 
1604 
1605 c..yakovlev & shalybkov 1989 equations 82, 85, 86, 87
1606  if (plasg .ge. 1.0) then
1607  x = plasg**(0.25d0)
1608  u0 = a1*plasg + b1*x + c1/x + d1
1609  ecoul = pion/den * u0
1610  pcoul = third * ecoul * den
1611  scoul = -avo*ytot1*kerg *
1612  1 (3.0d0*b1*x - 5.0d0*c1/x
1613  1 + d1 * (log(plasg) - 1.0d0) - e1)
1614 
1615  y = avo/abar*kt*(a1 + 0.25d0/plasg*(b1*x - c1/x))
1616  decouldd = y * plasgdd
1617  decouldt = y * plasgdt + ecoul/temp
1618  decoulda = y * plasgda - ecoul/abar
1619  decouldz = y * plasgdz
1620 
1621  y = third * den
1622  dpcouldd = third * ecoul + y*decouldd
1623  dpcouldt = y * decouldt
1624  dpcoulda = y * decoulda
1625  dpcouldz = y * decouldz
1626 
1627 
1628  y = -avo*kerg/(abar*plasg)*(0.75d0*b1*x +1.25d0*c1/x +d1)
1629  dscouldd = y * plasgdd
1630  dscouldt = y * plasgdt
1631  dscoulda = y * plasgda - scoul/abar
1632  dscouldz = y * plasgdz
1633 
1634 
1635 c..yakovlev & shalybkov 1989 equations 102, 103, 104
1636  else if (plasg .lt. 1.0) then
1637  x = plasg*sqrt(plasg)
1638  y = plasg**b2
1639  z = c2 * x - third * a2 * y
1640  pcoul = -pion * z
1641  ecoul = 3.0d0 * pcoul/den
1642  scoul = -avo/abar*kerg*(c2*x -a2*(b2-1.0d0)/b2*y)
1643 
1644  s = 1.5d0*c2*x/plasg - third*a2*b2*y/plasg
1645  dpcouldd = -dpiondd*z - pion*s*plasgdd
1646  dpcouldt = -dpiondt*z - pion*s*plasgdt
1647  dpcoulda = -dpionda*z - pion*s*plasgda
1648  dpcouldz = -dpiondz*z - pion*s*plasgdz
1649 
1650  s = 3.0d0/den
1651  decouldd = s * dpcouldd - ecoul/den
1652  decouldt = s * dpcouldt
1653  decoulda = s * dpcoulda
1654  decouldz = s * dpcouldz
1655 
1656  s = -avo*kerg/(abar*plasg)*(1.5d0*c2*x -a2*(b2-1.0d0)*y)
1657  dscouldd = s * plasgdd
1658  dscouldt = s * plasgdt
1659  dscoulda = s * plasgda - scoul/abar
1660  dscouldz = s * plasgdz
1661  end if
1662 
1663 
1664 
1665 
1666  return
1667  end subroutine coulomb
1668 
1669 
1670 
1671 
1672  subroutine etages(xni,zbar,temp,eta)
1673  include 'implno.dek'
1674  include 'const.dek'
1675 
1676 c..this routine makes a damn good guess for the electron degeneracy
1677 c..parameter eta.
1678 c..input is the ion number density xni, average charge zbar,
1679 c..average atomic weigt abar, and temperature temp.
1680 c..output is a guess at the chemical potential eta
1681 
1682 
1683 c..declare the pass
1684  double precision xni,zbar,temp,eta
1685 
1686 c..declare
1687  double precision xne,x,y,z,kt,beta,tmkt,xnefac
1688 
1689  double precision rt2,rt3,rtpi,cpf0,cpf1,cpf2,cpf3,
1690  1 twoth,fa0,forpi,mecc
1691  parameter(rt2 = 1.4142135623730951d0,
1692  1 rt3 = 1.7320508075688772d0,
1693  2 rtpi = 1.7724538509055159d0,
1694  3 cpf0 = h/(me*clight),
1695  4 cpf1 = 3.0d0/(8.0d0*pi) * cpf0**3,
1696  5 cpf2 = 4.0d0/cpf1,
1697  6 cpf3 = 2.0d0*rt3*rtpi/(rt2*cpf1),
1698  7 twoth = 2.0d0/3.0d0,
1699  8 fa0 = 64.0d0/(9.0d0*pi),
1700  9 forpi = 4.0d0 * pi,
1701  & mecc = me * clight * clight)
1702 
1703 c..notes: rt2=sqrt(2) rt3=sqrt(3) rtpi=sqrt(pi)
1704 
1705 
1706 c..for the purposes of guessing eta, assume full ionization
1707  xne = xni * zbar
1708  kt = kerg * temp
1709  beta = kt/mecc
1710 
1711 
1712 c..number density of ionized electrons (c&g 24.354k) and number density at
1713 c..turning point (c&g 24.354i). if either of these exceed the number density
1714 c..as given by a saha equation, then pairs are important. set alfa = 1/2.
1715 
1716  if (beta .ge. 1.0) then
1717  x = cpf2 * beta * beta
1718  else
1719  x = cpf3 * beta * (1.0d0 + 0.75d0*beta) * exp(-1.0d0/beta)
1720  end if
1721  if (x .ge. xne) then
1722  eta = -0.5d0
1723 
1724 
1725 c..get the dimensionless number density (c&g 24.313), if it is large apply the
1726 c..formula (c&g 24.309) to get a possible alfa, if not large do a two term
1727 c..binomial expansion on (c&g 24.309) to estimate alfa.
1728 
1729  else
1730  z = (xne*cpf1)**twoth
1731  if (z .ge. 1.0e-6) then
1732  y = (sqrt(z + 1.0d0) - 1.0d0)/beta
1733  else
1734  y = z * (1.0d0 - z * 0.25d0) * 0.5d0/beta
1735  end if
1736 
1737 
1738 c..isolate the constant in front of the number density integral. if it is
1739 c..small enough run the divine approximation backwards with c&g 24.43. then
1740 c..join it smoothly with the lower limit.
1741 
1742  x = log10(xne**0.6d0/temp)
1743  if (x .le. 9.5) then
1744  z = ((1.0d0 + fa0*beta)*sqrt(1.0d0 + fa0*beta*0.5) - 1.0d0)/fa0
1745  tmkt = 2.0d0 * me/h * kt/h
1746  xnefac = forpi * tmkt * sqrt(tmkt)
1747  eta = -log(xnefac*rtpi*(0.5d0+0.75d0*z)/xne)
1748  if (x .ge. 8.5) eta = eta*(9.5d0-x) + y * (1.0d0 - (9.5d0-x))
1749  else
1750  eta = y
1751  end if
1752  end if
1753 
1754  return
1755  end subroutine etages
1756 
1757 
1758 
1759 
1760 
1761 
1762 c..routine dfermi gets the fermi-dirac functions and their derivaties
1763 c..routine fdfunc1 forms the integrand of the fermi-dirac functions
1764 c..routine fdfunc2 same as fdfunc but with the change of variable z**2=x
1765 c..routine dqleg010 does 10 point gauss-legendre integration 9 fig accuracy
1766 c..routine dqleg020 does 20 point gauss-legendre integration 14 fig accuracy
1767 c..routine dqleg040 does 40 point gauss-legendre integration 18 fig accuracy
1768 c..routine dqleg080 does 80 point gauss-legendre integration 32 fig accuracy
1769 c..routine dqlag010 does 10 point gauss-laguerre integration 9 fig accuracy
1770 c..routine dqlag020 does 20 point gauss-laguerre integration 14 fig accuracy
1771 c..routine dqlag040 does 40 point gauss-laguerre integration 18 fig accuracy
1772 c..routine dqlag080 does 80 point gauss-laguerre integration 32 fig accuracy
1773 
1774 
1775 
1776  subroutine dfermi(dk,eta,theta,fd,fdeta,fdtheta)
1777  include 'implno.dek'
1778 c..
1779 c..this routine computes the fermi-dirac integrals of
1780 c..index dk, with degeneracy parameter eta and relativity parameter theta.
1781 c..input is dk the double precision index of the fermi-dirac function,
1782 c..eta the degeneracy parameter, and theta the relativity parameter.
1783 c..the output is fd is computed by applying three 10-point
1784 c..gauss-legendre and one 10-point gauss-laguerre rules over
1785 c..four appropriate subintervals. the derivative with respect to eta is
1786 c..output in fdeta, and the derivative with respct to theta is in fdtheta.
1787 c..within each subinterval the fd kernel.
1788 c..
1789 c..this routine delivers at least 9 figures of accuracy
1790 c..
1791 c..reference: j.m. aparicio, apjs 117, 632 1998
1792 c..
1793 c..declare
1794 c..declare
1795 !debug: needed to comment line below for undefined references reasons...
1796 ! external fdfunc1,fdfunc2
1797  double precision dk,eta,theta,fd,fdeta,fdtheta,
1798  1 d,sg,a1,b1,c1,a2,b2,c2,d2,e2,a3,b3,c3,d3,e3,
1799  2 eta1,xi,xi2,x1,x2,x3,s1,s2,s3,s12,par(3),
1800  3 res1,dres1,ddres1,res2,dres2,ddres2,
1801  4 res3,dres3,ddres3,res4,dres4,ddres4
1802 
1803 
1804 c parameters defining the location of the breakpoints for the
1805 c subintervals of integration:
1806  data d / 3.3609d 0 /
1807  data sg / 9.1186d-2 /
1808  data a1 / 6.7774d 0 /
1809  data b1 / 1.1418d 0 /
1810  data c1 / 2.9826d 0 /
1811  data a2 / 3.7601d 0 /
1812  data b2 / 9.3719d-2 /
1813  data c2 / 2.1063d-2 /
1814  data d2 / 3.1084d 1 /
1815  data e2 / 1.0056d 0 /
1816  data a3 / 7.5669d 0 /
1817  data b3 / 1.1695d 0 /
1818  data c3 / 7.5416d-1 /
1819  data d3 / 6.6558d 0 /
1820  data e3 /-1.2819d-1 /
1821 
1822 
1823 c integrand parameters:
1824  par(1)=dk
1825  par(2)=eta
1826  par(3)=theta
1827 
1828 
1829 c definition of xi:
1830  eta1=sg*(eta-d)
1831  if (eta1.le.5.d1) then
1832  xi=log(1.d0+exp(eta1))/sg
1833  else
1834  xi=eta-d
1835  endif
1836  xi2=xi*xi
1837 
1838 c definition of the x_i:
1839  x1=(a1 +b1*xi+c1* xi2)
1840  + /(1.d0+c1*xi)
1841  x2=(a2 +b2*xi+c2*d2*xi2)
1842  + /(1.d0+e2*xi+c2* xi2)
1843  x3=(a3 +b3*xi+c3*d3*xi2)
1844  + /(1.d0+e3*xi+c3* xi2)
1845 
1846 c breakpoints:
1847  s1=x1-x2
1848  s2=x1
1849  s3=x1+x3
1850  s12=sqrt(s1)
1851 
1852 c quadrature integrations:
1853 
1854 c 9 significant figure accuracy
1855 c call dqleg010(fdfunc2, 0.d0, s12, res1, dres1, ddres1, par,3)
1856 c call dqleg010(fdfunc1, s1, s2, res2, dres2, ddres2, par,3)
1857 c call dqleg010(fdfunc1, s2, s3, res3, dres3, ddres3, par,3)
1858 c call dqlag010(fdfunc1, s3, 1.d0, res4, dres4, ddres4, par,3)
1859 
1860 c 14 significant figure accuracy
1861  call dqleg020(fdfunc2, 0.d0, s12, res1, dres1, ddres1, par,3)
1862  call dqleg020(fdfunc1, s1, s2, res2, dres2, ddres2, par,3)
1863  call dqleg020(fdfunc1, s2, s3, res3, dres3, ddres3, par,3)
1864  call dqlag020(fdfunc1, s3, 1.d0, res4, dres4, ddres4, par,3)
1865 
1866 c 18 significant figure accuracy
1867 c call dqleg040(fdfunc2, 0.d0, s12, res1, dres1, ddres1, par,3)
1868 c call dqleg040(fdfunc1, s1, s2, res2, dres2, ddres2, par,3)
1869 c call dqleg040(fdfunc1, s2, s3, res3, dres3, ddres3, par,3)
1870 c call dqlag040(fdfunc1, s3, 1.d0, res4, dres4, ddres4, par,3)
1871 
1872 c 32 significant figure accuracy
1873 c call dqleg080(fdfunc2, 0.d0, s12, res1, dres1, ddres1, par,3)
1874 c call dqleg080(fdfunc1, s1, s2, res2, dres2, ddres2, par,3)
1875 c call dqleg080(fdfunc1, s2, s3, res3, dres3, ddres3, par,3)
1876 c call dqlag080(fdfunc1, s3, 1.d0, res4, dres4, ddres4, par,3)
1877 
1878 
1879 c..sum the contributions
1880  fd = res1 + res2 + res3 + res4
1881  fdeta = dres1 + dres2 + dres3 + dres4
1882  fdtheta = ddres1 + ddres2 + ddres3 + ddres4
1883  return
1884  end subroutine dfermi
1885 
1886 
1887 
1888 
1889  subroutine fdfunc1(x,par,n,fd,fdeta,fdtheta)
1890  include 'implno.dek'
1891 c..
1892 c..forms the fermi-dirac integrand and its derivatives with eta and theta.
1893 c..on input x is the integration variable, par(1) is the double precision
1894 c..index, par(2) is the degeneravy parameter, and par(3) is the relativity
1895 c..parameter. on output fd is the integrand, fdeta is the derivative
1896 c..with respect to eta, and fdtheta is the derivative with respect to theta.
1897 c..
1898 c..declare
1899  integer n
1900  double precision x,par(n),dk,eta,theta,fd,fdeta,fdtheta,
1901  1 factor,dxst,denom,denom2,xdk,xdkp1
1902 
1903 c..initialize
1904  dk = par(1)
1905  eta = par(2)
1906  theta = par(3)
1907  xdk = x**dk
1908  xdkp1 = x * xdk
1909  dxst = sqrt(1.0d0 + 0.5d0*x*theta)
1910 
1911 c avoid overflow in the exponentials at large x
1912  if ((x-eta) .lt. 1.0d2) then
1913  factor = exp(x-eta)
1914  denom = factor + 1.0d0
1915  fd = xdk * dxst / denom
1916  fdeta = fd * factor / denom
1917  denom2 = 4.0d0 * dxst * denom
1918  fdtheta = xdkp1 / denom2
1919 
1920  else
1921  factor = exp(eta-x)
1922  fd = xdk * dxst * factor
1923  fdeta = fd
1924  denom2 = 4.0d0 * dxst
1925  fdtheta = xdkp1/denom2 * factor
1926  endif
1927 
1928  return
1929  end subroutine fdfunc1
1930 
1931 
1932 
1933 
1934  subroutine fdfunc2(x,par,n,fd,fdeta,fdtheta)
1935  include 'implno.dek'
1936 c..
1937 c..forms the fermi-dirac integrand and its derivatives with eta and theta,
1938 c..when the z**2=x variable change has been made.
1939 c..on input x is the integration variable, par(1) is the double precision
1940 c..index, par(2) is the degeneravy parameter, and par(3) is the relativity
1941 c..parameter. on output fd is the integrand, fdeta is the derivative
1942 c..with respect to eta, and fdtheta is the derivative with respect to theta.
1943 c..
1944 c..declare
1945  integer n
1946  double precision x,par(n),dk,eta,theta,fd,fdeta,fdtheta,
1947  1 factor,dxst,denom,denom2,xdk,xdkp1,xsq
1948 
1949  dk = par(1)
1950  eta = par(2)
1951  theta = par(3)
1952  xsq = x * x
1953  xdk = x**(2.0d0 * dk + 1.0d0)
1954  xdkp1 = xsq * xdk
1955  dxst = sqrt(1.0d0 + 0.5d0 * xsq * theta)
1956 
1957 c avoid an overflow in the denominator at large x:
1958  if ((xsq-eta) .lt. 1.d2) then
1959  factor = exp(xsq - eta)
1960  denom = factor + 1.0d0
1961  fd = 2.0d0 * xdk * dxst/denom
1962  fdeta = fd * factor/denom
1963  denom2 = 4.0d0 * dxst * denom
1964  fdtheta = 2.0d0 * xdkp1/denom2
1965 
1966  else
1967  factor = exp(eta - xsq)
1968  fd = 2.0d0 * xdk * dxst * factor
1969  fdeta = fd
1970  denom2 = 4.0d0 * dxst
1971  fdtheta = 2.0d0 * xdkp1/denom2 * factor
1972  endif
1973 
1974  return
1975  end subroutine fdfunc2
1976 
1977 
1978 
1979 
1980 
1981  subroutine dqleg010(f,a,b,result,dresult,ddresult,par,n)
1982  include 'implno.dek'
1983 c..
1984 c..10 point gauss-legendre rule for the fermi-dirac function and
1985 c..its derivatives with respect to eta and theta.
1986 c..on input f is the name of the subroutine containing the integrand,
1987 c..a is the lower end point of the interval, b is the higher end point,
1988 c..par is an array of constant parameters to be passed to subroutine f,
1989 c..and n is the length of the par array. on output result is the
1990 c..approximation from applying the 10-point gauss-legendre rule,
1991 c..dresult is the derivative with respect to eta, and ddresult is the
1992 c..derivative with respect to theta.
1993 c..
1994 c..note: since the number of nodes is even, zero is not an abscissa.
1995 c..
1996 c..declare
1997  external f
1998  integer j,n
1999  double precision a,b,result,dresult,ddresult,par(n),
2000  1 absc1,absc2,center,hlfrun,wg(5),xg(5),
2001  2 fval1,dfval1,ddfval1,fval2,dfval2,ddfval2
2002 
2003 c the abscissae and weights are given for the interval (-1,1).
2004 c xg - abscissae of the 20-point gauss-legendre rule
2005 c for half of the usual run (-1,1), i.e.
2006 c the positive nodes of the 20-point rule
2007 c wg - weights of the 20-point gauss rule.
2008 c
2009 c abscissae and weights were evaluated with 100 decimal digit arithmetic.
2010 
2011  data xg( 1) / 1.4887433898 1631210884 8260011297 19984 d -1 /
2012  data xg( 2) / 4.3339539412 9247190799 2659431657 84162 d -1 /
2013  data xg( 3) / 6.7940956829 9024406234 3273651148 73575 d -1 /
2014  data xg( 4) / 8.6506336668 8984510732 0966884234 93048 d -1 /
2015  data xg( 5) / 9.7390652851 7171720077 9640120844 52053 d -1 /
2016 
2017  data wg( 1) / 2.9552422471 4752870173 8929946513 38329 d -1 /
2018  data wg( 2) / 2.6926671930 9996355091 2269215694 69352 d -1 /
2019  data wg( 3) / 2.1908636251 5982043995 5349342281 63192 d -1 /
2020  data wg( 4) / 1.4945134915 0580593145 7763396576 97332 d -1 /
2021  data wg( 5) / 6.6671344308 6881375935 6880989333 17928 d -2 /
2022 
2023 
2024 c list of major variables
2025 c -----------------------
2026 c
2027 c absc - abscissa
2028 c fval* - function value
2029 c result - result of the 10-point gauss formula
2030 
2031  center = 0.5d0 * (a+b)
2032  hlfrun = 0.5d0 * (b-a)
2033  result = 0.0d0
2034  dresult = 0.0d0
2035  ddresult = 0.0d0
2036  do j=1,5
2037  absc1 = center + hlfrun*xg(j)
2038  absc2 = center - hlfrun*xg(j)
2039  call f(absc1, par, n, fval1, dfval1, ddfval1)
2040  call f(absc2, par, n, fval2, dfval2, ddfval2)
2041  result = result + (fval1 + fval2)*wg(j)
2042  dresult = dresult + (dfval1 + dfval2)*wg(j)
2043  ddresult = ddresult + (ddfval1 + ddfval2)*wg(j)
2044  enddo
2045  result = result * hlfrun
2046  dresult = dresult * hlfrun
2047  ddresult = ddresult * hlfrun
2048  return
2049  end subroutine dqleg010
2050 
2051 
2052 
2053 
2054  subroutine dqleg020(f,a,b,result,dresult,ddresult,par,n)
2055  include 'implno.dek'
2056 c..
2057 c..20 point gauss-legendre rule for the fermi-dirac function and
2058 c..its derivatives with respect to eta and theta.
2059 c..on input f is the name of the subroutine containing the integrand,
2060 c..a is the lower end point of the interval, b is the higher end point,
2061 c..par is an array of constant parameters to be passed to subroutine f,
2062 c..and n is the length of the par array. on output result is the
2063 c..approximation from applying the 20-point gauss-legendre rule,
2064 c..dresult is the derivative with respect to eta, and ddresult is the
2065 c..derivative with respect to theta.
2066 c..
2067 c..note: since the number of nodes is even, zero is not an abscissa.
2068 c..
2069 c..declare
2070  external f
2071  integer j,n
2072  double precision a,b,result,dresult,ddresult,par(n),
2073  1 absc1,absc2,center,hlfrun,wg(10),xg(10),
2074  2 fval1,dfval1,ddfval1,fval2,dfval2,ddfval2
2075 
2076 
2077 c the abscissae and weights are given for the interval (-1,1).
2078 c xg - abscissae of the 20-point gauss-legendre rule
2079 c for half of the usual run (-1,1), i.e.
2080 c the positive nodes of the 20-point rule
2081 c wg - weights of the 20-point gauss rule.
2082 c
2083 c abscissae and weights were evaluated with 100 decimal digit arithmetic.
2084 
2085 
2086  data xg( 1) / 7.6526521133 4973337546 4040939883 82110 d -2 /
2087  data xg( 2) / 2.2778585114 1645078080 4961953685 74624 d -1 /
2088  data xg( 3) / 3.7370608871 5419560672 5481770249 27237 d -1 /
2089  data xg( 4) / 5.1086700195 0827098004 3640509552 50998 d -1 /
2090  data xg( 5) / 6.3605368072 6515025452 8366962262 85936 d -1 /
2091  data xg( 6) / 7.4633190646 0150792614 3050703556 41590 d -1 /
2092  data xg( 7) / 8.3911697182 2218823394 5290617015 20685 d -1 /
2093  data xg( 8) / 9.1223442825 1325905867 7524412032 98113 d -1 /
2094  data xg( 9) / 9.6397192727 7913791267 6661311972 77221 d -1 /
2095  data xg( 10) / 9.9312859918 5094924786 1223884713 20278 d -1 /
2096 
2097  data wg( 1) / 1.5275338713 0725850698 0843319550 97593 d -1 /
2098  data wg( 2) / 1.4917298647 2603746787 8287370019 69436 d -1 /
2099  data wg( 3) / 1.4209610931 8382051329 2983250671 64933 d -1 /
2100  data wg( 4) / 1.3168863844 9176626898 4944997481 63134 d -1 /
2101  data wg( 5) / 1.1819453196 1518417312 3773777113 82287 d -1 /
2102  data wg( 6) / 1.0193011981 7240435036 7501354803 49876 d -1 /
2103  data wg( 7) / 8.3276741576 7047487247 5814322204 62061 d -2 /
2104  data wg( 8) / 6.2672048334 1090635695 0653518704 16063 d -2 /
2105  data wg( 9) / 4.0601429800 3869413310 3995227493 21098 d -2 /
2106  data wg( 10) / 1.7614007139 1521183118 6196235185 28163 d -2 /
2107 
2108 
2109 c list of major variables
2110 c -----------------------
2111 c
2112 c absc - abscissa
2113 c fval* - function value
2114 c result - result of the 20-point gauss formula
2115 
2116 
2117  center = 0.5d0 * (a+b)
2118  hlfrun = 0.5d0 * (b-a)
2119  result = 0.0d0
2120  dresult = 0.0d0
2121  ddresult = 0.0d0
2122  do j=1,10
2123  absc1 = center + hlfrun*xg(j)
2124  absc2 = center - hlfrun*xg(j)
2125  call f(absc1, par, n, fval1, dfval1, ddfval1)
2126  call f(absc2, par, n, fval2, dfval2, ddfval2)
2127  result = result + (fval1 + fval2)*wg(j)
2128  dresult = dresult + (dfval1 + dfval2)*wg(j)
2129  ddresult = ddresult + (ddfval1 + ddfval2)*wg(j)
2130  enddo
2131  result = result * hlfrun
2132  dresult = dresult * hlfrun
2133  ddresult = ddresult * hlfrun
2134  return
2135  end subroutine dqleg020
2136 
2137 
2138 
2139 
2140 
2141  subroutine dqleg040(f,a,b,result,dresult,ddresult,par,n)
2142  include 'implno.dek'
2143 c..
2144 c..40 point gauss-legendre rule for the fermi-dirac function and
2145 c..its derivatives with respect to eta and theta.
2146 c..on input f is the name of the subroutine containing the integrand,
2147 c..a is the lower end point of the interval, b is the higher end point,
2148 c..par is an array of constant parameters to be passed to subroutine f,
2149 c..and n is the length of the par array. on output result is the
2150 c..approximation from applying the 40-point gauss-legendre rule,
2151 c..dresult is the derivative with respect to eta, and ddresult is the
2152 c..derivative with respect to theta.
2153 c..
2154 c..note: since the number of nodes is even, zero is not an abscissa.
2155 c..
2156 c..declare
2157  external f
2158  integer j,n
2159  double precision a,b,result,dresult,ddresult,par(n),
2160  1 absc1,absc2,center,hlfrun,wg(20),xg(20),
2161  2 fval1,dfval1,ddfval1,fval2,dfval2,ddfval2
2162 
2163 
2164 c the abscissae and weights are given for the interval (-1,1).
2165 c xg - abscissae of the 40-point gauss-legendre rule
2166 c for half of the usual run (-1,1), i.e.
2167 c the positive nodes of the 40-point rule
2168 c wg - weights of the 40-point gauss rule.
2169 c
2170 c abscissae and weights were evaluated with 100 decimal digit arithmetic.
2171 
2172  data xg( 1) / 3.8772417506 0508219331 9344402462 32946 d -2 /
2173  data xg( 2) / 1.1608407067 5255208483 4512844080 24113 d -1 /
2174  data xg( 3) / 1.9269758070 1371099715 5168520651 49894 d -1 /
2175  data xg( 4) / 2.6815218500 7253681141 1843448085 96183 d -1 /
2176  data xg( 5) / 3.4199409082 5758473007 4924811791 94310 d -1 /
2177  data xg( 6) / 4.1377920437 1605001524 8797458037 13682 d -1 /
2178  data xg( 7) / 4.8307580168 6178712908 5665742448 23004 d -1 /
2179  data xg( 8) / 5.4946712509 5128202075 9313055295 17970 d -1 /
2180  data xg( 9) / 6.1255388966 7980237952 6124502306 94877 d -1 /
2181  data xg( 10) / 6.7195668461 4179548379 3545149614 94109 d -1 /
2182  data xg( 11) / 7.2731825518 9927103280 9964517549 30548 d -1 /
2183  data xg( 12) / 7.7830565142 6519387694 9715455064 94848 d -1 /
2184  data xg( 13) / 8.2461223083 3311663196 3202306660 98773 d -1 /
2185  data xg( 14) / 8.6595950321 2259503820 7818083546 19963 d -1 /
2186  data xg( 15) / 9.0209880696 8874296728 2533308684 93103 d -1 /
2187  data xg( 16) / 9.3281280827 8676533360 8521668452 05716 d -1 /
2188  data xg( 17) / 9.5791681921 3791655804 5409994527 59285 d -1 /
2189  data xg( 18) / 9.7725994998 3774262663 3702837129 03806 d -1 /
2190  data xg( 19) / 9.9072623869 9457006453 0543522213 72154 d -1 /
2191  data xg( 20) / 9.9823770971 0559200349 6227024205 86492 d -1 /
2192 
2193  data wg( 1) / 7.7505947978 4248112637 2396295832 63269 d -2 /
2194  data wg( 2) / 7.7039818164 2479655883 0753428381 02485 d -2 /
2195  data wg( 3) / 7.6110361900 6262423715 5807592249 48230 d -2 /
2196  data wg( 4) / 7.4723169057 9682642001 8933626132 46731 d -2 /
2197  data wg( 5) / 7.2886582395 8040590605 1068344251 78358 d -2 /
2198  data wg( 6) / 7.0611647391 2867796954 8363085528 68323 d -2 /
2199  data wg( 7) / 6.7912045815 2339038256 9010823192 39859 d -2 /
2200  data wg( 8) / 6.4804013456 6010380745 5452956675 27300 d -2 /
2201  data wg( 9) / 6.1306242492 9289391665 3799640839 85959 d -2 /
2202  data wg( 10) / 5.7439769099 3915513666 1773091042 59856 d -2 /
2203  data wg( 11) / 5.3227846983 9368243549 9647977226 05045 d -2 /
2204  data wg( 12) / 4.8695807635 0722320614 3416044814 63880 d -2 /
2205  data wg( 13) / 4.3870908185 6732719916 7468604171 54958 d -2 /
2206  data wg( 14) / 3.8782167974 4720176399 7203129044 61622 d -2 /
2207  data wg( 15) / 3.3460195282 5478473926 7818308641 08489 d -2 /
2208  data wg( 16) / 2.7937006980 0234010984 8915750772 10773 d -2 /
2209  data wg( 17) / 2.2245849194 1669572615 0432418420 85732 d -2 /
2210  data wg( 18) / 1.6421058381 9078887128 6348488236 39272 d -2 /
2211  data wg( 19) / 1.0498284531 1528136147 4217106727 96523 d -2 /
2212  data wg( 20) / 4.5212770985 3319125847 1732878185 33272 d -3 /
2213 
2214 
2215 c list of major variables
2216 c -----------------------
2217 c
2218 c absc - abscissa
2219 c fval* - function value
2220 c result - result of the 20-point gauss formula
2221 
2222 
2223  center = 0.5d0 * (a+b)
2224  hlfrun = 0.5d0 * (b-a)
2225  result = 0.0d0
2226  dresult = 0.0d0
2227  ddresult = 0.0d0
2228  do j=1,20
2229  absc1 = center + hlfrun*xg(j)
2230  absc2 = center - hlfrun*xg(j)
2231  call f(absc1, par, n, fval1, dfval1, ddfval1)
2232  call f(absc2, par, n, fval2, dfval2, ddfval2)
2233  result = result + (fval1 + fval2)*wg(j)
2234  dresult = dresult + (dfval1 + dfval2)*wg(j)
2235  ddresult = ddresult + (ddfval1 + ddfval2)*wg(j)
2236  enddo
2237  result = result * hlfrun
2238  dresult = dresult * hlfrun
2239  ddresult = ddresult * hlfrun
2240  return
2241  end subroutine dqleg040
2242 
2243 
2244 
2245 
2246 
2247  subroutine dqleg080(f,a,b,result,dresult,ddresult,par,n)
2248  include 'implno.dek'
2249 c..
2250 c..80 point gauss-legendre rule for the fermi-dirac function and
2251 c..its derivatives with respect to eta and theta.
2252 c..on input f is the name of the subroutine containing the integrand,
2253 c..a is the lower end point of the interval, b is the higher end point,
2254 c..par is an array of constant parameters to be passed to subroutine f,
2255 c..and n is the length of the par array. on output result is the
2256 c..approximation from applying the 80-point gauss-legendre rule,
2257 c..dresult is the derivative with respect to eta, and ddresult is the
2258 c..derivative with respect to theta.
2259 c..
2260 c..note: since the number of nodes is even, zero is not an abscissa.
2261 c..
2262 c..declare
2263  external f
2264  integer j,n
2265  double precision a,b,result,dresult,ddresult,par(n),
2266  1 absc1,absc2,center,hlfrun,wg(40),xg(40),
2267  2 fval1,dfval1,ddfval1,fval2,dfval2,ddfval2
2268 
2269 
2270 c the abscissae and weights are given for the interval (-1,1).
2271 c xg - abscissae of the 80-point gauss-legendre rule
2272 c for half of the usual run (-1,1), i.e.
2273 c the positive nodes of the 80-point rule
2274 c wg - weights of the 80-point gauss rule.
2275 c
2276 c abscissae and weights were evaluated with 100 decimal digit arithmetic.
2277 
2278 
2279  data xg( 1) / 1.9511383256 7939976543 5123410745 45479 d -2 /
2280  data xg( 2) / 5.8504437152 4206686289 9332188341 77944 d -2 /
2281  data xg( 3) / 9.7408398441 5845990632 7845010493 69020 d -2 /
2282  data xg( 4) / 1.3616402280 9143886559 2410780007 17067 d -1 /
2283  data xg( 5) / 1.7471229183 2646812559 3390480112 86195 d -1 /
2284  data xg( 6) / 2.1299450285 7666132572 3885386663 21823 d -1 /
2285  data xg( 7) / 2.5095235839 2272120493 1588160350 04797 d -1 /
2286  data xg( 8) / 2.8852805488 4511853109 1393014347 13898 d -1 /
2287  data xg( 9) / 3.2566437074 7701914619 1129436273 58695 d -1 /
2288  data xg( 10) / 3.6230475349 9487315619 0432863589 63588 d -1 /
2289  data xg( 11) / 3.9839340588 1969227024 3796425175 33757 d -1 /
2290  data xg( 12) / 4.3387537083 1756093062 3867003631 81958 d -1 /
2291  data xg( 13) / 4.6869661517 0544477036 0783649358 08657 d -1 /
2292  data xg( 14) / 5.0280411188 8784987593 6727503675 68003 d -1 /
2293  data xg( 15) / 5.3614592089 7131932019 8572531254 00904 d -1 /
2294  data xg( 16) / 5.6867126812 2709784725 4857866248 27158 d -1 /
2295  data xg( 17) / 6.0033062282 9751743154 7462991640 06848 d -1 /
2296  data xg( 18) / 6.3107577304 6871966247 9283872893 36863 d -1 /
2297  data xg( 19) / 6.6085989898 6119801735 9671228443 17234 d -1 /
2298  data xg( 20) / 6.8963764434 2027600771 2076124389 35266 d -1 /
2299  data xg( 21) / 7.1736518536 2099880254 0682582938 15278 d -1 /
2300  data xg( 22) / 7.4400029758 3597272316 5405279309 13673 d -1 /
2301  data xg( 23) / 7.6950242013 5041373865 6160687490 26083 d -1 /
2302  data xg( 24) / 7.9383271750 4605449948 6393117384 54358 d -1 /
2303  data xg( 25) / 8.1695413868 1463470371 1249940122 95707 d -1 /
2304  data xg( 26) / 8.3883147358 0255275616 6230439028 67064 d -1 /
2305  data xg( 27) / 8.5943140666 3111096977 1921234916 56492 d -1 /
2306  data xg( 28) / 8.7872256767 8213828703 7733436391 24407 d -1 /
2307  data xg( 29) / 8.9667557943 8770683194 3240719673 95986 d -1 /
2308  data xg( 30) / 9.1326310257 1757654164 7336561509 47478 d -1 /
2309  data xg( 31) / 9.2845987717 2445795953 0459590754 53133 d -1 /
2310  data xg( 32) / 9.4224276130 9872674752 2660045000 01735 d -1 /
2311  data xg( 33) / 9.5459076634 3634905493 4815170210 29508 d -1 /
2312  data xg( 34) / 9.6548508904 3799251452 2731556714 54998 d -1 /
2313  data xg( 35) / 9.7490914058 5727793385 6452300691 36276 d -1 /
2314  data xg( 36) / 9.8284857273 8629070418 2880277091 16473 d -1 /
2315  data xg( 37) / 9.8929130249 9755531026 5031671366 31385 d -1 /
2316  data xg( 38) / 9.9422754096 5688277892 0635036649 11698 d -1 /
2317  data xg( 39) / 9.9764986439 8237688899 4942081831 22985 d -1 /
2318  data xg( 40) / 9.9955382265 1630629880 0804990945 67184 d -1 /
2319 
2320  data wg( 1) / 3.9017813656 3066548112 8043925275 40483 d -2 /
2321  data wg( 2) / 3.8958395962 7695311986 2552477226 08223 d -2 /
2322  data wg( 3) / 3.8839651059 0519689317 7418266878 71658 d -2 /
2323  data wg( 4) / 3.8661759774 0764633270 7711026715 66912 d -2 /
2324  data wg( 5) / 3.8424993006 9594231852 1243632949 01384 d -2 /
2325  data wg( 6) / 3.8129711314 4776383442 0679156573 62019 d -2 /
2326  data wg( 7) / 3.7776364362 0013974897 7497642632 10547 d -2 /
2327  data wg( 8) / 3.7365490238 7304900267 0537705783 86691 d -2 /
2328  data wg( 9) / 3.6897714638 2760088391 5099657340 52192 d -2 /
2329  data wg( 10) / 3.6373749905 8359780439 6499104652 28136 d -2 /
2330  data wg( 11) / 3.5794393953 4160546028 6158881615 44542 d -2 /
2331  data wg( 12) / 3.5160529044 7475934955 2659238869 68812 d -2 /
2332  data wg( 13) / 3.4473120451 7539287943 6422673102 98320 d -2 /
2333  data wg( 14) / 3.3733214984 6115228166 7516306423 87284 d -2 /
2334  data wg( 15) / 3.2941939397 6454013828 3618090195 95361 d -2 /
2335  data wg( 16) / 3.2100498673 4877731480 5649028725 06960 d -2 /
2336  data wg( 17) / 3.1210174188 1147016424 4286672060 35518 d -2 /
2337  data wg( 18) / 3.0272321759 5579806612 2001009090 11747 d -2 /
2338  data wg( 19) / 2.9288369583 2678476927 6758601957 91396 d -2 /
2339  data wg( 20) / 2.8259816057 2768623967 5319796501 45302 d -2 /
2340  data wg( 21) / 2.7188227500 4863806744 1870668054 42598 d -2 /
2341  data wg( 22) / 2.6075235767 5651179029 6874360026 92871 d -2 /
2342  data wg( 23) / 2.4922535764 1154911051 1784700321 98023 d -2 /
2343  data wg( 24) / 2.3731882865 9301012931 9252461356 84162 d -2 /
2344  data wg( 25) / 2.2505090246 3324619262 2158968616 87390 d -2 /
2345  data wg( 26) / 2.1244026115 7820063887 1073725061 31285 d -2 /
2346  data wg( 27) / 1.9950610878 1419989288 9192871511 35633 d -2 /
2347  data wg( 28) / 1.8626814208 2990314287 3541415215 72090 d -2 /
2348  data wg( 29) / 1.7274652056 2693063585 8420713129 09998 d -2 /
2349  data wg( 30) / 1.5896183583 7256880449 0290922917 85257 d -2 /
2350  data wg( 31) / 1.4493508040 5090761169 6207458346 05500 d -2 /
2351  data wg( 32) / 1.3068761592 4013392937 8682589705 63403 d -2 /
2352  data wg( 33) / 1.1624114120 7978269164 6676999543 26348 d -2 /
2353  data wg( 34) / 1.0161766041 1030645208 3185035240 69436 d -2 /
2354  data wg( 35) / 8.6839452692 6085842640 9452204034 28135 d -3 /
2355  data wg( 36) / 7.1929047681 1731275267 5570867956 50747 d -3 /
2356  data wg( 37) / 5.6909224514 0319864926 9107117162 01847 d -3 /
2357  data wg( 38) / 4.1803131246 9489523673 9304201681 35132 d -3 /
2358  data wg( 39) / 2.6635335895 1268166929 3535831668 45546 d -3 /
2359  data wg( 40) / 1.1449500031 8694153454 4171941315 63611 d -3 /
2360 
2361 
2362 c list of major variables
2363 c -----------------------
2364 c
2365 c absc - abscissa
2366 c fval* - function value
2367 c result - result of the 20-point gauss formula
2368 
2369 
2370  center = 0.5d0 * (a+b)
2371  hlfrun = 0.5d0 * (b-a)
2372  result = 0.0d0
2373  dresult = 0.0d0
2374  ddresult = 0.0d0
2375  do j=1,40
2376  absc1 = center + hlfrun*xg(j)
2377  absc2 = center - hlfrun*xg(j)
2378  call f(absc1, par, n, fval1, dfval1, ddfval1)
2379  call f(absc2, par, n, fval2, dfval2, ddfval2)
2380  result = result + (fval1 + fval2)*wg(j)
2381  dresult = dresult + (dfval1 + dfval2)*wg(j)
2382  ddresult = ddresult + (ddfval1 + ddfval2)*wg(j)
2383  enddo
2384  result = result * hlfrun
2385  dresult = dresult * hlfrun
2386  ddresult = ddresult * hlfrun
2387  return
2388  end subroutine dqleg080
2389 
2390 
2391 
2392 
2393 
2394  subroutine dqlag010(f,a,b,result,dresult,ddresult,par,n)
2395  include 'implno.dek'
2396 c..
2397 c..10 point gauss-laguerre rule for the fermi-dirac function.
2398 c..on input f is the external function defining the integrand
2399 c..f(x)=g(x)*w(x), where w(x) is the gaussian weight
2400 c..w(x)=exp(-(x-a)/b) and g(x) a smooth function,
2401 c..a is the lower end point of the interval, b is the higher end point,
2402 c..par is an array of constant parameters to be passed to the function f,
2403 c..and n is the length of the par array. on output result is the
2404 c..approximation from applying the 10-point gauss-laguerre rule.
2405 c..since the number of nodes is even, zero is not an abscissa.
2406 c..
2407 c..declare
2408  external f
2409  integer j,n
2410  double precision a,b,result,dresult,ddresult,par(n),
2411  1 absc,wg(10),xg(10),fval,dfval,ddfval
2412 
2413 
2414 c the abscissae and weights are given for the interval (0,+inf).
2415 c xg - abscissae of the 10-point gauss-laguerre rule
2416 c wg - weights of the 10-point gauss rule. since f yet
2417 c includes the weight function, the values in wg
2418 c are actually exp(xg) times the standard
2419 c gauss-laguerre weights
2420 c
2421 c abscissae and weights were evaluated with 100 decimal digit arithmetic.
2422 
2423  data xg( 1) / 1.3779347054 0492430830 7725056527 11188 d -1 /
2424  data xg( 2) / 7.2945454950 3170498160 3731216760 78781 d -1 /
2425  data xg( 3) / 1.8083429017 4031604823 2920075750 60883 d 0 /
2426  data xg( 4) / 3.4014336978 5489951448 2532221408 39067 d 0 /
2427  data xg( 5) / 5.5524961400 6380363241 7558486868 76285 d 0 /
2428  data xg( 6) / 8.3301527467 6449670023 8767197274 52218 d 0 /
2429  data xg( 7) / 1.1843785837 9000655649 1853891914 16139 d 1 /
2430  data xg( 8) / 1.6279257831 3781020995 3265393583 36223 d 1 /
2431  data xg( 9) / 2.1996585811 9807619512 7709019559 44939 d 1 /
2432  data xg( 10) / 2.9920697012 2738915599 0879334079 91951 d 1 /
2433 
2434  data wg( 1) / 3.5400973860 6996308762 2268914420 67608 d -1 /
2435  data wg( 2) / 8.3190230104 3580738109 8296581278 49577 d -1 /
2436  data wg( 3) / 1.3302885617 4932817875 2792194393 99369 d 0 /
2437  data wg( 4) / 1.8630639031 1113098976 3988735482 46693 d 0 /
2438  data wg( 5) / 2.4502555580 8301016607 2693731657 52256 d 0 /
2439  data wg( 6) / 3.1227641551 3518249615 0818263314 55472 d 0 /
2440  data wg( 7) / 3.9341526955 6152109865 5812459248 23077 d 0 /
2441  data wg( 8) / 4.9924148721 9302310201 1485652433 15445 d 0 /
2442  data wg( 9) / 6.5722024851 3080297518 7668710376 11234 d 0 /
2443  data wg( 10) / 9.7846958403 7463069477 0086638718 59813 d 0 /
2444 
2445 
2446 c list of major variables
2447 c -----------------------
2448 c absc - abscissa
2449 c fval* - function value
2450 c result - result of the 10-point gauss formula
2451 
2452  result = 0.0d0
2453  dresult = 0.0d0
2454  ddresult = 0.0d0
2455  do j=1,10
2456  absc = a+b*xg(j)
2457  call f(absc, par, n, fval, dfval, ddfval)
2458  result = result + fval*wg(j)
2459  dresult = dresult + dfval*wg(j)
2460  ddresult = ddresult + ddfval*wg(j)
2461  enddo
2462  result = result*b
2463  dresult = dresult*b
2464  ddresult = ddresult*b
2465  return
2466  end subroutine dqlag010
2467 
2468 
2469 
2470 
2471 
2472  subroutine dqlag020(f,a,b,result,dresult,ddresult,par,n)
2473  include 'implno.dek'
2474 c..
2475 c..20 point gauss-laguerre rule for the fermi-dirac function.
2476 c..on input f is the external function defining the integrand
2477 c..f(x)=g(x)*w(x), where w(x) is the gaussian weight
2478 c..w(x)=dexp(-(x-a)/b) and g(x) a smooth function,
2479 c..a is the lower end point of the interval, b is the higher end point,
2480 c..par is an array of constant parameters to be passed to the function f,
2481 c..and n is the length of the par array. on output result is the
2482 c..approximation from applying the 20-point gauss-laguerre rule.
2483 c..since the number of nodes is even, zero is not an abscissa.
2484 c..
2485 c..declare
2486  external f
2487  integer j,n
2488  double precision a,b,result,dresult,ddresult,par(n),
2489  1 absc,wg(20),xg(20),fval,dfval,ddfval
2490 
2491 
2492 c the abscissae and weights are given for the interval (0,+inf).
2493 c xg - abscissae of the 20-point gauss-laguerre rule
2494 c wg - weights of the 20-point gauss rule. since f yet
2495 c includes the weight function, the values in wg
2496 c are actually exp(xg) times the standard
2497 c gauss-laguerre weights
2498 c
2499 c abscissae and weights were evaluated with 100 decimal digit arithmetic.
2500 
2501  data xg( 1) / 7.0539889691 9887533666 8900458421 50958 d -2 /
2502  data xg( 2) / 3.7212681800 1611443794 2413887611 46636 d -1 /
2503  data xg( 3) / 9.1658210248 3273564667 7162770741 83187 d -1 /
2504  data xg( 4) / 1.7073065310 2834388068 7689667413 05070 d 0 /
2505  data xg( 5) / 2.7491992553 0943212964 5030460494 81338 d 0 /
2506  data xg( 6) / 4.0489253138 5088692237 4953369133 33219 d 0 /
2507  data xg( 7) / 5.6151749708 6161651410 4539885651 89234 d 0 /
2508  data xg( 8) / 7.4590174536 7106330976 8860218371 81759 d 0 /
2509  data xg( 9) / 9.5943928695 8109677247 3672734282 79837 d 0 /
2510  data xg( 10) / 1.2038802546 9643163096 2340929886 55158 d 1 /
2511  data xg( 11) / 1.4814293442 6307399785 1267971004 79756 d 1 /
2512  data xg( 12) / 1.7948895520 5193760173 6579099261 25096 d 1 /
2513  data xg( 13) / 2.1478788240 2850109757 3517036959 46692 d 1 /
2514  data xg( 14) / 2.5451702793 1869055035 1867748464 15418 d 1 /
2515  data xg( 15) / 2.9932554631 7006120067 1365613516 58232 d 1 /
2516  data xg( 16) / 3.5013434240 4790000062 8493590668 81395 d 1 /
2517  data xg( 17) / 4.0833057056 7285710620 2956770780 75526 d 1 /
2518  data xg( 18) / 4.7619994047 3465021399 4162715285 11211 d 1 /
2519  data xg( 19) / 5.5810795750 0638988907 5077344449 72356 d 1 /
2520  data xg( 20) / 6.6524416525 6157538186 4031879146 06659 d 1 /
2521 
2522  data wg( 1) / 1.8108006241 8989255451 6754059131 10644 d -1 /
2523  data wg( 2) / 4.2255676787 8563974520 3441725664 58197 d -1 /
2524  data wg( 3) / 6.6690954670 1848150373 4821149925 15927 d -1 /
2525  data wg( 4) / 9.1535237278 3073672670 6046847718 68067 d -1 /
2526  data wg( 5) / 1.1695397071 9554597380 1478222395 77476 d 0 /
2527  data wg( 6) / 1.4313549859 2820598636 8449948915 14331 d 0 /
2528  data wg( 7) / 1.7029811379 8502272402 5332616332 06720 d 0 /
2529  data wg( 8) / 1.9870158907 9274721410 9218392751 29020 d 0 /
2530  data wg( 9) / 2.2866357812 5343078546 2228546814 95651 d 0 /
2531  data wg( 10) / 2.6058347275 5383333269 4989509540 33323 d 0 /
2532  data wg( 11) / 2.9497837342 1395086600 2354168272 85951 d 0 /
2533  data wg( 12) / 3.3253957820 0931955236 9519374217 51118 d 0 /
2534  data wg( 13) / 3.7422554705 8981092111 7072932653 77811 d 0 /
2535  data wg( 14) / 4.2142367102 5188041986 8080637824 78746 d 0 /
2536  data wg( 15) / 4.7625184614 9020929695 2921978390 96371 d 0 /
2537  data wg( 16) / 5.4217260442 4557430380 3082979899 81779 d 0 /
2538  data wg( 17) / 6.2540123569 3242129289 5184903007 07542 d 0 /
2539  data wg( 18) / 7.3873143890 5443455194 0300191964 64791 d 0 /
2540  data wg( 19) / 9.1513287309 8747960794 3482425529 50528 d 0 /
2541  data wg( 20) / 1.2893388645 9399966710 2628712874 85278 d 1 /
2542 
2543 
2544 c list of major variables
2545 c -----------------------
2546 c absc - abscissa
2547 c fval* - function value
2548 c result - result of the 20-point gauss formula
2549 
2550  result = 0.0d0
2551  dresult = 0.0d0
2552  ddresult = 0.0d0
2553  do j=1,20
2554  absc = a+b*xg(j)
2555  call f(absc, par, n, fval, dfval, ddfval)
2556  result = result + fval*wg(j)
2557  dresult = dresult + dfval*wg(j)
2558  ddresult = ddresult + ddfval*wg(j)
2559  enddo
2560  result = result*b
2561  dresult = dresult*b
2562  ddresult = ddresult*b
2563  return
2564  end subroutine dqlag020
2565 
2566 
2567 
2568 
2569  subroutine dqlag040(f,a,b,result,dresult,ddresult,par,n)
2570  include 'implno.dek'
2571 c..
2572 c..20 point gauss-laguerre rule for the fermi-dirac function.
2573 c..on input f is the external function defining the integrand
2574 c..f(x)=g(x)*w(x), where w(x) is the gaussian weight
2575 c..w(x)=dexp(-(x-a)/b) and g(x) a smooth function,
2576 c..a is the lower end point of the interval, b is the higher end point,
2577 c..par is an array of constant parameters to be passed to the function f,
2578 c..and n is the length of the par array. on output result is the
2579 c..approximation from applying the 20-point gauss-laguerre rule.
2580 c..since the number of nodes is even, zero is not an abscissa.
2581 c..
2582 c..declare
2583  external f
2584  integer j,n
2585  double precision a,b,result,dresult,ddresult,par(n),
2586  1 absc,wg(40),xg(40),fval,dfval,ddfval
2587 
2588 
2589 c the abscissae and weights are given for the interval (0,+inf).
2590 c xg - abscissae of the 20-point gauss-laguerre rule
2591 c wg - weights of the 20-point gauss rule. since f yet
2592 c includes the weight function, the values in wg
2593 c are actually exp(xg) times the standard
2594 c gauss-laguerre weights
2595 c
2596 c abscissae and weights were evaluated with 100 decimal digit arithmetic.
2597 
2598  data xg( 1) / 3.5700394308 8883851220 8447128660 08554 d -2 /
2599  data xg( 2) / 1.8816228315 8698516003 5893462190 95913 d -1 /
2600  data xg( 3) / 4.6269428131 4576453564 9375245611 90364 d -1 /
2601  data xg( 4) / 8.5977296397 2934922257 2722246887 22412 d -1 /
2602  data xg( 5) / 1.3800108205 2733718649 8000329595 26559 d 0 /
2603  data xg( 6) / 2.0242091359 2282673344 2066002800 13075 d 0 /
2604  data xg( 7) / 2.7933693535 0681645765 3514486026 64039 d 0 /
2605  data xg( 8) / 3.6887026779 0827020959 1526351908 68698 d 0 /
2606  data xg( 9) / 4.7116411465 5497269361 8722836277 47369 d 0 /
2607  data xg( 10) / 5.8638508783 4371811427 3164237995 82987 d 0 /
2608  data xg( 11) / 7.1472479081 0228825068 5691951979 42362 d 0 /
2609  data xg( 12) / 8.5640170175 8616376271 8522042088 13232 d 0 /
2610  data xg( 13) / 1.0116634048 4519394068 4962965639 52448 d 1 /
2611  data xg( 14) / 1.1807892294 0045848428 4158670436 06304 d 1 /
2612  data xg( 15) / 1.3640933712 5370872283 7167636065 01202 d 1 /
2613  data xg( 16) / 1.5619285893 3390738372 0196365218 80145 d 1 /
2614  data xg( 17) / 1.7746905950 0956630425 7387749542 43772 d 1 /
2615  data xg( 18) / 2.0028232834 5748905296 1261481017 51172 d 1 /
2616  data xg( 19) / 2.2468249983 4984183513 7178622899 45366 d 1 /
2617  data xg( 20) / 2.5072560772 4262037943 9608620940 09769 d 1 /
2618  data xg( 21) / 2.7847480009 1688627207 5170414045 57997 d 1 /
2619  data xg( 22) / 3.0800145739 4454627007 5438519619 11114 d 1 /
2620  data xg( 23) / 3.3938657084 9137196090 9885858628 19990 d 1 /
2621  data xg( 24) / 3.7272245880 4760043283 2076099060 74207 d 1 /
2622  data xg( 25) / 4.0811492823 8869204661 5567558160 06426 d 1 /
2623  data xg( 26) / 4.4568603175 3344627071 2302063449 83559 d 1 /
2624  data xg( 27) / 4.8557763533 0599922809 6204880670 67936 d 1 /
2625  data xg( 28) / 5.2795611187 2169329693 5202113739 17638 d 1 /
2626  data xg( 29) / 5.7301863323 3936274950 3374699589 21651 d 1 /
2627  data xg( 30) / 6.2100179072 7751116121 6819905789 89921 d 1 /
2628  data xg( 31) / 6.7219370927 1269987990 8027755188 87054 d 1 /
2629  data xg( 32) / 7.2695158847 6124621175 2192772426 19385 d 1 /
2630  data xg( 33) / 7.8572802911 5713092805 4389683348 12596 d 1 /
2631  data xg( 34) / 8.4911231135 7049845427 0156470966 63186 d 1 /
2632  data xg( 35) / 9.1789874671 2363769923 3719348062 73153 d 1 /
2633  data xg( 36) / 9.9320808717 4468082501 0905416548 68123 d 1 /
2634  data xg( 37) / 1.0767244063 9388272520 7967676113 22664 d 2 /
2635  data xg( 38) / 1.1712230951 2690688807 6506441235 50702 d 2 /
2636  data xg( 39) / 1.2820184198 8255651192 5411043896 31263 d 2 /
2637  data xg( 40) / 1.4228004446 9159997888 3488353595 41764 d 2 /
2638 
2639  data wg( 1) / 9.1625471157 4598973115 1169808013 74830 d -2 /
2640  data wg( 2) / 2.1342058490 5012080007 1933671215 12341 d -1 /
2641  data wg( 3) / 3.3571811668 0284673880 5107016162 92191 d -1 /
2642  data wg( 4) / 4.5854093503 3497560385 4323803764 52497 d -1 /
2643  data wg( 5) / 5.8206816577 9105168990 9963654015 43283 d -1 /
2644  data wg( 6) / 7.0649521636 7219392989 8300156730 16682 d -1 /
2645  data wg( 7) / 8.3202690300 3485238099 1129479783 49523 d -1 /
2646  data wg( 8) / 9.5887819879 4443111448 1226796760 28906 d -1 /
2647  data wg( 9) / 1.0872761620 3054971575 3869333172 02661 d 0 /
2648  data wg( 10) / 1.2174623279 7778097895 4277850665 60948 d 0 /
2649  data wg( 11) / 1.3496954913 5676530792 3938594423 94519 d 0 /
2650  data wg( 12) / 1.4842549297 7684671120 5611786129 78719 d 0 /
2651  data wg( 13) / 1.6214441628 1182197802 3168843164 54527 d 0 /
2652  data wg( 14) / 1.7615953746 7676961118 4242204209 81598 d 0 /
2653  data wg( 15) / 1.9050746658 9479967668 2993205972 79371 d 0 /
2654  data wg( 16) / 2.0522883472 6171671760 1995822729 47454 d 0 /
2655  data wg( 17) / 2.2036905532 4509588909 8283443281 40570 d 0 /
2656  data wg( 18) / 2.3597925385 2320332354 0373753789 01497 d 0 /
2657  data wg( 19) / 2.5211741403 7643299165 3136902874 22820 d 0 /
2658  data wg( 20) / 2.6884980554 0884226415 9505447063 74659 d 0 /
2659  data wg( 21) / 2.8625278132 1044881203 4763959831 04311 d 0 /
2660  data wg( 22) / 3.0441506653 1151710041 0439679543 33670 d 0 /
2661  data wg( 23) / 3.2344070972 6353194177 4902394288 67111 d 0 /
2662  data wg( 24) / 3.4345293984 2774809220 3984818916 02464 d 0 /
2663  data wg( 25) / 3.6459928249 9408907238 9656466994 90434 d 0 /
2664  data wg( 26) / 3.8705845972 1651656808 4753202134 44338 d 0 /
2665  data wg( 27) / 4.1104986804 3282265583 5822472639 51577 d 0 /
2666  data wg( 28) / 4.3684687232 5406347450 8083382729 45025 d 0 /
2667  data wg( 29) / 4.6479589840 7446688299 3033998838 83991 d 0 /
2668  data wg( 30) / 4.9534461124 0989326218 6961507855 62721 d 0 /
2669  data wg( 31) / 5.2908484059 0073657468 7373657188 58968 d 0 /
2670  data wg( 32) / 5.6682046090 3297677000 7305290232 63795 d 0 /
2671  data wg( 33) / 6.0967964147 4342030593 3760108591 98806 d 0 /
2672  data wg( 34) / 6.5931088610 3999953794 4296642062 94899 d 0 /
2673  data wg( 35) / 7.1824959955 3689315064 4298016266 99574 d 0 /
2674  data wg( 36) / 7.9066663113 8422877369 3107423105 86595 d 0 /
2675  data wg( 37) / 8.8408924928 1034652079 1255950630 26792 d 0 /
2676  data wg( 38) / 1.0140899265 6211694839 0946003069 40468 d 1 /
2677  data wg( 39) / 1.2210021299 2046038985 2264858758 81108 d 1 /
2678  data wg( 40) / 1.6705520642 0242974052 4687743985 73553 d 1 /
2679 
2680 
2681 c list of major variables
2682 c -----------------------
2683 c absc - abscissa
2684 c fval* - function value
2685 c result - result of the 20-point gauss formula
2686 
2687 
2688  result = 0.0d0
2689  dresult = 0.0d0
2690  ddresult = 0.0d0
2691  do j=1,40
2692  absc = a+b*xg(j)
2693  call f(absc, par, n, fval, dfval, ddfval)
2694  result = result + fval*wg(j)
2695  dresult = dresult + dfval*wg(j)
2696  ddresult = ddresult + ddfval*wg(j)
2697  enddo
2698  result = result*b
2699  dresult = dresult*b
2700  ddresult = ddresult*b
2701  return
2702  end subroutine dqlag040
2703 
2704 
2705 
2706 
2707 
2708  subroutine dqlag080(f,a,b,result,dresult,ddresult,par,n)
2709  include 'implno.dek'
2710 c..
2711 c..20 point gauss-laguerre rule for the fermi-dirac function.
2712 c..on input f is the external function defining the integrand
2713 c..f(x)=g(x)*w(x), where w(x) is the gaussian weight
2714 c..w(x)=dexp(-(x-a)/b) and g(x) a smooth function,
2715 c..a is the lower end point of the interval, b is the higher end point,
2716 c..par is an array of constant parameters to be passed to the function f,
2717 c..and n is the length of the par array. on output result is the
2718 c..approximation from applying the 20-point gauss-laguerre rule.
2719 c..since the number of nodes is even, zero is not an abscissa.
2720 c..
2721 c..declare
2722  external f
2723  integer j,n
2724  double precision a,b,result,dresult,ddresult,par(n),
2725  1 absc,wg(80),xg(80),fval,dfval,ddfval
2726 
2727 
2728 c the abscissae and weights are given for the interval (0,+inf).
2729 c xg - abscissae of the 20-point gauss-laguerre rule
2730 c wg - weights of the 20-point gauss rule. since f yet
2731 c includes the weight function, the values in wg
2732 c are actually exp(xg) times the standard
2733 c gauss-laguerre weights
2734 c
2735 c abscissae and weights were evaluated with 100 decimal digit arithmetic.
2736 
2737  data xg( 1) / 1.7960423300 6983655540 1031924740 16803 d -2 /
2738  data xg( 2) / 9.4639912994 3539888113 9027246521 72943 d -2 /
2739  data xg( 3) / 2.3262286812 5867569207 7061572163 49831 d -1 /
2740  data xg( 4) / 4.3199254780 2387480255 7861724977 70411 d -1 /
2741  data xg( 5) / 6.9282886135 2021839905 7022136354 46867 d -1 /
2742  data xg( 6) / 1.0152325561 8947143744 6254368599 35350 d 0 /
2743  data xg( 7) / 1.3993276878 4287277414 4190514309 78382 d 0 /
2744  data xg( 8) / 1.8452623038 3584513811 1771177695 99966 d 0 /
2745  data xg( 9) / 2.3532088716 0926152447 2447080161 40181 d 0 /
2746  data xg( 10) / 2.9233646865 5542632483 6912342597 32862 d 0 /
2747  data xg( 11) / 3.5559523140 4613405944 9673083246 38370 d 0 /
2748  data xg( 12) / 4.2512200823 0987808316 4857664485 77637 d 0 /
2749  data xg( 13) / 5.0094426336 2016477243 3677068182 06389 d 0 /
2750  data xg( 14) / 5.8309215386 0871901982 1271132956 05083 d 0 /
2751  data xg( 15) / 6.7159859778 5131711156 5500876351 99430 d 0 /
2752  data xg( 16) / 7.6649934948 9177306073 4189090478 23480 d 0 /
2753  data xg( 17) / 8.6783308251 6770109543 4422555426 61083 d 0 /
2754  data xg( 18) / 9.7564148057 4293071316 5509446173 66591 d 0 /
2755  data xg( 19) / 1.0899693371 2878553774 3610010214 89406 d 1 /
2756  data xg( 20) / 1.2108646642 3656999007 0548486983 15593 d 1 /
2757  data xg( 21) / 1.3383788112 7786473701 6298406038 33297 d 1 /
2758  data xg( 22) / 1.4725665943 5085855393 3580762618 38437 d 1 /
2759  data xg( 23) / 1.6134864371 6624665791 6585454289 90907 d 1 /
2760  data xg( 24) / 1.7612005243 8144378598 6356869435 86520 d 1 /
2761  data xg( 25) / 1.9157749684 2412479221 7299702056 74985 d 1 /
2762  data xg( 26) / 2.0772799909 7920960924 4193790104 89579 d 1 /
2763  data xg( 27) / 2.2457901204 5404583114 0959169508 77516 d 1 /
2764  data xg( 28) / 2.4213844068 9586473771 9224693924 47092 d 1 /
2765  data xg( 29) / 2.6041466560 1655866929 3900535654 35682 d 1 /
2766  data xg( 30) / 2.7941656841 8594655558 2330692936 92111 d 1 /
2767  data xg( 31) / 2.9915355964 9009855011 2704121157 37715 d 1 /
2768  data xg( 32) / 3.1963560902 2089207107 7488875426 36533 d 1 /
2769  data xg( 33) / 3.4087327864 7261898749 8349473428 60505 d 1 /
2770  data xg( 34) / 3.6287775928 7814544588 0319884362 16948 d 1 /
2771  data xg( 35) / 3.8566091009 2922104582 5630521729 08535 d 1 /
2772  data xg( 36) / 4.0923530218 0312671999 0958505955 44326 d 1 /
2773  data xg( 37) / 4.3361426651 7312302957 8267604682 19500 d 1 /
2774  data xg( 38) / 4.5881194661 2788863456 2664899748 78378 d 1 /
2775  data xg( 39) / 4.8484335660 8331891358 7372733535 63006 d 1 /
2776  data xg( 40) / 5.1172444544 6070105959 8894323349 07144 d 1 /
2777  data xg( 41) / 5.3947216789 5544471206 2102787875 72430 d 1 /
2778  data xg( 42) / 5.6810456334 6362231341 2485032441 02122 d 1 /
2779  data xg( 43) / 5.9764084342 1099549427 2959612774 71927 d 1 /
2780  data xg( 44) / 6.2810148963 9264772036 2729175902 88682 d 1 /
2781  data xg( 45) / 6.5950836257 4560573434 6406271607 92248 d 1 /
2782  data xg( 46) / 6.9188482420 2362773741 9802886482 37373 d 1 /
2783  data xg( 47) / 7.2525587544 2633453588 3896526165 68450 d 1 /
2784  data xg( 48) / 7.5964831127 8641748269 4497949747 96502 d 1 /
2785  data xg( 49) / 7.9509089629 0888369620 5728262599 80809 d 1 /
2786  data xg( 50) / 8.3161456401 0536896630 4295068758 48705 d 1 /
2787  data xg( 51) / 8.6925264419 6156234481 1659260404 48396 d 1 /
2788  data xg( 52) / 9.0804112300 9407559518 4117278203 18427 d 1 /
2789  data xg( 53) / 9.4801894215 9474332072 0718891387 35302 d 1 /
2790  data xg( 54) / 9.8922834446 9405791648 0193727380 36790 d 1 /
2791  data xg( 55) / 1.0317152750 8039130233 0470941673 45654 d 2 /
2792  data xg( 56) / 1.0755298497 7539906327 6078907989 75954 d 2 /
2793  data xg( 57) / 1.1207269048 4128333623 9300461662 11013 d 2 /
2794  data xg( 58) / 1.1673666467 3503666318 1578881308 01099 d 2 /
2795  data xg( 59) / 1.2155154249 0952625566 8638957521 10813 d 2 /
2796  data xg( 60) / 1.2652466579 6515540341 5702654316 53573 d 2 /
2797  data xg( 61) / 1.3166419525 2120310870 0890863080 06192 d 2 /
2798  data xg( 62) / 1.3697924668 6936973947 5706372894 63788 d 2 /
2799  data xg( 63) / 1.4248005891 2161601930 8265692004 55232 d 2 /
2800  data xg( 64) / 1.4817820245 5004441818 6523848360 07732 d 2 /
2801  data xg( 65) / 1.5408684228 1798697859 4174252655 96259 d 2 /
2802  data xg( 66) / 1.6022107287 0095715935 2684168930 10646 d 2 /
2803  data xg( 67) / 1.6659835193 4053918744 5211797337 12213 d 2 /
2804  data xg( 68) / 1.7323907133 4249503830 9065037750 56999 d 2 /
2805  data xg( 69) / 1.8016732304 9032317982 4302089977 01523 d 2 /
2806  data xg( 70) / 1.8741194967 6963772390 4901345880 21771 d 2 /
2807  data xg( 71) / 1.9500802244 1532991450 3904796005 99643 d 2 /
2808  data xg( 72) / 2.0299898419 5074937824 8076778237 14777 d 2 /
2809  data xg( 73) / 2.1143987049 4836466691 4849046955 42608 d 2 /
2810  data xg( 74) / 2.2040236815 1735739654 0442066777 63168 d 2 /
2811  data xg( 75) / 2.2998320607 5680004348 4109696758 44754 d 2 /
2812  data xg( 76) / 2.4031908705 5841540417 5974604792 19628 d 2 /
2813  data xg( 77) / 2.5161587933 0499611167 4449393109 73194 d 2 /
2814  data xg( 78) / 2.6421382388 3199102097 6961086914 35553 d 2 /
2815  data xg( 79) / 2.7876673304 6004563652 0141725306 11597 d 2 /
2816  data xg( 80) / 2.9696651199 5651345758 8528591557 03581 d 2 /
2817 
2818  data wg( 1) / 4.6093103133 0609664705 2513213955 10083 d -2 /
2819  data wg( 2) / 1.0731300778 3932752564 1503203043 98860 d -1 /
2820  data wg( 3) / 1.6866442954 7948111794 2204577827 02406 d -1 /
2821  data wg( 4) / 2.3008808938 4940054411 2571819781 93282 d -1 /
2822  data wg( 5) / 2.9160130250 2437964832 1693187729 43752 d -1 /
2823  data wg( 6) / 3.5322675357 5408236352 7231258056 47046 d -1 /
2824  data wg( 7) / 4.1498817755 0940466187 1976863112 80092 d -1 /
2825  data wg( 8) / 4.7690979230 2936241314 7770254185 05661 d -1 /
2826  data wg( 9) / 5.3901621847 4955374499 5076565223 27912 d -1 /
2827  data wg( 10) / 6.0133249744 7190529086 7652488407 39512 d -1 /
2828  data wg( 11) / 6.6388413639 6680571849 4422407272 99214 d -1 /
2829  data wg( 12) / 7.2669716361 4156688973 5672962491 40514 d -1 /
2830  data wg( 13) / 7.8979818942 8428531349 7930783987 88294 d -1 /
2831  data wg( 14) / 8.5321447143 8152298354 5981624313 62968 d -1 /
2832  data wg( 15) / 9.1697398383 3892698590 3429000315 53302 d -1 /
2833  data wg( 16) / 9.8110549100 4005747195 0601559842 18607 d -1 /
2834  data wg( 17) / 1.0456386258 0654218147 5684456631 76029 d 0 /
2835  data wg( 18) / 1.1106039730 0025890771 1247632597 29371 d 0 /
2836  data wg( 19) / 1.1760331584 1226175056 6510765192 08666 d 0 /
2837  data wg( 20) / 1.2419589444 9809359279 3517618178 71338 d 0 /
2838  data wg( 21) / 1.3084153330 3134064261 1885428459 54645 d 0 /
2839  data wg( 22) / 1.3754376757 4892843813 1559170934 90796 d 0 /
2840  data wg( 23) / 1.4430627938 7849270398 3124172072 47308 d 0 /
2841  data wg( 24) / 1.5113291075 8830693847 6550205599 17703 d 0 /
2842  data wg( 25) / 1.5802767765 3099415830 2018787231 21659 d 0 /
2843  data wg( 26) / 1.6499478528 0267874116 0120428193 55036 d 0 /
2844  data wg( 27) / 1.7203864478 1283277182 0042814522 90770 d 0 /
2845  data wg( 28) / 1.7916389147 6093832891 4426205276 88915 d 0 /
2846  data wg( 29) / 1.8637540486 4909708435 9257090286 88162 d 0 /
2847  data wg( 30) / 1.9367833060 3070923513 9254343278 41646 d 0 /
2848  data wg( 31) / 2.0107810470 1134222912 6149881755 55546 d 0 /
2849  data wg( 32) / 2.0858048023 8741046429 3039785129 89079 d 0 /
2850  data wg( 33) / 2.1619155692 4159897378 3163440488 27763 d 0 /
2851  data wg( 34) / 2.2391781388 2364652373 4539974474 45645 d 0 /
2852  data wg( 35) / 2.3176614611 4651854068 6060480434 96370 d 0 /
2853  data wg( 36) / 2.3974390514 4001430514 1172386388 49980 d 0 /
2854  data wg( 37) / 2.4785894444 4973417756 3691644552 22527 d 0 /
2855  data wg( 38) / 2.5611967035 7790455335 1155092225 72643 d 0 /
2856  data wg( 39) / 2.6453509930 6968892850 4634410003 67534 d 0 /
2857  data wg( 40) / 2.7311492228 9915138861 4102871311 69260 d 0 /
2858  data wg( 41) / 2.8186957777 5934171703 1418737478 11157 d 0 /
2859  data wg( 42) / 2.9081033436 8223018934 5502767774 92687 d 0 /
2860  data wg( 43) / 2.9994938483 9685626832 4124518299 68724 d 0 /
2861  data wg( 44) / 3.0929995346 9357468116 6951083530 33660 d 0 /
2862  data wg( 45) / 3.1887641899 4712376429 3652715016 23466 d 0 /
2863  data wg( 46) / 3.2869445597 5337531998 3781070122 16956 d 0 /
2864  data wg( 47) / 3.3877119796 0397652334 0549087621 54571 d 0 /
2865  data wg( 48) / 3.4912542659 8732012281 7324237827 64895 d 0 /
2866  data wg( 49) / 3.5977779176 9613046096 2947301749 02943 d 0 /
2867  data wg( 50) / 3.7075106900 1745708341 0271556592 28179 d 0 /
2868  data wg( 51) / 3.8207046196 5311695152 0299594304 67622 d 0 /
2869  data wg( 52) / 3.9376395977 1430720676 8005406573 30923 d 0 /
2870  data wg( 53) / 4.0586276133 8354481597 4201161879 88679 d 0 /
2871  data wg( 54) / 4.1840178238 1424031850 6076923345 03121 d 0 /
2872  data wg( 55) / 4.3142026492 9613425820 0845732179 87912 d 0 /
2873  data wg( 56) / 4.4496251505 3655906604 9828201553 77774 d 0 /
2874  data wg( 57) / 4.5907880226 3617511042 9598491489 29810 d 0 /
2875  data wg( 58) / 4.7382646459 8929537394 7538735058 38770 d 0 /
2876  data wg( 59) / 4.8927127796 6692168696 8869367432 83567 d 0 /
2877  data wg( 60) / 5.0548916853 4039512820 5725071351 75938 d 0 /
2878  data wg( 61) / 5.2256837559 4272391089 2780101660 22467 d 0 /
2879  data wg( 62) / 5.4061221337 9727909853 3235123407 17863 d 0 /
2880  data wg( 63) / 5.5974264018 4041404016 5536941589 80053 d 0 /
2881  data wg( 64) / 5.8010493213 7643943530 6261624553 94841 d 0 /
2882  data wg( 65) / 6.0187389387 8099108768 0151515140 26344 d 0 /
2883  data wg( 66) / 6.2526224749 1437403092 9342134800 91928 d 0 /
2884  data wg( 67) / 6.5053217351 7668675787 4827196636 96133 d 0 /
2885  data wg( 68) / 6.7801152120 0777294201 2873479800 59368 d 0 /
2886  data wg( 69) / 7.0811712202 5414518776 1743119167 59402 d 0 /
2887  data wg( 70) / 7.4138924461 5305421421 6956062266 87752 d 0 /
2888  data wg( 71) / 7.7854415484 1612700386 2327403392 30532 d 0 /
2889  data wg( 72) / 8.2055734781 4596472333 9050861009 17119 d 0 /
2890  data wg( 73) / 8.6880138399 6161871469 4199580582 55237 d 0 /
2891  data wg( 74) / 9.2528697341 5578523923 5565062019 79918 d 0 /
2892  data wg( 75) / 9.9311447184 0215736008 3709865340 09772 d 0 /
2893  data wg( 76) / 1.0773973641 4646829405 7508435229 90655 d 1 /
2894  data wg( 77) / 1.1873891246 5097447081 9508877108 77400 d 1 /
2895  data wg( 78) / 1.3422885849 7264236139 7349401540 89734 d 1 /
2896  data wg( 79) / 1.5919780161 6897924449 5542522001 85978 d 1 /
2897  data wg( 80) / 2.1421454296 4372259537 5210361864 15127 d 1 /
2898 
2899 
2900 c list of major variables
2901 c -----------------------
2902 c absc - abscissa
2903 c fval* - function value
2904 c result - result of the 20-point gauss formula
2905 
2906  result = 0.0d0
2907  dresult = 0.0d0
2908  ddresult = 0.0d0
2909  do j=1,80
2910  absc = a+b*xg(j)
2911  call f(absc, par, n, fval, dfval, ddfval)
2912  result = result + fval*wg(j)
2913  dresult = dresult + dfval*wg(j)
2914  ddresult = ddresult + ddfval*wg(j)
2915  enddo
2916  result = result*b
2917  dresult = dresult*b
2918  ddresult = ddresult*b
2919  return
2920  end subroutine dqlag080
coulomb
subroutine coulomb(den, temp, abar, zbar, pion, dpiondd, dpiondt, dpionda, dpiondz, xne, dxnedd, dxnedt, dxneda, dxnedz, plasg, pcoul, dpcouldd, dpcouldt, dpcoulda, dpcouldz, ecoul, decouldd, decouldt, decoulda, decouldz, scoul, dscouldd, dscouldt, dscoulda, dscouldz)
Definition: eosfxt.f:1501
xneroot
subroutine xneroot(mode, den, temp, abar, zbar, ionized, aa, f, df, etaele, detadd, detadt, detada, detadz, etapos, zeff, xne, dxnedd, dxnedt, dxneda, dxnedz, xnefer, dxneferdd, dxneferdt, dxneferda, dxneferdz, xnpfer, dxnpferdd, dxnpferdt, dxnpferda, dxnpferdz, pele, dpeledd, dpeledt, dpeleda, dpeledz, ppos, dpposdd, dpposdt, dpposda, dpposdz, pep, dpepdd, dpepdt, dpepda, dpepdz, eele, deeledd, deeledt, deeleda, deeledz, epos, deposdd, deposdt, deposda, deposdz, eep, deepdd, deepdt, deepda, deepdz, sele, dseledd, dseledt, dseleda, dseledz, spos, dsposdd, dsposdt, dsposda, dsposdz, sep, dsepdd, dsepdt, dsepda, dsepdz, potmult, eip, deipdd, deipdt, deipda, deipdz, sip, dsipdd, dsipdt, dsipda, dsipdz)
Definition: eosfxt.f:971
dqlag020
subroutine dqlag020(f, a, b, result, dresult, ddresult, par, n)
Definition: eosfxt.f:2473
dqleg010
subroutine dqleg010(f, a, b, result, dresult, ddresult, par, n)
Definition: eosfxt.f:1982
fdfunc2
subroutine fdfunc2(x, par, n, fd, fdeta, fdtheta)
Definition: eosfxt.f:1935
dqlag010
subroutine dqlag010(f, a, b, result, dresult, ddresult, par, n)
Definition: eosfxt.f:2395
dqlag080
subroutine dqlag080(f, a, b, result, dresult, ddresult, par, n)
Definition: eosfxt.f:2709
eosfxt
subroutine eosfxt
Definition: eosfxt.f:13
dqleg040
subroutine dqleg040(f, a, b, result, dresult, ddresult, par, n)
Definition: eosfxt.f:2142
dqlag040
subroutine dqlag040(f, a, b, result, dresult, ddresult, par, n)
Definition: eosfxt.f:2570
fdfunc1
subroutine fdfunc1(x, par, n, fd, fdeta, fdtheta)
Definition: eosfxt.f:1890
dfermi
subroutine dfermi(dk, eta, theta, fd, fdeta, fdtheta)
Definition: eosfxt.f:1777
dqleg020
subroutine dqleg020(f, a, b, result, dresult, ddresult, par, n)
Definition: eosfxt.f:2055
etages
subroutine etages(xni, zbar, temp, eta)
Definition: eosfxt.f:1673
pi
real(r_kind) function pi()
Further information: http://netlib.org/quadpack/index.html https://orion.math.iastate....
Definition: quadpack_module.f90:193
dqleg080
subroutine dqleg080(f, a, b, result, dresult, ddresult, par, n)
Definition: eosfxt.f:2248