From 499d1bddfd2693a783533b5f530fb6b4e0249552 Mon Sep 17 00:00:00 2001 From: Wojtek Kosior Date: Sat, 1 Jun 2019 16:55:30 +0200 Subject: print original function or transformed depending on argumnet --- src/f1.f90 | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/f1.f90 b/src/f1.f90 index 82e60b1..b1f89b9 100644 --- a/src/f1.f90 +++ b/src/f1.f90 @@ -12,9 +12,31 @@ PROGRAM test delta = (end - start) / real(npoints - 1, C_DOUBLE) type(C_PTR) :: p_real, p_complex, plan - + real(C_DOUBLE), pointer :: arr_real(:) complex(C_DOUBLE_COMPLEX), pointer :: arr_complex(:) + + character(100) :: arg + + IF (command_argument_count() < 1) THEN + + DO i = 1, npoints + + t = (i - 1) * delta + start + + write(*,*) t, " ", f1(t) + + END DO + + STOP + END IF + + call get_command_argument(1, arg) + + IF (trim(arg) /= "dft") THEN + + STOP "wrong argument" + END IF p_real = fftw_alloc_real(int(npoints, C_SIZE_T)) -- cgit v1.2.3