avm99963 | 802583e | 2022-05-12 10:56:56 +0200 | [diff] [blame] | 1 | real*8 function ENERG(S, L, PBC) |
2 | integer*2 :: S(1:L, 1:L) | ||||
3 | integer*4 :: I, J, L | ||||
4 | integer*4 :: PBC(0:L+1) | ||||
5 | real*8 :: ENE | ||||
6 | ENE = 0.0d0 | ||||
7 | do I = 1, L | ||||
8 | do J = 1, L | ||||
9 | ENE = ENE - S(I, J)*S(PBC(I + 1), J) - S(I, J)*S(I, PBC(J + 1)) | ||||
10 | enddo | ||||
11 | enddo | ||||
12 | ENERG = ENE | ||||
13 | return | ||||
14 | endfunction |