The key logic specific to the game of life
Subroutine to find the steady state of the game of life
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| logical, | intent(out) | :: | steady_state |
Logical flag indicating whether the global board has reached a steady state |
||
| integer, | intent(out) | :: | generation_number |
The number of generations required to reach the steady state |
||
| integer, | intent(in), | dimension(:,:), allocatable | :: | global_input_board |
The global board representing the current state of the game |
|
| integer, | intent(in) | :: | global_nrows |
The number of columns in the global board |
||
| integer, | intent(in) | :: | global_ncols |
The number of rows in the global board |
||
| integer, | intent(in) | :: | base_mpi_communicator |
The base MPI communicator for parallel processing |
||
| integer, | intent(in) | :: | nprocs |
The total number of processes in the MPI communicator |
Evolve the board into the state of the next iteration
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in), | dimension(:,:), allocatable | :: | current_board |
The current state of the board |
|
| integer, | intent(inout), | dimension(:,:), allocatable | :: | new_board |
The new state of the board |
Check if we have reached steady state, i.e. current and new board match
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| logical, | intent(out) | :: | steady_state |
Logical to indicate whether current and new board match |
||
| integer, | intent(in), | dimension(:,:) | :: | current_board |
The board as it currently is before this iteration |
|
| integer, | intent(in), | dimension(:,:) | :: | new_board |
The board into which the new state has been stored after this iteration |