diff options
author | Wojtek Kosior <kwojtus@protonmail.com> | 2019-06-01 16:55:30 +0200 |
---|---|---|
committer | Wojtek Kosior <kwojtus@protonmail.com> | 2019-06-01 16:55:30 +0200 |
commit | 499d1bddfd2693a783533b5f530fb6b4e0249552 (patch) | |
tree | 175f930e5a9ea842d21fdfed821aae4fc21992d0 /src | |
parent | 9aca0009ddae08ac7a98df518fbc0c95f11e8691 (diff) | |
download | fortran-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.f90 | 24 |
1 files changed, 23 insertions, 1 deletions
@@ -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)) |