forked from dwr-psandhu/ann_calsim
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfnet_ORRSL.f90
183 lines (181 loc) · 13 KB
/
fnet_ORRSL.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_ORRSL
! a = 0.00057239
! b = 0.038113
intrinsic Reshape
real, dimension(8,126) :: input = &
Reshape((/0.005788,-0.090229,0.139098,0.090026,0.011541,-0.193970,0.130701,0.098459, &
-0.023684,-0.011523,0.031955,0.076520,0.017812,0.089144,-0.035326,-0.057776, &
-0.067476,0.017559,0.060834,-0.036737,-0.019077,0.012995,0.029712,0.051757, &
-0.037610,-0.017883,0.034672,0.005025,-0.011843,0.077405,-0.015801,0.059212, &
0.000824,0.026952,0.042136,0.012544,-0.033609,0.016750,0.008259,0.013450, &
0.027770,-0.034248,0.049153,-0.004511,-0.039178,0.024629,-0.004194,0.128702, &
-0.073860,-0.063651,0.062498,-0.015047,-0.019926,0.025902,0.045846,0.235739, &
0.020016,-0.072473,0.095497,-0.075374,-0.061619,0.044229,0.026404,0.261945, &
0.299000,-0.747429,0.776268,0.955625,-0.035709,-0.154881,0.398783,1.246207, &
0.202411,-0.062425,0.375893,1.812735,0.188902,-0.282432,-0.073358,-0.330788, &
0.069997,0.108286,0.573700,1.196635,0.064657,-1.669497,0.733216,0.098447, &
-0.791191,0.361728,0.296427,0.764556,0.167861,-0.710975,0.296516,-0.461540, &
-0.527387,0.122903,0.142767,0.183966,-0.008785,-0.834307,0.307213,0.133038, &
-0.521165,0.016443,0.076850,-0.297366,-0.019714,0.032215,-0.041446,0.034854, &
-0.061527,-0.139110,-0.086479,0.097981,0.102241,0.218249,-0.112574,0.006336, &
-0.299468,0.067436,-0.117610,-0.440521,-0.020163,-0.171763,0.101832,0.151674, &
-0.518895,0.426528,0.174380,-0.296484,-0.036897,-0.625529,0.271892,-0.328814, &
-0.264687,0.041818,0.163331,-0.007046,0.043400,-0.496890,0.239316,-0.191008, &
-0.719055,-0.021239,0.191483,0.232474,0.143115,-0.370072,0.321272,0.618124, &
-0.192892,-0.198556,0.017697,-0.293847,0.060188,-0.244190,0.417227,0.530573, &
-0.163584,-0.324185,-0.155269,-0.067660,0.134105,1.191486,-0.598261,-0.142326, &
-0.183146,-0.275662,-0.006822,0.391447,0.182591,0.996909,-0.316114,0.155137, &
-0.129228,-0.245191,0.057685,0.284171,0.149065,0.583678,-0.146137,0.250997, &
-0.199235,-0.537619,0.227893,0.545014,0.273249,0.326475,-0.000236,0.592309, &
0.284197,-0.539865,0.022832,0.636526,0.280649,0.497576,-0.101222,0.340365, &
0.271212,-0.907008,-0.270919,0.271558,0.356592,0.571248,-0.074211,0.878689, &
2.091601,-0.062914,-1.729549,-1.549457,0.980090,0.321027,0.415934,-1.059146, &
1.380590,0.205079,-1.088088,-1.010348,1.178483,0.015653,0.217648,-0.434543, &
0.586338,1.409553,-0.649928,-0.657883,0.543688,-0.828628,0.427526,-0.357893, &
-0.166045,0.860293,0.196762,0.371952,0.227032,-0.956258,0.467962,0.115475, &
0.124775,0.598410,0.196048,-0.266702,0.079459,-0.389648,0.123326,-0.122694, &
-1.347360,0.837600,-0.497293,1.425982,0.783663,0.994385,-0.640753,-1.051631, &
-0.089606,0.546551,0.448373,-0.139443,-0.216062,0.381022,-0.053211,0.332195, &
0.653252,0.206424,0.318760,-0.319822,-0.237711,0.323567,0.021578,0.123940, &
0.266675,-0.289719,-0.736669,1.422312,0.477755,0.403387,-0.265994,0.212588, &
0.083748,0.446032,0.341230,-1.361347,-0.460201,-1.063400,0.644453,0.553879, &
1.165043,0.095524,-3.125260,1.155221,0.357654,1.153197,-0.376339,-0.553598, &
0.891316,-0.209054,-1.570231,0.391168,-0.107400,0.129348,0.037233,0.897105, &
1.407328,-0.822560,-0.282952,0.698270,-0.094897,0.034352,-0.033812,1.192349, &
0.880615,-1.601862,-1.402604,0.131684,-0.398651,-0.020987,-0.134193,2.225004, &
1.315330,-0.782810,-2.523487,-0.255714,-0.458791,-0.145893,0.277496,2.575483, &
0.666526,-0.109781,-4.140619,-1.770589,-0.752084,0.776334,-0.073920,2.610345, &
0.890664,0.061773,-5.106083,-2.998879,-1.395823,0.089357,0.239152,4.986858, &
1.530275,1.273485,-5.969696,-4.574477,-2.756389,0.390818,-0.030997,8.785476, &
-2.845175,-1.208030,-9.562180,0.526811,-12.779818,-1.127774,0.614276,14.997048, &
-3.110490,-1.245251,-3.752527,5.629349,-22.042698,-0.752077,0.252168,11.002049, &
-1.381660,-16.160240,0.565830,-3.369226,-12.711794,-0.838658,0.401228,6.597043, &
-3.540273,-12.694038,-1.556448,-5.712455,-4.979218,0.563863,-0.357841,7.265525, &
-2.683284,-10.376674,-1.678391,-5.189207,-3.600204,1.015660,-0.360257,4.787861, &
-2.299160,-8.838927,-1.414090,-3.591009,-3.469441,-0.212089,-0.044504,2.987687, &
-0.118175,-8.008244,0.922958,-6.083278,-1.375960,0.118391,-0.153159,-0.969587, &
2.488994,-5.781349,-1.092390,-1.144141,-0.060040,0.247755,-0.182533,-0.926500, &
1.685441,-4.095149,0.329686,1.865864,0.092135,-0.299889,0.156953,0.761819, &
1.320560,-5.194048,-0.216467,-0.693502,-0.028862,0.316356,-0.189584,0.203312, &
-1.456524,0.007994,0.731811,-0.544522,-0.811160,-1.158212,-0.566199,-1.397666, &
-1.160705,0.422063,0.333077,-1.755945,-0.534751,-2.815851,0.817280,0.047286, &
-0.780401,0.575350,0.537285,-2.912753,-0.440233,-4.083677,1.521870,1.410355, &
-0.357481,1.038290,0.435963,-2.765771,-0.853114,-4.745136,1.738550,2.460018, &
0.387451,1.210561,-0.200564,-2.345105,-1.425338,-4.148212,1.476723,3.088521, &
1.178567,1.787455,-0.109237,-2.174735,-2.138172,-3.073538,0.574125,3.629894, &
2.238638,1.243548,0.351116,-1.303499,-2.459955,-1.790313,0.513761,4.552078, &
4.098422,1.670716,1.177931,-1.764417,-2.642348,-1.103262,0.008173,5.683953, &
1.766379,-1.860713,2.410629,2.337944,-8.272197,-3.717502,1.402013,3.203859, &
3.762992,-0.895314,2.622834,0.465830,-7.276947,-4.288594,1.146416,2.971447, &
5.549676,-7.740302,-0.683801,-3.634489,-3.556174,-5.825839,0.401427,1.562813, &
3.869005,-7.608849,-1.652494,-4.815336,-1.267941,2.910159,0.405697,0.484785, &
2.661291,-9.452733,0.862751,-0.160002,-1.441294,0.564886,-0.148448,-0.729418, &
1.577484,-6.961270,2.514942,1.709084,0.240191,-1.993335,1.244434,1.100157, &
2.808050,-1.808045,0.155097,0.945255,0.434417,1.376889,0.262584,3.365534, &
1.254471,-0.986449,1.397185,0.071021,-0.206457,-1.571147,1.127390,4.638084, &
-0.239505,-1.762722,-0.631216,-0.509562,-0.469581,-0.536642,-0.088753,1.580221, &
-0.918176,0.175627,0.328849,-3.016668,-0.630296,1.261659,-0.514818,0.453959, &
0.703886,-0.372258,-0.156313,0.391897,0.064388,0.749322,-0.377935,-0.022912, &
-0.049818,0.045223,0.062099,-0.054357,-0.041839,-0.023531,-0.016928,0.000362, &
0.002825,-0.114292,-0.098185,-0.009691,0.096634,-0.087167,0.036404,-0.171547, &
0.187388,-0.052733,-0.065681,0.320105,0.048327,0.208266,-0.121480,-0.078648, &
0.001096,-0.091374,-0.141677,0.282338,0.133831,0.121340,-0.160074,-0.269357, &
0.112040,-0.021880,0.025375,0.196670,0.053938,0.452158,-0.257579,-0.315856, &
0.491656,-0.115124,-0.185773,-0.109701,-0.038419,-0.208994,0.141690,0.263268, &
-0.305977,-0.133487,0.140999,0.511489,0.215742,0.147925,-0.217417,-0.308192, &
-0.521952,0.312741,-0.190207,2.457119,0.664518,1.347306,-1.155196,-2.026631, &
-1.067826,-0.247485,-0.292288,1.381492,0.713357,1.102338,-0.865379,-0.935772, &
-1.103735,0.103654,0.314528,0.358251,0.081970,-0.139618,-0.063584,1.255804, &
-2.075044,-0.125938,1.104041,-0.487414,0.041825,-1.753409,0.936044,1.313551, &
-2.286424,-0.283830,0.918367,-0.450626,0.004551,-2.275758,1.377310,2.849779, &
0.479827,-0.582575,0.939268,-0.721548,-0.498518,-0.692993,0.834686,1.583082, &
0.131012,0.143541,0.382156,-0.165435,-0.356769,0.201487,0.149080,-0.030866, &
1.432723,0.054988,0.206961,-1.017291,-0.455859,0.751371,0.008183,-1.346419, &
1.981213,-0.110848,-0.365641,0.054619,-0.280380,1.945811,-0.882998,-0.970164, &
1.569469,0.507992,0.022688,-0.567571,-0.488266,1.009164,-0.472395,-2.089123, &
0.432320,0.089543,-0.693825,-1.095237,-0.237739,0.659908,0.064721,0.609977, &
0.230735,-0.192063,-0.429637,-0.350451,-0.094598,-0.390823,0.432251,0.846650, &
0.139460,-0.082560,-0.191556,-0.098819,-0.090082,-0.401084,0.176421,0.576258, &
0.210956,-0.117821,0.145764,-0.288313,-0.111330,-1.006632,0.618739,0.687488, &
0.243242,0.068497,0.242069,-0.440435,-0.084179,-1.024198,0.673226,0.244114, &
0.400307,-0.072083,0.207475,-0.208170,-0.134200,-0.608683,0.451560,0.675198, &
-0.114481,-0.180514,0.160211,-0.241428,0.095800,-0.490317,0.397954,0.421213, &
0.000637,-0.319223,-0.008445,-0.296085,0.092225,0.251852,-0.073277,0.389480, &
0.207164,0.188111,-0.153011,-0.054307,0.437798,-1.672961,1.435248,-0.147816, &
-0.466276,0.328654,0.634674,-0.618232,1.178962,-2.396327,1.509351,-1.701985, &
-0.513725,1.709104,-1.025346,0.706716,0.754113,-0.596869,0.373385,-1.103442, &
-0.469749,1.572220,-0.730059,0.195479,0.088552,0.394759,-0.010664,-1.627545, &
-1.368247,0.915917,-0.851158,-0.039705,0.329015,0.710063,0.075549,-0.115705, &
-2.120993,1.400883,-1.040612,1.197855,0.708150,-0.747920,0.405248,-1.002162, &
-2.447108,1.805447,-1.072134,1.772319,0.754098,-0.260355,-0.056918,-1.813450, &
-2.317940,1.293568,-0.498702,1.192995,0.435221,-0.459433,0.195488,-0.984628, &
-1.093556,1.141573,-0.942872,1.695656,0.302373,-0.115214,-0.151848,-0.602924, &
-0.361543,1.416187,0.342720,1.400268,0.047191,-0.025497,0.122188,-0.961265, &
0.010101,-0.131621,-0.075190,-0.139703,-0.007173,0.545771,-0.431653,-0.185165, &
0.021685,0.006825,-0.037522,-0.029419,-0.003571,0.019818,-0.021247,-0.056996, &
-0.013974,-0.032121,-0.068274,0.169224,0.031185,0.178299,-0.121493,-0.054191, &
0.038365,0.009219,-0.047464,-0.009162,-0.001246,0.100496,-0.060879,-0.036665, &
0.026540,-0.044723,-0.028924,0.234954,0.028763,0.082244,-0.085339,0.021454, &
0.202093,-0.076475,-0.008035,0.017441,-0.012970,0.229027,-0.110072,-0.005912, &
0.105393,-0.049257,0.033677,0.072658,-0.002021,0.083594,-0.039679,0.028034, &
0.120963,-0.256840,0.011202,0.059927,0.062428,0.150266,-0.084794,0.134441, &
0.164197,-0.167700,0.123642,0.429214,0.065147,-0.331222,0.234907,0.327425, &
-0.138919,0.131901,-0.001533,-0.223874,-0.081819,0.402119,-0.077702,-0.085855, &
-0.189673,0.149137,-0.128441,0.038738,0.004477,0.305658,-0.135014,-0.115663, &
-0.019985,0.089497,0.083575,0.348401,-0.033044,-0.290920,0.148599,0.146628, &
-0.357763,0.161160,0.051333,-0.267572,-0.024386,-0.065574,0.046024,-0.106089, &
-0.100732,0.036660,-0.100322,0.338692,0.079227,0.199308,-0.129836,-0.101744, &
0.015711,-0.113134,0.133859,-0.259499,-0.050145,-0.147115,0.135168,0.263483, &
-0.253299,-0.041258,0.021609,-0.046324,0.033365,0.517253,-0.258759,-0.168955, &
-0.173929,0.057764,0.008957,0.569714,0.135748,0.306155,-0.196960,-0.245962, &
0.443253,-0.058461,-0.080377,-0.398437,-0.163827,-0.510874,0.292021,0.321578 &
/),(/8,126/))
real, dimension(2,8) :: hidden1 = &
Reshape((/-0.821973,-1.848100, &
0.414461,-2.814703, &
7.238200,-3.789664, &
1.106251,1.718371, &
-0.591297,-11.047502, &
2.527177,2.837868, &
0.920599,4.083221, &
3.382692,-0.120919 &
/),(/2,8/))
real, dimension(1,2) :: hidden2 = &
Reshape((/1.848913,-2.313572/),(/1,2/))
real, dimension(8) :: bias1 = &
(/6.492214,3.204702,3.383128,-1.625894,4.463122,6.759003,-4.95591,-7.923138/)
real, dimension(2) :: bias2 = &
(/-0.570992,1.284441/)
real, dimension(1) :: bias3 = &
(/0.656641/)
contains
subroutine fnet_ORRSL_initall()
end subroutine fnet_ORRSL_initall
subroutine fnet_ORRSL_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_ORRSL_engine
end module fnet_ORRSL