Skip to content

Commit

Permalink
missed file from previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
vtripath65 committed Oct 3, 2024
1 parent c8e3147 commit 25f670a
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions src/subs/symmetrize.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
!---------------------------------------------------------!
! Symmetrize either upper or lower square matrix !
! !
! Parameters: !
! UPLO 'U' !
! 'L' !
! mat N * N matrix !
! N size of the matrix !
!---------------------------------------------------------!

subroutine symmetrize(UPLO,mat,N)
implicit none

integer :: iatom, jatom, N
double precision :: mat(N,N)
character :: UPLO

if (UPLO == 'U') then
do iatom = 2,N
do jatom = 1,iatom - 1
mat(iatom,jatom) = mat(jatom,iatom)
end do
end do
else if (UPLO == 'L') then
do iatom = 2,N
do jatom = 1,iatom - 1
mat(jatom,iatom) = mat(iatom,jatom)
end do
end do
else
call QuickErr('UPLO has to be either U or L in symmetrize')
Return
end if

end subroutine symmetrize

0 comments on commit 25f670a

Please sign in to comment.