blob: ba7841cc5c96aa934e8b7d0b48556fd820465bc5 [file] [log] [blame]
avm9996345a8a462022-06-04 12:41:03 +02001real*8 function ENERG(S, L)
2 integer*2 :: S(1:64, 1:64)
3 integer*4 :: I, J, L, PBC
4 real*8 :: ENE
5 ENE = 0.0d0
6 do I = 1, L
7 do J = 1, L
8 ENE = ENE - S(I, J)*S(PBC(I + 1, L), J) - S(I, J)*S(I, PBC(J + 1, L))
9 enddo
10 enddo
11 ENERG = ENE
12 return
13endfunction