1diff -ur espresso-4.3.2/PP/plan_avg.f90 espresso-4.3.2-patch/PP/plan_avg.f90 2--- espresso-4.3.2/PP/plan_avg.f90 2011-07-14 04:22:39.000000000 -0400 3+++ espresso-4.3.2-patch/PP/plan_avg.f90 2011-07-14 04:22:39.000000000 -0400 4@@ -123,10 +123,14 @@ 5 ENDDO 6 ENDDO 7 ! 8+ CLOSE (UNIT = iunplot, STATUS = 'keep') 9+ ! 10 ENDIF 11 ! 12 DEALLOCATE (plan) 13 DEALLOCATE (averag) 14+ ! 15+ CALL stop_pp ( ) 16 17 CONTAINS 18 ! 19diff -ur espresso-4.3.2/PW/pw_restart.f90 espresso-4.3.2-patch/PW/pw_restart.f90 20--- espresso-4.3.2/PW/pw_restart.f90 2011-07-14 04:22:40.000000000 -0400 21+++ espresso-4.3.2-patch/PW/pw_restart.f90 2011-07-14 04:22:40.000000000 -0400 22@@ -1981,9 +1981,15 @@ 23 ierr = 0 24 IF ( lpw_read ) RETURN 25 ! 26- IF ( ionode ) & 27+ IF ( ionode ) THEN 28+ ! 29 CALL iotk_open_read( iunpun, FILE = TRIM( dirname ) // '/' // & 30 & TRIM( xmlpun ), IERR = ierr ) 31+ IF ( ierr > 0 ) & 32+ CALL iotk_open_read( iunpun, FILE = TRIM( dirname ) // '/' // & 33+ & TRIM( xmlpun ) // '.bck', IERR = ierr ) 34+ ! 35+ END IF 36 ! 37 CALL mp_bcast( ierr, ionode_id, intra_image_comm ) 38 ! 39@@ -2927,6 +2933,9 @@ 40 ! 41 CALL iotk_open_read( iunpun, FILE = TRIM( dirname ) // '/' // & 42 & TRIM( xmlpun ), IERR = ierr ) 43+ IF ( ierr > 0 ) & 44+ CALL iotk_open_read( iunpun, FILE = TRIM( dirname ) // '/' // & 45+ & TRIM( xmlpun ) // '.bck', IERR = ierr ) 46 ! 47 END IF 48 ! 49diff -ur espresso-4.3.2/PW/setup.f90 espresso-4.3.2-patch/PW/setup.f90 50--- espresso-4.3.2/PW/setup.f90 2011-07-14 01:22:40.000000000 -0700 51+++ espresso-4.3.2-patch/PW/setup.f90 2011-10-06 10:35:05.383930820 -0700 52@@ -83,6 +83,7 @@ 53 #endif 54 USE funct, ONLY : dft_is_meta, dft_is_hybrid, dft_is_gradient 55 USE paw_variables, ONLY : okpaw 56+ USE input_parameters, ONLY : k_points 57 ! DCC 58 ! USE ee_mod, ONLY : do_coarse, do_mltgrid 59 60@@ -91,7 +92,7 @@ 61 ! 62 INTEGER :: na, nt, input_nks, is, ierr, ibnd, ik 63 LOGICAL :: magnetic_sym 64- REAL(DP) :: iocc, ionic_charge 65+ REAL(DP) :: iocc, ionic_charge, norm 66 ! 67 LOGICAL, EXTERNAL :: check_para_diag 68 INTEGER, EXTERNAL :: set_Hubbard_l 69@@ -522,8 +523,15 @@ 70 ! ... If some symmetries of the lattice are missing in the crystal, 71 ! ... "irreducible_BZ" computes the missing k-points. 72 ! 73- CALL irreducible_BZ (nrot, s, nsym, time_reversal, at, bg, npk, & 74+ IF ( k_points == 'automatic' ) THEN ! unfold k-points only in this case 75+ CALL irreducible_BZ (nrot, s, nsym, time_reversal, at, bg, npk, & 76 nkstot, xk, wk, t_rev) 77+ ELSE 78+ ! normalize weights to one 79+ ! 80+ norm = SUM (wk(1:nkstot)) 81+ if ( norm > 0.0D0 ) wk(1:nkstot) = wk(1:nkstot) / norm 82+ END IF 83 ! 84 END IF 85 ! 86