V3FIT
Main Page
Related Pages
Modules
Modules List
Module Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions/Subroutines
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
w
y
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Data Types List
Data Types List
Data Types
Class Hierarchy
Data Fields
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
y
z
~
Functions/Subroutines
a
b
c
d
e
f
g
i
l
m
n
p
r
s
t
u
v
x
y
~
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
y
z
Files
File List
File Members
All
b
c
g
i
l
m
n
p
t
v
w
Functions/Subroutines
b
c
g
i
m
p
t
v
w
Variables
Enumerations
Macros
•
All
Classes
Namespaces
Files
Functions
Variables
Enumerations
Macros
Pages
LIBSTELL
Sources
Miscel
integral.f
1
FUNCTION
integral (n, x, y1, y2)
2
USE
stel_kinds
3
IMPLICIT NONE
4
!-----------------------------------------------
5
! D u m m y A r g u m e n t s
6
!-----------------------------------------------
7
INTEGER
,
INTENT(IN)
:: n
8
REAL
(rprec),
INTENT(IN)
,
DIMENSION(n)
:: y1, y2 , x
9
REAL
(rprec),
PARAMETER
:: one = 1
10
REAL
(rprec) :: h, integral
11
!------------------------------------------------------------------------------
12
! WARNING: The integral formula assumes values on the half MESH,
13
! that is, the independent variable is given from x(3/2) to x(M-1/2),
14
! but the limits of the integral are x(1)=-1 and x(M)=1. N = M-1 is the
15
! number of points on the half mesh.
16
! In the current version, fulfilment of this condition is ONLY checked
17
! for the case in which the interval of integration is the interval
18
! of orthogonality of Legendre polynomias, i.e., [-1,1].
19
! Integration formula is a 2-nd order HALF-MESH formula from
20
! "Numerical Recipes", W.Press et al, Chapter 4, page 110.
21
!------------------------------------------------------------------------------
22
IF
(n < 10) stop
'Too few points to carry out integration.!'
23
IF
(x(n) < x(1)) stop
' B < A in INTEGRAL!'
24
IF
(x(n) == one .or. x(1) == -one) stop
'HALF MESH INTEGRAL!'
25
26
h = (x(n)-x(1))/(n-1)
27
integral = h* sum(y1*y2)
28
29
END FUNCTION
integral
Generated on Thu Mar 5 2020 15:49:23 for V3FIT by
1.8.17