Commit 7024fc76 authored by Marco Govoni's avatar Marco Govoni
Browse files

Merge branch 'develop' into 'doc_improvement'

# Conflicts:
#   IO_kernel/pdep_io.f90
#   Wfreq/solve_gfreq.f90
#   Wfreq/solve_wfreq.f90
parents 89215e18 0d29121a
......@@ -7,28 +7,28 @@
!
! This file is part of WEST.
!
! Contributors to this file:
! Contributors to this file:
! Marco Govoni
!
!-----------------------------------------------------------------------
MODULE pdep_io
!----------------------------------------------------------------------------
!
USE kinds, ONLY : DP
USE mp_global, ONLY : me_bgrp,root_bgrp,nproc_bgrp,intra_bgrp_comm,my_pool_id,my_bgrp_id,inter_bgrp_comm,inter_pool_comm,&
& intra_pool_comm
USE westcom, ONLY : npwq, npwq_g, npwqx, ngq, ngq_g, npwqx, igq_q !, igq_l2g_kdip
USE gvect, ONLY : ig_l2g
USE json_module, ONLY : json_file
USE control_flags, ONLY : gamma_only
USE base64_module
USE kinds, ONLY : DP
USE mp_global, ONLY : me_bgrp,root_bgrp,nproc_bgrp,intra_bgrp_comm,my_pool_id,&
& my_bgrp_id,inter_bgrp_comm,inter_pool_comm,intra_pool_comm
USE westcom, ONLY : npwq,npwq_g,npwqx,ngq,ngq_g,igq_q
USE gvect, ONLY : ig_l2g
USE json_module, ONLY : json_file
USE control_flags, ONLY : gamma_only
USE base64_module
!
IMPLICIT NONE
!
CONTAINS
!
! ******************************************
! WRITE IN G SPACE
! WRITE IN G SPACE
! wfc is passed distributed in G space
! then merged and written in R space
! ******************************************
......@@ -36,12 +36,12 @@ MODULE pdep_io
SUBROUTINE pdep_merge_and_write_G(fname,pdepg,iq)
!
USE mp_wave, ONLY : mergewf
USE mp, ONLY : mp_bcast, mp_max
USE mp, ONLY : mp_bcast,mp_max
!
IMPLICIT NONE
!
! I/O
!
!
CHARACTER(*), INTENT(IN) :: fname
COMPLEX(DP), INTENT(IN) :: pdepg(npwqx)
INTEGER, INTENT(IN), OPTIONAL :: iq
......@@ -49,24 +49,26 @@ MODULE pdep_io
! Workspace
!
COMPLEX(DP),ALLOCATABLE :: tmp_vec(:)
INTEGER :: iun,ierr,ig
INTEGER :: ig
CHARACTER(LEN=:),ALLOCATABLE :: charbase64
INTEGER :: nbytes, ndim, iunit, nlen
CHARACTER(LEN=30) :: endian
INTEGER :: npwqx_g
INTEGER :: npwqx_g
INTEGER, ALLOCATABLE :: igq_l2g_kdip(:), igq_l2g(:)
INTEGER, PARAMETER :: default_iq = 1
INTEGER :: iq_
INTEGER :: iq_
!
IF( PRESENT(iq) ) THEN
CALL start_clock('pdep_write')
!
IF( PRESENT(iq) ) THEN
iq_ = iq
ELSE
iq_ = default_iq
ENDIF
ENDIF
!
IF ( .NOT. gamma_only) THEN
!
! Resume all components
! Resume all components
!
ndim = ngq_g(iq_)
!
......@@ -84,40 +86,40 @@ MODULE pdep_io
DEALLOCATE( igq_l2g )
!
! </NEW>
!
! npwq_g = MAXVAL(igq_l2g_kdip(1:ndim,iq))
! CALL mp_max(npwq_g,intra_pool_comm)
! CALL mp_max(npwq_g,intra_bgrp_comm)
!
! npwq_g = MAXVAL(igq_l2g_kdip(1:ndim,iq))
! CALL mp_max(npwq_g,intra_pool_comm)
! CALL mp_max(npwq_g,intra_bgrp_comm)
!
ALLOCATE( tmp_vec(npwq_g) )
tmp_vec=0._DP
!
CALL mergewf( pdepg(:), tmp_vec, npwq, igq_l2g_kdip, me_bgrp, nproc_bgrp, root_bgrp, intra_bgrp_comm)
DEALLOCATE( igq_l2g_kdip )
DEALLOCATE( igq_l2g_kdip )
!
! ONLY ROOT W/IN BGRP WRITES
!
IF(me_bgrp==root_bgrp) THEN
IF(me_bgrp==root_bgrp) THEN
!
nbytes = SIZEOF(tmp_vec(1)) * ndim
nlen = lenbase64(nbytes)
ALLOCATE(CHARACTER(LEN=nlen) :: charbase64)
CALL base64_encode_complex(tmp_vec(1:ndim), ndim, charbase64)
CALL base64_encode_complex(tmp_vec(1:ndim), ndim, charbase64)
!
IF( islittleendian() ) THEN
IF( islittleendian() ) THEN
endian = '"islittleendian" : true'
ELSE
endian = '"islittleendian" : false'
ENDIF
ENDIF
!
OPEN( NEWUNIT=iunit, FILE = TRIM(fname) )
WRITE( iunit, '(a)' ) '{'
WRITE( iunit, '(a,i0,a)' ) '"meta" : { "name" : "eigenpotential", "type" : "complex double", "space" : "G",&
"ndim" : ', ndim, ', "encoding" : "base64", '//TRIM(endian)//' }'
WRITE( iunit, '(a)') ', "data" : '
WRITE( iunit, '(a)') ', "data" : '
WRITE( iunit, '(a)' ) '"'//charbase64//'"'
WRITE( iunit, '(a)' ) '}'
CLOSE( iunit )
CLOSE( iunit )
!
DEALLOCATE( charbase64 )
!
......@@ -127,37 +129,37 @@ MODULE pdep_io
!
ELSE
!
! Resume all components
! Resume all components
!
ALLOCATE( tmp_vec(npwq_g) )
tmp_vec=0._DP
!
CALL mergewf( pdepg(:), tmp_vec, npwq, ig_l2g(1:npwq), me_bgrp, nproc_bgrp, root_bgrp, intra_bgrp_comm)
CALL mergewf( pdepg(:), tmp_vec, npwq, ig_l2g(1:npwq), me_bgrp, nproc_bgrp, root_bgrp, intra_bgrp_comm)
!
! ONLY ROOT W/IN BGRP WRITES
!
IF(me_bgrp==root_bgrp) THEN
IF(me_bgrp==root_bgrp) THEN
!
ndim = npwq_g
nbytes = SIZEOF(tmp_vec(1)) * ndim
nlen = lenbase64(nbytes)
ALLOCATE(CHARACTER(LEN=nlen) :: charbase64)
CALL base64_encode_complex(tmp_vec(1:ndim), ndim, charbase64)
CALL base64_encode_complex(tmp_vec(1:ndim), ndim, charbase64)
!
IF( islittleendian() ) THEN
IF( islittleendian() ) THEN
endian = '"islittleendian" : true'
ELSE
endian = '"islittleendian" : false'
ENDIF
ENDIF
!
OPEN( NEWUNIT=iunit, FILE = TRIM(fname) )
WRITE( iunit, '(a)' ) '{'
WRITE( iunit, '(a,i0,a)' ) '"meta" : { "name" : "eigenpotential", "type" : "complex double", "space" : "G",&
"ndim" : ', ndim, ', "encoding" : "base64", '//TRIM(endian)//' }'
WRITE( iunit, '(a)') ', "data" : '
WRITE( iunit, '(a)') ', "data" : '
WRITE( iunit, '(a)' ) '"'//charbase64//'"'
WRITE( iunit, '(a)' ) '}'
CLOSE( iunit )
CLOSE( iunit )
!
DEALLOCATE( charbase64 )
!
......@@ -166,11 +168,13 @@ MODULE pdep_io
DEALLOCATE( tmp_vec )
!
ENDIF
!
!
CALL stop_clock('pdep_write')
!
END SUBROUTINE
!
! ******************************************
! READ IN G SPACE
! READ IN G SPACE
! wfc is read merged in G space
! then split in G space
! ******************************************
......@@ -185,7 +189,7 @@ MODULE pdep_io
IMPLICIT NONE
!
! I/O
!
!
CHARACTER(*), INTENT(IN) :: fname
COMPLEX(DP), INTENT(OUT) :: pdepg(npwqx)
INTEGER, INTENT(IN), OPTIONAL :: iq
......@@ -194,31 +198,33 @@ MODULE pdep_io
!
TYPE(json_file) :: json
COMPLEX(DP),ALLOCATABLE :: tmp_vec(:)
INTEGER :: iun,ierr,ig
INTEGER :: ig
CHARACTER(LEN=1000) :: line
CHARACTER(LEN=:),ALLOCATABLE :: charbase64
CHARACTER(LEN=:),ALLOCATABLE :: endian
INTEGER :: nbytes, ndim, iunit, nlen
LOGICAL :: found, isle
INTEGER :: npwqx_g
INTEGER, ALLOCATABLE :: igq_l2g_kdip(:), igq_l2g(:)
INTEGER, ALLOCATABLE :: igq_l2g_kdip(:), igq_l2g(:)
INTEGER, PARAMETER :: default_iq = 1
INTEGER :: iq_
INTEGER :: iq_
!
IF( PRESENT(iq) ) THEN
CALL start_clock('pdep_read')
!
IF( PRESENT(iq) ) THEN
iq_ = iq
ELSE
iq_ = default_iq
ENDIF
ENDIF
!
IF ( .NOT. gamma_only ) THEN
!
! Resume all components
! Resume all components
!
ndim = ngq_g(iq_)
! npwq_g = MAXVAL(igq_l2g_kdip(1:ndim,iq))
! CALL mp_max(npwq_g,intra_pool_comm)
! CALL mp_max(npwq_g,intra_bgrp_comm)
! npwq_g = MAXVAL(igq_l2g_kdip(1:ndim,iq))
! CALL mp_max(npwq_g,intra_pool_comm)
! CALL mp_max(npwq_g,intra_bgrp_comm)
!
ALLOCATE( tmp_vec(npwq_g) )
tmp_vec=0._DP
......@@ -231,17 +237,17 @@ MODULE pdep_io
nbytes = SIZEOF(tmp_vec(1)) * ndim
nlen = lenbase64(nbytes)
!
IF(me_bgrp==root_bgrp) THEN
IF(me_bgrp==root_bgrp) THEN
!
ALLOCATE(CHARACTER(LEN=(nlen+2)) :: charbase64)
!
OPEN( NEWUNIT=iunit, FILE = TRIM(fname) )
READ( iunit, * )
READ( iunit, '(a)' ) line
READ( iunit, * )
READ( iunit, * )
READ( iunit, '(a)' ) line
READ( iunit, * )
READ( iunit, '(a)' ) charbase64
CLOSE( iunit )
CALL base64_decode_complex(charbase64(2:(nlen+1)), ndim, tmp_vec(1:ndim))
CALL base64_decode_complex(charbase64(2:(nlen+1)), ndim, tmp_vec(1:ndim))
DEALLOCATE( charbase64 )
!
CALL json%load_from_string("{"//TRIM(line)//"}")
......@@ -267,9 +273,9 @@ MODULE pdep_io
DEALLOCATE( igq_l2g )
!
! </NEW>
!
CALL splitwf( pdepg, tmp_vec, npwq, igq_l2g_kdip, me_bgrp, nproc_bgrp, root_bgrp, intra_bgrp_comm)
DEALLOCATE( igq_l2g_kdip )
!
CALL splitwf( pdepg, tmp_vec, npwq, igq_l2g_kdip, me_bgrp, nproc_bgrp, root_bgrp, intra_bgrp_comm)
DEALLOCATE( igq_l2g_kdip )
!
ENDIF
!
......@@ -280,7 +286,7 @@ MODULE pdep_io
!
ELSE
!
! Resume all components
! Resume all components
!
ALLOCATE( tmp_vec(npwq_g) )
tmp_vec=0._DP
......@@ -294,17 +300,17 @@ MODULE pdep_io
nbytes = SIZEOF(tmp_vec(1)) * ndim
nlen = lenbase64(nbytes)
!
IF(me_bgrp==root_bgrp) THEN
IF(me_bgrp==root_bgrp) THEN
!
ALLOCATE(CHARACTER(LEN=(nlen+2)) :: charbase64)
!
OPEN( NEWUNIT=iunit, FILE = TRIM(fname) )
READ( iunit, * )
READ( iunit, '(a)' ) line
READ( iunit, * )
READ( iunit, * )
READ( iunit, '(a)' ) line
READ( iunit, * )
READ( iunit, '(a)' ) charbase64
CLOSE( iunit )
CALL base64_decode_complex(charbase64(2:(nlen+1)), ndim, tmp_vec(1:ndim))
CALL base64_decode_complex(charbase64(2:(nlen+1)), ndim, tmp_vec(1:ndim))
DEALLOCATE( charbase64 )
!
CALL json%load_from_string("{"//TRIM(line)//"}")
......@@ -315,7 +321,7 @@ MODULE pdep_io
!
END IF
!
CALL splitwf( pdepg, tmp_vec, npwq, ig_l2g(1:npwq), me_bgrp, nproc_bgrp, root_bgrp, intra_bgrp_comm)
CALL splitwf( pdepg, tmp_vec, npwq, ig_l2g(1:npwq), me_bgrp, nproc_bgrp, root_bgrp, intra_bgrp_comm)
!
ENDIF
!
......@@ -325,7 +331,9 @@ MODULE pdep_io
CALL mp_bcast(pdepg,0,inter_pool_comm)
!
ENDIF
!
!
CALL stop_clock('pdep_read')
!
END SUBROUTINE
!
END MODULE
......@@ -7,34 +7,34 @@
!
! This file is part of WEST.
!
! Contributors to this file:
! Contributors to this file:
! Marco Govoni
!
!-----------------------------------------------------------------------
SUBROUTINE solve_gfreq(l_read_restart)
!-----------------------------------------------------------------------
!
USE control_flags, ONLY : gamma_only
USE control_flags, ONLY : gamma_only
!
IMPLICIT NONE
!
! I/O
! I/O
!
LOGICAL,INTENT(IN) :: l_read_restart
!
IF( gamma_only ) THEN
IF( gamma_only ) THEN
CALL solve_gfreq_gamma( l_read_restart )
ELSE
CALL solve_gfreq_k( l_read_restart )
ENDIF
!
END SUBROUTINE
END SUBROUTINE
!
!-----------------------------------------------------------------------
SUBROUTINE solve_gfreq_gamma(l_read_restart)
!-----------------------------------------------------------------------
!
USE kinds, ONLY : DP
USE kinds, ONLY : DP
USE westcom, ONLY : west_prefix,n_pdep_eigen_to_use,n_lanczos,npwq,qp_bandrange,iks_l2g,&
& l_enable_lanczos,nbnd_occ,iuwfc,lrwfc,o_restart_time,npwqx,fftdriver, &
& wstat_save_dir
......@@ -50,14 +50,12 @@ SUBROUTINE solve_gfreq_gamma(l_read_restart)
USE wavefunctions_module, ONLY : evc,psic,psic_nc
USE io_files, ONLY : tmp_dir,nwordwfc,iunwfc
USE fft_at_gamma, ONLY : single_invfft_gamma,single_fwfft_gamma
! USE fft_at_k, ONLY : SINGLEBAND_INVFFT_k,SINGLEBAND_FWFFT_k
USE becmod, ONLY : becp,allocate_bec_type,deallocate_bec_type
USE uspp, ONLY : vkb,nkb
USE pdep_db, ONLY : generate_pdep_fname
USE pdep_io, ONLY : pdep_read_G_and_distribute
USE pdep_io, ONLY : pdep_read_G_and_distribute
USE io_push, ONLY : io_push_title
! USE control_flags, ONLY : gamma_only
USE noncollin_module, ONLY : noncolin,npol
USE noncollin_module, ONLY : noncolin,npol
USE buffers, ONLY : get_buffer
USE bar, ONLY : bar_type,start_bar_type,update_bar_type,stop_bar_type
USE distribution_center, ONLY : pert
......@@ -84,6 +82,7 @@ SUBROUTINE solve_gfreq_gamma(l_read_restart)
COMPLEX(DP),ALLOCATABLE :: q_s( :, :, : )
COMPLEX(DP),ALLOCATABLE :: dvpsi(:,:)
COMPLEX(DP),ALLOCATABLE :: pertg(:),pertr(:)
COMPLEX(DP),ALLOCATABLE :: pertg_all(:,:)
REAL(DP),ALLOCATABLE :: ps_r(:,:)
TYPE(bar_type) :: barra
INTEGER :: barra_load
......@@ -97,7 +96,7 @@ SUBROUTINE solve_gfreq_gamma(l_read_restart)
!
! This is to reduce memory
!
CALL deallocate_bec_type( becp )
CALL deallocate_bec_type( becp )
CALL allocate_bec_type ( nkb, pert%nloc, becp ) ! I just need 2 becp at a time
!
CALL pot3D%init('Wave',.FALSE.,'default')
......@@ -105,12 +104,12 @@ SUBROUTINE solve_gfreq_gamma(l_read_restart)
IF(l_read_restart) THEN
CALL solvegfreq_restart_read( bks )
ELSE
bks%lastdone_ks = 0
bks%lastdone_band = 0
bks%old_ks = 0
bks%old_band = 0
bks%lastdone_ks = 0
bks%lastdone_band = 0
bks%old_ks = 0
bks%old_band = 0
bks%max_ks = k_grid%nps
bks%min_ks = 1
bks%min_ks = 1
ENDIF
!
barra_load = 0
......@@ -121,15 +120,27 @@ SUBROUTINE solve_gfreq_gamma(l_read_restart)
barra_load = barra_load + 1
ENDDO
ENDDO
!
IF( barra_load == 0 ) THEN
!
IF( barra_load == 0 ) THEN
CALL start_bar_type( barra, 'glanczos', 1 )
CALL update_bar_type( barra, 'glanczos', 1 )
CALL update_bar_type( barra, 'glanczos', 1 )
ELSE
CALL start_bar_type( barra, 'glanczos', barra_load )
ENDIF
!
! LOOP
! Read PDEP
!
ALLOCATE(pertg_all(npwqx,pert%nloc))
pertg_all = 0._DP
!
DO ip = 1,pert%nloc
glob_ip = pert%l2g(ip)
CALL generate_pdep_fname(filepot,glob_ip)
fname = TRIM(wstat_save_dir)//"/"//filepot
CALL pdep_read_G_and_distribute(fname,pertg_all(:,ip))
ENDDO
!
! LOOP
!
DO iks = 1, k_grid%nps ! KPOINT-SPIN
IF(iks<bks%lastdone_ks) CYCLE
......@@ -149,7 +160,7 @@ SUBROUTINE solve_gfreq_gamma(l_read_restart)
!
IF(k_grid%nps>1) THEN
!iuwfc = 20
!lrwfc = nbnd * npwx * npol
!lrwfc = nbnd * npwx * npol
!!CALL get_buffer( evc, nwordwfc, iunwfc, iks )
IF(my_image_id==0) CALL get_buffer( evc, lrwfc, iuwfc, iks )
!CALL mp_bcast(evc,0,inter_image_comm)
......@@ -178,37 +189,30 @@ SUBROUTINE solve_gfreq_gamma(l_read_restart)
bks%max_band=nbndval
bks%min_band=1
!
ALLOCATE(dvpsi(npwx*npol,pert%nlocx))
ALLOCATE(dvpsi(npwx*npol,pert%nlocx))
CALL preallocate_solvegfreq( iks_l2g(iks), qp_bandrange(1), qp_bandrange(2), pert )
!
time_spent(1) = get_clock( 'glanczos' )
time_spent(1) = get_clock( 'glanczos' )
!
! LOOP over band states
! LOOP over band states
!
DO ib = qp_bandrange(1), qp_bandrange(2)
IF(iks==bks%lastdone_ks .AND. ib <= bks%lastdone_band ) CYCLE
!
! PSIC
!
CALL single_invfft_gamma(dffts,npw,npwx,evc(1,ib),psic,'Wave')
CALL single_invfft_gamma(dffts,npw,npwx,evc(1,ib),psic,'Wave')
!
! ZEROS
!
dvpsi = 0._DP
!
! Read PDEP
dvpsi = 0._DP
!
ALLOCATE( pertg(npwqx) )
ALLOCATE( pertg( npwqx ) )
ALLOCATE( pertr( dffts%nnr ) )
!
DO ip=1,pert%nloc
glob_ip = pert%l2g(ip)
!
! Exhume dbs eigenvalue
!
CALL generate_pdep_fname( filepot, glob_ip )
fname = TRIM( wstat_save_dir ) // "/"// filepot
CALL pdep_read_G_and_distribute(fname,pertg)
pertg = pertg_all(:,ip)
!
! Multiply by sqvc
!pertg(:) = sqvc(:) * pertg(:) ! / SQRT(fpi*e2) ! CONTROLLARE QUESTO
......@@ -218,31 +222,31 @@ SUBROUTINE solve_gfreq_gamma(l_read_restart)
!
! Bring it to R-space
CALL single_invfft_gamma(dffts,npwq,npwqx,pertg(1),pertr,TRIM(fftdriver))
DO ir=1,dffts%nnr
DO ir=1,dffts%nnr
pertr(ir)=psic(ir)*pertr(ir)
ENDDO
CALL single_fwfft_gamma(dffts,npw,npwx,pertr,dvpsi(1,ip),'Wave')
!
!
ENDDO ! pert
!
!
DEALLOCATE(pertr)
DEALLOCATE(pertg)
!
! OVERLAP( glob_ip, im=1:n_hstates ) = < psi_im iks | dvpsi_glob_ip >
!
IF(ALLOCATED(ps_r)) DEALLOCATE(ps_r)
ALLOCATE(ps_r(nbnd,pert%nloc))
CALL glbrak_gamma(evc,dvpsi,ps_r,npw,npwx,nbnd,pert%nloc,nbnd,npol)
CALL mp_sum(ps_r,intra_bgrp_comm)
!
IF(ALLOCATED(overlap)) DEALLOCATE(overlap)
ALLOCATE(overlap(pert%nglob, nbnd ) )
overlap = 0._DP
DO im = 1, nbnd
DO ip = 1, pert%nloc
glob_ip = pert%l2g(ip)
overlap(glob_ip,im) = ps_r(im,ip)
IF(ALLOCATED(ps_r)) DEALLOCATE(ps_r)
ALLOCATE(ps_r(nbnd,pert%nloc))
CALL glbrak_gamma(evc,dvpsi,ps_r,npw,npwx,nbnd,pert%nloc,nbnd,npol)
CALL mp_sum(ps_r,intra_bgrp_comm)
!
IF(ALLOCATED(overlap)) DEALLOCATE(overlap)
ALLOCATE(overlap(pert%nglob, nbnd ) )
overlap = 0._DP
DO im = 1, nbnd
DO ip = 1, pert%nloc
glob_ip = pert%l2g(ip)
overlap(glob_ip,im) = ps_r(im,ip)
ENDDO
ENDDO
!
......@@ -256,12 +260,12 @@ SUBROUTINE solve_gfreq_gamma(l_read_restart)
! Now dvpsi is distributed according to eigen_distr (image), I need to use it for lanczos
! In the gamma_only case I need to process 2 dvpsi at a time (+ the odd last one, eventually), otherwise 1 at a time.
!
IF( l_enable_lanczos ) THEN
IF( l_enable_lanczos ) THEN
!
ALLOCATE( bnorm ( pert%nloc ) )
ALLOCATE( diago ( n_lanczos , pert%nloc ) )
ALLOCATE( subdiago ( n_lanczos-1 , pert%nloc ) )
ALLOCATE( q_s ( npwx*npol , pert%nloc , n_lanczos ) ) ! WARNING ORDER INVERTED TO SMOOTHEN LANCZOS ALGORITHM
ALLOCATE( q_s ( npwx*npol , pert%nloc , n_lanczos ) ) ! WARNING ORDER INVERTED TO SMOOTHEN LANCZOS ALGORITHM
!
CALL solve_deflated_lanczos_w_full_ortho ( nbnd, pert%nloc, n_lanczos, dvpsi, diago, subdiago, q_s, bnorm)
!
......@@ -276,21 +280,21 @@ SUBROUTINE solve_gfreq_gamma(l_read_restart)
DEALLOCATE( bnorm )
DEALLOCATE( subdiago )
!
! MPI-IO
! MPI-IO
!
CALL writeout_solvegfreq( iks_l2g(iks), ib, diago, braket, pert%nloc, pert%nglob, pert%myoffset )
!
DEALLOCATE( diago )
DEALLOCATE( diago )
DEALLOCATE( braket )
!
ENDIF ! l_enable_lanczos
!
time_spent(2) = get_clock( 'glanczos' )
time_spent(2) = get_clock( 'glanczos' )
!
IF( o_restart_time >= 0._DP ) THEN
IF( (time_spent(2)-time_spent(1)) > o_restart_time*60._DP .OR. ib == qp_bandrange(2) ) THEN
IF( o_restart_time >= 0._DP ) THEN
IF( (time_spent(2)-time_spent(1)) > o_restart_time*60._DP .OR. ib == qp_bandrange(2) ) THEN
bks%lastdone_ks=iks
bks%lastdone_band=ib
bks%lastdone_band=ib
CALL solvegfreq_restart_write( bks )
bks%old_ks=iks
bks%old_band=ib
......@@ -304,18 +308,19 @@ SUBROUTINE solve_gfreq_gamma(l_read_restart)