Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions app/main.f90
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
program tcell
use tcelsim, only : initialize_positions, create_distribution, move_tcells
use tcelsim, only : initialize_positions, create_distribution, create_rand_num_table, move_tcells
implicit none

integer i,j,k
integer ncells, npositions, nintervals
parameter(ncells = 100, npositions = 25)
parameter(nintervals = 10)
Expand All @@ -14,18 +13,12 @@ program tcell
double precision x(ncells,npositions)
double precision y(ncells,npositions)
double precision z(ncells,npositions)

do i = 1,ncells
do j = 1,npositions
do k = 1,4
call random_number(random_number_table(i,j,k))
end do
end do
end do

call initialize_positions(x,y,z,ncells,npositions)

call create_distribution(vel,cumulative_distribution,nintervals)

call create_rand_num_table(ncells,npositions,random_number_table)

call move_tcells(x,y,z,vel,cumulative_distribution,random_number_table,ncells,npositions,nintervals)

Expand Down
1 change: 1 addition & 0 deletions src/tcelsim.f90
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module tcelsim
use t_cell_m, only : initialize_positions
use distribution_m, only : create_distribution
use random_numbers_m, only : create_rand_num_table
use move_m, only : move_tcells
implicit none

Expand Down
17 changes: 17 additions & 0 deletions src/tcelsim/random_numbers_m.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module random_numbers_m
implicit none

interface

module subroutine create_rand_num_table(ncells,npositions,random_number_table)

implicit none
integer, intent(in) :: ncells,npositions
double precision, intent(out) :: random_number_table(ncells,npositions,4)

end subroutine

end interface

end module random_numbers_m

21 changes: 21 additions & 0 deletions src/tcelsim/random_numbers_s.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
submodule(random_numbers_m) random_numbers_s
implicit none

contains

module procedure create_rand_num_table

! Local variables
integer i,j,k

do i = 1,ncells
do j = 1,npositions
do k = 1,4
call random_number(random_number_table(i,j,k))
end do
end do
end do

end procedure create_rand_num_table

end submodule random_numbers_s