-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathreduce.f90
54 lines (46 loc) · 1.67 KB
/
reduce.f90
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
SUBROUTINE REDUCE(CXV,IOCC,MXN3,MXNAT,NAT,NAT0)
USE DDPRECISION,ONLY: WP
IMPLICIT NONE
! Arguments:
INTEGER :: MXN3,MXNAT,NAT,NAT0
INTEGER*2 :: IOCC(MXNAT)
COMPLEX(WP) :: CXV(MXN3)
! Local variables:
INTEGER :: J,JOC,M
!***********************************************************************
! Given:
! CXV(1-3*NAT) defined for NAT lattice sites with ordering
! (v_x1,...,v_xj,...,v_xNAT,v_y1,...,v_yj,...,v_yNAT,
! v_z1,...,v_zj,...,v_zNAT)
! where index j runs over occupied and unoccupied lattice sites
! IOCC(1-NAT) = 0 or 1 depending on whether lattice site
! is vacant or occupied
! MXN3,MXNAT = dimensioning information
! NAT = number of lattice sites
! NAT0 = number of occupied lattice sites
! Returns
! CXV(1-3*NAT0) defined for NAT0 occupied lattice sites
! with ordering
! (v_x1,...,v_xj,...,v_xNAT0,v_y1,...,v_yj,...,v_yNAT0,
! v_z1,...,v_zj,...,v_zNAT0)
! where index j now runs over only occupied lattice sites
! B.T.Draine, Princeton Univ. Observatory, 90.11.29
! History:
! 90.12.03 (BTD): Modified for new ordering of vectors.
! 90.12.05 (BTD): Corrected errors
! 06.04.11 (BTD): Cosmetic changes
! end history
! Copyright (C) 1993, 2006 B.T. Draine and P.J. Flatau
! This code is covered by the GNU General Public License.
!***********************************************************************
DO M=0,2
JOC=0
DO J=1,NAT
IF(IOCC(J)>=1)THEN
JOC=JOC+1
CXV(JOC+M*NAT0)=CXV(J+M*NAT)
ENDIF
ENDDO
ENDDO
RETURN
END SUBROUTINE REDUCE