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 :: &
30 loct_ylm, &
49
50
51 ! ---------------------------------------------------------
53 interface loct_incomplete_gamma
54 function oct_incomplete_gamma(a, x)
55 use iso_c_binding
56 implicit none
57 real(c_double) :: oct_incomplete_gamma
58 real(c_double), intent(in) :: a, x
59 end function oct_incomplete_gamma
60 end interface loct_incomplete_gamma
61
62 interface loct_bessel
63 function oct_bessel(n, x)
64 use iso_c_binding
65 implicit none
66 real(c_double) :: oct_bessel
67 integer, intent(in) :: n
68 real(c_double), intent(in) :: x
69 end function oct_bessel
70 end interface loct_bessel
71
72 interface loct_bessel_in
73 function oct_bessel_in(n, x)
74 use iso_c_binding
75 implicit none
76 real(c_double) :: oct_bessel_in
77 integer, intent(in) :: n
78 real(c_double), intent(in) :: x
79 end function oct_bessel_in
80 end interface loct_bessel_in
81
82 interface loct_sph_bessel
83 function oct_sph_bessel(l, x)
84 use iso_c_binding
85 implicit none
86 real(c_double) :: oct_sph_bessel
87 integer, intent(in) :: l
88 real(c_double), intent(in) :: x
89 end function oct_sph_bessel
90 end interface loct_sph_bessel
91
92 interface loct_bessel_j0
93 function oct_bessel_j0(x)
94 use iso_c_binding
95 implicit none
96 real(c_double) :: oct_bessel_j0
97 real(c_double), intent(in) :: x
98 end function oct_bessel_j0
99 end interface loct_bessel_j0
100
101 interface loct_bessel_j1
102 function oct_bessel_j1(x)
103 use iso_c_binding
104 implicit none
105 real(c_double) :: oct_bessel_j1
106 real(c_double), intent(in) :: x
107 end function oct_bessel_j1
108 end interface loct_bessel_j1
109
110 interface loct_bessel_k0
111 function oct_bessel_k0(x)
112 use iso_c_binding
113 implicit none
114 real(c_double) :: oct_bessel_k0
115 real(c_double), intent(in) :: x
116 end function oct_bessel_k0
117 end interface loct_bessel_k0
118
119 interface loct_bessel_k1
120 function oct_bessel_k1(x)
121 use iso_c_binding
122 implicit none
123 real(c_double) :: oct_bessel_k1
124 real(c_double), intent(in) :: x
125 end function oct_bessel_k1
126 end interface loct_bessel_k1
127
128 interface loct_legendre_sphplm
129 function oct_legendre_sphplm(l, m, x)
130 use iso_c_binding
131 implicit none
132 real(c_double) :: oct_legendre_sphplm
133 integer, intent(in) :: l, m
134 real(c_double), intent(in) :: x
135 end function oct_legendre_sphplm
136 end interface loct_legendre_sphplm
137
138 interface loct_sf_laguerre_n
139 function oct_sf_laguerre_n(n, a, x)
140 use iso_c_binding
141 implicit none
142 real(c_double) :: oct_sf_laguerre_n
143 integer, intent(in) :: n
144 real(c_double), intent(in) :: a
145 real(c_double), intent(in) :: x
146 end function oct_sf_laguerre_n
147 end interface loct_sf_laguerre_n
149 interface loct_ylm
150 subroutine oct_ylm(n, x, y, z, l, m, ylm)
151 use iso_c_binding
152 implicit none
153 integer, intent(in) :: n
154 real(c_double), intent(in) :: x, y, z
155 integer, intent(in) :: l, m
156 real(c_double), intent(out) :: ylm
157 end subroutine oct_ylm
158 subroutine oct_ylm_vector(n, xx, rr, l, m, ylm)
159 use iso_c_binding
160 implicit none
161 integer, intent(in) :: n
162 real(c_double), intent(in) :: xx, rr
163 integer, intent(in) :: l, m
164 real(c_double), intent(out) :: ylm
165 end subroutine oct_ylm_vector
166 end interface loct_ylm
168 ! ---------------------------------------------------------
170 interface loct_combination_init
171 subroutine oct_combination_init(c, n, k)
172 use iso_c_binding
173 implicit none
174 type(c_ptr), intent(out) :: c
175 integer, intent(in) :: n, k
176 end subroutine oct_combination_init
179 interface loct_combination_end
180 subroutine oct_combination_end(c)
181 use iso_c_binding
182 implicit none
183 type(c_ptr), intent(in) :: c
184 end subroutine oct_combination_end
185 end interface loct_combination_end
186
188 subroutine oct_combination_next(c, next)
189 use iso_c_binding
190 implicit none
191 type(c_ptr), intent(inout) :: c
192 integer, intent(out) :: next
193 end subroutine oct_combination_next
194 end interface loct_combination_next
195
196 interface
197 subroutine oct_get_combination(c, comb)
198 use iso_c_binding
199 type(c_ptr), intent(in) :: c
200 integer, intent(out) :: comb
201 end subroutine oct_get_combination
202 end interface
203
204 ! ---------------------------------------------------------
207 subroutine oct_ran_init(r)
208 use iso_c_binding
209 implicit none
210 type(c_ptr), intent(out) :: r
211 end subroutine oct_ran_init
212 end interface loct_ran_init
213
214 interface loct_ran_end
215 subroutine oct_ran_end(r)
216 use iso_c_binding
217 implicit none
218 type(c_ptr), intent(inout) :: r
219 end subroutine oct_ran_end
220 end interface loct_ran_end
221
222 interface loct_ran_gaussian
223 function oct_ran_gaussian(r, sigma)
224 use iso_c_binding
225 implicit none
226 real(c_double) :: oct_ran_gaussian
227 type(c_ptr), intent(in) :: r
228 real(c_double), intent(in) :: sigma
229 end function oct_ran_gaussian
230 end interface loct_ran_gaussian
231
232 interface loct_ran_flat
233 function oct_ran_flat(r, a, b)
234 use iso_c_binding
235 implicit none
236 real(c_double) :: oct_ran_flat
237 type(c_ptr), intent(in) :: r
238 real(c_double), intent(in) :: a
239 real(c_double), intent(in) :: b
240 end function oct_ran_flat
241 end interface loct_ran_flat
242
243 interface loct_fft_optimize
244 subroutine oct_fft_optimize(n, par)
245 implicit none
246 integer, intent(inout) :: n
247 integer, intent(in) :: par
248 end subroutine oct_fft_optimize
249 end interface loct_fft_optimize
250
251contains
252
253 subroutine loct_get_combination(c, comb)
254 use iso_c_binding
255 type(c_ptr), intent(in) :: c
256 integer, intent(out) :: comb(0:)
257
258 call oct_get_combination(c, comb(0))
259 end subroutine loct_get_combination
260
261end module loct_math_oct_m
262
263!! Local Variables:
264!! mode: f90
265!! coding: utf-8
266!! End:
Functions to generate combinations.
Definition: loct_math.F90:265
Define which routines can be seen from the outside.
Definition: loct_math.F90:148
Functions to generate random numbers.
Definition: loct_math.F90:301
subroutine, public loct_get_combination(c, comb)
Definition: loct_math.F90:349