! Retorna, donada una matriu d'spins S d'un sistema de mida LxL, | |
! la magnetitzaciรณ del sistema. | |
real*8 function magne(S, L) | |
implicit none | |
integer*4, intent(in) :: L | |
integer*2, intent(out) :: S(1:128,1:128) | |
integer*4 :: i, j | |
real*8 :: mag | |
mag = 0d0 | |
do i = 1, L | |
do j = 1, L | |
mag = mag + S(i, j) | |
enddo | |
enddo | |
magne = mag | |
return | |
end function magne |