aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWojtek Kosior <kwojtus@protonmail.com>2019-06-01 16:55:30 +0200
committerWojtek Kosior <kwojtus@protonmail.com>2019-06-01 16:55:30 +0200
commit499d1bddfd2693a783533b5f530fb6b4e0249552 (patch)
tree175f930e5a9ea842d21fdfed821aae4fc21992d0 /src
parent9aca0009ddae08ac7a98df518fbc0c95f11e8691 (diff)
downloadfortran-assignment2-499d1bddfd2693a783533b5f530fb6b4e0249552.tar.gz
fortran-assignment2-499d1bddfd2693a783533b5f530fb6b4e0249552.zip
print original function or transformed depending on argumnet
Diffstat (limited to 'src')
-rw-r--r--src/f1.f9024
1 files changed, 23 insertions, 1 deletions
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))