blob: 4ee85083b2d4ec05ff141675e722c729732ae622 [file] [log] [blame]
avm999639622dc72022-04-29 15:44:05 +02001real*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
14endfunction