Skip to content

Commit a1b9a91

Browse files
authored
Merge pull request fortran-lang#211 from jvdp1/some_cleaning
Remove some unused variables and simplify use of ieee_value
2 parents 85f7f6d + c3a26fc commit a1b9a91

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

src/stdlib_experimental_stats_mean.fypp

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ contains
1919
${t1}$ :: res
2020

2121
if (.not.optval(mask, .true.)) then
22-
res = ieee_value(real(res, kind=${k1}$), ieee_quiet_nan)
22+
res = ieee_value(1._${k1}$, ieee_quiet_nan)
2323
return
2424
end if
2525

@@ -38,7 +38,7 @@ contains
3838
real(dp) :: res
3939

4040
if (.not.optval(mask, .true.)) then
41-
res = ieee_value(res, ieee_quiet_nan)
41+
res = ieee_value(1._dp, ieee_quiet_nan)
4242
return
4343
end if
4444

@@ -59,7 +59,7 @@ contains
5959
${t1}$ :: res${reduced_shape('x', rank, 'dim')}$
6060

6161
if (.not.optval(mask, .true.)) then
62-
res = ieee_value(real(res, kind=${k1}$), ieee_quiet_nan)
62+
res = ieee_value(1._${k1}$, ieee_quiet_nan)
6363
return
6464
end if
6565

@@ -84,7 +84,7 @@ contains
8484
real(dp) :: res${reduced_shape('x', rank, 'dim')}$
8585

8686
if (.not.optval(mask, .true.)) then
87-
res = ieee_value(res, ieee_quiet_nan)
87+
res = ieee_value(1._dp, ieee_quiet_nan)
8888
return
8989
end if
9090

src/tests/ascii/test_ascii.f90

-1
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,6 @@ subroutine test_to_upper_long()
486486
!
487487
subroutine test_ascii_table
488488
integer :: i, j
489-
character(len=1) :: c
490489
logical :: table(15,12)
491490

492491
abstract interface

src/tests/linalg/test_linalg.f90

+3-5
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ subroutine test_diag_rqp
152152

153153
subroutine test_diag_csp
154154
integer, parameter :: n = 3
155-
complex(sp) :: v(n), a(n,n), b(n,n)
155+
complex(sp) :: a(n,n), b(n,n)
156156
complex(sp), parameter :: i_ = cmplx(0,1,kind=sp)
157157
integer :: i,j
158158
write(*,*) "test_diag_csp"
@@ -169,9 +169,8 @@ subroutine test_diag_csp
169169

170170
subroutine test_diag_cdp
171171
integer, parameter :: n = 3
172-
complex(dp) :: v(n), a(n,n), b(n,n)
172+
complex(dp) :: a(n,n)
173173
complex(dp), parameter :: i_ = cmplx(0,1,kind=dp)
174-
integer :: i,j
175174
write(*,*) "test_diag_cdp"
176175
a = diag([i_],-2) + diag([i_],2)
177176
call check(a(3,1) == i_ .and. a(1,3) == i_, &
@@ -180,9 +179,8 @@ subroutine test_diag_cdp
180179

181180
subroutine test_diag_cqp
182181
integer, parameter :: n = 3
183-
complex(qp) :: v(n), a(n,n), b(n,n)
182+
complex(qp) :: a(n,n)
184183
complex(qp), parameter :: i_ = cmplx(0,1,kind=qp)
185-
integer :: i,j
186184
write(*,*) "test_diag_cqp"
187185
a = diag([i_,i_],-1) + diag([i_,i_],1)
188186
call check(all(diag(a,-1) == i_) .and. all(diag(a,1) == i_), &

0 commit comments

Comments
 (0)