aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWojtek Kosior <kwojtus@protonmail.com>2019-06-01 16:59:03 +0200
committerWojtek Kosior <kwojtus@protonmail.com>2019-06-01 16:59:03 +0200
commit0ef69b67e70da34e96cddfca4700ffe0a5e2304f (patch)
treee4e41c807d41cde761f526909e409df0398dc809
parent499d1bddfd2693a783533b5f530fb6b4e0249552 (diff)
downloadfortran-assignment2-0ef69b67e70da34e96cddfca4700ffe0a5e2304f.tar.gz
fortran-assignment2-0ef69b67e70da34e96cddfca4700ffe0a5e2304f.zip
only use c real types where necessary
-rw-r--r--src/f1.f9012
1 files changed, 6 insertions, 6 deletions
diff --git a/src/f1.f90 b/src/f1.f90
index b1f89b9..f8054cd 100644
--- a/src/f1.f90
+++ b/src/f1.f90
@@ -6,9 +6,9 @@ PROGRAM test
INCLUDE 'fftw3.f03'
integer, parameter :: npoints = 1024, ncomplex = npoints / 2 + 1
- real(C_DOUBLE), parameter :: start = 0, end = 1
+ real(kind=8), parameter :: start = 0, end = 1
integer :: i
- real(C_DOUBLE) :: t, &
+ real(kind=8) :: t, &
delta = (end - start) / real(npoints - 1, C_DOUBLE)
type(C_PTR) :: p_real, p_complex, plan
@@ -51,7 +51,7 @@ PROGRAM test
DO i = 1, npoints
t = (i - 1) * delta + start
- arr_real(i) = f1(t)
+ arr_real(i) = real(f1(t), C_DOUBLE)
! write(*,*) t, " ", arr_real(i)
@@ -70,9 +70,9 @@ PROGRAM test
CONTAINS
- PURE real(C_DOUBLE) FUNCTION f1(t)
- real(C_DOUBLE), intent(in) :: t
- real(C_DOUBLE), parameter :: pi = acos(-1.0)
+ PURE real(kind=8) FUNCTION f1(t)
+ real(kind=8), intent(in) :: t
+ real(kind=8), parameter :: pi = acos(-1.0)
f1 = sin(2 * pi * t * 200) + 2 * sin(2 * pi * t * 400)