-
Notifications
You must be signed in to change notification settings - Fork 6
/
eosfxt.f90
5046 lines (4171 loc) · 166 KB
/
eosfxt.f90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
program teos
include 'implno.dek'
include 'vector_eos.dek'
! tests the eos routine
!
! ionmax = number of isotopes in the network
! xmass = mass fraction of isotope i
! aion = number of nucleons in isotope i
! zion = number of protons in isotope i
integer ionmax
parameter (ionmax=3)
double precision xmass(ionmax),aion(ionmax),zion(ionmax),temp,den,abar,zbar
! set the mass fractions, z's and a's of the composition
! hydrogen, heliu, and carbon
xmass(1) = 0.75d0 ; aion(1) = 1.0d0 ; zion(1) = 1.0d0
xmass(2) = 0.23d0 ; aion(2) = 4.0d0 ; zion(2) = 2.0d0
xmass(3) = 0.02d0 ; aion(3) = 12.0d0 ; zion(3) = 6.0d0
! average atomic weight and charge
abar = 1.0d0/sum(xmass(1:ionmax)/aion(1:ionmax))
zbar = abar * sum(xmass(1:ionmax) * zion(1:ionmax)/aion(1:ionmax))
! set the input vector. pipeline is only 1 element long
temp_row(1) = 1.0d8 ; den_row(1) = 1.0d6 ; abar_row(1) = abar ; zbar_row(1) = zbar
jlo_eos = 1 ; jhi_eos = 1
! call the eos
call eosfxt
! write out the results
call pretty_eos_out('eosfxt: ')
end
!
! this file contains
! timmes eos: eosfxt
! routine xneroot does electron-positron thermodynamics
! routine coulomb implments coulomb corrections
! routine etages makes a good guess for the electron chemical potential
subroutine eosfxt
include 'implno.dek'
include 'const.dek'
include 'vector_eos.dek'
! given a temperature temp [K], density den [g/cm**3], and a composition
! characterized by abar (average weight) and zbar (average charge),
! this routine returns all the other thermodynamic quantities.
! of interest is the pressure [erg/cm**3], specific thermal energy [erg/gr],
! the entropy [erg/g/K], with their derivatives with respect to temperature,
! density, abar, and zbar.
! other quantites such the normalized chemical potential eta (plus its
! derivatives), number density of electrons and positron pair (along
! with their derivatives), adiabatic indices, specific heats, and
! relativistically correct sound speed are also returned.
! this routine assumes planckian photons, an ideal gas of ions,
! and an electron-positron gas with an arbitrary degree of relativity
! and degeneracy. the full fermi-dirac integrals and their derivatives
! with respect to eta and beta are computed to machine precision, and
! all other derivatives are analytic.
! references: cox & giuli (c&g) chapter 24,
! timmes & arnett, apj supp. 125, 277, 1999
! timmes & swesty, apj supp. 126, 501, 2000
! bring in the dictionary
! a dictionary of terms used:
! this routine has now been pipelined.
! all the input and output variables are in the file vector_eos.dek.
! the vector name is the scaler name appended with an "_row",
! for example, temp_row(i), den_row(i), and so on.
! input:
! temp = temperature
! den = density
! abar = average number of nucleons per nuclei
! zbar = average number of protons per nuclei
! output:
! pres = total pressure
! dpresdd = derivative of total pressure with respect to density
! dpresdt = derivative of total pressure with respect to temperature
! dpresda = derivative of total pressure with respect to abar
! dpresdz = derivative of total pressure with respect to zbar
! ener = total internal energy
! denerdd = derivative of total energy with respect to density
! denerdt = derivative of total energy with respect to temperature
! denerda = derivative of total energy with respect to abar
! denerdz = derivative of total energy with respect to zbar
! entr = total entropy
! dentrdd = derivative of total entropy with respect to density
! dentrdt = derivative of total entropy with respect to temperature
! dentrda = derivative of total entropy with respect to abar
! dentrdz = derivative of total entropy with respect to zbar
! prad = radiation pressure
! dpraddd = derivative of the radiation pressure with density
! dpraddt = derivative of the radiation pressure with temperature
! dpradda = derivative of the radiation pressure with abar
! dpraddz = derivative of the radiation pressure with zbar
! erad = radiation energy
! deraddd = derivative of the radiation energy with density
! deraddt = derivative of the radiation energy with temperature
! deradda = derivative of the radiation energy with abar
! deraddz = derivative of the radiation energy with zbar
! srad = radiation entropy
! dsraddd = derivative of the radiation entropy with density
! dsraddt = derivative of the radiation entropy with temperature
! dsradda = derivative of the radiation entropy with abar
! dsraddz = derivative of the radiation entropy with zbar
! radmult = radiation multiplier (useful for turning radiation off/on)
! xni = number density of ions
! dxnidd = derivative of the ion number density with density
! dxnidt = derivative of the ion number density with temperature
! dxnida = derivative of the ion number density with abar
! dxnidz = derivative of the ion number density with zbar
! pion = ion pressure
! dpiondd = derivative of the ion pressure with density
! dpiondt = derivative of the ion pressure with temperature
! dpionda = derivative of the ion pressure with abar
! dpiondz = derivative of the ion pressure with zbar
! eion = ion energy
! deiondd = derivative of the ion energy with density
! deiondt = derivative of the ion energy with temperature
! deionda = derivative of the ion energy with abar
! deiondz = derivative of the ion energy with zbar
! sion = ion entropy
! dsiondd = derivative of the ion entropy with density
! dsiondt = derivative of the ion entropy with temperature
! dsionda = derivative of the ion entropy with abar
! dsiondz = derivative of the ion entropy with zbar
! ionmult = ion multiplier (useful for turning ions off/on)
! etaele = electron chemical potential
! detadd = derivative of the electron chem potential with density
! detadt = derivative of the electron chem potential with temperature
! detada = derivative of the electron chem potential with abar
! detadz = derivative of the electron chem potential with zbar
! etapos = positron degeneracy parameter
! xne = number density of electrons
! dxnedd = derivative of the electron number density with density
! dxnedt = derivative of the electron number density with temperature
! dxneda = derivative of the electron number density with abar
! dxnedz = derivative of the electron number density with zbar
! xnefer = fermi integral electron number density
! dxneferdd = derivative of the fermi electron number density with density
! dxneferdt = derivative of the fermi electron number density with temperature
! dxneferda = derivative of the fermi electron number density with abar
! dxneferdz = derivative of the fermi electron number density with zbar
! xnpfer = fermi integral positron number density
! dxnpferdd = derivative of the fermi positron number density with density
! dxnpferdt = derivative of the fermi positron number density with temperature
! dxnpferda = derivative of the fermi positron number density with abar
! dxnpferdz = derivative of the fermi positron number density with zbar
! pele = electron pressure
! dpeledd = derivative of the electron pressure with density
! dpeledt = derivative of the electron pressure with temperature
! dpeleda = derivative of the electron pressure with abar
! dpeledz = derivative of the electron pressure with zbar
! eele = electron energy
! deeledd = derivative of the electron energy with density
! deeledt = derivative of the electron energy with temperature
! deeleda = derivative of the electron energy with abar
! deeledz = derivative of the electron energy with zbar
! sele = electron entropy
! dseledd = derivative of the electron entropy with density
! dseledt = derivative of the electron entropy with temperature
! dseleda = derivative of the electron entropy with abar
! dseledz = derivative of the electron entropy with zbar
! ppos = positron pressure
! dpposdd = derivative of the positron pressure with density
! dpposdt = derivative of the positron pressure with temperature
! dpposda = derivative of the positron pressure with abar
! dpposdz = derivative of the positron pressure with zbar
! epos = electron energy
! deposdd = derivative of the positron energy with density
! deposdt = derivative of the positron energy with temperature
! deposda = derivative of the positron energy with abar
! deposdz = derivative of the positron energy with zbar
! spos = electron entropy
! dsposdd = derivative of the positron entropy with density
! dsposdt = derivative of the positron entropy with temperature
! dsposda = derivative of the positron entropy with abar
! dsposdz = derivative of the positron entropy with zbar
! pep = electron + positron pressure
! dpepdd = derivative of the electron+positron pressure with density
! dpepdt = derivative of the electron+positron pressure with temperature
! dpepda = derivative of the electron+positron pressure with abar
! dpepdz = derivative of the electron+positron pressure with zbar
! eep = electron + positron energy
! deepdd = derivative of the electron+positron energy with density
! deepdt = derivative of the electron+positron energy with temperature
! deepda = derivative of the electron+positron energy with abar
! deepdz = derivative of the electron+positron energy with zbar
! sep = electron + positron entropy
! dsepdd = derivative of the electron+positron entropy with density
! dsepdt = derivative of the electron+positron entropy with temperature
! dsepda = derivative of the electron+positron entropy with abar
! dsepdz = derivative of the electron+positron entropy with zbar
! elemult = electron multiplier (useful for turning e-e+ off/on)
! eip = ionization potential ennergy
! deipdd = derivative of ionization energy with density
! deipdt = derivative of ionization energy with temperature
! deipda = derivative of ionization energy with abar
! deipdz = derivative of ionization energy with zbar
! sip = ionization potential ennergy
! dsipdd = derivative of ionization energy with density
! dsipdt = derivative of ionization energy with temperature
! dsipda = derivative of ionization energy with abar
! dsipdz = derivative of ionization energy with zbar
! potmult = ionization energy multiplier (useful for turning off ionization additions)
! pcoul = coulomb pressure correction
! coulmult = coulomb component multiplier
! dpcouldd = derivative of the coulomb pressure with density
! dpcouldt = derivative of the coulomb pressure with temperature
! dpcoulda = derivative of the coulomb pressure with abar
! dpcouldz = derivative of the coulomb pressure with zbar
! ecoul = coulomb energy correction
! decouldd = derivative of the coulomb energy with density
! decouldt = derivative of the coulomb energy with temperature
! decoulda = derivative of the coulomb energy with abar
! decouldz = derivative of the coulomb energy with zbar
! scoul = coulomb entropy correction
! dscouldd = derivative of the coulomb entropy with density
! dscouldt = derivative of the coulomb entropy with temperature
! dscoulda = derivative of the coulomb entropy with abar
! dscouldz = derivative of the coulomb entropy with zbar
! kt = kerg * temperature
! beta = dimensionless ratio of kerg*temp/me*c^2
! chit = temperature exponent in the pressure equation of state
! chid = density exponent in the pressure equation of state
! cv = specific heat at constant volume
! cp = specific heat at constant pressure
! gam1 = first adiabatic exponent
! gam2 = second adiabatic exponent
! gam3 = third adiabatic exponent
! nabad = adiabatic gradient
! sound = relativistically correct adiabatic sound speed
! plasg = ratio of electrostatic to thermal energy
! dse = thermodynamic consistency check de/dt = t*ds/dt
! dpe = thermodynamic consistency check p = d**2 de/dd + t*dpdt
! dsp = thermodynamic consistency check dp/dt = - d**2 ds/dd
! declare the input
double precision temp,den,zbar,abar
! declare local variables
! totals
double precision pres, &
dpresdd,dpresdt,dpresda,dpresdz, &
dpresddd,dpresddt,dpresdda,dpresddz, &
dpresdtt,dpresdta,dpresdtz, &
dpresdaa,dpresdaz,dpresdzz, &
ener, &
denerdd,denerdt,denerda,denerdz, &
denerddd,denerddt,denerdda,denerddz, &
denerdtt,denerdta,denerdtz, &
denerdaa,denerdaz,denerdzz, &
entr, &
dentrdd,dentrdt,dentrda,dentrdz, &
dentrddd,dentrddt,dentrdda,dentrddz, &
dentrdtt,dentrdta,dentrdtz, &
dentrdaa,dentrdaz,dentrdzz
! for the gas
double precision pgas, &
dpgasdd,dpgasdt,dpgasda,dpgasdz, &
dpgasddd,dpgasddt,dpgasdda,dpgasddz, &
dpgasdtt,dpgasdta,dpgasdtz, &
dpgasdaa,dpgasdaz,dpgasdzz, &
egas, &
degasdd,degasdt,degasda,degasdz, &
degasddd,degasddt,degasdda,degasddz, &
degasdtt,degasdta,degasdtz, &
degasdaa,degasdaz,degasdzz, &
sgas, &
dsgasdd,dsgasdt,dsgasda,dsgasdz, &
dsgasddd,dsgasddt,dsgasdda,dsgasddz, &
dsgasdtt,dsgasdta,dsgasdtz, &
dsgasdaa,dsgasdaz,dsgasdzz
! radiation
integer radmult
double precision prad, &
dpraddd,dpraddt,dpradda,dpraddz, &
dpradddd,dpradddt,dpraddda,dpradddz, &
dpraddtt,dpraddta,dpraddtz, &
dpraddaa,dpraddaz,dpraddzz, &
erad, &
deraddd,deraddt,deradda,deraddz, &
deradddd,deradddt,deraddda,deradddz, &
deraddtt,deraddta,deraddtz, &
deraddaa,deraddaz,deraddzz, &
srad, &
dsraddd,dsraddt,dsradda,dsraddz, &
dsradddd,dsradddt,dsraddda,dsradddz, &
dsraddtt,dsraddta,dsraddtz, &
dsraddaa,dsraddaz,dsraddzz
! ions; now in xniroot_common.dek
integer ionmult
double precision eta_ion_try
! electron-positrons; now in the file xneroot_common.dek
integer elemult
! ionization contributions; now in the file xneroot_common.dek
integer ionized,potmult
! coulomb corrections; now in the file coulomb_common.dek
integer coulmult
double precision s,sinv,dsdd,dsdt,dsda,dsdz, &
dsddd,dsddt,dsdda,dsddz,dsdtt,dsdta,dsdtz, &
dsdaa,dsdaz,dsdzz
double precision aele,aeleinv,daeledd,daeledt,daeleda,daeledz, &
daeleddd,daeleddt,daeledda,daeleddz,daeledtt, &
daeledta,daeledtz,daeledaa,daeledaz,daeledzz
double precision eplasg, &
deplasgdd,deplasgdt,deplasgda,deplasgdz, &
deplasgddd,deplasgddt,deplasgdda,deplasgddz, &
deplasgdtt,deplasgdta,deplasgdtz,deplasgdaa, &
deplasgdaz,deplasgdzz
double precision &
dplasgdd,dplasgdt,dplasgda,dplasgdz, &
dplasgddd,dplasgddt,dplasgdda,dplasgddz, &
dplasgdtt,dplasgdta,dplasgdtz,dplasgdaa, &
dplasgdaz,dplasgdzz
double precision u0,du0,ddu0,p1,p2,p3,p4,p5,p6,ion_radius
double precision a1,b1,c1,d1,e1,a2,b2,c2
parameter (a1 = -0.898004d0, &
b1 = 0.96786d0, &
c1 = 0.220703d0, &
d1 = -0.86097d0, &
e1 = 2.5269d0, &
a2 = 0.29561d0, &
b2 = 1.9885d0, &
c2 = 0.288675d0)
! various physical quantities based on derivatives
double precision &
chit, &
dchitdd,dchitdt,dchitda,dchitdz, &
chid, &
dchiddd,dchiddt,dchidda,dchiddz, &
cv, &
dcvdd,dcvdt,dcvda,dcvdz, &
cp, &
dcpdd,dcpdt,dcpda,dcpdz, &
gam1, &
dgam1dd,dgam1dt,dgam1da,dgam1dz, &
gam2, &
dgam2dd,dgam2dt,dgam2da,dgam2dz, &
gam3, &
dgam3dd,dgam3dt,dgam3da,dgam3dz, &
nabad, &
dnabdd,dnabdt,dnabda,dnabdz, &
sound, &
dcsdd,dcsdt,dcsda,dcsdz
double precision &
chit_gas, &
dchit_gasdd,dchit_gasdt,dchit_gasda,dchit_gasdz, &
chid_gas, &
dchid_gasdd,dchid_gasdt,dchid_gasda,dchid_gasdz, &
cv_gas, &
dcv_gasdd,dcv_gasdt,dcv_gasda,dcv_gasdz, &
cp_gas, &
dcp_gasdd,dcp_gasdt,dcp_gasda,dcp_gasdz, &
gam1_gas, &
dgam1_gasdd,dgam1_gasdt,dgam1_gasda,dgam1_gasdz, &
gam2_gas, &
dgam2_gasdd,dgam2_gasdt,dgam2_gasda,dgam2_gasdz, &
gam3_gas, &
dgam3_gasdd,dgam3_gasdt,dgam3_gasda,dgam3_gasdz, &
nabad_gas, &
dnab_gasdd,dnab_gasdt,dnab_gasda,dnab_gasdz, &
sound_gas, &
dcs_gasdd,dcs_gasdt,dcs_gasda,dcs_gasdz
! for the maxwell relations
double precision dse,dpe,dsp
! miscelaneous local variables
integer i,j,k,kend,niter,mode
double precision kt,ktinv,x,y,z,ww,xx,yy,zz,zzi,ytot1,ye, &
ages,agesav,agesnew,ratio,fk,dfk, &
deninv,tempinv,presinv,plasginv,zbarxx
! various derived constants
! f90 allows expressions
double precision third,sioncon,sifac,kergavo,asoli3, &
clight2,eostol,fpmin
parameter (third = 1.0d0/3.0d0, &
sioncon = (2.0d0 * pi * amu * kerg)/(h*h), &
sifac = h**3/(2.0d0 * pi* amu)**1.5d0, &
kergavo = kerg * avo, &
asoli3 = asol/3.0d0, &
clight2 = clight*clight, &
eostol = 1.0d-13, &
fpmin = 1.0d-14)
double precision forth,fiveth,teninth,esqu,forthpi
parameter (forth = 4.0d0/3.0d0, &
fiveth = 5.0d0/3.0d0, &
teninth = 10.0d0/9.0d0, &
esqu = qe*qe, &
forthpi = forth * pi)
! bring in common block variables
! common block communication with routine xneroot
! electron-positrons
double precision etaele,detadd,detadt,detada,detadz, &
detaddd,detaddt,detadda,detaddz,detadtt, &
detadta,detadtz,detadaa,detadaz,detadzz
common /xneta/ etaele,detadd,detadt,detada,detadz, &
detaddd,detaddt,detadda,detaddz,detadtt, &
detadta,detadtz,detadaa,detadaz,detadzz
double precision &
pep,dpepdd,dpepdt,dpepda,dpepdz, &
dpepddd,dpepddt,dpepdda,dpepddz, &
dpepdtt,dpepdta,dpepdtz,dpepdaa, &
dpepdaz,dpepdzz, &
eep,deepdd,deepdt,deepda,deepdz, &
deepddd,deepddt,deepdda,deepddz, &
deepdtt,deepdta,deepdtz,deepdaa, &
deepdaz,deepdzz, &
sep,dsepdd,dsepdt,dsepda,dsepdz, &
dsepddd,dsepddt,dsepdda,dsepddz, &
dsepdtt,dsepdta,dsepdtz,dsepdaa, &
dsepdaz,dsepdzz
common /epc1/ &
pep,dpepdd,dpepdt,dpepda,dpepdz, &
dpepddd,dpepddt,dpepdda,dpepddz, &
dpepdtt,dpepdta,dpepdtz,dpepdaa, &
dpepdaz,dpepdzz, &
eep,deepdd,deepdt,deepda,deepdz, &
deepddd,deepddt,deepdda,deepddz, &
deepdtt,deepdta,deepdtz,deepdaa, &
deepdaz,deepdzz, &
sep,dsepdd,dsepdt,dsepda,dsepdz, &
dsepddd,dsepddt,dsepdda,dsepddz, &
dsepdtt,dsepdta,dsepdtz,dsepdaa, &
dsepdaz,dsepdzz
double precision &
etapos,zeff
common /xnec1/ &
etapos,zeff
double precision &
pele,dpeledd,dpeledt,dpeleda,dpeledz, &
dpeleddd,dpeleddt,dpeledda,dpeleddz, &
dpeledtt,dpeledta,dpeledtz,dpeledaa, &
dpeledaz,dpeledzz, &
eele,deeledd,deeledt,deeleda,deeledz, &
deeleddd,deeleddt,deeledda,deeleddz, &
deeledtt,deeledta,deeledtz,deeledaa, &
deeledaz,deeledzz, &
sele,dseledd,dseledt,dseleda,dseledz, &
dseleddd,dseleddt,dseledda,dseleddz, &
dseledtt,dseledta,dseledtz,dseledaa, &
dseledaz,dseledzz
common /eleth1/ &
pele,dpeledd,dpeledt,dpeleda,dpeledz, &
dpeleddd,dpeleddt,dpeledda,dpeleddz, &
dpeledtt,dpeledta,dpeledtz,dpeledaa, &
dpeledaz,dpeledzz, &
eele,deeledd,deeledt,deeleda,deeledz, &
deeleddd,deeleddt,deeledda,deeleddz, &
deeledtt,deeledta,deeledtz,deeledaa, &
deeledaz,deeledzz, &
sele,dseledd,dseledt,dseleda,dseledz, &
dseleddd,dseleddt,dseledda,dseleddz, &
dseledtt,dseledta,dseledtz,dseledaa, &
dseledaz,dseledzz
double precision &
ppos,dpposdd,dpposdt,dpposda,dpposdz, &
dpposddd,dpposddt,dpposdda,dpposddz, &
dpposdtt,dpposdta,dpposdtz,dpposdaa, &
dpposdaz,dpposdzz, &
epos,deposdd,deposdt,deposda,deposdz, &
deposddd,deposddt,deposdda,deposddz, &
deposdtt,deposdta,deposdtz,deposdaa, &
deposdaz,deposdzz, &
spos,dsposdd,dsposdt,dsposda,dsposdz, &
dsposddd,dsposddt,dsposdda,dsposddz, &
dsposdtt,dsposdta,dsposdtz,dsposdaa, &
dsposdaz,dsposdzz
common /posth1/ &
ppos,dpposdd,dpposdt,dpposda,dpposdz, &
dpposddd,dpposddt,dpposdda,dpposddz, &
dpposdtt,dpposdta,dpposdtz,dpposdaa, &
dpposdaz,dpposdzz, &
epos,deposdd,deposdt,deposda,deposdz, &
deposddd,deposddt,deposdda,deposddz, &
deposdtt,deposdta,deposdtz,deposdaa, &
deposdaz,deposdzz, &
spos,dsposdd,dsposdt,dsposda,dsposdz, &
dsposddd,dsposddt,dsposdda,dsposddz, &
dsposdtt,dsposdta,dsposdtz,dsposdaa, &
dsposdaz,dsposdzz
double precision xne, &
dxnedd,dxnedt,dxneda,dxnedz, &
dxneddd,dxneddt,dxnedda,dxneddz, &
dxnedtt,dxnedta,dxnedtz,dxnedaa, &
dxnedaz,dxnedzz
common /xnec2/ xne, &
dxnedd,dxnedt,dxneda,dxnedz, &
dxneddd,dxneddt,dxnedda,dxneddz, &
dxnedtt,dxnedta,dxnedtz,dxnedaa, &
dxnedaz,dxnedzz
double precision &
xnefer,dxneferdd,dxneferdt,dxneferda,dxneferdz, &
dxneferddd,dxneferddt,dxneferdda,dxneferddz, &
dxneferdtt,dxneferdta,dxneferdtz,dxneferdaa, &
dxneferdaz,dxneferdzz, &
xnpfer,dxnpferdd,dxnpferdt,dxnpferda,dxnpferdz, &
dxnpferddd,dxnpferddt,dxnpferdda,dxnpferddz, &
dxnpferdtt,dxnpferdta,dxnpferdtz,dxnpferdaa, &
dxnpferdaz,dxnpferdzz
common /xnec3/ &
xnefer,dxneferdd,dxneferdt,dxneferda,dxneferdz, &
dxneferddd,dxneferddt,dxneferdda,dxneferddz, &
dxneferdtt,dxneferdta,dxneferdtz,dxneferdaa, &
dxneferdaz,dxneferdzz, &
xnpfer,dxnpferdd,dxnpferdt,dxnpferda,dxnpferdz, &
dxnpferddd,dxnpferddt,dxnpferdda,dxnpferddz, &
dxnpferdtt,dxnpferdta,dxnpferdtz,dxnpferdaa, &
dxnpferdaz,dxnpferdzz
! ionization contributions
double precision eip,deipdd,deipdt,deipda,deipdz, &
sip,dsipdd,dsipdt,dsipda,dsipdz, &
pip,dpipdd,dpipdt,dpipda,dpipdz
common /xnec4/ eip,deipdd,deipdt,deipda,deipdz, &
sip,dsipdd,dsipdt,dsipda,dsipdz, &
pip,dpipdd,dpipdt,dpipda,dpipdz
! common block communication with routine xniroot
! ions
! pressure, energy, entropy
double precision pion,eion,sion, &
dpiondd,dpiondt,dpionda,dpiondz, &
deiondd,deiondt,deionda,deiondz, &
dsiondd,dsiondt,dsionda,dsiondz, &
dpionddd,dpionddt,dpiondda,dpionddz, &
dpiondtt,dpiondta,dpiondtz, &
dpiondaa,dpiondaz,dpiondzz, &
deionddd,deionddt,deiondda,deionddz, &
deiondtt,deiondta,deiondtz, &
deiondaa,deiondaz,deiondzz, &
dsionddd,dsionddt,dsiondda,dsionddz, &
dsiondtt,dsiondta,dsiondtz, &
dsiondaa,dsiondaz,dsiondzz
common /ionc1/ pion,eion,sion, &
dpiondd,dpiondt,dpionda,dpiondz, &
deiondd,deiondt,deionda,deiondz, &
dsiondd,dsiondt,dsionda,dsiondz, &
dpionddd,dpionddt,dpiondda,dpionddz, &
dpiondtt,dpiondta,dpiondtz, &
dpiondaa,dpiondaz,dpiondzz, &
deionddd,deionddt,deiondda,deionddz, &
deiondtt,deiondta,deiondtz, &
deiondaa,deiondaz,deiondzz, &
dsionddd,dsionddt,dsiondda,dsionddz, &
dsiondtt,dsiondta,dsiondtz, &
dsiondaa,dsiondaz,dsiondzz
! number densities
double precision xni, &
dxnidd,dxnidt,dxnida,dxnidz, &
dxniddd,dxniddt,dxnidda,dxniddz, &
dxnidtt,dxnidta,dxnidtz, &
dxnidaa,dxnidaz,dxnidzz
common /ionc2/ xni, &
dxnidd,dxnidt,dxnida,dxnidz, &
dxniddd,dxniddt,dxnidda,dxniddz, &
dxnidtt,dxnidta,dxnidtz, &
dxnidaa,dxnidaz,dxnidzz
double precision &
xnifer,dxniferdd,dxniferdt,dxniferda,dxniferdz, &
dxniferddd,dxniferddt,dxniferdda,dxniferddz, &
dxniferdtt,dxniferdta,dxniferdtz,dxniferdaa, &
dxniferdaz,dxniferdzz
common /xnic3/ &
xnifer,dxniferdd,dxniferdt,dxniferda,dxniferdz, &
dxniferddd,dxniferddt,dxniferdda,dxniferddz, &
dxniferdtt,dxniferdta,dxniferdtz,dxniferdaa, &
dxniferdaz,dxniferdzz
! chemical potential
double precision etaion, &
detaidd,detaidt,detaida,detaidz, &
detaiddd,detaiddt,detaidda,detaiddz, &
detaidtt,detaidta,detaidtz, &
detaidaa,detaidaz,detaidzz
common /ionc3/ etaion, &
detaidd,detaidt,detaida,detaidz, &
detaiddd,detaiddt,detaidda,detaiddz, &
detaidtt,detaidta,detaidtz, &
detaidaa,detaidaz,detaidzz
! common block communication with routine coulomb
! coulomb corrections
! pressure, energy, entropy
double precision plasg
common /coulc1/ plasg
double precision pcoul, &
dpcouldd,dpcouldt,dpcoulda,dpcouldz, &
dpcoulddd,dpcoulddt,dpcouldda,dpcoulddz, &
dpcouldtt,dpcouldta,dpcouldtz,dpcouldaa, &
dpcouldaz,dpcouldzz
common /coulc2/ pcoul, &
dpcouldd,dpcouldt,dpcoulda,dpcouldz, &
dpcoulddd,dpcoulddt,dpcouldda,dpcoulddz, &
dpcouldtt,dpcouldta,dpcouldtz,dpcouldaa, &
dpcouldaz,dpcouldzz
double precision ecoul, &
decouldd,decouldt,decoulda,decouldz, &
decoulddd,decoulddt,decouldda,decoulddz, &
decouldtt,decouldta,decouldtz,decouldaa, &
decouldaz,decouldzz
common /coulc4/ ecoul, &
decouldd,decouldt,decoulda,decouldz, &
decoulddd,decoulddt,decouldda,decoulddz, &
decouldtt,decouldta,decouldtz,decouldaa, &
decouldaz,decouldzz
double precision scoul, &
dscouldd,dscouldt,dscoulda,dscouldz, &
dscoulddd,dscoulddt,dscouldda,dscoulddz, &
dscouldtt,dscouldta,dscouldtz,dscouldaa, &
dscouldaz,dscouldzz
common /coulc4/ scoul, &
dscouldd,dscouldt,dscoulda,dscouldz, &
dscoulddd,dscoulddt,dscouldda,dscoulddz, &
dscouldtt,dscouldta,dscouldtz,dscouldaa, &
dscouldaz,dscouldzz
! popular format statements for debugging
01 format(1x,5(a,1pe24.16))
02 format(1x,5(a,1pe16.8))
03 format(1x,1p5e16.8)
! set the on/off switches
radmult = 1
ionmult = 1
ionized = 1
elemult = 1
coulmult = 1
potmult = 0
! start pipeline loop
do j=jlo_eos,jhi_eos
if ((temp_row(j) .le. 0.0) .or. (den_row(j) .le. 0.0)) then
call zero_eos_vector(j,j)
else
temp = temp_row(j)
den = den_row(j)
abar = abar_row(j)
zbar = zbar_row(j)
ytot1 = 1.0d0/abar
! initialize local variables to zero
prad = 0.0d0
dpraddd = 0.0d0
dpraddt = 0.0d0
dpradda = 0.0d0
dpraddz = 0.0d0
dpradddd = 0.0d0
dpradddt = 0.0d0
dpraddda = 0.0d0
dpradddz = 0.0d0
dpraddtt = 0.0d0
dpraddta = 0.0d0
dpraddtz = 0.0d0
dpraddaa = 0.0d0
dpraddaz = 0.0d0
dpraddzz = 0.0d0
erad = 0.0d0
deraddd = 0.0d0
deraddt = 0.0d0
deradda = 0.0d0
deraddz = 0.0d0
deradddd = 0.0d0
deradddt = 0.0d0
deraddda = 0.0d0
deradddz = 0.0d0
deraddtt = 0.0d0
deraddta = 0.0d0
deraddtz = 0.0d0
deraddaa = 0.0d0
deraddaz = 0.0d0
deraddzz = 0.0d0
srad = 0.0d0
dsraddd = 0.0d0
dsraddt = 0.0d0
dsradda = 0.0d0
dsraddz = 0.0d0
dsradddd = 0.0d0
dsradddt = 0.0d0
dsraddda = 0.0d0
dsradddz = 0.0d0
dsraddtt = 0.0d0
dsraddta = 0.0d0
dsraddtz = 0.0d0
dsraddaa = 0.0d0
dsraddaz = 0.0d0
dsraddzz = 0.0d0
xni = 0.0d0
dxnidd = 0.0d0
dxnidt = 0.0d0
dxnida = 0.0d0
dxnidz = 0.0d0
dxniddd = 0.0d0
dxniddt = 0.0d0
dxnidda = 0.0d0
dxniddz = 0.0d0
dxnidtt = 0.0d0
dxnidta = 0.0d0
dxnidtz = 0.0d0
dxnidaa = 0.0d0
dxnidaz = 0.0d0
dxnidzz = 0.0d0
pion = 0.0d0
dpiondd = 0.0d0
dpiondt = 0.0d0
dpionda = 0.0d0
dpiondz = 0.0d0
dpionddd = 0.0d0
dpionddt = 0.0d0
dpiondda = 0.0d0
dpionddz = 0.0d0
dpiondtt = 0.0d0
dpiondta = 0.0d0
dpiondtz = 0.0d0
dpiondaa = 0.0d0
dpiondaz = 0.0d0
dpiondzz = 0.0d0
eion = 0.0d0
deiondd = 0.0d0
deiondt = 0.0d0
deionda = 0.0d0
deiondz = 0.0d0
deionddd = 0.0d0
deionddt = 0.0d0
deiondda = 0.0d0
deionddz = 0.0d0
deiondtt = 0.0d0
deiondta = 0.0d0
deiondtz = 0.0d0
deiondaa = 0.0d0
deiondaz = 0.0d0
deiondzz = 0.0d0
sion = 0.0d0
dsiondd = 0.0d0
dsiondt = 0.0d0
dsionda = 0.0d0
dsiondz = 0.0d0
dsionddd = 0.0d0
dsionddt = 0.0d0
dsiondda = 0.0d0
dsionddz = 0.0d0
dsiondtt = 0.0d0
dsiondta = 0.0d0
dsiondtz = 0.0d0
dsiondaa = 0.0d0
dsiondaz = 0.0d0
dsiondzz = 0.0d0
etaion = 0.0d0
detaidd = 0.0d0
detaidt = 0.0d0
detaida = 0.0d0
detaidz = 0.0d0
detaiddd = 0.0d0
detaiddt = 0.0d0
detaidda = 0.0d0
detaiddz = 0.0d0
detaidtt = 0.0d0
detaidta = 0.0d0
detaidtz = 0.0d0
detaidaa = 0.0d0
detaidaz = 0.0d0
detaidzz = 0.0d0
xne = 0.0d0
dxnedd = 0.0d0
dxnedt = 0.0d0
dxneda = 0.0d0
dxnedz = 0.0d0
dxneddd = 0.0d0
dxneddt = 0.0d0
dxnedda = 0.0d0
dxneddz = 0.0d0
dxnedtt = 0.0d0
dxnedta = 0.0d0
dxnedtz = 0.0d0
dxnedaa = 0.0d0
dxnedaz = 0.0d0
dxnedzz = 0.0d0
etaele = 0.0d0
detadd = 0.0d0
detadt = 0.0d0
detada = 0.0d0
detadz = 0.0d0
detaddd = 0.0d0
detaddt = 0.0d0
detadda = 0.0d0
detaddz = 0.0d0
detadtt = 0.0d0
detadta = 0.0d0
detadtz = 0.0d0
detadaa = 0.0d0
detadaz = 0.0d0
detadzz = 0.0d0
etapos = 0.0d0
xnefer = 0.0d0
dxneferdd = 0.0d0
dxneferdt = 0.0d0
dxneferda = 0.0d0
dxneferdz = 0.0d0
dxneferddd = 0.0d0
dxneferddt = 0.0d0
dxneferdda = 0.0d0
dxneferddz = 0.0d0
dxneferdtt = 0.0d0
dxneferdta = 0.0d0
dxneferdtz = 0.0d0
dxneferdaa = 0.0d0
dxneferdaz = 0.0d0
dxneferdzz = 0.0d0
xnpfer = 0.0d0
dxnpferdd = 0.0d0
dxnpferdt = 0.0d0
dxnpferda = 0.0d0
dxnpferdz = 0.0d0
dxnpferddd = 0.0d0
dxnpferddt = 0.0d0
dxnpferdda = 0.0d0
dxnpferddz = 0.0d0
dxnpferdtt = 0.0d0
dxnpferdta = 0.0d0
dxnpferdtz = 0.0d0
dxnpferdaa = 0.0d0