forked from dwr-psandhu/ann_calsim
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfnet_Beldan.f90
183 lines (181 loc) · 13.1 KB
/
fnet_Beldan.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
module fnet_Beldan
! a = 4.5804e-005
! b = 0.091868
intrinsic Reshape
real, dimension(8,126) :: input = &
Reshape((/0.173268,0.025435,-0.159944,-0.082021,0.048883,0.225691,-0.076968,-0.035901, &
-0.052268,0.095323,0.063283,0.062465,-0.098897,-0.515185,0.058877,0.075966, &
-1.087180,-0.496007,-1.630369,0.477459,-0.827268,1.129766,-1.037555,-0.217344, &
0.480726,0.848244,-1.431433,-0.861932,-0.220224,0.140867,-0.529886,-0.422866, &
-0.307484,-0.166842,-0.214298,-0.073424,0.179348,0.261185,0.270852,-0.191362, &
0.120962,-0.184157,-0.394632,-0.336882,-0.193887,-0.075872,-0.280306,0.167124, &
-0.309945,0.080551,1.072726,-0.030624,0.501185,-0.063604,-1.434056,-0.025808, &
0.091100,-0.021560,0.019286,-0.106584,-0.003432,-0.007253,-0.052267,-0.007619, &
0.213069,-0.138638,0.217143,-0.071234,-0.115428,-0.335963,0.311874,0.028225, &
-0.942813,0.101982,-2.166106,-0.003990,-0.510744,1.091098,0.101195,0.779314, &
0.534065,0.959480,-1.238515,-0.527184,-0.522863,0.103737,-0.311399,-0.187679, &
0.143527,-0.175707,-0.152233,-0.005845,-0.086349,0.415894,-0.174408,-0.112189, &
0.060371,0.043174,-0.611779,-0.119300,-0.323172,-0.239129,-0.179332,0.021755, &
-0.011764,0.373729,0.962537,0.109740,0.371200,0.049327,-1.178919,-0.508533, &
0.096439,0.106486,-0.011681,0.024020,-0.028207,0.073346,-0.002136,-0.015190, &
0.160758,-0.234875,0.177066,-0.038647,-0.117976,-0.349685,0.118399,0.097805, &
-0.842612,1.649269,-2.565053,-0.989950,0.495203,0.886708,0.775237,1.599596, &
0.363284,1.406551,-1.154076,-0.609894,-0.363132,0.213059,-0.040229,-0.005483, &
0.047784,-0.013270,-0.092817,0.003613,-0.116706,0.088076,-0.086090,-0.102875, &
0.089221,0.029779,-0.271486,-0.294212,-0.046593,-0.333789,-0.160869,-0.027622, &
0.043710,0.534262,0.506369,0.139668,0.302745,0.019709,-0.587973,-0.608392, &
0.015881,-0.043548,0.066594,-0.016496,0.094874,0.189318,-0.147338,-0.001175, &
-0.127693,-0.325667,0.261970,0.149182,0.052507,-0.133700,0.195439,-0.042214, &
-0.782742,2.891808,-2.578999,-1.392850,0.534579,0.733673,0.437360,2.036274, &
0.195816,1.463964,-1.340525,-0.780307,-0.260397,0.177250,-0.077108,0.258728, &
-0.073287,-0.131364,-0.024587,-0.055839,-0.052104,0.046760,-0.152457,-0.091144, &
0.226384,-0.250585,-0.411271,-0.142096,-0.333822,-0.245853,-0.210913,0.160755, &
-0.007210,0.423544,0.240208,-0.005836,0.324150,-0.131926,0.159131,-0.444129, &
0.068479,0.146287,0.004637,0.035178,-0.049970,-0.012365,0.020205,-0.044173, &
0.166798,-0.098608,0.161516,-0.054636,-0.083776,-0.191329,-0.212263,-0.038041, &
-1.028946,3.654096,-2.232735,-1.428772,1.014453,0.490905,-0.233782,2.211832, &
0.029897,1.369331,-1.316700,-0.587185,-0.285187,0.039170,-0.363471,0.317970, &
0.067757,-0.101293,-0.055567,-0.066364,-0.117591,0.166184,-0.147014,-0.079501, &
0.134255,-0.029019,-0.333150,-0.106775,-0.043165,-0.048964,-0.350985,0.118806, &
-0.220934,0.101467,-0.105896,0.053091,0.050619,-0.083904,-0.028217,-0.172555, &
0.158179,0.014697,0.049527,-0.006160,-0.049182,-0.080098,-0.094289,0.116287, &
-0.021469,-0.205757,0.147542,0.012290,0.074120,-0.064574,0.053522,-0.083491, &
-1.288928,4.204646,-2.278013,-1.297103,0.772684,0.697723,-1.250413,2.276929, &
0.174231,1.242736,-1.458774,-0.325519,-0.387450,0.036717,-0.580260,0.283405, &
0.043227,-0.042470,0.032610,0.028596,-0.102253,0.115053,-0.080916,-0.065602, &
0.200979,-0.242746,-0.151151,-0.057175,-0.175474,0.030719,-0.096790,-0.044224, &
-0.061231,0.081522,-0.048777,-0.017292,0.123984,-0.132778,0.036484,-0.030325, &
-0.034757,0.070523,-0.035789,0.025274,0.007852,-0.022509,-0.039553,-0.010234, &
0.014399,-0.253605,0.305861,0.045362,-0.042797,-0.348074,0.109642,-0.106836, &
-1.464618,4.675353,-2.041434,-1.528178,0.957717,0.840581,-1.667832,2.146006, &
0.221345,1.220617,-1.281346,0.024234,-0.216391,-0.198567,-0.669677,0.507593, &
-0.155234,-0.194500,-0.004106,0.115561,-0.062030,0.203568,0.113876,-0.138789, &
0.259674,0.017272,-0.403980,0.001073,-0.312916,-0.122579,-0.362958,0.091387, &
-0.100881,0.027513,-0.146449,0.072015,0.016982,0.072286,0.069644,-0.070983, &
0.160225,0.130454,0.049591,0.132070,-0.099128,-0.030587,0.131080,0.034653, &
0.098828,-0.311634,0.125961,0.079699,-0.087740,-0.089844,-0.094702,-0.134804, &
-1.968225,5.685914,-1.830737,-1.769141,1.228558,1.093475,-2.036646,2.933173, &
-0.102372,1.787232,-1.111679,0.262166,-0.363989,0.008889,-0.913293,0.765946, &
-0.245028,-0.383879,-0.204301,-0.136125,0.126844,0.222457,0.328868,-0.091449, &
0.123093,-0.326083,-0.261208,-0.068891,-0.138712,-0.109754,-0.309194,0.187914, &
-0.006207,0.308007,-0.071800,0.092123,0.082168,0.086373,0.211837,-0.212815, &
0.049287,-0.523692,-0.232754,-0.274336,0.072327,0.530590,0.036738,-0.103228, &
0.397549,-0.873407,-0.195199,0.152678,0.493866,-0.225308,-0.262948,-0.579015, &
-8.897512,13.634438,2.724416,-8.192356,-4.216950,8.702036,2.171277,11.931632, &
-1.961576,4.140418,0.568863,0.690507,-1.854800,0.931068,-0.739561,2.872954, &
-0.515984,-0.941593,-0.080490,-0.356820,-0.149887,0.748875,0.238279,-0.588631, &
0.469871,-0.621316,-0.253888,0.543026,0.167770,-0.589657,-0.348355,-0.253530, &
0.123616,0.437836,-0.867567,-0.168148,0.172305,-0.047012,0.754780,-0.357894, &
0.009272,-0.046835,0.071180,0.163928,0.191524,0.392429,0.341787,-0.104160, &
0.454887,-0.549272,-0.098510,0.471703,0.728724,-0.082940,0.190591,-0.365782, &
-9.394869,7.461847,-0.187396,-9.775183,-10.527558,9.465905,-0.697100,3.891002, &
-2.074684,1.539513,0.132304,-1.013954,-3.608952,2.218841,-1.276762,0.156235, &
-0.803646,-0.429315,0.195114,-0.471420,-0.219887,0.579508,0.541965,-0.435886, &
0.160967,-0.090732,0.107949,0.507542,0.501950,-0.624864,0.128482,0.004649, &
0.279952,0.193243,-0.516225,-0.035495,0.091298,0.318803,0.385266,-0.151069, &
-0.022314,0.479925,0.208175,0.089578,0.309456,0.238232,0.000449,-0.200166, &
0.097484,-0.063808,0.137393,0.798976,0.642493,-0.522776,0.888488,-0.065914, &
-6.820476,-1.350067,-2.597408,-11.769451,-10.647403,6.549432,-0.832686,-0.362848, &
-1.300419,-1.425644,0.389351,-3.641196,-2.350388,2.180134,-0.647934,-0.451956, &
-0.190787,-0.119311,-0.561516,-0.622372,0.623639,0.413535,0.730437,-0.091757, &
-0.145482,0.623140,0.213172,0.817841,0.365306,-0.384105,-0.150125,-0.158865, &
-0.298496,0.127446,0.192569,0.163290,0.368372,0.093766,0.007574,-0.029021, &
0.316236,0.233140,-0.113485,0.084435,-0.055801,0.485349,-0.178972,-0.033906, &
0.191719,0.063140,0.250330,0.428649,0.222597,-0.688444,0.031886,0.114592, &
-3.057685,-4.166833,-3.092915,-10.721127,-4.878815,1.537224,-1.952268,0.296105, &
0.496297,-1.108129,-0.293366,-4.634561,-0.253302,1.677853,-0.218059,1.246229, &
-0.306971,-0.484804,0.017737,-0.058244,0.172122,0.555553,0.471769,-0.256545, &
-0.005951,0.514171,0.005528,0.548666,0.273201,-0.183367,-0.124803,-0.168759, &
-0.024559,-0.187411,-0.076310,-0.073066,0.095442,0.173727,-0.036815,0.040586, &
0.174945,0.151200,-0.303699,-0.038082,-0.138829,0.164899,-0.439130,0.061036, &
-0.246967,-0.216666,0.385323,0.529983,0.200149,-0.580777,-0.251353,0.197846, &
-2.366467,-3.378737,-0.941918,-10.620605,-1.649546,0.666625,-0.735150,0.590608, &
0.866400,0.351837,-0.301889,-2.903728,0.100850,1.102383,-1.264647,0.589960, &
-0.220059,-0.374185,-0.059810,-0.097820,0.342219,0.387648,-0.109441,0.054050, &
-0.160704,0.631871,-0.204445,0.611719,-0.234928,-0.133767,-0.006254,-0.208480, &
0.148183,0.188920,-0.101092,0.025462,-0.015077,0.120682,0.090332,-0.109526, &
-0.014391,0.207198,-0.293349,0.006177,-0.119028,-0.041428,-0.050392,-0.058734, &
0.090590,0.378528,0.191543,0.219851,-0.042371,-0.810751,0.620703,-0.363411, &
-0.801855,-1.269286,-0.118393,-8.005383,-0.406717,0.593170,0.207714,-0.399593, &
0.548518,0.953206,-0.074142,-1.083894,-0.142451,0.279465,-1.025161,0.296032, &
0.003942,-0.447505,-0.023648,0.222660,-0.130353,0.181744,-0.821810,-0.064436, &
-0.113961,0.342221,-0.000605,0.046260,-0.077541,-0.221089,-0.118519,-0.169218, &
0.142063,0.487731,0.189888,0.055445,-0.042785,-0.113815,-0.001242,-0.141560, &
0.040543,-0.136672,0.135493,0.091493,-0.059025,-0.130694,0.078613,0.127929, &
0.018973,0.075077,0.500174,0.259012,0.212643,-0.055547,-0.049035,0.036405, &
0.443630,-0.256169,-0.306939,-3.982795,-0.004053,0.036931,-0.529608,0.154029, &
-0.252360,0.236447,0.498506,0.300423,-0.462441,-0.300741,-0.370721,-0.653473, &
0.186302,-0.162206,-0.326131,0.036876,0.211248,-0.118341,-0.115823,0.362098, &
0.107808,-0.012695,-0.083834,0.096001,-0.341486,-0.117582,-0.244664,-0.336116, &
0.051556,-0.073327,0.003328,-0.108654,-0.026770,-0.086897,-0.186710,0.072076, &
-0.010115,-0.030021,0.156370,-0.137021,0.182524,0.105415,0.085056,-0.127401, &
-0.007050,-0.042716,-0.228959,-0.128437,-0.047651,-0.035894,-0.382035,0.011185, &
0.229910,-0.101691,-0.189359,-1.833886,-0.271459,-0.370636,-0.346956,0.094629, &
-0.347860,0.274966,-0.253291,0.541719,-0.415847,-0.241105,1.432470,-0.087835, &
0.139935,-0.008125,-0.291722,-0.124530,0.117394,0.125175,0.121520,0.517600, &
-0.034995,0.110523,-0.176508,-0.113629,-0.214802,0.174042,-0.038881,-0.098302, &
0.142984,0.026613,-0.108740,-0.020567,-0.105410,-0.016230,0.178714,-0.011424, &
-0.042856,0.131291,-0.045572,0.080712,-0.033388,0.043650,0.110236,-0.160449, &
0.104179,-0.475465,-0.269792,-0.044221,0.034386,-0.160587,0.027341,0.448715, &
-0.042705,-1.107625,0.362720,-1.201508,-0.052387,0.083378,0.027273,0.019125, &
-0.258464,-0.343648,0.471176,-0.075258,-0.307326,-0.356635,0.603693,0.198085, &
0.222408,-0.111899,-0.540574,-0.309675,-0.155241,0.055274,-0.259298,0.698788, &
0.116737,0.034972,-0.412911,0.029701,-0.186773,0.197455,-0.101408,0.100954, &
0.099392,0.068130,0.062677,0.051867,0.001206,0.115597,0.064264,-0.004512, &
-0.246272,0.596085,0.299815,0.454220,-0.150773,-0.651924,0.164380,-0.040667, &
-0.353882,-0.077079,0.099619,-0.053674,0.184561,-0.328687,0.223670,-0.074211, &
-0.585632,0.157541,-0.159044,-0.210000,0.751718,-0.469500,1.427184,0.193713, &
0.156548,-1.255999,0.966958,-0.044289,-0.042033,-0.481646,-0.674599,0.242937, &
0.408444,-0.218836,0.050206,0.109582,-0.522523,-0.231417,-0.792535,0.297646, &
0.005897,-0.231739,-0.225771,-0.243126,-0.138883,0.071985,-0.038129,-0.265234, &
0.016370,-0.013333,-0.027396,-0.017127,-0.194296,-0.328004,0.018352,0.031954 &
/),(/8,126/))
real, dimension(2,8) :: hidden1 = &
Reshape((/-1.809514,-1.312912, &
1.542939,1.478229, &
1.264932,2.555896, &
-3.121917,-2.428459, &
-1.061113,-2.073956, &
0.594287,1.148283, &
0.094302,1.449595, &
4.046720,2.155863 &
/),(/2,8/))
real, dimension(1,2) :: hidden2 = &
Reshape((/-0.272397,-1.262327/),(/1,2/))
real, dimension(8) :: bias1 = &
(/-0.821628,0.411038,0.745823,-1.012007,-0.972895,1.360335,0.722239,0.554176/)
real, dimension(2) :: bias2 = &
(/-0.785793,-0.194092/)
real, dimension(1) :: bias3 = &
(/1.527434/)
contains
subroutine fnet_Beldan_initall()
end subroutine fnet_Beldan_initall
subroutine fnet_Beldan_engine(inarray, outarray, init)
intrinsic MatMul, Size
real, dimension(:), intent(in) :: inarray
real, dimension(:), intent(inout) :: outarray
real, dimension(126) :: inarray2
real (kind=8), dimension(8) :: layer1
real (kind=8), dimension(2) :: layer2
real (kind=8), dimension(1) :: layer3
integer , intent(inout) :: init
integer :: i, j
!do i = 1, 126
! inarray2(i) = inarray(127-i)
!end do
layer1 = MatMul(input,inarray)
layer1 = layer1 + bias1
do i = 1, Size(layer1,1)
layer1(i) = 1.0 / (1.0 + DEXP(-1.0 * layer1(i)))
end do
layer2 = MatMul(hidden1,layer1)
layer2 = layer2 + bias2
do i = 1, Size(layer2,1)
layer2(i) = 1.0 / (1.0 + DEXP(-1.0 * layer2(i)))
end do
layer3 = MatMul(hidden2,layer2)
layer3 = layer3 + bias3
outarray(1) = layer3(1)
end subroutine fnet_Beldan_engine
end module fnet_Beldan