forked from dwr-psandhu/ann_calsim
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfnet_MidR_intake.f90
183 lines (181 loc) · 13.1 KB
/
fnet_MidR_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_MidR_intake
! a = 0.00084822
! b = 0.0059421
intrinsic Reshape
real, dimension(8,126) :: input = &
Reshape((/-0.074040,0.001846,0.208714,0.568052,-0.085852,0.268043,0.139169,-0.145685, &
0.744615,-0.060253,0.424435,0.187916,0.023668,-0.103426,0.022433,-0.096228, &
0.255682,-0.662534,1.233344,0.397117,-0.264852,-0.580424,0.791817,0.440021, &
-0.797681,0.082017,1.012977,-0.773321,-1.078796,-0.773472,-0.258573,2.310312, &
0.014890,-0.753972,-0.383436,0.170945,-0.151547,0.296486,0.241891,-0.308885, &
-0.351500,-0.167889,0.035976,-0.321312,-0.056618,-0.310122,-0.371101,-0.100189, &
0.188236,0.652841,-0.478228,-0.336213,-0.048818,-0.076227,-0.168262,0.121484, &
0.561903,0.069684,0.612327,0.428575,-0.015613,0.260103,-0.018774,-0.021839, &
0.651490,-0.006149,1.387824,0.155634,-0.000538,-0.107093,0.004245,0.088698, &
0.282928,-0.102448,1.319624,0.697754,-0.068474,-0.151492,0.423468,0.262821, &
-0.786164,-0.074625,1.610215,-0.837811,-0.060412,-0.562461,-0.452703,2.252011, &
0.050758,-0.200323,-0.001905,0.259430,-0.023323,0.170427,0.111677,-0.111944, &
-0.312459,-0.219663,-0.007509,-0.490096,-0.060144,-0.295646,-0.220046,0.119461, &
0.106433,1.013184,-0.350536,-0.148935,-0.014893,-0.206050,0.051397,-0.016306, &
0.454993,0.124276,0.777145,0.344737,-0.001593,0.146985,-0.042723,0.061897, &
0.618153,-0.219045,1.864505,0.277446,0.039767,0.258304,-0.171736,-0.004136, &
0.414980,0.117774,0.537083,0.867544,0.008731,-0.217195,0.381265,0.014196, &
-0.367137,-0.025034,2.307983,-0.431479,0.112378,-0.682376,-0.605632,2.377121, &
0.080458,-0.143274,0.007571,-0.143890,-0.024743,0.034226,-0.067125,-0.029905, &
-0.159775,-0.303780,-0.108529,-0.294747,0.039599,-0.298287,-0.224217,0.184852, &
-0.095706,0.744456,-0.380060,-0.284406,-0.019566,-0.192891,0.047337,-0.057538, &
0.262784,-0.003063,0.449710,0.177516,-0.028289,-0.019700,0.016023,0.133062, &
0.547688,0.039392,2.040336,0.121178,0.037359,0.385390,-0.377377,0.032810, &
0.169941,0.166897,-0.808012,0.797145,-0.214434,-0.071164,0.467160,-0.434971, &
-0.192157,-0.122487,2.878661,-0.617960,-0.428612,-0.541144,-0.249411,2.596780, &
-0.089232,-0.199339,0.091610,-0.031768,0.090076,0.100971,-0.083079,-0.035777, &
-0.001122,0.125604,0.064729,-0.280952,-0.003458,-0.349218,-0.190173,0.067173, &
-0.130548,0.891646,-0.558144,-0.221086,-0.012844,-0.251961,0.141032,-0.151233, &
-0.456927,-0.083708,0.194251,0.075517,-0.012334,0.051198,-0.009903,0.034530, &
0.456789,0.062643,1.647729,0.168857,-0.003667,0.233116,-0.287501,0.170853, &
0.115616,-0.349780,-1.448681,-0.137013,-0.150242,0.057471,-0.061308,-0.165022, &
0.206044,-0.096906,3.084128,-0.779330,-0.402370,-0.481455,-0.151087,3.010786, &
-0.213249,-0.183455,-0.274366,-0.157775,-0.069887,-0.154826,0.174516,-0.017533, &
-0.042012,0.194590,0.308145,-0.195978,0.034417,-0.304547,-0.327872,0.403042, &
-0.178386,0.898896,-0.307530,-0.127515,0.013193,-0.154648,0.061554,-0.148519, &
-12.456998,-0.073704,-0.302567,0.027787,-0.068927,-0.105079,0.119487,0.023166, &
-0.064505,0.139223,1.429158,0.029268,0.088002,0.383566,-0.533914,0.195981, &
-0.043656,-0.127722,-1.587799,-0.219727,-0.081917,-0.118592,-0.091843,0.002582, &
0.050884,-0.123221,3.544404,-0.823074,-0.387046,-0.662443,-0.007517,3.930276, &
-0.128754,-0.312363,0.014775,-0.025088,0.018870,0.099749,0.048955,-0.047641, &
-0.342045,0.027338,0.254991,-0.314748,-0.018646,-0.250376,-0.186334,0.502974, &
-0.127585,0.552757,-0.038572,-0.042222,0.022770,-0.080788,0.015247,-0.117316, &
-17.405410,-0.007613,-0.460103,0.047026,-0.036758,-0.039825,0.073613,-0.081597, &
0.033603,0.018852,1.141442,-0.123540,0.098073,0.260627,-0.516115,0.269874, &
-0.138752,-0.245693,-1.170009,-0.144963,-0.618143,0.012708,0.031156,-0.182157, &
0.001171,-0.106535,3.668169,-0.576872,-0.367949,-0.940311,-0.042213,4.674673, &
-0.094131,-0.247386,0.096909,0.108673,0.001258,0.055496,0.011933,0.025571, &
-0.503211,0.086408,0.144921,-0.280253,0.082494,-0.303296,-0.297296,0.433265, &
-0.261471,0.319268,-0.003231,-0.068463,-0.006083,-0.149941,0.043007,0.030588, &
-1.532967,-0.023868,-0.639293,0.223252,-0.020141,0.002452,0.124370,-0.163810, &
-0.209424,0.235459,1.416357,-0.021487,0.135700,0.262273,-0.700650,0.364267, &
-0.265062,-0.010764,-0.566416,0.092609,-0.306465,0.041998,-0.177369,0.036672, &
0.417257,0.211568,4.061620,-0.442200,0.150593,-1.400448,0.418031,5.932774, &
0.221377,-0.672161,-0.283751,0.109661,-0.101187,0.335191,0.282743,-0.304031, &
-0.886489,0.186296,0.223298,-0.046998,0.153031,-0.316000,-0.406326,0.624325, &
-0.247512,0.168944,0.024668,0.097892,0.040628,0.021933,-0.022751,-0.093736, &
-0.974708,-0.642154,-0.312356,1.152908,-0.383424,0.511983,0.205794,-0.394738, &
0.523520,-0.145929,3.111888,-0.723904,1.221214,0.075537,-1.293800,0.287167, &
-0.795691,0.100659,-0.467520,0.888875,-8.788235,0.749665,-1.029914,-0.621696, &
1.603883,-0.082838,2.025406,0.514219,-0.820562,-2.243276,0.563320,10.779299, &
0.049638,-2.529443,-1.226495,-0.227430,0.296566,0.618537,0.732072,-0.790668, &
-2.121475,-0.767903,1.190753,0.020814,0.437752,-0.453058,-0.715642,0.783292, &
0.161147,0.096120,0.735080,0.478013,0.120791,0.079414,0.018226,-0.159170, &
0.281210,0.070551,0.604405,0.575703,-0.090635,0.709607,-0.385660,-0.522573, &
-0.387271,-0.453870,2.567491,-0.070495,1.915824,0.250829,-0.274109,-0.137769, &
-0.567048,0.803519,-1.693420,1.732501,-20.302555,0.936613,-0.923463,-2.022032, &
0.983963,-0.056046,-0.364277,-0.497774,-7.572893,-1.067406,-0.314672,10.651646, &
-0.671141,-2.727788,-1.238929,-0.374308,0.121089,0.794024,0.704122,-0.557931, &
-1.265898,-0.471679,2.087948,-0.376218,0.753580,-0.440798,-0.373360,0.620217, &
0.177767,-0.275680,0.335145,0.501481,-0.045686,0.297673,0.093534,-0.151278, &
1.082233,-0.095730,0.385978,-0.470168,0.105801,0.136564,-0.917135,0.597169, &
-1.028954,-0.611541,0.472141,0.247610,1.629568,0.541759,0.320193,-0.806047, &
2.227724,0.183944,0.560271,2.880667,-22.570760,1.168692,-0.703117,-1.275052, &
-1.093946,-1.983059,0.479006,-1.688044,-8.082610,1.657782,-1.832562,7.775983, &
-0.116399,-0.798365,-1.647010,0.455973,0.391029,0.436837,0.501428,0.144104, &
-0.339146,-0.159907,1.839457,-0.210345,0.973263,-0.180150,-0.184510,0.370074, &
0.786555,0.279461,0.195703,0.383545,-0.043048,0.199134,0.084991,-0.416509, &
0.328778,-0.358435,1.298333,0.525503,-0.056092,0.169956,0.121831,0.283565, &
0.246229,-0.291271,0.369125,-0.060787,1.051924,0.548401,-0.190120,-0.408022, &
-0.647265,-0.292230,-0.133824,1.557765,-16.223835,1.253615,0.287905,-1.474789, &
-3.476522,-1.824361,4.472099,-0.687814,-4.634869,1.953253,-2.152685,1.751315, &
-0.471801,-1.004223,-1.591655,0.771285,0.101735,0.557337,0.678999,-0.163049, &
0.042155,-0.039025,0.638291,0.124744,0.708340,-0.105872,-0.207890,-0.001424, &
0.721932,0.483191,0.022798,0.258399,0.130479,0.027672,0.001250,-0.405821, &
-0.253629,-0.009235,-0.086535,-0.108816,-0.125652,-0.080077,0.029319,0.114993, &
-0.509553,-0.275611,-1.164811,-0.097936,0.849579,-0.128379,-0.078090,0.014122, &
0.500401,-0.416235,-1.652756,1.455921,-11.509070,0.574167,0.401556,-1.790991, &
-0.538504,0.518499,4.329999,0.154977,-3.574906,0.622617,-0.484307,-0.922407, &
-0.476192,0.111552,-1.674954,1.205917,0.044664,0.108891,0.445119,0.420269, &
-0.307647,-0.337712,0.987934,0.300572,0.167102,-0.106876,0.095453,0.122376, &
0.228408,-0.019856,-0.129846,-0.099212,-0.118356,-0.071033,0.060246,0.041867, &
0.772925,0.199340,-0.085773,0.286898,0.003310,-0.228681,0.065146,-0.155854, &
-0.035134,0.154994,-1.457844,-0.818654,0.668638,-0.131012,-0.459957,0.013677, &
1.568955,0.467040,2.106620,1.074654,-5.419220,-0.091898,-0.494616,1.506130, &
2.062172,0.662215,4.327106,-0.029791,-2.731718,-0.446571,0.769109,-0.641528, &
-0.620713,-0.104752,-1.795808,1.222849,-0.665034,0.187624,0.267218,-0.348762, &
-0.228889,-0.723044,0.717757,-0.282192,0.151306,0.410419,0.638833,-0.039343, &
-0.236038,-0.036621,0.233575,-0.618448,-0.035957,-0.196201,-0.210817,0.374641, &
0.304655,-0.215321,0.827594,1.098950,0.225691,0.601048,-0.042779,-0.317672, &
-0.705083,-0.553342,0.075122,-0.893180,-0.048731,0.200462,-0.146003,0.095869, &
-3.053958,0.422119,3.703075,0.752609,-3.460131,0.193808,0.117206,0.789863, &
0.192408,-0.184525,0.065692,-0.115446,-1.248949,-0.585365,1.147764,0.093848, &
-0.519457,0.328302,-1.637674,0.775771,-0.534007,-0.361856,0.208046,-0.286258, &
-0.288993,-0.585843,-0.009910,-0.001088,0.063822,0.273958,0.507664,-0.130357, &
0.296847,0.069669,0.151551,0.210679,0.022629,-0.127050,0.147734,0.038278, &
-0.422382,-0.182910,-0.160645,0.274468,-0.051703,0.037480,0.101730,0.144554, &
0.490039,-0.058837,-0.078650,-0.041945,0.055143,0.163009,-0.175698,-0.063520, &
-8.786743,-0.172218,-0.115995,1.031249,-3.286680,-0.014053,0.545418,-0.145476, &
-2.531763,-0.114336,-3.554599,1.766011,-1.993084,-0.332495,-0.089843,0.975740, &
-0.480711,0.274833,-0.762526,-0.073192,-0.629851,-0.585074,-0.136084,-0.535412, &
-1.661090,-0.510891,-0.842708,0.128032,-0.701742,0.117872,-0.136833,0.083119, &
-0.294830,-0.133687,-0.552809,-0.105136,-0.070782,0.001063,0.085737,-0.068854, &
0.648669,0.321709,-0.025094,0.905224,-0.015932,0.179743,0.232579,-0.472745, &
-0.531237,0.192700,-0.291895,-0.290465,0.143252,-0.612998,-0.053389,0.694327, &
-9.311654,-0.122716,-1.212198,1.940406,-1.223834,-0.388392,1.075076,-0.301233, &
0.065978,0.105179,-2.734025,1.020323,-0.493506,-0.010711,0.405655,0.087878, &
-0.165091,-0.505003,-0.565641,-0.047645,-0.663956,-0.333127,0.179604,-0.319055, &
-1.199416,-0.409452,-0.587224,0.384822,-0.215790,-0.180020,0.448439,0.202112, &
-0.139727,0.130257,0.452634,-0.248164,0.027250,0.038412,-0.215883,0.074019, &
-0.113971,-0.178386,0.489947,0.975540,0.170431,0.398458,0.114544,-0.263755, &
-0.867145,-0.350397,-0.348049,-1.379722,-0.500443,-0.847508,0.338033,0.841432, &
-5.986238,0.451615,1.940727,2.606811,-1.376208,-0.898139,2.278419,-0.409220, &
-0.840987,-1.251943,-3.712754,-0.449510,-0.538041,-1.508759,1.567324,-1.575360, &
0.452620,0.345164,-0.494947,-0.375276,-0.144519,-0.469988,-0.154883,-0.602683, &
0.583428,-1.009646,-1.275947,0.117659,-0.150616,0.247603,0.418978,-0.282550, &
0.365932,0.012213,-0.002812,1.148069,0.084437,0.305041,0.217709,-0.447421 &
/),(/8,126/))
real, dimension(2,8) :: hidden1 = &
Reshape((/5.929279,-5.812307, &
1.265747,-2.122142, &
-0.843611,1.163391, &
-1.938996,1.086081, &
-2.181769,-4.449668, &
-0.957428,-1.035373, &
1.404035,-1.427477, &
-1.893992,-0.249052 &
/),(/2,8/))
real, dimension(1,2) :: hidden2 = &
Reshape((/-1.534419,-1.887204/),(/1,2/))
real, dimension(8) :: bias1 = &
(/1.794633,0.839142,0.087546,-1.275979,-2.663123,1.156448,0.309623,-1.489758/)
real, dimension(2) :: bias2 = &
(/0.581794,0.689009/)
real, dimension(1) :: bias3 = &
(/1.734265/)
contains
subroutine fnet_MidR_intake_initall()
end subroutine fnet_MidR_intake_initall
subroutine fnet_MidR_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_MidR_intake_engine
end module fnet_MidR_intake