Skip to content

Commit

Permalink
Update MPI communicator in GFS_debug.F90
Browse files Browse the repository at this point in the history
  • Loading branch information
climbfuji committed May 13, 2024
1 parent 53a98be commit 6f6175a
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions physics/Interstitials/UFS_SCM_NEPTUNE/GFS_debug.F90
Original file line number Diff line number Diff line change
Expand Up @@ -426,21 +426,19 @@ subroutine GFS_diagtoscreen_run (Model, Statein, Stateout, Sfcprop, Coupling,

!--- local variables
integer :: impi, iomp, ierr, n, idtend, iprocess, itracer
integer :: mpirank, mpisize, mpicomm
integer :: mpirank, mpisize
integer :: omprank, ompsize

! Initialize CCPP error handling variables
errmsg = ''
errflg = 0

#ifdef MPI
mpicomm = Model%communicator
mpirank = Model%me
mpisize = Model%ntasks
#else
mpirank = 0
mpisize = 1
mpicomm = 0
#endif
#ifdef _OPENMP
omprank = OMP_GET_THREAD_NUM()
Expand All @@ -454,7 +452,7 @@ subroutine GFS_diagtoscreen_run (Model, Statein, Stateout, Sfcprop, Coupling,
!$OMP BARRIER
#endif
#ifdef MPI
! call MPI_BARRIER(mpicomm,ierr)
! call MPI_BARRIER(Model%communicator,ierr)
#endif

do impi=0,mpisize-1
Expand Down Expand Up @@ -952,15 +950,15 @@ subroutine GFS_diagtoscreen_run (Model, Statein, Stateout, Sfcprop, Coupling,
#endif
end do
#ifdef MPI
! call MPI_BARRIER(mpicomm,ierr)
! call MPI_BARRIER(Model%communicator,ierr)
#endif
end do

#ifdef _OPENMP
!$OMP BARRIER
#endif
#ifdef MPI
! call MPI_BARRIER(mpicomm,ierr)
! call MPI_BARRIER(Model%communicator,ierr)
#endif

end subroutine GFS_diagtoscreen_run
Expand Down Expand Up @@ -1104,7 +1102,7 @@ subroutine GFS_interstitialtoscreen_run (Model, Statein, Stateout, Sfcprop, Coup

!--- local variables
integer :: impi, iomp, ierr
integer :: mpirank, mpisize, mpicomm
integer :: mpirank, mpisize
integer :: omprank, ompsize
integer :: istart, iend, kstart, kend

Expand All @@ -1113,13 +1111,11 @@ subroutine GFS_interstitialtoscreen_run (Model, Statein, Stateout, Sfcprop, Coup
errflg = 0

#ifdef MPI
mpicomm = Model%communicator
mpirank = Model%me
call MPI_COMM_SIZE(mpicomm, mpisize, ierr)
call MPI_COMM_SIZE(Model%communicator, mpisize, ierr)
#else
mpirank = 0
mpisize = 1
mpicomm = 0
#endif
#ifdef _OPENMP
omprank = OMP_GET_THREAD_NUM()
Expand All @@ -1133,7 +1129,7 @@ subroutine GFS_interstitialtoscreen_run (Model, Statein, Stateout, Sfcprop, Coup
!$OMP BARRIER
#endif
#ifdef MPI
! call MPI_BARRIER(mpicomm,ierr)
! call MPI_BARRIER(Model%communicator,ierr)
#endif

do impi=0,mpisize-1
Expand Down Expand Up @@ -1482,15 +1478,15 @@ subroutine GFS_interstitialtoscreen_run (Model, Statein, Stateout, Sfcprop, Coup
#endif
end do
#ifdef MPI
! call MPI_BARRIER(mpicomm,ierr)
! call MPI_BARRIER(Model%communicator,ierr)
#endif
end do

#ifdef _OPENMP
!$OMP BARRIER
#endif
#ifdef MPI
! call MPI_BARRIER(mpicomm,ierr)
! call MPI_BARRIER(Model%communicator,ierr)
#endif

end subroutine GFS_interstitialtoscreen_run
Expand Down

0 comments on commit 6f6175a

Please sign in to comment.