Skip to content

Commit ae235f4

Browse files
author
Ben Wells
committed
Add -Wall compiler optnio
1 parent 07459e9 commit ae235f4

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ get_filename_component (Fortran_COMPILER_NAME ${CMAKE_Fortran_COMPILER} NAME)
2222

2323
if (Fortran_COMPILER_NAME MATCHES "gfortran.*")
2424
# gfortran
25-
set (CMAKE_Fortran_FLAGS_RELEASE "-funroll-all-loops -fno-f2c -O3")
26-
set (CMAKE_Fortran_FLAGS_DEBUG "-fno-f2c -O0 -g")
25+
set (CMAKE_Fortran_FLAGS_RELEASE "-funroll-all-loops -fno-f2c -O3 -Wall")
26+
set (CMAKE_Fortran_FLAGS_DEBUG "-fno-f2c -O0 -g -Wall")
2727
elseif (Fortran_COMPILER_NAME MATCHES "ifort.*")
2828
# ifort (untested)
2929
set (CMAKE_Fortran_FLAGS_RELEASE "-f77rtl -O3")

src/main.f90

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ program pme
2323
!*********************************************************************************
2424
implicit none
2525
!---------------------------------------------------------------------------------
26-
integer :: nodes, i, reports, reportid
26+
integer :: nodes, reports, reportid
2727
double precision, dimension(:), allocatable :: u, x, theta, x_dot
2828
double precision :: output_t, delta_t, total_t, t_init, rzero, tzero
2929
double precision :: report_step, report_time
@@ -177,8 +177,8 @@ subroutine initial_conditions(u, x, nodes, m, Q, t_init, rzero, tzero)
177177
one_over_m = 1.0d0/m
178178

179179
! Calculate quantities for self-similar solution.
180-
gamman = gamma(one_over_m + (3.0d0/2.0d0))
181-
gammad = gamma(one_over_m + 1.0d0)
180+
gamman = GammaFunction(one_over_m + (3.0d0/2.0d0))
181+
gammad = GammaFunction(one_over_m + 1.0d0)
182182

183183
rzero = Q*gamman/(SQRT(pi)*gammad)
184184
tzero = ((rzero**2)*m)/(2.0d0*(m + 2.0d0))

src/special_functions.f90

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module special_functions
22

33
contains
44

5-
double precision function gamma(xx)
5+
double precision function GammaFunction(xx)
66
!*********************************************************************************
77
!** **
88
!** This function calculates the gamma funtion for the value xx. **
@@ -36,11 +36,11 @@ double precision function gamma(xx)
3636
ser = ser + cof(j)/y
3737
end do
3838

39-
gamma = tmp + dlog(stp*ser/x)
40-
gamma = dexp(gamma)
39+
GammaFunction = tmp + dlog(stp*ser/x)
40+
GammaFunction = dexp(GammaFunction)
4141

4242
return
4343

44-
end function gamma
44+
end function GammaFunction
4545

4646
end module special_functions

0 commit comments

Comments
 (0)