blob: 431a296824fc19cda660818e87c96cf571bbc748 [file] [log] [blame]
Adrià Vilanova Martínezebb87792022-06-04 20:07:20 +02001real*8 function energ(S, L)
avm9996345a8a462022-06-04 12:41:03 +02002 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