Version 0.1
Fortran Code
subroutine get_stream_tn_parallel
use omp_lib
implicit none
integer :: i, thread_id,partial_Sum,total_Sum
t1_vertex(0)%value = t0_vertex(0)%value - dt * (t0_vertex(0)%value - t0_vertex(nx)%value)/dx
!$OMP PARALLEL PRIVATE(partial_Sum) SHARED(total_Sum)
!$OMP DO
do i = 1,nx + nghost
t1_vertex(i)%value = t0_vertex(i)%value - dt * (t0_vertex(i)%value - t0_vertex(i-1)%value)/dx
!thread_id = OMP_GET_THREAD_NUM()
!print *, "Upwind process: ", thread_id
enddo
!$OMP end DO
!$OMP DO
do i = 1 - nghost, nx + nghost
t0_vertex(i)%value = t1_vertex(i)%value
enddo
!$OMP end DO
!$OMP END PARALLEL
end subroutine get_stream_tn_parallel
小于 1 分钟