Skip to content

Commit 3cb977c

Browse files
author
Sabyasachi Tiwari
committed
Fix in EPW/utilities/nscf2supercond
1 parent 92a2897 commit 3cb977c

File tree

3 files changed

+32
-25
lines changed

3 files changed

+32
-25
lines changed

EPW/src/supercond_coul.f90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ SUBROUTINE read_eigen_cl()
183183
ENDIF
184184
!
185185
ldum = .TRUE.
186-
DO isym = 1, 48
186+
DO isym = 1, nrot
187187
IF (t_rev_read(isym) .NE. t_rev(isym)) THEN
188188
ldum = .FALSE.
189189
ENDIF
@@ -194,7 +194,7 @@ SUBROUTINE read_eigen_cl()
194194
ENDIF
195195
!
196196
ldum = .TRUE.
197-
DO isym = 1, 48
197+
DO isym = 1, nrot
198198
DO j = 1, 3
199199
DO i = 1, 3
200200
IF (s_read(i, j, isym) .NE. s(i, j, isym)) THEN

EPW/src/utilities/nscf2supercond.f90

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ PROGRAM nscf2supercond
1515
USE mp_global, ONLY : mp_startup
1616
USE mp_pools, ONLY : npool
1717
USE environment, ONLY : environment_start, environment_end
18-
USE io_global, ONLY : ionode, ionode_id, stdout
19-
USE mp, ONLY : mp_bcast
20-
USE mp_images, ONLY : intra_image_comm
18+
USE io_global, ONLY : meta_ionode, meta_ionode_id, stdout
19+
USE mp_global, ONLY : world_comm
20+
USE mp, ONLY : mp_bcast, mp_barrier
2121
!
2222
IMPLICIT NONE
2323
!
@@ -45,7 +45,7 @@ PROGRAM nscf2supercond
4545
!
4646
ios = 0
4747
!
48-
IF ( ionode ) THEN
48+
IF ( meta_ionode ) THEN
4949
!
5050
CALL input_from_file ( )
5151
!
@@ -56,17 +56,14 @@ PROGRAM nscf2supercond
5656
ENDIF
5757
!
5858
!
59-
CALL mp_bcast( ios, ionode_id, intra_image_comm )
59+
CALL mp_bcast( ios, meta_ionode_id, world_comm)
6060
IF (ios /= 0) CALL errore ('bands2epw', 'reading bands namelist', abs(ios) )
6161
!
6262
! ... Broadcast variables
6363
!
64-
CALL mp_bcast( tmp_dir, ionode_id, intra_image_comm )
65-
CALL mp_bcast( prefix, ionode_id, intra_image_comm )
66-
CALL mp_bcast( filband, ionode_id, intra_image_comm )
67-
!
68-
IF ( npool > 1 ) CALL errore('bands', &
69-
'pools not implemented',npool)
64+
CALL mp_bcast( tmp_dir, meta_ionode_id, world_comm)
65+
CALL mp_bcast( prefix, meta_ionode_id, world_comm)
66+
CALL mp_bcast( filband, meta_ionode_id, world_comm)
7067
!
7168
! Now allocate space for pwscf variables, read and check them.
7269
!
@@ -76,6 +73,7 @@ PROGRAM nscf2supercond
7673
!
7774
CALL environment_end ( 'BANDS' )
7875
!
76+
CALL stop_pp()
7977
STOP
8078
!
8179
!-----------------------------------------------------------------------
@@ -100,14 +98,17 @@ SUBROUTINE write_eigen_band (filband)
10098
USE noncollin_module, ONLY : noncolin, lspinorb
10199
USE control_flags, ONLY : noinv
102100
USE lsda_mod, ONLY : nspin, lsda
103-
USE io_global, ONLY : ionode, ionode_id, stdout
101+
USE io_global, ONLY : meta_ionode, meta_ionode_id, stdout
104102
USE mp, ONLY : mp_bcast
105-
USE mp_images, ONLY : intra_image_comm
106103
!
107104
IMPLICIT NONE
108105
!
109106
CHARACTER (len=*) :: filband
110107
!
108+
INTEGER :: t_rev_tmp(48)
109+
!! it is used to copy t_rev(1:nrot)
110+
INTEGER :: s_tmp(3, 3, 48)
111+
!! it is used to copy s(:,:,1:nrot)
111112
INTEGER :: ik
112113
!! Counter on k points
113114
INTEGER :: isym
@@ -119,21 +120,27 @@ SUBROUTINE write_eigen_band (filband)
119120
INTEGER :: ios
120121
!! IO error message
121122
!
122-
IF ( ionode ) THEN
123+
! HM: Since s is not properly initialized,
124+
! s(:,:,nrot+1:48) may contain uninitialized values, depending on the compiler.
125+
s_tmp(:, :, :) = 0
126+
s_tmp(:, :, 1:nrot) = s(:, :, 1:nrot)
127+
t_rev_tmp(:) = 0
128+
t_rev_tmp(1:nrot) = t_rev(1:nrot)
129+
!
130+
IF ( meta_ionode ) THEN
123131
OPEN (unit = iunpun, file = filband, status = 'unknown', form = &
124-
'formatted', iostat = ios)
125-
REWIND (iunpun)
132+
'formatted', position = 'rewind', iostat = ios)
126133
WRITE(iunpun, '(ES23.15)') alat
127134
WRITE(iunpun, '(ES23.15,2(1x,ES23.15))') at(:,1)
128135
WRITE(iunpun, '(ES23.15,2(1x,ES23.15))') at(:,2)
129136
WRITE(iunpun, '(ES23.15,2(1x,ES23.15))') at(:,3)
130137
WRITE(iunpun, '(I5,1x,I5)') nrot, nsym
131138
WRITE(iunpun, '(L1)') time_reversal
132-
WRITE(iunpun, '(I2,15(1x,I2))') t_rev(1:16)
133-
WRITE(iunpun, '(I2,15(1x,I2))') t_rev(17:32)
134-
WRITE(iunpun, '(I2,15(1x,I2))') t_rev(33:48)
139+
WRITE(iunpun, '(I2,15(1x,I2))') t_rev_tmp(1:16)
140+
WRITE(iunpun, '(I2,15(1x,I2))') t_rev_tmp(17:32)
141+
WRITE(iunpun, '(I2,15(1x,I2))') t_rev_tmp(33:48)
135142
DO isym = 1, 48
136-
WRITE(iunpun, '(I3,8(1x,I3))') ((s(i, j, isym), i=1,3), j=1,3)
143+
WRITE(iunpun, '(I3,8(1x,I3))') ((s_tmp(i, j, isym), i=1,3), j=1,3)
137144
ENDDO
138145
WRITE(iunpun, '(L1,1x,I3)') lsda, nspin
139146
WRITE(iunpun, '(L1)') noinv
@@ -156,4 +163,4 @@ SUBROUTINE write_eigen_band (filband)
156163
END SUBROUTINE write_eigen_band
157164
!-----------------------------------------------------------------------
158165

159-
166+

test-suite/run-epw.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ elif [[ "$1" == "9" ]]
114114
then
115115
# nscf2supercond.x
116116
echo "Running NSCF2SUPERCOND ..."
117-
echo "${PARA_PREFIX} ${ESPRESSO_ROOT}/bin/nscf2supercond.x -input $2 > $3 2> $4"
118-
${PARA_PREFIX} ${ESPRESSO_ROOT}/bin/nscf2supercond.x -input $2 > $3 2> $4
117+
echo "${PARA_PREFIX} ${ESPRESSO_ROOT}/bin/nscf2supercond.x ${PARA_SUFFIX} -input $2 > $3 2> $4"
118+
${PARA_PREFIX} ${ESPRESSO_ROOT}/bin/nscf2supercond.x ${PARA_SUFFIX} -input $2 > $3 2> $4
119119
cat *.bands.*.dat >> $3
120120
if [[ -e CRASH ]]
121121
then

0 commit comments

Comments
 (0)