Commit 6732a5e2 authored by Pavel Kus's avatar Pavel Kus

simplified some real/complex variable initializations

parent 154a0d61
...@@ -347,14 +347,9 @@ ...@@ -347,14 +347,9 @@
stop 1 stop 1
endif endif
#if REALCASE == 1 hh_gath(:,:,:) = 0.0_rck
hh_gath(:,:,:) = CONST_0_0 hh_send(:,:,:) = 0.0_rck
hh_send(:,:,:) = CONST_0_0
#endif
#if COMPLEXCASE == 1
hh_gath(:,:,:) = CONST_COMPLEX_0_0
hh_send(:,:,:) = CONST_COMPLEX_0_0
#endif
! Some counters ! Some counters
allocate(hh_cnt(nblocks), stat=istat, errmsg=errorMessage) allocate(hh_cnt(nblocks), stat=istat, errmsg=errorMessage)
...@@ -425,14 +420,8 @@ ...@@ -425,14 +420,8 @@
stop 1 stop 1
endif endif
#if REALCASE == 1 hv_t = 0.0_rck
hv_t = 0 tau_t = 0.0_rck
tau_t = 0
#endif
#if COMPLEXCASE == 1
hv_t = CONST_COMPLEX_0_0
tau_t = CONST_COMPLEX_0_0
#endif
#endif /* WITH_OPENMP */ #endif /* WITH_OPENMP */
! --------------------------------------------------------------------------- ! ---------------------------------------------------------------------------
...@@ -470,14 +459,8 @@ ...@@ -470,14 +459,8 @@
if (my_pe==0) then if (my_pe==0) then
n = MIN(na-na_s,nb) ! number of rows to be reduced n = MIN(na-na_s,nb) ! number of rows to be reduced
#if REALCASE == 1 hv(:) = 0.0_rck
hv(:) = CONST_0_0 tau = 0.0_rck
tau = CONST_0_0
#endif
#if COMPLEXCASE == 1
hv(:) = CONST_COMPLEX_0_0
tau = CONST_COMPLEX_0_0
#endif
! Transform first column of remaining matrix ! Transform first column of remaining matrix
#if REALCASE == 1 #if REALCASE == 1
...@@ -525,12 +508,7 @@ ...@@ -525,12 +508,7 @@
e(istep) = ab(2,na_s-n_off) e(istep) = ab(2,na_s-n_off)
if (istep == na-1) then if (istep == na-1) then
d(na) = ab(1,na_s+1-n_off) d(na) = ab(1,na_s+1-n_off)
#if REALCASE == 1 e(na) = 0.0_rck
e(na) = CONST_0_0
#endif
#if COMPLEXCASE == 1
e(na) = CONST_REAL_0_0
#endif
endif endif
else else
if (na>na_s) then if (na>na_s) then
...@@ -577,24 +555,14 @@ ...@@ -577,24 +555,14 @@
#endif /* WITH_OPENMP */ #endif /* WITH_OPENMP */
tau = hv(1) tau = hv(1)
#if REALCASE == 1 hv(1) = 1.0_rck
hv(1) = CONST_1_0
#endif
#if COMPLEXCASE == 1
hv(1) = CONST_COMPLEX_1_0
#endif
endif endif
endif endif
na_s = na_s+1 na_s = na_s+1
if (na_s-n_off > nb) then if (na_s-n_off > nb) then
ab(:,1:nblocks*nb) = ab(:,nb+1:(nblocks+1)*nb) ab(:,1:nblocks*nb) = ab(:,nb+1:(nblocks+1)*nb)
#if REALCASE == 1 ab(:,nblocks*nb+1:(nblocks+1)*nb) = 0.0_rck
ab(:,nblocks*nb+1:(nblocks+1)*nb) = CONST_0_0
#endif
#if COMPLEXCASE == 1
ab(:,nblocks*nb+1:(nblocks+1)*nb) = 0
#endif
n_off = n_off + nb n_off = n_off + nb
endif endif
...@@ -682,14 +650,8 @@ ...@@ -682,14 +650,8 @@
call PRECISION_HER2('L', nc, CONST_COMPLEX_PAIR_NEGATIVE_1_0, hd, 1, hv, 1, ab(1,ns), 2*nb-1) call PRECISION_HER2('L', nc, CONST_COMPLEX_PAIR_NEGATIVE_1_0, hd, 1, hv, 1, ab(1,ns), 2*nb-1)
#endif #endif
if (wantDebug) call obj%timer%stop("blas") if (wantDebug) call obj%timer%stop("blas")
#if REALCASE == 1 hv_t(:,my_thread) = 0.0_rck
hv_t(:,my_thread) = CONST_0_0 tau_t(my_thread) = 0.0_rck
tau_t(my_thread) = CONST_0_0
#endif
#if COMPLEXCASE == 1
hv_t(:,my_thread) = CONST_COMPLEX_0_0
tau_t(my_thread) = CONST_COMPLEX_0_0
#endif
if (nr<=0) cycle ! No subdiagonal block present any more if (nr<=0) cycle ! No subdiagonal block present any more
! Transform subdiagonal block ! Transform subdiagonal block
...@@ -732,19 +694,9 @@ ...@@ -732,19 +694,9 @@
&PRECISION & &PRECISION &
(obj, ab(nb+1,ns), vnorm2, hf, tau_t(my_thread), wantDebug) (obj, ab(nb+1,ns), vnorm2, hf, tau_t(my_thread), wantDebug)
#if REALCASE == 1 hv_t(1 ,my_thread) = 1.0_rck
hv_t(1 ,my_thread) = CONST_1_0
#endif
#if COMPLEXCASE == 1
hv_t(1 ,my_thread) = CONST_COMPLEX_1_0
#endif
hv_t(2:nr,my_thread) = ab(nb+2:nb+nr,ns)*hf hv_t(2:nr,my_thread) = ab(nb+2:nb+nr,ns)*hf
#if REALCASE == 1 ab(nb+2:,ns) = 0.0_rck
ab(nb+2:,ns) = CONST_0_0
#endif
#if COMPLEXCASE == 1
ab(nb+2:,ns) = CONST_COMPLEX_0_0
#endif
! update subdiagonal block for old and new Householder transformation ! update subdiagonal block for old and new Householder transformation
! This way we can use a nonsymmetric rank 2 update which is (hopefully) faster ! This way we can use a nonsymmetric rank 2 update which is (hopefully) faster
if (wantDebug) call obj%timer%start("blas") if (wantDebug) call obj%timer%start("blas")
...@@ -790,12 +742,7 @@ ...@@ -790,12 +742,7 @@
#endif #endif
enddo enddo
! For safety: there is one remaining dummy transformation (but tau is 0 anyways) ! For safety: there is one remaining dummy transformation (but tau is 0 anyways)
#if REALCASE == 1 hv_t(1,my_thread) = 1.0_rck
hv_t(1,my_thread) = CONST_1_0
#endif
#if COMPLEXCASE == 1
hv_t(1,my_thread) = CONST_COMPLEX_1_0
#endif
endif endif
enddo enddo
...@@ -975,12 +922,7 @@ ...@@ -975,12 +922,7 @@
! First do the matrix multiplications without last column ... ! First do the matrix multiplications without last column ...
! Diagonal block, the contribution of the last element is added below! ! Diagonal block, the contribution of the last element is added below!
#if REALCASE == 1 ab(1,ne) = 0.0_rck
ab(1,ne) = CONST_0_0
#endif
#if COMPLEXCASE == 1
ab(1,ne) = CONST_COMPLEX_0_0
#endif
if (wantDebug) call obj%timer%start("blas") if (wantDebug) call obj%timer%start("blas")
#if REALCASE == 1 #if REALCASE == 1
...@@ -1055,14 +997,8 @@ ...@@ -1055,14 +997,8 @@
! Calculate first column of subdiagonal block and calculate new ! Calculate first column of subdiagonal block and calculate new
! Householder transformation for this column ! Householder transformation for this column
#if REALCASE == 1 hv_new(:) = 0.0_rck ! Needed, last rows must be 0 for nr < nb
hv_new(:) = CONST_0_0 ! Needed, last rows must be 0 for nr < nb tau_new = 0.0_rck
tau_new = CONST_0_0
#endif
#if COMPLEXCASE == 1
hv_new(:) = 0 ! Needed, last rows must be 0 for nr < nb
tau_new = 0
#endif
if (nr>0) then if (nr>0) then
! complete (old) Householder transformation for first column ! complete (old) Householder transformation for first column
...@@ -1090,19 +1026,9 @@ ...@@ -1090,19 +1026,9 @@
#endif #endif
&PRECISION & &PRECISION &
(obj, ab(nb+1,ns), vnorm2, hf, tau_new, wantDebug) (obj, ab(nb+1,ns), vnorm2, hf, tau_new, wantDebug)
#if REALCASE == 1 hv_new(1) = 1.0_rck
hv_new(1) = CONST_1_0
#endif
#if COMPLEXCASE == 1
hv_new(1) = CONST_COMPLEX_1_0
#endif
hv_new(2:nr) = ab(nb+2:nb+nr,ns)*hf hv_new(2:nr) = ab(nb+2:nb+nr,ns)*hf
#if REALCASE == 1 ab(nb+2:,ns) = 0.0_rck
ab(nb+2:,ns) = CONST_0_0
#endif
#if COMPLEXCASE == 1
ab(nb+2:,ns) = CONST_COMPLEX_0_0
#endif
endif ! nr > 1 endif ! nr > 1
! ... and send it away immediatly if this is the last block ! ... and send it away immediatly if this is the last block
......
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