Octopus
loct_math.F90
Go to the documentation of this file.
1!! Copyright (C) 2002-2006 M. Marques, A. Castro, A. Rubio, G. Bertsch, M. Oliveira
2!!
3!! This program is free software; you can redistribute it and/or modify
4!! it under the terms of the GNU General Public License as published by
5!! the Free Software Foundation; either version 2, or (at your option)
6!! any later version.
7!!
8!! This program is distributed in the hope that it will be useful,
9!! but WITHOUT ANY WARRANTY; without even the implied warranty of
10!! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11!! GNU General Public License for more details.
12!!
13!! You should have received a copy of the GNU General Public License
14!! along with this program; if not, write to the Free Software
15!! Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
16!! 02110-1301, USA.
17!!
18
19#include "global.h"
20
21module loct_math_oct_m
22 use, intrinsic :: iso_c_binding
23
24 implicit none
25
27 private
28 public :: &
29 loct_gamma, &
31 loct_erf, &
32 loct_erfc, &
33 loct_ylm, &
52
53
54 ! ---------------------------------------------------------
56 interface loct_gamma
57 function oct_gamma(x)
58 use iso_c_binding
59 implicit none
60 real(c_double) :: oct_gamma
61 real(c_double), intent(in) :: x
62 end function oct_gamma
63 end interface loct_gamma
64
65 interface loct_incomplete_gamma
66 function oct_incomplete_gamma(a, x)
67 use iso_c_binding
68 implicit none
69 real(c_double) :: oct_incomplete_gamma
70 real(c_double), intent(in) :: a, x
71 end function oct_incomplete_gamma
72 end interface loct_incomplete_gamma
73
74 interface loct_bessel
75 function oct_bessel(n, x)
76 use iso_c_binding
77 implicit none
78 real(c_double) :: oct_bessel
79 integer, intent(in) :: n
80 real(c_double), intent(in) :: x
81 end function oct_bessel
82 end interface loct_bessel
83
84 interface loct_bessel_in
85 function oct_bessel_in(n, x)
86 use iso_c_binding
87 implicit none
88 real(c_double) :: oct_bessel_in
89 integer, intent(in) :: n
90 real(c_double), intent(in) :: x
91 end function oct_bessel_in
92 end interface loct_bessel_in
93
94 interface loct_sph_bessel
95 function oct_sph_bessel(l, x)
96 use iso_c_binding
97 implicit none
98 real(c_double) :: oct_sph_bessel
99 integer, intent(in) :: l
100 real(c_double), intent(in) :: x
101 end function oct_sph_bessel
102 end interface loct_sph_bessel
103
104 interface loct_bessel_j0
105 function oct_bessel_j0(x)
106 use iso_c_binding
107 implicit none
108 real(c_double) :: oct_bessel_j0
109 real(c_double), intent(in) :: x
110 end function oct_bessel_j0
111 end interface loct_bessel_j0
112
113 interface loct_bessel_j1
114 function oct_bessel_j1(x)
115 use iso_c_binding
116 implicit none
117 real(c_double) :: oct_bessel_j1
118 real(c_double), intent(in) :: x
119 end function oct_bessel_j1
120 end interface loct_bessel_j1
121
122 interface loct_bessel_k0
123 function oct_bessel_k0(x)
124 use iso_c_binding
125 implicit none
126 real(c_double) :: oct_bessel_k0
127 real(c_double), intent(in) :: x
128 end function oct_bessel_k0
129 end interface loct_bessel_k0
130
131 interface loct_bessel_k1
132 function oct_bessel_k1(x)
133 use iso_c_binding
134 implicit none
135 real(c_double) :: oct_bessel_k1
136 real(c_double), intent(in) :: x
137 end function oct_bessel_k1
138 end interface loct_bessel_k1
139
140 interface loct_erf
141 function oct_erf(x)
142 use iso_c_binding
143 implicit none
144 real(c_double) :: oct_erf
145 real(c_double), intent(in) :: x
146 end function oct_erf
147 end interface loct_erf
148
149 interface loct_erfc
150 function oct_erfc(x)
151 use iso_c_binding
152 implicit none
153 real(c_double) oct_erfc
154 real(c_double), intent(in) :: x
155 end function oct_erfc
156 end interface loct_erfc
157
159 function oct_legendre_sphplm(l, m, x)
160 use iso_c_binding
161 implicit none
162 real(c_double) :: oct_legendre_sphplm
163 integer, intent(in) :: l, m
164 real(c_double), intent(in) :: x
165 end function oct_legendre_sphplm
166 end interface loct_legendre_sphplm
169 function oct_sf_laguerre_n(n, a, x)
170 use iso_c_binding
171 implicit none
172 real(c_double) :: oct_sf_laguerre_n
173 integer, intent(in) :: n
174 real(c_double), intent(in) :: a
175 real(c_double), intent(in) :: x
176 end function oct_sf_laguerre_n
177 end interface loct_sf_laguerre_n
179 interface loct_ylm
180 subroutine oct_ylm(n, x, y, z, l, m, ylm)
181 use iso_c_binding
182 implicit none
183 integer, intent(in) :: n
184 real(c_double), intent(in) :: x, y, z
185 integer, intent(in) :: l, m
186 real(c_double), intent(out) :: ylm
187 end subroutine oct_ylm
188 subroutine oct_ylm_vector(n, xx, rr, l, m, ylm)
189 use iso_c_binding
190 implicit none
191 integer, intent(in) :: n
192 real(c_double), intent(in) :: xx, rr
193 integer, intent(in) :: l, m
194 real(c_double), intent(out) :: ylm
195 end subroutine oct_ylm_vector
196 end interface loct_ylm
198 ! ---------------------------------------------------------
200 interface loct_combination_init
201 subroutine oct_combination_init(c, n, k)
202 use iso_c_binding
203 implicit none
204 type(c_ptr), intent(out) :: c
205 integer, intent(in) :: n, k
206 end subroutine oct_combination_init
208
209 interface loct_combination_end
210 subroutine oct_combination_end(c)
211 use iso_c_binding
212 implicit none
213 type(c_ptr), intent(in) :: c
214 end subroutine oct_combination_end
217 interface loct_combination_next
218 subroutine oct_combination_next(c, next)
219 use iso_c_binding
220 implicit none
221 type(c_ptr), intent(inout) :: c
222 integer, intent(out) :: next
223 end subroutine oct_combination_next
226 interface
227 subroutine oct_get_combination(c, comb)
228 use iso_c_binding
229 type(c_ptr), intent(in) :: c
230 integer, intent(out) :: comb
231 end subroutine oct_get_combination
232 end interface
234 ! ---------------------------------------------------------
236 interface loct_ran_init
237 subroutine oct_ran_init(r)
238 use iso_c_binding
239 implicit none
240 type(c_ptr), intent(out) :: r
241 end subroutine oct_ran_init
242 end interface loct_ran_init
244 interface loct_ran_end
245 subroutine oct_ran_end(r)
246 use iso_c_binding
247 implicit none
248 type(c_ptr), intent(inout) :: r
249 end subroutine oct_ran_end
250 end interface loct_ran_end
253 function oct_ran_gaussian(r, sigma)
254 use iso_c_binding
255 implicit none
256 real(c_double) :: oct_ran_gaussian
257 type(c_ptr), intent(in) :: r
258 real(c_double), intent(in) :: sigma
259 end function oct_ran_gaussian
260 end interface loct_ran_gaussian
263 function oct_ran_flat(r, a, b)
264 use iso_c_binding
265 implicit none
266 real(c_double) :: oct_ran_flat
267 type(c_ptr), intent(in) :: r
268 real(c_double), intent(in) :: a
269 real(c_double), intent(in) :: b
270 end function oct_ran_flat
271 end interface loct_ran_flat
274 subroutine oct_fft_optimize(n, par)
275 implicit none
276 integer, intent(inout) :: n
277 integer, intent(in) :: par
278 end subroutine oct_fft_optimize
279 end interface loct_fft_optimize
280
281contains
282
283 subroutine loct_get_combination(c, comb)
284 use iso_c_binding
285 type(c_ptr), intent(in) :: c
286 integer, intent(out) :: comb(0:)
287
288 call oct_get_combination(c, comb(0))
289 end subroutine loct_get_combination
290
291end module loct_math_oct_m
292
293!! Local Variables:
294!! mode: f90
295!! coding: utf-8
296!! End:
Functions to generate combinations.
Definition: loct_math.F90:293
Define which routines can be seen from the outside.
Definition: loct_math.F90:149
Functions to generate random numbers.
Definition: loct_math.F90:329
subroutine, public loct_get_combination(c, comb)
Definition: loct_math.F90:377