Adrià Vilanova Martínez | ebb8779 | 2022-06-04 20:07:20 +0200 | [diff] [blame] | 1 | subroutine generateSpinMatrix(S, L, SEED) |
avm99963 | 45a8a46 | 2022-06-04 12:41:03 +0200 | [diff] [blame] | 2 | 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ínez | ebb8779 | 2022-06-04 20:07:20 +0200 | [diff] [blame] | 21 | end subroutine generateSpinMatrix |