diff options
-rw-r--r-- | src/f1.f90 | 18 |
1 files changed, 15 insertions, 3 deletions
@@ -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) |