13#include "base/base_uses.f90"
17 cpabort(
"CP2K not compiled with GreenX link - please recompile to access GXAC.")
20 USE gx_ac,
ONLY: create_thiele_pade, &
21 evaluate_thiele_pade_at, &
27 COMPLEX(kind=dp) :: damp_one = (2, 0), &
29 center_one = (2, 0), &
30 center_two = (8, 0), &
33 min_source = (0, 0), &
35 max_source = (10, 0), &
37 INTEGER,
PARAMETER :: n_source = 20, &
41 COMPLEX(kind=dp) :: d_source, &
43 COMPLEX(kind=dp),
DIMENSION(n_source) :: x_source, &
45 COMPLEX(kind=dp),
DIMENSION(n_fit) :: x_fit, &
47 TYPE(params) :: fit_params
49 d_source = (max_source - min_source)/cmplx(n_source - 1, kind=
dp)
50 d_fit = (max_fit - min_fit)/cmplx(n_fit - 1, kind=
dp)
52 print
'(A12)',
"#Source data"
55 x_source(i) = min_source + cmplx(i - 1, 0.0, kind=
dp)*d_source
56 y_source(i) = amp_one/(damp_one*damp_one + (x_source(i) - center_one)*(x_source(i) - center_one))
57 y_source(i) = y_source(i) + amp_two/(damp_two*damp_two + (x_source(i) - center_two)*(x_source(i) - center_two))
58 print
'(E20.8E3,E20.8E3)', real(x_source(i), kind=
dp), real(y_source(i), kind=
dp)
61 print
'(A9)',
"#Fit data"
65 fit_params = create_thiele_pade(n_param, x_source, y_source)
69 x_fit(i) = min_fit + d_fit*cmplx(i - 1, 0, kind=
dp)
72 y_fit(1:n_fit) = evaluate_thiele_pade_at(fit_params, x_fit)
75 print
'(E20.8E3,E20.8E3)', real(x_fit(i), kind=
dp), real(y_fit(i), kind=
dp)
78 CALL free_params(fit_params)
program gx_ac_unittest
GreenX Analytic continuation unit test.
Defines the basic variable types.
integer, parameter, public dp