forked from dwr-psandhu/ann_calsim
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfnet_CCFB_intake.f90
183 lines (181 loc) · 13.1 KB
/
fnet_CCFB_intake.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_CCFB_intake
! a = 0.00076145
! b = 0.026005
intrinsic Reshape
real, dimension(8,126) :: input = &
Reshape((/1.613108,-0.477459,0.300708,-0.334373,-0.096165,0.138876,0.005277,-0.371812, &
-1.568618,0.710853,0.537343,-1.083499,-0.206078,-0.295322,-0.345948,-0.547604, &
-0.179636,0.241710,0.233436,-0.858068,0.358532,0.182313,0.495759,0.451410, &
-0.925244,-1.033938,-1.672240,-4.461555,5.022235,2.499420,1.002125,-0.780111, &
0.282646,0.510105,0.464362,0.020686,0.300739,0.317819,0.170081,-0.160064, &
0.758441,-0.525953,-0.263233,-0.842122,0.435229,0.113735,0.277839,-0.493092, &
-0.391883,0.072816,0.071872,0.110970,0.252359,0.239186,-0.077890,-0.200708, &
16.461496,-0.280644,0.180514,-0.020997,-0.096442,0.053713,0.154434,-0.043491, &
-0.967501,0.564412,-0.182828,0.109261,0.024190,-0.476869,-0.574894,-0.882534, &
-1.890159,-0.782956,-1.243012,0.085400,-0.002487,-0.224632,0.697707,-0.358689, &
-0.211178,0.468106,-2.859220,-2.777450,4.543314,2.412867,0.488510,-3.634692, &
0.053534,0.046089,0.295588,0.137742,0.030214,0.035086,0.043896,-0.150835, &
3.597191,-0.151509,-0.223394,-0.924811,0.386127,0.040069,0.141341,-0.396603, &
0.996904,-0.076011,-0.071790,-0.063808,0.006808,-0.003106,-0.018014,0.031533, &
1.851423,-0.109197,-0.041216,0.000818,0.086008,-0.100594,-0.008940,-0.280749, &
-0.481639,-0.084771,0.143136,-0.183482,-0.100024,-0.273828,0.056230,-0.240720, &
0.028818,-0.144728,-0.510458,0.677985,0.120472,0.523438,-0.379999,-0.104410, &
0.267543,0.639861,-1.635247,-0.652702,4.688623,2.612489,-0.020715,-3.032927, &
0.154193,0.086059,-0.039784,0.000504,0.247656,0.132574,0.151580,0.027983, &
0.698886,0.259078,-0.251858,-0.566442,0.434879,0.161541,0.114085,-0.323525, &
0.288128,0.151554,0.084696,-0.048422,-0.014820,-0.013280,0.003508,0.030794, &
-0.115283,-0.026341,0.051614,-0.016098,0.091072,-0.061786,-0.007238,-0.301529, &
-0.292479,-0.430422,0.149510,-0.608398,0.019305,0.023914,0.376166,0.087683, &
0.003125,0.107041,0.011991,0.377960,0.086582,0.213575,-0.793893,-0.035472, &
-0.106115,0.359982,-0.206534,0.266274,4.530277,2.787276,-0.056793,-2.014041, &
0.188218,0.165440,-0.021310,0.203173,0.059537,0.082741,0.005908,0.056763, &
-0.056294,0.190191,-0.127213,-0.049061,0.247541,-0.097862,0.013366,-0.555451, &
0.010399,0.020292,-0.035022,-0.019657,0.022147,-0.006590,0.065794,0.081244, &
-0.159642,0.047911,0.061051,0.016388,0.198643,-0.007028,0.152438,-0.196750, &
-0.015347,-0.137185,0.244324,-0.729121,-0.010620,-0.134493,0.577059,0.068078, &
-0.004052,-0.039537,-0.104958,-0.121774,0.090027,0.729794,-0.673793,-0.014287, &
-0.490488,0.163747,0.504558,0.632753,4.177520,3.418440,0.067604,-0.972450, &
-0.159227,0.289805,0.197626,0.194602,0.099020,0.103588,0.035685,0.042672, &
-0.148860,0.023801,-0.171103,-0.063750,0.108799,-0.120333,0.073321,-0.255605, &
0.016251,-0.041145,-0.018319,-0.016062,-0.087543,-0.045357,0.023288,0.083619, &
-0.296810,-0.055684,-0.030196,-0.009040,0.143727,0.023293,0.075810,-0.154204, &
-0.211760,-0.017051,0.230866,-0.413355,-0.100945,-0.234944,0.263291,-0.076548, &
0.197526,-0.049054,-0.186217,0.301633,0.076836,1.313605,-0.400330,0.248155, &
-0.559985,0.236125,0.724588,0.154833,4.232477,4.015189,0.991688,-0.977149, &
-0.218320,0.246780,0.058478,0.003095,0.207193,0.183326,0.055581,0.075783, &
-0.129905,-0.216559,-0.104705,0.226450,-0.028197,-0.080026,-0.007778,-0.197774, &
-0.056936,0.012290,0.085416,-0.030106,-0.012493,-0.046272,0.086096,-0.045698, &
-0.169892,-0.098087,-0.022650,0.008588,0.036201,0.000764,0.035673,-0.111317, &
-0.233733,-0.016269,0.380647,-0.614703,-0.204513,-0.491449,0.496780,-0.126647, &
0.249850,-0.121416,-0.315612,0.060308,0.088657,1.960712,-0.027300,0.303162, &
-0.600468,0.373548,0.524615,-0.142542,4.186318,4.017030,1.253524,-0.624417, &
-0.018650,0.206876,0.319321,-0.027716,0.098436,0.014868,0.204805,-0.100984, &
-0.136159,-0.064795,0.028355,-0.072766,0.063720,-0.010771,0.396024,-0.000484, &
-0.151438,-0.077759,-0.047377,0.004605,-0.053389,-0.025149,-0.018320,0.002220, &
-0.563041,-0.172638,-0.244167,-0.005822,0.213287,0.153574,-0.020039,-0.102487, &
-0.321889,0.257184,0.417688,-0.422977,-0.196691,-0.648481,0.457318,-0.147505, &
0.596022,-0.516976,-0.556996,0.090488,0.283459,2.806594,0.367384,0.210661, &
-1.117572,0.287158,0.335987,-0.569644,4.220788,4.428307,2.202850,-0.443352, &
0.296489,0.569401,0.499957,0.308023,0.260679,0.236485,0.093682,-0.102654, &
-0.028040,-0.097847,-0.043104,0.011108,-0.097755,-0.256466,0.278198,-0.137751, &
-0.396702,-0.092385,0.017863,0.061650,0.025004,0.002019,0.070539,-0.073799, &
2.315311,0.058566,-0.053522,0.263573,0.554616,0.760211,0.071484,-0.318225, &
0.964352,0.904293,0.675287,-0.728619,-0.478229,-2.225501,0.269894,-0.124509, &
0.185046,-0.710864,-0.883010,0.067192,-0.763669,15.465164,2.407994,-0.096170, &
-0.569233,0.047502,0.378085,0.272528,5.712613,6.147676,2.358902,0.543577, &
0.181107,2.226746,1.377691,0.965412,0.920228,0.837272,-0.281692,-0.392140, &
1.097339,0.684345,0.013987,0.256358,-0.013449,-0.951326,-0.131672,0.057181, &
-0.067398,0.191559,0.088110,-0.161113,-0.178151,-0.214300,0.006799,0.068482, &
-0.101349,-0.273280,-0.011797,-0.152182,0.080729,0.193405,0.196789,-0.118513, &
0.971968,1.225922,0.535120,-0.572301,-0.311047,-2.613894,-0.204594,0.184818, &
-0.593236,-0.570879,-0.735242,-0.406302,0.649172,27.373972,7.932067,-0.075889, &
-0.000838,0.705685,0.480980,1.137096,3.901154,10.349353,5.079021,-0.182703, &
-0.291688,2.982872,1.835948,1.738211,0.560666,0.804635,-0.465450,0.089653, &
1.577735,0.639758,-0.423514,0.481377,-0.150663,-1.402853,-0.089313,0.214372, &
-0.242447,0.084474,0.259670,0.281867,-0.023942,0.168130,-0.205685,-0.200614, &
-1.090166,0.127381,-0.785231,-0.058773,-0.071549,-0.161847,-0.379859,-0.016212, &
0.804550,-0.407556,0.014722,-0.699283,-0.067705,-1.555158,-1.527308,0.075474, &
-2.326593,-2.761412,-2.555954,-0.244107,0.360392,18.370426,20.528055,-1.366545, &
7.555294,3.209024,0.926512,0.988447,1.769462,6.159596,6.718170,-3.296236, &
0.115995,1.230912,0.828086,1.850321,-0.134110,0.051132,-0.524600,0.412139, &
1.400697,1.410945,-0.296976,0.535343,0.060207,-1.247344,-0.730880,-0.028026, &
-1.259513,-0.125493,0.128855,0.068348,-0.157852,-0.029789,0.026030,-0.091473, &
0.697634,0.226578,0.050427,0.499098,-0.354093,-0.102522,-0.017131,0.352140, &
-0.201536,-0.103497,-0.070103,-0.076349,0.299472,-0.478802,-1.029403,-0.445275, &
0.155504,-0.734665,-0.610474,-0.710520,-0.622575,9.708512,16.215446,-0.043773, &
5.655624,1.725068,1.881203,0.812502,0.635314,4.325798,5.219049,0.125862, &
-0.023840,1.100925,0.908671,2.555832,0.069075,0.379856,-0.269333,0.331218, &
0.234340,0.651947,-0.080758,-0.374049,-0.238199,-0.585829,-0.641599,0.642073, &
-0.268802,0.153115,0.205710,-0.081284,-0.177788,-0.089094,-0.064020,-0.041529, &
-1.112253,-0.041880,-0.229313,-0.180228,-0.085088,0.022750,-0.449092,-0.171198, &
1.184337,-0.082981,-0.004580,0.144165,0.675187,-0.223613,-0.268089,-0.380360, &
-0.256242,-0.045039,0.225461,-1.228721,-0.443194,6.127206,12.555486,0.011042, &
-1.773141,0.105375,0.304158,-0.731477,1.741080,0.072531,4.795440,-1.644208, &
-0.931713,0.757820,0.913595,3.385215,-0.700288,-0.136762,-0.401500,0.724143, &
-0.364987,0.544506,-0.230495,-0.834123,-0.705635,0.180565,-0.676942,0.780970, &
-0.448116,-0.073891,-0.091213,0.116809,-0.008267,0.175975,-0.273932,-0.083432, &
-1.212127,0.216311,0.159665,-0.458287,-0.517205,-0.170336,-0.003883,0.237824, &
0.953843,-0.290413,-0.042834,0.016493,0.220814,-0.324450,-0.460247,-0.241102, &
-2.098010,0.196032,-0.493322,0.243913,-0.945762,2.162202,6.830775,1.587126, &
-3.115877,-1.989157,-0.723526,-2.071128,0.434878,-0.128150,4.285123,-2.465659, &
0.277515,-0.535870,0.038283,1.672718,-0.341291,0.621387,-0.417754,0.346343, &
-0.676062,0.787861,0.063307,-0.647828,-0.289572,-0.240287,-0.469541,1.023916, &
1.816471,-0.344468,-0.302578,0.533297,0.216135,0.223505,-0.069162,-0.116772, &
0.638644,0.095535,0.030376,0.561750,-0.255141,-0.187071,-0.064757,0.217092, &
0.729600,0.188574,0.111178,0.254830,0.076391,0.296412,-0.319628,0.077953, &
-0.048096,0.129577,-1.366674,2.031157,-0.404819,2.053069,4.515270,1.358230, &
-0.352246,-1.271120,-0.322582,-1.365123,1.006956,-1.108688,2.516594,-0.503959, &
0.454886,-1.299939,-0.547486,0.302023,-0.088656,0.278739,0.289998,0.204817, &
-0.625901,0.678224,0.255980,-0.502907,-0.008645,0.071352,-0.496714,0.188747, &
-1.375878,0.173741,0.137887,0.017549,-0.156334,-0.211176,0.052082,0.019814, &
-0.986965,0.051306,-0.244783,0.491351,-0.188944,0.072755,-0.599960,0.013563, &
-0.193320,-0.889959,-0.533232,-0.323520,0.418995,0.082080,0.140033,-0.655028, &
1.860059,-0.736563,-0.427067,0.338712,1.547586,1.441607,2.279751,-1.027800, &
4.387633,0.572636,0.308079,-0.164616,-1.118372,0.783760,2.804497,-0.057429, &
0.533910,-1.899577,-1.255034,-1.345841,-0.317566,0.030788,0.365851,0.165330, &
0.967860,-0.165474,-0.385368,0.989346,-0.268524,0.718044,-0.103443,0.075056, &
0.340345,0.071252,0.210008,-0.165608,0.254894,0.155681,0.185595,-0.195306, &
-0.946313,-0.200936,-0.294779,0.489700,-0.069934,0.313209,-0.102790,0.211647, &
0.641116,-0.007075,-0.219120,0.154886,-0.278471,-0.570932,-0.113038,0.280750, &
8.343520,0.553784,0.793027,-0.099847,0.482955,0.709996,2.532751,-0.703487, &
5.312595,-0.260021,0.564784,-0.455259,-0.664870,-1.179978,0.517979,0.179595, &
1.335302,-1.099682,-0.719776,-0.928901,-0.002286,0.275046,0.539263,0.129685, &
0.654636,0.191574,-0.241559,0.650605,0.296564,-0.308694,-0.355960,-0.063557, &
-0.099084,-0.077372,0.043369,-0.325199,-0.004564,-0.039341,0.082050,-0.057673, &
1.210695,0.242271,0.135111,1.463492,-0.182105,-0.136553,-0.219610,0.147627, &
0.878937,1.291331,-0.044271,0.263745,0.060223,0.376905,-0.016199,1.055529, &
2.200763,0.528056,1.597219,-0.234342,0.372421,-0.297900,4.281624,-0.297954, &
8.909657,-0.774872,0.643813,1.868251,-1.113609,1.018114,-1.920310,0.123360, &
1.152296,-1.413776,-1.087389,-1.788883,0.101035,0.010683,0.295996,-0.333896, &
0.483816,-0.592184,-0.600459,0.406681,0.390280,0.531277,-0.116890,-0.183451, &
-0.659895,-0.110343,0.064426,-1.222297,-0.038280,-0.063851,-0.045637,-0.154555 &
/),(/8,126/))
real, dimension(2,8) :: hidden1 = &
Reshape((/-2.101628,-1.716499, &
-1.174154,-1.111409, &
0.802922,1.581465, &
1.231653,0.266108, &
2.014589,0.378955, &
-2.292914,-0.816677, &
-1.681772,-0.362228, &
0.589244,1.923986 &
/),(/2,8/))
real, dimension(1,2) :: hidden2 = &
Reshape((/3.165509,0.85524/),(/1,2/))
real, dimension(8) :: bias1 = &
(/-1.513485,-3.555026,1.349037,4.022742,-1.19566,1.997691,1.717631,1.322457/)
real, dimension(2) :: bias2 = &
(/0.663116,0.476759/)
real, dimension(1) :: bias3 = &
(/-0.223176/)
contains
subroutine fnet_CCFB_intake_initall()
end subroutine fnet_CCFB_intake_initall
subroutine fnet_CCFB_intake_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_CCFB_intake_engine
end module fnet_CCFB_intake