diff --git a/init/unfoldBandKPTS.f90 b/init/unfoldBandKPTS.f90 index acc41eb51db13ab434e2aa8d72adbc5b7e9258af..a3e1c6d7e5fa932cbb01cbda891f10865b4eac23 100644 --- a/init/unfoldBandKPTS.f90 +++ b/init/unfoldBandKPTS.f90 @@ -75,37 +75,38 @@ CONTAINS list(1,i)=pc_kpoint_c(1) list(2,i)=pc_kpoint_c(2) list(3,i)=pc_kpoint_c(3) - representation_found='F' - DO m1= -banddos%s_cell_x,banddos%s_cell_x + representation_found=.false. +m_loop: DO m1= -banddos%s_cell_x,banddos%s_cell_x DO m2= -banddos%s_cell_y,banddos%s_cell_y DO m3= -banddos%s_cell_z,banddos%s_cell_z pc_kpoint_c(1)=list(1,i)-m1*cell%bmat(1,1)-m2*cell%bmat(1,2)-m3*cell%bmat(1,3) pc_kpoint_c(2)=list(2,i)-m1*cell%bmat(2,1)-m2*cell%bmat(2,2)-m3*cell%bmat(2,3) pc_kpoint_c(3)=list(3,i)-m1*cell%bmat(3,1)-m2*cell%bmat(3,2)-m3*cell%bmat(3,3) - IF ((dot_product(pc_kpoint_c(:), cell%bmat(:,1)) >= 0).AND.(dot_product(pc_kpoint_c(:), cell%bmat(:,1)) <= 1) & - & .AND. (dot_product(pc_kpoint_c(:), cell%bmat(:,2)) >= 0).AND.(dot_product(pc_kpoint_c(:), cell%bmat(:,2)) <= 1) & - & .AND. (dot_product(pc_kpoint_c(:), cell%bmat(:,3)) >= 0).AND.(dot_product(pc_kpoint_c(:), cell%bmat(:,3)) <= 1)) THEN + IF ((dot_product(pc_kpoint_c(:), cell%bmat(:,1)) >= 0).AND.(dot_product(pc_kpoint_c(:), cell%bmat(:,1)) < dot_product(cell%bmat(:,1), cell%bmat(:,1))) & + & .AND. (dot_product(pc_kpoint_c(:), cell%bmat(:,2)) >= 0).AND.(dot_product(pc_kpoint_c(:), cell%bmat(:,2)) < dot_product(cell%bmat(:,2), cell%bmat(:,2))) & + & .AND. (dot_product(pc_kpoint_c(:), cell%bmat(:,3)) >= 0).AND.(dot_product(pc_kpoint_c(:), cell%bmat(:,3)) < dot_product(cell%bmat(:,3), cell%bmat(:,3)))) THEN list(4,i)=pc_kpoint_c(1) list(5,i)=pc_kpoint_c(2) list(6,i)=pc_kpoint_c(3) list(7,i)=-m1 list(8,i)=-m2 list(9,i)=-m3 - representation_found='T' + write(*,'(a,f15.8,f15.8,f15.8,6l,3i)') 'representation found for the following kpoint:',list(1,i),list(2,i),list(3,i),(dot_product(pc_kpoint_c(:),& + & cell%bmat(:,1)) >= 0),(dot_product(pc_kpoint_c(:), cell%bmat(:,1)) <= dot_product(cell%bmat(:,1), cell%bmat(:,1)) ) & + & , (dot_product(pc_kpoint_c(:), cell%bmat(:,2)) >= 0),(dot_product(pc_kpoint_c(:), cell%bmat(:,2)) <= dot_product(cell%bmat(:,2), cell%bmat(:,2))) & + & ,(dot_product(pc_kpoint_c(:), cell%bmat(:,3)) >= 0),(dot_product(pc_kpoint_c(:), cell%bmat(:,3)) <= dot_product(cell%bmat(:,3), cell%bmat(:,3))),-m1,-m2,-m3 + representation_found=.true. END IF - IF (representation_found) EXIT + IF (representation_found) EXIT m_loop END DO - IF (representation_found) EXIT END DO - IF (representation_found) EXIT - END DO - IF (representation_found=='F') THEN + END DO m_loop + IF (.not.representation_found) THEN write(*,'(a,f15.8,f15.8,f15.8)') 'No representation found for the following kpoint:',list(1,i),list(2,i),list(3,i) - END IF + END IF END DO write(90,'(9f15.8)') list CALL juDFT_error('Not yet implemented', calledby='find_supercell_kpts') - END SUBROUTINE find_supercell_kpts END MODULE m_unfold_band_kpts