-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest_sym.f90
246 lines (233 loc) · 10.7 KB
/
test_sym.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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
! This is file : test_sym
! Author= zaikunzhang
! Started at: 05.04.2022
! Last Modified: Wednesday, April 06, 2022 PM11:17:10
program testsym
use, intrinsic :: iso_fortran_env, only : RP => REAL128
implicit none
real(RP) :: x(16), y(4, 4), z(4, 4), A(64), B(64), C(8, 8), D(8, 8), E(64), F(8, 8)
logical :: yeq, zeq
x = [5.67635718134880359791797203535324E+036_RP, -9.68222553446994580511021227037435E+035_RP, &
& -5.69604948021532808221926034740832E+036_RP, -4.60812554893602616143855070462312E+034_RP, &
& 0.00000000000000000000000000000000_RP, 0.00000000000000000000000000000000_RP, &
& 0.00000000000000000000000000000000_RP, 0.00000000000000000000000000000000_RP, &
& -5.67635718134880359791797203535324E+036_RP, 9.68222553446994580511021227037435E+035_RP, &
& 5.69604948021532808221926034740832E+036_RP, 4.60812554893602616143855070462312E+034_RP, &
& 0.00000000000000000000000000000000_RP, 0.00000000000000000000000000000000_RP, &
& 0.00000000000000000000000000000000_RP, 0.00000000000000000000000000000000_RP]
y = reshape(x, [4, 4])
z = y + transpose(y)
write (*, *) (y + transpose(y)) == transpose(y + transpose(y)) ! This line cannot be compiled by Absoft Fortran
yeq = (y(1, 3) + y(3, 1) == y(3, 1) + y(1, 3))
if (yeq) then
write (*, *) 'Correct: y(1, 3) + y(3, 1) == y(3, 1) + y(1, 3)'
else
write (*, *) 'Wrong: y(1, 3) + y(3, 1) /= y(3, 1) + y(1, 3)'
end if
zeq = (z(1, 3) == z(3, 1))
if (zeq) then
write (*, *) 'Correct: z(1, 3) == z(3, 1)'
else
write (*, *) 'Wrong: z(1, 3) /= z(3, 1)'
end if
A = [-1.13178571967172584198122409942296E+032_RP, &
&-3838611941296438956235083526490.1_RP, &
&-3.45815241384265589988391188787025E+032_RP, &
& 6.31996954971711254382634086471459E+033_RP, &
& 1.47596007881735223307177465906471E+033_RP, &
& 1.12694896769312353106256306426199E+033_RP, &
&-1.83853337605181647160341237287813E+033_RP, &
&-2.79086554383203896462822271076167E+033_RP, &
&-3838611941296438956235083526490.1_RP, &
& 0.00000000000000000000000000000000_RP, &
&-37698447399432947466261488056810._RP, &
& 4.22672108784073192589468607545562E+032_RP, &
& 1.05205019067653418245510055916017E+032_RP, &
& 81199327679154369165393079521470._RP, &
&-1.18285472474740457719056847268004E+032_RP, &
&-1.88518142664271344220259467887472E+032_RP, &
&-3.45815241384265589988391188787025E+032_RP, &
&-37698447399432947466261488056810._RP, &
& 4.12357769164238527135371642253344E+033_RP, &
&-2.22436852763404249300375650185381E+034_RP, &
&-6.49025034869010823432984904906584E+033_RP, &
&-5.12937806942982050236134105691211E+033_RP, &
& 5.53865305090201636237691283306983E+033_RP, &
& 1.01953778634543841331311370098939E+034_RP, &
& 6.31996954971711254382634086471459E+033_RP, &
& 4.22672108784073192589468607545562E+032_RP, &
&-2.22436852763404249300375650185381E+034_RP, &
&-1.95745286578314413281863609974110E+034_RP, &
& 5.82057084170336272307536601084687E+033_RP, &
& 5.83868923803557757394379542089867E+033_RP, &
& 1.31724622509585437095988629563817E+034_RP, &
& 5.65445038656789084368283892877022E+033_RP, &
& 1.47596007881735223307177465906471E+033_RP, &
& 1.05205019067653418245510055916017E+032_RP, &
&-6.49025034869010823432984904906584E+033_RP, &
& 5.82057084170336272307536601084687E+033_RP, &
& 4.11024361069180218542968624592074E+033_RP, &
& 3.50745729906653684330195637600659E+033_RP, &
& 2.86299750098377191345230826116095E+032_RP, &
&-3.36171408463705474345664517422630E+033_RP, &
& 1.12694896769312353106256306426199E+033_RP, &
& 81199327679154369165393079521470._RP, &
&-5.12937806942982050236134105691211E+033_RP, &
& 5.83868923803557757394379542089867E+033_RP, &
& 3.50745729906653684330195637600659E+033_RP, &
& 2.96575407820996212904846928862032E+033_RP, &
&-1.55780298161079619630201921617792E+032_RP, &
&-3.19508870679337164188374702331226E+033_RP, &
&-1.83853337605181647160341237287813E+033_RP, &
&-1.18285472474740457719056847268004E+032_RP, &
& 5.53865305090201636237691283306983E+033_RP, &
& 1.31724622509585437095988629563817E+034_RP, &
& 2.86299750098377191345230826116095E+032_RP, &
&-1.55780298161079619630201921617792E+032_RP, &
&-5.83965275621659265265118037404153E+033_RP, &
&-5.01426971606305257777801718799182E+033_RP, &
&-2.79086554383203896462822271076167E+033_RP, &
&-1.88518142664271344220259467887472E+032_RP, &
& 1.01953778634543841331311370098939E+034_RP, &
& 5.65445038656789084368283892877022E+033_RP, &
&-3.36171408463705474345664517422630E+033_RP, &
&-3.19508870679337164188374702331226E+033_RP, &
&-5.01426971606305257777801718799182E+033_RP, &
&-1.14998991195854239999916408694344E+033_RP]
B = [-1.44386051264239244054697797705290E+034_RP, &
&-1.22032271297175506059163032630080E+032_RP, &
& 3.85022638498153269823457072998269E+033_RP, &
&-1.01909964875975118646334686689364E+034_RP, &
&-3.62305957410502942917894616882898E+033_RP, &
&-1.00538568439981611102985860719332E+032_RP, &
& 5.52316974270537127543886507643952E+032_RP, &
&-3.61611585676880307755974135639439E+033_RP, &
&-1.22032271297175506059163032630080E+032_RP, &
&-1.22093313254449877787492642012856E+033_RP, &
&-4.29637322499826428781939494715815E+032_RP, &
&-44423588142053233198732885193250._RP, &
& 5.83108168823453626876768478042312E+032_RP, &
&-36391722877242658982857080985600._RP, &
&-1.52183536014028342416492510701802E+032_RP, &
& 5.03576882461370380378033221686210E+032_RP, &
& 3.85022638498153269823457072998269E+033_RP, &
&-4.29637322499826428781939494715815E+032_RP, &
&-7.19218840884230066080275778007717E+033_RP, &
& 2.32864393188250023206037506777308E+034_RP, &
& 5.91121718132896435809765594363955E+033_RP, &
& 3.92377381535783146597995151254948E+033_RP, &
&-4.81354780297470891037468750951982E+033_RP, &
&-4.47667450177080621745694947810489E+033_RP, &
&-1.01909964875975118646334686689364E+034_RP, &
&-44423588142053233198732885193250._RP, &
& 2.32864393188250023206037506777308E+034_RP, &
& 7.02183980055649413824614738851069E+033_RP, &
& 2.36878446527114330824064540870144E+032_RP, &
&-4.86772021669702393929969953663378E+033_RP, &
&-1.16020007190711109917796369449594E+034_RP, &
&-1.91128223911803134842705100996235E+033_RP, &
&-3.62305957410502942917894616882898E+033_RP, &
& 5.83108168823453626876768478042312E+032_RP, &
& 5.91121718132896435809765594363955E+033_RP, &
& 2.36878446527114330824064540870144E+032_RP, &
&-1.58432059361268984173972123220925E+034_RP, &
& 3.82591417880960372099352163960923E+033_RP, &
&-8.10504670459901060882103735488538E+033_RP, &
&-4.55494390487134081558314839075389E+033_RP, &
&-1.00538568439981611102985860719332E+032_RP, &
&-36391722877242658982857080985600._RP, &
& 3.92377381535783146597995151254948E+033_RP, &
&-4.86772021669702393929969953663378E+033_RP, &
& 3.82591417880960372099352163960923E+033_RP, &
&-1.32591853931439821528948809877935E+034_RP, &
& 5.22134530580180357710059611820899E+032_RP, &
& 1.33345491266425590305489923942042E+033_RP, &
& 5.52316974270537127543886507643952E+032_RP, &
&-1.52183536014028342416492510701802E+032_RP, &
&-4.81354780297470891037468750951982E+033_RP, &
&-1.16020007190711109917796369449594E+034_RP, &
&-8.10504670459901060882103735488538E+033_RP, &
& 5.22134530580180357710059611820899E+032_RP, &
&-3.20881577077578972583570511248076E+033_RP, &
& 1.08736922296292381692164475961720E+033_RP, &
&-3.61611585676880307755974135639439E+033_RP, &
& 5.03576882461370380378033221686210E+032_RP, &
&-4.47667450177080621745694947810489E+033_RP, &
&-1.91128223911803134842705100996235E+033_RP, &
&-4.55494390487134081558314839075389E+033_RP, &
& 1.33345491266425590305489923942042E+033_RP, &
& 1.08736922296292381692164475961720E+033_RP, &
&-1.80400328090134701916189272269023E+034_RP]
E = [-56589285983586292099061204971140._RP, &
&-3838611941296438956235083526490.1_RP, &
& 2.09939873654321357353598823372446E+032_RP, &
& 88885708199859883685604176323810._RP, &
&-74985159194225034032262132853310._RP, &
&-70101436458617322443063298090490._RP, &
&-94754496617598520113580690296660._RP, &
&-11708064131196026654772243895010._RP, &
& 0.00000000000000000000000000000000_RP, &
& 0.00000000000000000000000000000000_RP, &
& 0.00000000000000000000000000000000_RP, &
& 0.00000000000000000000000000000000_RP, &
& 0.00000000000000000000000000000000_RP, &
& 0.00000000000000000000000000000000_RP, &
& 0.00000000000000000000000000000000_RP, &
& 0.00000000000000000000000000000000_RP, &
&-5.55755115038586947341990012159469E+032_RP, &
&-37698447399432947466261488056810._RP, &
& 2.06178884582119263567685821126672E+033_RP, &
& 8.72933562021395309481167121871663E+032_RP, &
&-7.36418299857337736696330716626661E+032_RP, &
&-6.88455971943685213464326321262071E+032_RP, &
&-9.30570076169735888743273853471265E+032_RP, &
&-1.14983188337087373784088764825454E+032_RP, &
& 6.23108384151725266014073668839092E+033_RP, &
& 4.22672108784073192589468607545562E+032_RP, &
&-2.31166188383618202395187321404093E+034_RP, &
&-9.78726432891572066409318049870549E+033_RP, &
& 8.25666565123753216069064045523446E+033_RP, &
& 7.71891569918614709441602000539297E+033_RP, &
& 1.04334805170765259688631758705147E+034_RP, &
& 1.28918271286376649970105324448624E+033_RP, &
& 1.55094523801157726710403679191802E+033_RP, &
& 1.05205019067653418245510055916017E+032_RP, &
&-5.75383204883277049763351833243915E+033_RP, &
&-2.43609480953416943761527444438767E+033_RP, &
& 2.05512180534590109271484312296037E+033_RP, &
& 1.92127338529768556376133940529971E+033_RP, &
& 2.59694097133287669369240294973013E+033_RP, &
& 3.20883467515026071834342478068487E+032_RP, &
& 1.19705040415174085350562636235248E+033_RP, &
& 81199327679154369165393079521470._RP, &
&-4.44092209748613528889701473565013E+033_RP, &
&-1.88022646115056952047222458449425E+033_RP, &
& 1.58618391376885127954061697070684E+033_RP, &
& 1.48287703910498106452423464431016E+033_RP, &
& 2.00437073025077973052252262774025E+033_RP, &
& 2.47664246976853409351024747692687E+032_RP, &
&-1.74377887943421795148983168258149E+033_RP, &
&-1.18285472474740457719056847268004E+032_RP, &
& 6.46922312707175225112018668654111E+033_RP, &
& 2.73898173388201774073568708586701E+033_RP, &
&-2.31064122123449950234717212361407E+033_RP, &
&-2.16015102841185935015272454935807E+033_RP, &
&-2.91982637810829632632559018702076E+033_RP, &
&-3.60779864884011846889510397157920E+032_RP, &
&-2.77915747970084293797345046686668E+033_RP, &
&-1.88518142664271344220259467887472E+032_RP, &
& 1.03103610517914715069152257747192E+034_RP, &
& 4.36526767370412434398178568428399E+033_RP, &
&-3.68259755215208081529098765229476E+033_RP, &
&-3.44275295377022505123477177100487E+033_RP, &
&-4.65348985117904073088850679083393E+033_RP, &
&-5.74994955979271199999582043471720E+032_RP]
D = reshape(B, [8, 8])
F = reshape(E, [8, 8])
C = F + transpose(F)
write (*, *) D == transpose(D)
write (*, *) C == transpose(C)
D = D + C
!D = D + (F + transpose(F)) ! This line is an alternative to the last line. Not symmetric either.
write (*, *) D == transpose(D)
end program testsym