aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/f1.f9018
1 files changed, 15 insertions, 3 deletions
diff --git a/src/f1.f90 b/src/f1.f90
index 38f360f..f03b9bf 100644
--- a/src/f1.f90
+++ b/src/f1.f90
@@ -11,14 +11,26 @@ PROGRAM test
real(C_DOUBLE) :: t, &
delta = (end - start) / real(npoints - 1, C_DOUBLE)
- DO i = 0, npoints - 1
+ type(C_PTR) :: p_in!, p_out, plan
- t = i * delta + start
+ real(C_DOUBLE), pointer :: arr_in(:)
+! complex(C_DOUBLE_COMPLEX), pointer :: out_arr(npoints)
+
+ p_in = fftw_alloc_real(int(npoints, C_SIZE_T))
+
+ call c_f_pointer(p_in, arr_in, [npoints])
+
+ DO i = 1, npoints
+
+ t = (i - 1) * delta + start
+ arr_in(i) = f1(t)
- write(*,*) t, " ", f1(t)
+ write(*,*) t, " ", arr_in(i)
END DO
+ call fftw_free(p_in)
+
CONTAINS
PURE real(C_DOUBLE) FUNCTION f1(t)