Commit f6249192 authored by Pavel Kus's avatar Pavel Kus

improving forgotten precision macros

master_pre_stage (even though it did not solve the issue)
parent 2ef1cb32
...@@ -62,9 +62,10 @@ ...@@ -62,9 +62,10 @@
use precision use precision
use elpa_abstract_impl use elpa_abstract_impl
implicit none implicit none
#include "../general/precision_kinds.F90"
class(elpa_abstract_impl_t), intent(inout) :: obj class(elpa_abstract_impl_t), intent(inout) :: obj
integer(kind=ik) :: n integer(kind=ik) :: n
real(kind=REAL_DATATYPE) :: v(n),s real(kind=rk) :: v(n),s
v(:) = v(:) + s v(:) = v(:) + s
end subroutine v_add_s_& end subroutine v_add_s_&
...@@ -76,9 +77,10 @@ ...@@ -76,9 +77,10 @@
use precision use precision
use elpa_abstract_impl use elpa_abstract_impl
implicit none implicit none
#include "../general/precision_kinds.F90"
class(elpa_abstract_impl_t), intent(inout) :: obj class(elpa_abstract_impl_t), intent(inout) :: obj
real(kind=REAL_DATATYPE) :: g_col(nlen), l_col(*) ! chnage this to proper 2d 1d matching ! remove assumed size real(kind=rk) :: g_col(nlen), l_col(*) ! chnage this to proper 2d 1d matching ! remove assumed size
integer(kind=ik) :: noff, nlen, my_prow, np_rows, nblk integer(kind=ik) :: noff, nlen, my_prow, np_rows, nblk
integer(kind=ik) :: nbs, nbe, jb, g_off, l_off, js, je integer(kind=ik) :: nbs, nbe, jb, g_off, l_off, js, je
...@@ -160,10 +162,10 @@ ...@@ -160,10 +162,10 @@
#include "../../src/general/precision_kinds.F90" #include "../../src/general/precision_kinds.F90"
class(elpa_abstract_impl_t), intent(inout) :: obj class(elpa_abstract_impl_t), intent(inout) :: obj
integer(kind=ik) :: n, i integer(kind=ik) :: n, i
real(kind=REAL_DATATYPE) :: d(n), z(n), delta(n), rho, dlam real(kind=rk) :: d(n), z(n), delta(n), rho, dlam
integer(kind=ik) :: iter integer(kind=ik) :: iter
real(kind=REAL_DATATYPE) :: a, b, x, y, dshift real(kind=rk) :: a, b, x, y, dshift
! In order to obtain sufficient numerical accuracy we have to shift the problem ! In order to obtain sufficient numerical accuracy we have to shift the problem
! either by d(i) or d(i+1), whichever is closer to the solution ! either by d(i) or d(i+1), whichever is closer to the solution
...@@ -261,24 +263,25 @@ ...@@ -261,24 +263,25 @@
use precision use precision
use elpa_abstract_impl use elpa_abstract_impl
implicit none implicit none
#include "../general/precision_kinds.F90"
class(elpa_abstract_impl_t), intent(inout) :: obj class(elpa_abstract_impl_t), intent(inout) :: obj
logical, intent(in) :: wantDebug logical, intent(in) :: wantDebug
#if REALCASE == 1 #if REALCASE == 1
real(kind=REAL_DATATYPE), intent(inout) :: alpha real(kind=rk), intent(inout) :: alpha
#endif #endif
#if COMPLEXCASE == 1 #if COMPLEXCASE == 1
complex(kind=COMPLEX_DATATYPE), intent(inout) :: alpha complex(kind=ck), intent(inout) :: alpha
#endif #endif
real(kind=REAL_DATATYPE), intent(in) :: xnorm_sq real(kind=rk), intent(in) :: xnorm_sq
#if REALCASE == 1 #if REALCASE == 1
real(kind=REAL_DATATYPE), intent(out) :: xf, tau real(kind=rk), intent(out) :: xf, tau
#endif #endif
#if COMPLEXCASE == 1 #if COMPLEXCASE == 1
complex(kind=COMPLEX_DATATYPE), intent(out) :: xf, tau complex(kind=ck), intent(out) :: xf, tau
real(kind=REAL_DATATYPE) :: ALPHR, ALPHI real(kind=rk) :: ALPHR, ALPHI
#endif #endif
real(kind=REAL_DATATYPE) :: BETA real(kind=rk) :: BETA
if (wantDebug) call obj%timer%start("hh_transform_& if (wantDebug) call obj%timer%start("hh_transform_&
&MATH_DATATYPE& &MATH_DATATYPE&
...@@ -286,29 +289,29 @@ ...@@ -286,29 +289,29 @@
&PRECISION_SUFFIX ) &PRECISION_SUFFIX )
#if COMPLEXCASE == 1 #if COMPLEXCASE == 1
ALPHR = real( ALPHA, kind=REAL_DATATYPE ) ALPHR = real( ALPHA, kind=rk )
ALPHI = PRECISION_IMAG( ALPHA ) ALPHI = PRECISION_IMAG( ALPHA )
#endif #endif
#if REALCASE == 1 #if REALCASE == 1
if ( XNORM_SQ==0. ) then if ( XNORM_SQ==0.0_rk ) then
#endif #endif
#if COMPLEXCASE == 1 #if COMPLEXCASE == 1
if ( XNORM_SQ==0. .AND. ALPHI==0. ) then if ( XNORM_SQ==0.0_rk .AND. ALPHI==0.0_rk ) then
#endif #endif
#if REALCASE == 1 #if REALCASE == 1
if ( ALPHA>=0. ) then if ( ALPHA>=0.0_rk ) then
#endif #endif
#if COMPLEXCASE == 1 #if COMPLEXCASE == 1
if ( ALPHR>=0. ) then if ( ALPHR>=0.0_rk ) then
#endif #endif
TAU = 0. TAU = 0.0_rk
else else
TAU = 2. TAU = 2.0_rk
ALPHA = -ALPHA ALPHA = -ALPHA
endif endif
XF = 0. XF = 0.0_rk
else else
...@@ -327,8 +330,8 @@ ...@@ -327,8 +330,8 @@
ALPHA = XNORM_SQ / ALPHA ALPHA = XNORM_SQ / ALPHA
#endif #endif
#if COMPLEXCASE == 1 #if COMPLEXCASE == 1
ALPHR = ALPHI * (ALPHI/real( ALPHA , kind=KIND_PRECISION)) ALPHR = ALPHI * (ALPHI/real( ALPHA , kind=rk))
ALPHR = ALPHR + XNORM_SQ/real( ALPHA, kind=KIND_PRECISION ) ALPHR = ALPHR + XNORM_SQ/real( ALPHA, kind=rk )
#endif #endif
#if REALCASE == 1 #if REALCASE == 1
...@@ -340,7 +343,7 @@ ...@@ -340,7 +343,7 @@
ALPHA = PRECISION_CMPLX( -ALPHR, ALPHI ) ALPHA = PRECISION_CMPLX( -ALPHR, ALPHI )
#endif #endif
END IF END IF
XF = 1.0/ALPHA XF = 1.0_rk/ALPHA
ALPHA = BETA ALPHA = BETA
endif endif
......
...@@ -228,7 +228,7 @@ ...@@ -228,7 +228,7 @@
stop 1 stop 1
endif endif
ab = 0 ! needed for lower half, the extra block should also be set to 0 for safety ab = 0.0_rck ! needed for lower half, the extra block should also be set to 0 for safety
! n_off: Offset of ab within band ! n_off: Offset of ab within band
n_off = block_limits(my_pe)*nb n_off = block_limits(my_pe)*nb
...@@ -470,7 +470,7 @@ ...@@ -470,7 +470,7 @@
#else #else
vnorm2 = sum(real(ab(3:n+1,na_s-n_off),kind=rk4)**2+aimag(ab(3:n+1,na_s-n_off))**2) vnorm2 = sum(real(ab(3:n+1,na_s-n_off),kind=rk4)**2+aimag(ab(3:n+1,na_s-n_off))**2)
#endif #endif
if (n<2) vnorm2 = 0. ! Safety only if (n<2) vnorm2 = 0.0_rk ! Safety only
#endif /* COMPLEXCASE */ #endif /* COMPLEXCASE */
call hh_transform_& call hh_transform_&
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment