blob: 4e0e89ed3289fe808be113843940f9dbfd7c242f [file] [log] [blame]
Adrià Vilanova Martínez24d87012022-06-16 00:29:59 +02001! Retorna, donada una matriu d'spins S d'un sistema de mida LxL,
2! la magnetització del sistema.
Adrià Vilanova Martínezebb87792022-06-04 20:07:20 +02003real*8 function magne(S, L)
avm9996345a8a462022-06-04 12:41:03 +02004 implicit none
5 integer*4, intent(in) :: L
Adrià Vilanova Martínez24d87012022-06-16 00:29:59 +02006 integer*2, intent(out) :: S(1:128,1:128)
avm9996345a8a462022-06-04 12:41:03 +02007 integer*4 :: i, j
8 real*8 :: mag
9 mag = 0d0
10
11 do i = 1, L
12 do j = 1, L
13 mag = mag + S(i, j)
14 enddo
15 enddo
16
17 magne = mag
18 return
Adrià Vilanova Martínezebb87792022-06-04 20:07:20 +020019end function magne