forked from hxmhuang/dm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.F90
157 lines (131 loc) · 3.52 KB
/
main.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
program main
use dm
use dm_op
use dm_test
implicit none
#include <petsc/finclude/petscsys.h>
#include <petsc/finclude/petscviewer.h>
#include <petsc/finclude/petscvec.h>
#include <petsc/finclude/petscvec.h90>
#include <petsc/finclude/petscmat.h>
#include <petsc/finclude/petscksp.h>
type(Matrix) :: A,B,C,D,E,F,G,H,II,KK
type(Matrix) :: X,Y,Z,U,V,W
integer :: myrank, mysize
integer :: m,n,k
real(kind=8) :: ep,alpha
real(kind=8) :: a1,a2,a3
logical :: debug
integer :: ierr
real(kind=8),allocatable :: array(:)
debug=.false.
call dm_init1(ierr)
call dm_comm_rank(myrank,ierr)
call dm_comm_size(mysize,ierr)
call dm_option_int('-m',m,ierr)
call dm_option_int('-n',n,ierr)
call dm_option_int('-k',k,ierr)
call dm_option_real('-ep',ep,ierr)
call dm_option_bool('-debug',debug,ierr)
call dm_init2(m,n,k,ierr)
if(myrank==0) then
print *, "==============Input paramenters==========="
print *, "m=",m,",n=",n,",k=",k,",ep=",ep,",debug=",debug
endif
if(myrank==0) then
print *, "****************************************"
print *, "* Test Normal Operations *"
print *, "****************************************"
endif
call test_dm_zeros()
call test_dm_ones()
call test_dm_eye()
call test_dm_copy()
call test_dm_add()
call test_dm_minus()
call test_dm_xjoin()
call test_dm_yjoin()
call test_dm_zjoin()
call test_dm_mult()
call test_dm_emult()
call test_dm_ediv()
call test_dm_rep()
call test_dm_seqs()
call test_dm_rand()
call test_dm_sum()
call test_dm_axpy()
call test_dm_aypx()
call test_dm_trans()
call test_dm_xyt()
call test_dm_xty()
call test_dm_exp()
call test_dm_log()
call test_dm_sqrt()
call test_dm_squ()
call test_dm_cube()
call test_dm_abs()
call test_dm_pow()
call test_dm_solve()
call test_dm_setvalue()
call test_dm_getsub()
call test_dm_setvalues()
call test_dm_getvalues()
call test_dm_norm()
call test_dm_lt()
call test_dm_le()
call test_dm_gt()
call test_dm_ge()
call test_dm_eq()
call test_dm_nq()
call test_dm_max_min()
call test_dm_trid()
call test_dm_sparse()
call test_dm_save()
call test_dm_load()
call test_dm_save3d()
call test_dm_load3d()
call test_dm_getdiag()
call test_dm_setdiag()
call test_dm_gendiag()
call test_dm_find()
call test_dm_inverse()
! if(myrank==0) then
! print *, "****************************************"
! print *, "* Test Operator Matrices *"
! print *, "****************************************"
! endif
! call test_OP_AXF()
! call test_OP_AXB()
! call test_OP_AYF()
! call test_OP_AYB()
! call test_OP_DXF()
! call test_OP_DXB()
! call test_OP_DYF()
! call test_OP_DYB()
! if(myrank==0) then
! print *, "****************************************"
! print *, "* Test Operator Module *"
! print *, "****************************************"
! endif
call InitOperatorModule(2*m+1, 2*n+1, k)
call test_AXF()
call test_AXB()
call test_AYF()
call test_AYB()
call test_AZF()
call test_AZB()
call test_DXF()
call test_DXB()
call test_DXC()
call test_DYF()
call test_DYB()
call test_DYC()
call test_DZF()
call test_DZB()
call test_DZC()
call test_CSUM() !for cumulative sum type 1,2,3
call test_SHIFT()
call test_copy_edge()
call FinalizeOperatorModule()
call dm_finalize(ierr)
end program main