File: blowsy.f90

package info (click to toggle)
xtb 6.7.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 10,348 kB
  • sloc: f90: 139,236; fortran: 2,948; ansic: 2,215; makefile: 71; sh: 17; csh: 7; tcl: 7
file content (54 lines) | stat: -rw-r--r-- 1,510 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
! This file is part of xtb.
!
! Copyright (C) 2017-2020 Stefan Grimme
!
! xtb is free software: you can redistribute it and/or modify it under
! the terms of the GNU Lesser General Public License as published by
! the Free Software Foundation, either version 3 of the License, or
! (at your option) any later version.
!
! xtb is distributed in the hope that it will be useful,
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
! GNU Lesser General Public License for more details.
!
! You should have received a copy of the GNU Lesser General Public License
! along with xtb.  If not, see <https://www.gnu.org/licenses/>.
module xtb_blowsy
contains

pure subroutine blowsy(ity,a,b,n)
   use xtb_mctc_accuracy, only : wp
   implicit none
   ! blow up symmetric or antisymmetric matrix to full size
   integer, intent(in)  :: ity
   integer, intent(in)  :: n
   real(wp),intent(in)  :: a(*)
   real(wp),intent(out) :: b(n,n)
   integer :: ij,i,j
   ! determine if we have an antisymmetric integral

   ij=0
   if (ity.eq.-1) then
      do i=1,n
         do j=1,i-1
            ij=ij+1
            b(j,i)=-a(ij)
            b(i,j)=a(ij)
         enddo
         ij=ij+1
         b(i,i)=0.d0
      enddo
   else
      do i=1,n
         do j=1,i-1
            ij=ij+1
            b(j,i)=a(ij)
            b(i,j)=a(ij)
         enddo
         ij=ij+1
         b(i,i)=a(ij)
      enddo
   endif
end subroutine blowsy
end module xtb_blowsy