Skip to content

Commit

Permalink
nitpicking
Browse files Browse the repository at this point in the history
  • Loading branch information
p-costa committed Jul 9, 2022
1 parent 2d853a8 commit 03196ce
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 28 deletions.
10 changes: 6 additions & 4 deletions src/initmpi.f90
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ subroutine initmpi(my_block,nblocks,id_first,dims,cbc,bc,is_periodic,periods, &
write(stderr,*) 'ERROR: invalid connectivity for block ', iblock, '.'
write(stderr,*) ''
error stop
endif
end if
do idir=1,3
idir_t(:) = pack([1,2,3],[1,2,3] /= idir) ! extract tangential directions
do inb=0,1
Expand All @@ -98,7 +98,7 @@ subroutine initmpi(my_block,nblocks,id_first,dims,cbc,bc,is_periodic,periods, &
end do
lo_g(:) = lo_all(:,my_block)
deallocate(lo_all,ng_all,cbc_all,bc_all,lmin_all)
endif
end if
call MPI_BCAST(lo_g,3,MPI_INTEGER,0,comm_block)
hi_g(:) = lo_g(:)+ng(:)-1
!
Expand All @@ -107,9 +107,9 @@ subroutine initmpi(my_block,nblocks,id_first,dims,cbc,bc,is_periodic,periods, &
call MPI_ALLREDUCE(lo_g(1),lo_g_min(1),3,MPI_INTEGER,MPI_MIN,MPI_COMM_WORLD)
call MPI_ALLREDUCE(hi_g(1),hi_g_max(1),3,MPI_INTEGER,MPI_MAX,MPI_COMM_WORLD)
where(is_periodic(:))
periods(:) = hi_g_max(:)-lo_g_min(:)+1
periods(:) = hi_g_max(:)-lo_g_min(:)+1
elsewhere
periods(:) = 0
periods(:) = 0
end where
!
! determine array extents for possibly uneven data
Expand All @@ -131,6 +131,8 @@ subroutine initmpi(my_block,nblocks,id_first,dims,cbc,bc,is_periodic,periods, &
hi(:) = hi(:) + mod(ng(:),dims(:))
end where
!
! determine neighbors and check connectivity
!
allocate(lo_all(3,0:nrank-1),hi_all(3,0:nrank-1),lo_g_all(3,0:nrank-1),hi_g_all(3,0:nrank-1), &
lmin_all(3,0:nrank-1),lmax_all(3,0:nrank-1),gr_all(3,0:nrank-1),gt_all(3,0:nrank-1), &
blocks_all(0:nrank-1),cbc_all(0:1,3,0:nrank-1),bc_all(0:1,3,0:nrank-1))
Expand Down
2 changes: 1 addition & 1 deletion src/main.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1076,7 +1076,7 @@ program snac
var(2) = time
var(3) = 1.*ichkptnum
call out0d(trim(datadir)//'log_saves.out',3,myid,var)
endif
end if
end if
call load('w',trim(datadir)//trim(filename),comm_block,ng,[1,1,1],lo_1,hi_1,u,v,w,p,po,time,istep)
if(.not.is_overwrite_save) then
Expand Down
42 changes: 21 additions & 21 deletions src/post.f90
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,11 @@ subroutine cmpt_wall_forces(n,is_bound,dxc,dxf,dyc,dyf,dzc,dzf,visc,u,v,w,p,bfor
if(ib == 0) then
i = 1
norm = 1.
endif
end if
if(ib == 1) then
i = n(idir) + 1
norm = -1.
endif
end if
if(is_bound(ib,idir)) then
do k=1,n(3)
do j=1,n(2)
Expand All @@ -201,17 +201,17 @@ subroutine cmpt_wall_forces(n,is_bound,dxc,dxf,dyc,dyf,dzc,dzf,visc,u,v,w,p,bfor
end do
end do
end if
enddo
end do
idir = 2
do ib = 0,1
if(ib == 0) then
j = 1
sgn = 1.
endif
end if
if(ib == 1) then
j = n(idir) + 1
sgn = -1.
endif
end if
if(is_bound(ib,idir)) then
do k=1,n(3)
do i=1,n(1)
Expand All @@ -226,11 +226,11 @@ subroutine cmpt_wall_forces(n,is_bound,dxc,dxf,dyc,dyf,dzc,dzf,visc,u,v,w,p,bfor
if(ib == 0) then
k = 1
sgn = 1.
endif
end if
if(ib == 1) then
k = n(idir) + 1
sgn = -1.
endif
end if
if(is_bound(ib,idir)) then
do j=1,n(2)
do i=1,n(1)
Expand All @@ -248,11 +248,11 @@ subroutine cmpt_wall_forces(n,is_bound,dxc,dxf,dyc,dyf,dzc,dzf,visc,u,v,w,p,bfor
if(ib == 0) then
j = 1
norm = 1.
endif
end if
if(ib == 1) then
j = n(idir) + 1
norm = -1.
endif
end if
if(is_bound(ib,idir)) then
do k=1,n(3)
do i=1,n(1)
Expand All @@ -262,17 +262,17 @@ subroutine cmpt_wall_forces(n,is_bound,dxc,dxf,dyc,dyf,dzc,dzf,visc,u,v,w,p,bfor
end do
end do
end if
enddo
end do
idir = 3
do ib = 0,1
if(ib == 0) then
k = 1
sgn = 1.
endif
end if
if(ib == 1) then
k = n(idir) + 1
sgn = -1.
endif
end if
if(is_bound(ib,idir)) then
do j=1,n(2)
do i=1,n(1)
Expand All @@ -287,11 +287,11 @@ subroutine cmpt_wall_forces(n,is_bound,dxc,dxf,dyc,dyf,dzc,dzf,visc,u,v,w,p,bfor
if(ib == 0) then
i = 1
sgn = 1.
endif
end if
if(ib == 1) then
i = n(idir) + 1
sgn = -1.
endif
end if
if(is_bound(ib,idir)) then
do k=1,n(3)
do j=1,n(2)
Expand All @@ -309,11 +309,11 @@ subroutine cmpt_wall_forces(n,is_bound,dxc,dxf,dyc,dyf,dzc,dzf,visc,u,v,w,p,bfor
if(ib == 0) then
k = 1
norm = 1.
endif
end if
if(ib == 1) then
k = n(idir) + 1
norm = -1.
endif
end if
if(is_bound(ib,idir)) then
do j=1,n(2)
do i=1,n(1)
Expand All @@ -323,17 +323,17 @@ subroutine cmpt_wall_forces(n,is_bound,dxc,dxf,dyc,dyf,dzc,dzf,visc,u,v,w,p,bfor
end do
end do
end if
enddo
end do
idir = 1
do ib = 0,1
if(ib == 0) then
i = 1
sgn = 1.
endif
end if
if(ib == 1) then
i = n(idir) + 1
sgn = -1.
endif
end if
if(is_bound(ib,idir)) then
do k=1,n(3)
do j=1,n(2)
Expand All @@ -348,11 +348,11 @@ subroutine cmpt_wall_forces(n,is_bound,dxc,dxf,dyc,dyf,dzc,dzf,visc,u,v,w,p,bfor
if(ib == 0) then
j = 1
sgn = 1.
endif
end if
if(ib == 1) then
j = n(idir) + 1
sgn = -1.
endif
end if
if(is_bound(ib,idir)) then
do k=1,n(3)
do i=1,n(1)
Expand Down
4 changes: 2 additions & 2 deletions src/sanity.f90
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ subroutine chk_inflow(periods,inflow_type,passed)
do idir = 1,3
do ib = 0,1
if( is_inflow( ib,idir) ) passed = passed .and. periods(idir) == 0
enddo
enddo
end do
end do
if(.not.passed) call write_error('Periodicity and inflow BCs cannot be combined.')
call mpi_allreduce(MPI_IN_PLACE,passed,1,MPI_LOGICAL,MPI_LAND,MPI_COMM_WORLD)
end subroutine chk_inflow
Expand Down

0 comments on commit 03196ce

Please sign in to comment.