-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathfortran_wrappers.f90
145 lines (119 loc) · 3.61 KB
/
fortran_wrappers.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
!*********************************************************************
! This file is part of Polylogarithm.
!
! Polylogarithm is licenced under the MIT License.
!*********************************************************************
subroutine cl2_fortran(x, res) bind(C)
use, intrinsic :: iso_c_binding
implicit none
real(c_double), intent(in) :: x
real(c_double), intent(out) :: res
double precision dcl2
res = dcl2(x)
end subroutine cl2_fortran
subroutine cl3_fortran(x, res) bind(C)
use, intrinsic :: iso_c_binding
implicit none
real(c_double), intent(in) :: x
real(c_double), intent(out) :: res
double precision dcl3
res = dcl3(x)
end subroutine cl3_fortran
subroutine cl4_fortran(x, res) bind(C)
use, intrinsic :: iso_c_binding
implicit none
real(c_double), intent(in) :: x
real(c_double), intent(out) :: res
double precision dcl4
res = dcl4(x)
end subroutine cl4_fortran
subroutine cl5_fortran(x, res) bind(C)
use, intrinsic :: iso_c_binding
implicit none
real(c_double), intent(in) :: x
real(c_double), intent(out) :: res
double precision dcl5
res = dcl5(x)
end subroutine cl5_fortran
subroutine cl6_fortran(x, res) bind(C)
use, intrinsic :: iso_c_binding
implicit none
real(c_double), intent(in) :: x
real(c_double), intent(out) :: res
double precision dcl6
res = dcl6(x)
end subroutine cl6_fortran
subroutine li2_fortran(x, res) bind(C)
use, intrinsic :: iso_c_binding
implicit none
real(c_double), intent(in) :: x
real(c_double), intent(out) :: res
double precision dli2
res = dli2(x)
end subroutine li2_fortran
subroutine li3_fortran(x, res) bind(C)
use, intrinsic :: iso_c_binding
implicit none
real(c_double), intent(in) :: x
real(c_double), intent(out) :: res
double precision dli3
res = dli3(x)
end subroutine li3_fortran
subroutine li4_fortran(x, res) bind(C)
use, intrinsic :: iso_c_binding
implicit none
real(c_double), intent(in) :: x
real(c_double), intent(out) :: res
double precision dli4
res = dli4(x)
end subroutine li4_fortran
subroutine cli2_fortran(re, im, res_re, res_im) bind(C)
use, intrinsic :: iso_c_binding
implicit none
real(c_double), intent(in) :: im, re
real(c_double), intent(out) :: res_re, res_im
double complex res, cdli2
res = cdli2(dcmplx(re, im))
res_re = real(res)
res_im = aimag(res)
end subroutine cli2_fortran
subroutine cli3_fortran(re, im, res_re, res_im) bind(C)
use, intrinsic :: iso_c_binding
implicit none
real(c_double), intent(in) :: im, re
real(c_double), intent(out) :: res_re, res_im
double complex res, cdli3
res = cdli3(dcmplx(re, im))
res_re = real(res)
res_im = aimag(res)
end subroutine cli3_fortran
subroutine cli4_fortran(re, im, res_re, res_im) bind(C)
use, intrinsic :: iso_c_binding
implicit none
real(c_double), intent(in) :: im, re
real(c_double), intent(out) :: res_re, res_im
double complex res, cdli4
res = cdli4(dcmplx(re, im))
res_re = real(res)
res_im = aimag(res)
end subroutine cli4_fortran
subroutine cli5_fortran(re, im, res_re, res_im) bind(C)
use, intrinsic :: iso_c_binding
implicit none
real(c_double), intent(in) :: im, re
real(c_double), intent(out) :: res_re, res_im
double complex res, cdli5
res = cdli5(dcmplx(re, im))
res_re = real(res)
res_im = aimag(res)
end subroutine cli5_fortran
subroutine cli6_fortran(re, im, res_re, res_im) bind(C)
use, intrinsic :: iso_c_binding
implicit none
real(c_double), intent(in) :: im, re
real(c_double), intent(out) :: res_re, res_im
double complex res, cdli6
res = cdli6(dcmplx(re, im))
res_re = real(res)
res_im = aimag(res)
end subroutine cli6_fortran