Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

variance_correction: small issue with debug mode of gfortran 7 #171

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/stdlib_experimental_stats_var.fypp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ contains
end do
#:endfor
case default
call error_stop("ERROR (mean): wrong dimension")
call error_stop("ERROR (var): wrong dimension")
end select
res = res / (n - merge(1, 0, optval(corrected, .true.)))

Expand Down Expand Up @@ -140,7 +140,7 @@ contains
end do
#:endfor
case default
call error_stop("ERROR (mean): wrong dimension")
call error_stop("ERROR (var): wrong dimension")
end select
res = res / (n - merge(1, 0, optval(corrected, .true.)))

Expand Down Expand Up @@ -229,7 +229,7 @@ contains
end do
#:endfor
case default
call error_stop("ERROR (mean): wrong dimension")
call error_stop("ERROR (var): wrong dimension")
end select
res = res / (n - merge(1, 0, (optval(corrected, .true.) .and. n > 0)))

Expand Down Expand Up @@ -264,7 +264,7 @@ contains
end do
#:endfor
case default
call error_stop("ERROR (mean): wrong dimension")
call error_stop("ERROR (var): wrong dimension")
end select
res = res / (n - merge(1, 0, (optval(corrected, .true.) .and. n > 0)))

Expand Down
6 changes: 3 additions & 3 deletions src/tests/stats/test_var.f90
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ program test_var

!2dim
print*,' test_sp_2dim'
s = d
allocate(s, source = real(d))
call check( abs(var(s) - 13) < sptol)
call check( all( abs( var(s, 1) - [20. / 3., 20. / 3., 5. / 3.]) < sptol))
call check( all( abs( var(s, 2) - [19.0, 43. / 3., 31. / 3. , 7.0]) < sptol))
Expand Down Expand Up @@ -231,7 +231,7 @@ program test_var

!2dim
print*,' test_int32_2dim'
i32 = d
allocate(i32, source = int(d))
call check( abs(var(i32) - 13) < dptol)
call check( all( abs( var(i32,1) -&
[20._dp/3._dp, 20._dp/3._dp, 5._dp/3._dp]) < dptol))
Expand Down Expand Up @@ -321,7 +321,7 @@ program test_var

!2dim
print*,' test_int64_2dim'
i64 = d
allocate(i64, source = int(d, int64))
call check( abs(var(i64) - 13) < dptol)
call check( all( abs( var(i64,1) -&
[20._dp/3._dp, 20._dp/3._dp, 5._dp/3._dp]) < dptol))
Expand Down
4 changes: 2 additions & 2 deletions src/tests/stats/test_varn.f90
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ program test_varn

!2dim
print*,' test_sp_2dim'
s = d
allocate(s, source = real(d))
call check( abs(var(s, corrected=.false.) - 13.*11./12.) < sptol)
call check( all( abs( var(s, 1, corrected=.false.) - [20., 20., 5.]/4.) < sptol))
call check( all( abs( var(s, 2, corrected=.false.) -&
Expand Down Expand Up @@ -227,7 +227,7 @@ program test_varn
call check( abs(var(i321, 1, i321 < 5, corrected=.false.) - 5._dp/4.) < dptol)

!2dim
i32 = d
allocate(i32, source = int(d, int32))
print*,' test_int32_2dim'
call check( abs(var(i32, corrected=.false.) - 13._dp*11./12.) < dptol)
call check( all( abs( var(i32, 1, corrected=.false.) -&
Expand Down