Commit f4c0cdb0 authored by Matteo Gerosa's avatar Matteo Gerosa
Browse files

Small changes in Wfreq I/O (file names).

parent 26622c51
......@@ -133,7 +133,7 @@ MODULE wfreq_io
!
!
!
SUBROUTINE preallocate_solvegfreq_q( ik, ik1, nb_1, nb_2, idistr)
SUBROUTINE preallocate_solvegfreq_q( ik, ikk, nb_1, nb_2, idistr)
!
USE kinds, ONLY : DP
USE class_idistribute, ONLY : idistribute
......@@ -147,26 +147,26 @@ MODULE wfreq_io
!
! I/O
!
INTEGER,INTENT(IN) :: ik, ik1, nb_1, nb_2
INTEGER,INTENT(IN) :: ik, ikk, nb_1, nb_2
TYPE(idistribute), INTENT(IN) :: idistr
!
! Workspace
!
INTEGER :: ib, ii
CHARACTER(LEN=5) :: c_glob_iks
CHARACTER(LEN=5) :: c_glob_iks1
CHARACTER(LEN=5) :: c_glob_ikks
CHARACTER(LEN=5) :: c_glob_ib
CHARACTER(LEN=512) :: fname
!
WRITE(c_glob_iks,'(i5.5)') ik
WRITE(c_glob_iks1,'(i5.5)') ik1
WRITE(c_glob_ikks,'(i5.5)') ikk
DO ib = nb_1, nb_2
!
WRITE(c_glob_ib, '(i5.5)') ib
!
fname = TRIM( wfreq_save_dir )//"/g_diag_K"//c_glob_iks//"K1"//c_glob_iks1//"B"//c_glob_ib//".dat"
fname = TRIM( wfreq_save_dir )//"/g_diag_K"//c_glob_iks//"KK"//c_glob_ikks//"B"//c_glob_ib//".dat"
CALL mp_master_creates_and_preallocates( fname, n_lanczos*idistr%nglob * 1 ) ! check nmode
fname = TRIM( wfreq_save_dir )//"/g_brak_K"//c_glob_iks//"K1"//c_glob_iks1//"B"//c_glob_ib//".dat"
fname = TRIM( wfreq_save_dir )//"/g_brak_K"//c_glob_iks//"KK"//c_glob_ikks//"B"//c_glob_ib//".dat"
CALL mp_master_creates_and_preallocates( fname, n_lanczos*idistr%nglob*idistr%nglob*2 )
!
ENDDO
......@@ -218,7 +218,7 @@ MODULE wfreq_io
!
!
!
SUBROUTINE writeout_solvewfreq_q( glob_iks, glob_iks1, glob_ib, diago, braket, nloc, nglob, myoffset)
SUBROUTINE writeout_solvewfreq_q( glob_iks, glob_ikks, glob_ib, diago, braket, nloc, nglob, myoffset)
!
! WHO WRITES? ... root_bgrp
! WHAT? ... diago( n_lanczos )
......@@ -235,7 +235,7 @@ MODULE wfreq_io
! I/O
!
INTEGER,INTENT(IN) :: glob_iks
INTEGER,INTENT(IN) :: glob_iks1
INTEGER,INTENT(IN) :: glob_ikks
INTEGER,INTENT(IN) :: glob_ib
REAL(DP),INTENT(IN) :: diago(n_lanczos,nloc)
REAL(DP),INTENT(IN) :: braket(nglob,n_lanczos,nloc)
......@@ -244,20 +244,20 @@ MODULE wfreq_io
! Workspace
!
CHARACTER(LEN=5) :: c_glob_iks
CHARACTER(LEN=5) :: c_glob_iks1
CHARACTER(LEN=5) :: c_glob_ikks
CHARACTER(LEN=5) :: c_glob_ib
CHARACTER(LEN=512) :: fname
!
! Generate the filename
!
WRITE(c_glob_iks,'(i5.5)') glob_iks
WRITE(c_glob_iks1,'(i5.5)') glob_iks1
WRITE(c_glob_ikks,'(i5.5)') glob_ikks
WRITE(c_glob_ib, '(i5.5)') glob_ib
!
fname = TRIM( wfreq_save_dir )//"/w_diag_K"//c_glob_iks//"K1"//c_glob_iks1//"B"//c_glob_ib//".dat"
fname = TRIM( wfreq_save_dir )//"/w_diag_K"//c_glob_iks//"KK"//c_glob_ikks//"B"//c_glob_ib//".dat"
CALL mp_write_dmsg_at( fname, diago, n_lanczos*nloc, n_lanczos*myoffset )
!
fname = TRIM( wfreq_save_dir )//"/w_brak_K"//c_glob_iks//"K1"//c_glob_iks1//"B"//c_glob_ib//".dat"
fname = TRIM( wfreq_save_dir )//"/w_brak_K"//c_glob_iks//"KK"//c_glob_ikks//"B"//c_glob_ib//".dat"
CALL mp_write_dmsg_at( fname, braket, nglob*n_lanczos*nloc, nglob*n_lanczos*myoffset )
!
END SUBROUTINE
......@@ -514,7 +514,7 @@ MODULE wfreq_io
!
!
!
SUBROUTINE writeout_solvegfreq_complex_q( glob_iks, glob_iks1, glob_ib, diago, braket, nloc, nglob, myoffset)
SUBROUTINE writeout_solvegfreq_complex_q( glob_iks, glob_ikks, glob_ib, diago, braket, nloc, nglob, myoffset)
!
! WHO WRITES? ... root_bgrp
! WHAT? ... diago( n_lanczos )
......@@ -531,7 +531,7 @@ MODULE wfreq_io
! I/O
!
INTEGER,INTENT(IN) :: glob_iks
INTEGER,INTENT(IN) :: glob_iks1
INTEGER,INTENT(IN) :: glob_ikks
INTEGER,INTENT(IN) :: glob_ib
REAL(DP),INTENT(IN) :: diago(n_lanczos,nloc)
COMPLEX(DP),INTENT(IN) :: braket(nglob,n_lanczos,nloc)
......@@ -540,20 +540,20 @@ MODULE wfreq_io
! Workspace
!
CHARACTER(LEN=5) :: c_glob_iks
CHARACTER(LEN=5) :: c_glob_iks1
CHARACTER(LEN=5) :: c_glob_ikks
CHARACTER(LEN=5) :: c_glob_ib
CHARACTER(LEN=512) :: fname
!
! Generate the filename
!
WRITE(c_glob_iks,'(i5.5)') glob_iks
WRITE(c_glob_iks1,'(i5.5)') glob_iks1
WRITE(c_glob_ikks,'(i5.5)') glob_ikks
WRITE(c_glob_ib, '(i5.5)') glob_ib
!
fname = TRIM( wfreq_save_dir )//"/g_diag_K"//c_glob_iks//"K1"//c_glob_iks1//"B"//c_glob_ib//".dat"
fname = TRIM( wfreq_save_dir )//"/g_diag_K"//c_glob_iks//"KK"//c_glob_ikks//"B"//c_glob_ib//".dat"
CALL mp_write_dmsg_at( fname, diago, n_lanczos*nloc, n_lanczos*myoffset )
!
fname = TRIM( wfreq_save_dir )//"/g_brak_K"//c_glob_iks//"K1"//c_glob_iks1//"B"//c_glob_ib//".dat"
fname = TRIM( wfreq_save_dir )//"/g_brak_K"//c_glob_iks//"KK"//c_glob_ikks//"B"//c_glob_ib//".dat"
CALL mp_write_zmsg_at( fname, braket, nglob*n_lanczos*nloc, nglob*n_lanczos*myoffset )
!
END SUBROUTINE
......@@ -646,7 +646,7 @@ MODULE wfreq_io
!
!
!
SUBROUTINE readin_solvegfreq_complex_q( glob_iks, glob_iks1, glob_ib, diago, braket, nloc, nglob, myoffset)
SUBROUTINE readin_solvegfreq_complex_q( glob_iks, glob_ikks, glob_ib, diago, braket, nloc, nglob, myoffset)
!
! WHO READS? ... root_bgrp
! WHAT? ... diago( n_lanczos )
......@@ -663,7 +663,7 @@ MODULE wfreq_io
! I/O
!
INTEGER,INTENT(IN) :: glob_iks
INTEGER,INTENT(IN) :: glob_iks1
INTEGER,INTENT(IN) :: glob_ikks
INTEGER,INTENT(IN) :: glob_ib
REAL(DP),INTENT(OUT) :: diago(n_lanczos,nloc)
COMPLEX(DP),INTENT(OUT) :: braket(nglob,n_lanczos,nloc)
......@@ -672,20 +672,20 @@ MODULE wfreq_io
! Workspace
!
CHARACTER(LEN=5) :: c_glob_iks
CHARACTER(LEN=5) :: c_glob_iks1
CHARACTER(LEN=5) :: c_glob_ikks
CHARACTER(LEN=5) :: c_glob_ib
CHARACTER(LEN=512) :: fname
!
! Generate the filename
!
WRITE(c_glob_iks,'(i5.5)') glob_iks
WRITE(c_glob_iks1,'(i5.5)') glob_iks1
WRITE(c_glob_ikks,'(i5.5)') glob_ikks
WRITE(c_glob_ib, '(i5.5)') glob_ib
!
fname = TRIM( wfreq_save_dir )//"/g_diag_K"//c_glob_iks//"K1"//c_glob_iks1//"B"//c_glob_ib//".dat"
fname = TRIM( wfreq_save_dir )//"/g_diag_K"//c_glob_iks//"KK"//c_glob_ikks//"B"//c_glob_ib//".dat"
CALL mp_read_dmsg_at( fname, diago, n_lanczos*nloc, n_lanczos*myoffset )
!
fname = TRIM( wfreq_save_dir )//"/g_brak_K"//c_glob_iks//"K1"//c_glob_iks1//"B"//c_glob_ib//".dat"
fname = TRIM( wfreq_save_dir )//"/g_brak_K"//c_glob_iks//"KK"//c_glob_ikks//"B"//c_glob_ib//".dat"
CALL mp_read_zmsg_at( fname, braket, nglob*n_lanczos*nloc, nglob*n_lanczos*myoffset )
!
END SUBROUTINE
......@@ -818,7 +818,7 @@ MODULE wfreq_io
!
!
!
SUBROUTINE writeout_overlap_complex_q( labellina, glob_iks, glob_iks1, glob_ib, overlap, no1, no2)
SUBROUTINE writeout_overlap_complex_q( labellina, glob_iks, glob_ikks, glob_ib, overlap, no1, no2)
!
! WHO WRITES? ... root
! WHAT? ... overlap( no1, no2 )
......@@ -835,7 +835,7 @@ MODULE wfreq_io
!
CHARACTER(LEN=1),INTENT(IN) :: labellina
INTEGER,INTENT(IN) :: glob_iks
INTEGER,INTENT(IN) :: glob_iks1
INTEGER,INTENT(IN) :: glob_ikks
INTEGER,INTENT(IN) :: glob_ib
COMPLEX(DP),INTENT(IN) :: overlap(no1,no2)
INTEGER,INTENT(IN) :: no1,no2
......@@ -843,7 +843,7 @@ MODULE wfreq_io
! Workspace
!
CHARACTER(LEN=5) :: c_glob_iks
CHARACTER(LEN=5) :: c_glob_iks1
CHARACTER(LEN=5) :: c_glob_ikks
CHARACTER(LEN=5) :: c_glob_ib
INTEGER :: iunout, ierr
CHARACTER(LEN=512) :: fname
......@@ -851,10 +851,10 @@ MODULE wfreq_io
! Generate the filename
!
WRITE(c_glob_iks,'(i5.5)') glob_iks
WRITE(c_glob_iks1,'(i5.5)') glob_iks1
WRITE(c_glob_ikks,'(i5.5)') glob_ikks
WRITE(c_glob_ib, '(i5.5)') glob_ib
!
fname = TRIM( wfreq_save_dir )//"/over_"//labellina//"K"//c_glob_iks//"K1"//c_glob_iks1//"B"//c_glob_ib//".dat"
fname = TRIM( wfreq_save_dir )//"/over_"//labellina//"K"//c_glob_iks//"KK"//c_glob_ikks//"B"//c_glob_ib//".dat"
!
IF ( mpime == root ) THEN
!
......@@ -1014,7 +1014,7 @@ MODULE wfreq_io
!
!
!
SUBROUTINE readin_overlap_complex_q( labellina, glob_iks, glob_iks1, glob_ib, overlap, no1, no2 )
SUBROUTINE readin_overlap_complex_q( labellina, glob_iks, glob_ikks, glob_ib, overlap, no1, no2 )
!
! WHO WRITES? ... root
! WHAT? ... overlap( no1, no2 )
......@@ -1031,7 +1031,7 @@ MODULE wfreq_io
!
CHARACTER(LEN=1),INTENT(IN) :: labellina
INTEGER,INTENT(IN) :: glob_iks
INTEGER,INTENT(IN) :: glob_iks1
INTEGER,INTENT(IN) :: glob_ikks
INTEGER,INTENT(IN) :: glob_ib
COMPLEX(DP),INTENT(OUT) :: overlap(no1,no2)
INTEGER,INTENT(IN) :: no1,no2
......@@ -1039,7 +1039,7 @@ MODULE wfreq_io
! Workspace
!
CHARACTER(LEN=5) :: c_glob_iks
CHARACTER(LEN=5) :: c_glob_iks1
CHARACTER(LEN=5) :: c_glob_ikks
CHARACTER(LEN=5) :: c_glob_ib
INTEGER :: iunout, ierr
CHARACTER(LEN=512) :: fname
......@@ -1047,10 +1047,10 @@ MODULE wfreq_io
! Generate the filename
!
WRITE(c_glob_iks,'(i5.5)') glob_iks
WRITE(c_glob_iks1,'(i5.5)') glob_iks1
WRITE(c_glob_ikks,'(i5.5)') glob_ikks
WRITE(c_glob_ib, '(i5.5)') glob_ib
!
fname = TRIM( wfreq_save_dir )//"/over_"//labellina//"K"//c_glob_iks//"K1"//c_glob_iks1//"B"//c_glob_ib//".dat"
fname = TRIM( wfreq_save_dir )//"/over_"//labellina//"K"//c_glob_iks//"KK"//c_glob_ikks//"B"//c_glob_ib//".dat"
!
IF ( mpime == root ) THEN
!
......
......@@ -56,16 +56,16 @@ MODULE wfreq_restart
!
TYPE :: bksks_type
INTEGER :: lastdone_ks
INTEGER :: lastdone_ksc
INTEGER :: lastdone_kks
INTEGER :: lastdone_band
INTEGER :: old_ks
INTEGER :: old_ksc
INTEGER :: old_kks
INTEGER :: old_band
INTEGER :: max_ks
INTEGER :: max_ksc
INTEGER :: max_kks
INTEGER :: max_band
INTEGER :: min_ks
INTEGER :: min_ksc
INTEGER :: min_kks
INTEGER :: min_band
END TYPE bksks_type
!
......@@ -236,16 +236,16 @@ MODULE wfreq_restart
!
CALL iotk_write_begin( iunout, "BKSKS-SUMMARY" )
CALL iotk_write_dat( iunout, "lastdone_ks" , bksks%lastdone_ks )
CALL iotk_write_dat( iunout, "lastdone_ksc" , bksks%lastdone_ksc )
CALL iotk_write_dat( iunout, "lastdone_kks" , bksks%lastdone_kks )
CALL iotk_write_dat( iunout, "lastdone_band", bksks%lastdone_band)
CALL iotk_write_dat( iunout, "old_ks" , bksks%old_ks )
CALL iotk_write_dat( iunout, "old_ksc" , bksks%old_ksc )
CALL iotk_write_dat( iunout, "old_kks" , bksks%old_kks )
CALL iotk_write_dat( iunout, "old_band" , bksks%old_band )
CALL iotk_write_dat( iunout, "max_ks" , bksks%max_ks )
CALL iotk_write_dat( iunout, "max_ksc" , bksks%max_ksc )
CALL iotk_write_dat( iunout, "max_kks" , bksks%max_kks )
CALL iotk_write_dat( iunout, "max_band" , bksks%max_band )
CALL iotk_write_dat( iunout, "min_ks" , bksks%min_ks )
CALL iotk_write_dat( iunout, "min_ksc" , bksks%min_ksc )
CALL iotk_write_dat( iunout, "min_kks" , bksks%min_kks )
CALL iotk_write_dat( iunout, "min_band" , bksks%min_band )
CALL iotk_write_end( iunout, "BKSKS-SUMMARY" )
!
......@@ -430,16 +430,16 @@ MODULE wfreq_restart
!
CALL iotk_scan_begin( iunout, "BKSKS-SUMMARY" )
CALL iotk_scan_dat( iunout, "lastdone_ks" , bksks%lastdone_ks )
CALL iotk_scan_dat( iunout, "lastdone_ksc" , bksks%lastdone_ksc )
CALL iotk_scan_dat( iunout, "lastdone_kks" , bksks%lastdone_kks )
CALL iotk_scan_dat( iunout, "lastdone_band", bksks%lastdone_band )
CALL iotk_scan_dat( iunout, "old_ks" , bksks%old_ks )
CALL iotk_scan_dat( iunout, "old_ksc" , bksks%old_ksc )
CALL iotk_scan_dat( iunout, "old_kks" , bksks%old_kks )
CALL iotk_scan_dat( iunout, "old_band" , bksks%old_band )
CALL iotk_scan_dat( iunout, "max_ks" , bksks%max_ks )
CALL iotk_scan_dat( iunout, "max_ksc" , bksks%max_ksc )
CALL iotk_scan_dat( iunout, "max_kks" , bksks%max_kks )
CALL iotk_scan_dat( iunout, "max_band" , bksks%max_band )
CALL iotk_scan_dat( iunout, "min_ks" , bksks%min_ks )
CALL iotk_scan_dat( iunout, "min_ksc" , bksks%min_ksc )
CALL iotk_scan_dat( iunout, "min_kks" , bksks%min_kks )
CALL iotk_scan_dat( iunout, "min_band" , bksks%min_band )
CALL iotk_scan_end( iunout, "BKSKS-SUMMARY" )
!
......@@ -448,16 +448,16 @@ MODULE wfreq_restart
END IF
!
CALL mp_bcast( bksks%lastdone_ks , root , world_comm )
CALL mp_bcast( bksks%lastdone_ksc , root , world_comm )
CALL mp_bcast( bksks%lastdone_kks , root , world_comm )
CALL mp_bcast( bksks%lastdone_band , root , world_comm )
CALL mp_bcast( bksks%old_ks , root , world_comm )
CALL mp_bcast( bksks%old_ksc , root , world_comm )
CALL mp_bcast( bksks%old_kks , root , world_comm )
CALL mp_bcast( bksks%old_band , root , world_comm )
CALL mp_bcast( bksks%max_ks , root , world_comm )
CALL mp_bcast( bksks%max_ksc , root , world_comm )
CALL mp_bcast( bksks%max_kks , root , world_comm )
CALL mp_bcast( bksks%max_band , root , world_comm )
CALL mp_bcast( bksks%min_ks , root , world_comm )
CALL mp_bcast( bksks%min_ksc , root , world_comm )
CALL mp_bcast( bksks%min_kks , root , world_comm )
CALL mp_bcast( bksks%min_band , root , world_comm )
!
END SUBROUTINE
......
......@@ -386,15 +386,15 @@ SUBROUTINE solve_gfreq_k(l_read_restart)
CALL solvegfreq_restart_read_q( bksks )
ELSE
bksks%lastdone_ks = 0
bksks%lastdone_ksc = 0
bksks%lastdone_kks = 0
bksks%lastdone_band = 0
bksks%old_ks = 0
bksks%old_ksc = 0
bksks%old_kks = 0
bksks%old_band = 0
bksks%max_ks = k_grid%nps
bksks%min_ks = 1
bksks%max_ksc = k_grid%nps
bksks%min_ksc = 1
bksks%max_kks = k_grid%nps
bksks%min_kks = 1
ENDIF
!
ALLOCATE( evck(npwx*npol,nbnd) )
......@@ -411,7 +411,7 @@ SUBROUTINE solve_gfreq_k(l_read_restart)
DO ib = qp_bandrange(1), qp_bandrange(2)
IF(ikks==bksks%lastdone_ks .AND. ib < bksks%lastdone_band ) CYCLE
DO iks = 1, k_grid%nps
IF (ikks==bksks%lastdone_ks .AND. ib == bksks%lastdone_band .AND. iks <= bksks%lastdone_ksc) CYCLE
IF (ikks==bksks%lastdone_ks .AND. ib == bksks%lastdone_band .AND. iks <= bksks%lastdone_kks) CYCLE
barra_load = barra_load + 1
ENDDO
ENDDO
......@@ -463,7 +463,7 @@ SUBROUTINE solve_gfreq_k(l_read_restart)
ENDIF
!
DO iks = 1, k_grid%nps ! KPOINT-SPIN (INTEGRAL OVER K')
IF (ikks==bksks%lastdone_ks .AND. ib==bksks%lastdone_band .AND. iks <= bksks%lastdone_ksc) CYCLE
IF (ikks==bksks%lastdone_ks .AND. ib==bksks%lastdone_band .AND. iks <= bksks%lastdone_kks) CYCLE
!
ik = k_grid%ip(iks)
!
......@@ -627,11 +627,11 @@ SUBROUTINE solve_gfreq_k(l_read_restart)
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
bksks%lastdone_ks=ikks
bksks%lastdone_ksc=iks
bksks%lastdone_kks=iks
bksks%lastdone_band=ib
CALL solvegfreq_restart_write_q( bksks )
bksks%old_ks=ikks
bksks%old_ksc=iks
bksks%old_kks=iks
bksks%old_band=ib
time_spent(1) = get_clock( 'glanczos' )
ENDIF
......
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