~nickpapior/siesta/trunk-buds-format0.92

« back to all changes in this revision

Viewing changes to Src/buds/src/SM_CSC0.F90

  • Committer: Nick Papior
  • Date: 2017-04-07 12:42:28 UTC
  • Revision ID: nickpapior@gmail.com-20170407124228-u5t08yr2p4fhzfeo
Initial commit of buds merged into siesta

Currently I have only enabled buds compilation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
  ! @@LICENSE@@ see Copyright notice in the top-directory
 
2
 
 
3
! Get default commands
 
4
#include "bud_utils.inc"
 
5
 
 
6
!> @defgroup sm-csc0 CSC0 (Compressed Sparse Column 0-based column pointer)
 
7
!! @ingroup sm
 
8
!!
 
9
!! A compressed sparse column matrix implementation using
 
10
!! a 0-based column-pointer.
 
11
!!
 
12
!! This only contains the indices for the sparse matrix, the
 
13
!! data for the sparse matrix should be contained in an additional
 
14
!! data array of the corresponding data type.
 
15
!!
 
16
!! The CSC sparsity pattern stored can be sorted in each
 
17
!! column such that the rows are consecutively aligned.
 
18
!! This will help ensure a fast access pattern in the matrix
 
19
!! with a column-based access pattern.
 
20
!!
 
21
!! \code{.f90}
 
22
!!   integer :: nc, nz, ic, idx
 
23
!!   integer, pointer BUD_FORTRAN_CONTIGUOUS :: cptr(:), row(:)
 
24
!!
 
25
!!   call attach(this, nr=nc, nz=nz, cptr=cptr, row=row)
 
26
!!
 
27
!!   do ic = 1 , nc
 
28
!!     do idx = cptr(ic) + 1 , cptr(ic+1)
 
29
!!       ! access M(row(idx)+1,ic)
 
30
!!     end do
 
31
!!   end do
 
32
!! \endcode
 
33
!!
 
34
!! There are no data-consistency checks performed (for performance
 
35
!! reasons) hence you *can* end up with multiple entries for the
 
36
!! same matrix element.
 
37
!! In such cases the developer must take care of these.
 
38
!! Please note that in certain cases such *duplicate* entries may a
 
39
!! wanted feature.
 
40
!!
 
41
!! @{
 
42
 
 
43
 
 
44
# define BUD_MOD_NAME BUD_CC3(BUD_MOD,_,iSM_CSC0)
 
45
!> @defgroup BUD_MOD_NAME Integer (int)
 
46
!! `integer(selected_int_kind(9))` data type
 
47
!! @{
 
48
module BUD_MOD_NAME
 
49
# define BUD_LIST_NAME BUD_CC2(BUD_TYPE,iList)
 
50
# define BUD_TYPE_NAME BUD_CC2(BUD_TYPE,iSM_CSC0)
 
51
# define BUD_TYPE_VAR integer
 
52
# define BUD_TYPE_VAR_PREC ii_
 
53
# define BUD_SM_CSC 1
 
54
#include "SM_CSC.inc"
 
55
end module
 
56
!> @}
 
57
 
 
58
# define BUD_MOD_NAME BUD_CC3(BUD_MOD,_,lSM_CSC0)
 
59
!> @defgroup BUD_MOD_NAME Integer (long)
 
60
!! `integer(selected_int_kind(18))` data type
 
61
!! @{
 
62
module BUD_MOD_NAME
 
63
# define BUD_LIST_NAME BUD_CC2(BUD_TYPE,lList)
 
64
# define BUD_TYPE_NAME BUD_CC2(BUD_TYPE,lSM_CSC0)
 
65
# define BUD_TYPE_VAR integer
 
66
# define BUD_TYPE_VAR_PREC il_
 
67
# define BUD_SM_CSC 1
 
68
#include "SM_CSC.inc"
 
69
end module
 
70
!> @}
 
71
 
 
72
 
 
73
# define BUD_MOD_NAME BUD_CC3(BUD_MOD,_,SM_CSC0)
 
74
!> @defgroup BUD_MOD_NAME all sparse matrices in CSC0 format
 
75
!! @{
 
76
module BUD_MOD_NAME
 
77
  use BUD_CC3(BUD_MOD,_,iSM_CSC0)
 
78
  use BUD_CC3(BUD_MOD,_,lSM_CSC0)
 
79
end module
 
80
!> @}
 
81
 
 
82
! GROUP sm-csc0
 
83
!> @}
 
84
 
 
85
 
 
86
! project-buds -- local file settings
 
87
!     Anything below this line may be overwritten by scripts
 
88
!     Below are non-editable settings
 
89
 
 
90
! Local Variables:
 
91
!  mode: f90
 
92
!  f90-if-indent: 2
 
93
!  f90-type-indent: 2
 
94
!  f90-associate-indent: 2
 
95
!  f90-continuation-indent: 2
 
96
!  f90-structure-indent: 2
 
97
!  f90-critical-indent: 2
 
98
!  f90-program-indent: 2
 
99
!  f90-do-indent: 2
 
100
! End:
 
101