aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWojtek Kosior <kwojtus@protonmail.com>2019-06-01 17:02:24 +0200
committerWojtek Kosior <kwojtus@protonmail.com>2019-06-01 17:02:24 +0200
commitf37ab2c95709480faceb8756ad52e754a460b466 (patch)
tree0eeb2686fac37ead182e81b81bbcec633ee2ad5c
parent0ef69b67e70da34e96cddfca4700ffe0a5e2304f (diff)
downloadfortran-assignment2-f37ab2c95709480faceb8756ad52e754a460b466.tar.gz
fortran-assignment2-f37ab2c95709480faceb8756ad52e754a460b466.zip
make pi global constant
-rw-r--r--src/f1.f904
1 files changed, 3 insertions, 1 deletions
diff --git a/src/f1.f90 b/src/f1.f90
index f8054cd..955be71 100644
--- a/src/f1.f90
+++ b/src/f1.f90
@@ -5,6 +5,9 @@ PROGRAM test
INCLUDE 'fftw3.f03'
+ real(kind=8), parameter :: pi = acos(-1.0) ! also used from f1()
+
+ ! rest of variables only used from "main" program code
integer, parameter :: npoints = 1024, ncomplex = npoints / 2 + 1
real(kind=8), parameter :: start = 0, end = 1
integer :: i
@@ -72,7 +75,6 @@ CONTAINS
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)