From 3ec4e553c39cc76d200aba62d24680f7793aa457 Mon Sep 17 00:00:00 2001 From: pecchia Date: Tue, 3 Nov 2020 14:53:24 +0100 Subject: [PATCH] Add constants.f90 --- .gitignore | 3 +++ caotic_pendulum.f90 | 4 +--- constants.f90 | 7 +++++++ make.dep | 2 ++ test.f90 | 2 +- 5 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 constants.f90 diff --git a/.gitignore b/.gitignore index a0c6846..5187bdf 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,5 @@ *.o *.mod +*.f90~ +#Makefile# +test diff --git a/caotic_pendulum.f90 b/caotic_pendulum.f90 index 0be591f..8e4ea50 100644 --- a/caotic_pendulum.f90 +++ b/caotic_pendulum.f90 @@ -1,12 +1,10 @@ module caotic_pendulum use precision + use constants use functions use solvers implicit none - real(dp), parameter :: pi = 3.14159265358979323846264338327_dp - real(dp), parameter :: eps = 1.d-10 - contains subroutine solve(Nstep, Nperiods, x0, v0) diff --git a/constants.f90 b/constants.f90 new file mode 100644 index 0000000..1cab51f --- /dev/null +++ b/constants.f90 @@ -0,0 +1,7 @@ +module constants + use precision + + real(dp), parameter :: pi = acos(-1.0_dp) + real(dp), parameter :: eps = 1.d-10 + +end module constants diff --git a/make.dep b/make.dep index d39d716..0b06475 100644 --- a/make.dep +++ b/make.dep @@ -1,6 +1,8 @@ caotic_pendulum.o: precision.o +caotic_pendulum.o: constants.o caotic_pendulum.o: functions.o caotic_pendulum.o: solvers.o +constants.o: precision.o functions.o: precision.o functions.o: precision.o solvers.o: precision.o diff --git a/test.f90 b/test.f90 index b06cc87..dabae77 100644 --- a/test.f90 +++ b/test.f90 @@ -1,10 +1,10 @@ program test use precision + use constants use functions use solvers implicit none - real(dp), parameter :: pi = acos(-1.0_dp) real(dp) :: err, t, dt, x0, v0, Qmin, Qmax, dQ, AA, BB, xex real(dp), allocatable :: u(:), u0(:), param(:) integer :: i, j, k, NQ, Nstep, Ncicli, num_args, funit ! funit = file unit