blob: 0128119b1079f960b448c6c354f7da6465a926b0 [file] [log] [blame]
Adrià Vilanova Martínezebb87792022-06-04 20:07:20 +02001subroutine generateSpinMatrix(S, L, SEED)
avm9996345a8a462022-06-04 12:41:03 +02002 use iso_fortran_env
3 implicit none
4 integer*4, intent(in) :: L
5 integer*4, intent(in) :: SEED
6 integer*2, intent(out) :: S(1:64,1:64)
7 integer*4 :: i, j
8 integer(int32) :: genrand_int31
9
10 call init_genrand(SEED)
11
12 do i = 1, L
13 do j = 1, L
14 if (genrand_int31() < 2**30) then
15 S(i, j) = 1
16 else
17 S(i, j) = -1
18 endif
19 enddo
20 enddo
Adrià Vilanova Martínezebb87792022-06-04 20:07:20 +020021end subroutine generateSpinMatrix