Skip to content

Commit

Permalink
Add mpi_barrier() calls to SW gas optics initialization routine
Browse files Browse the repository at this point in the history
  • Loading branch information
dustinswales committed Dec 9, 2019
1 parent fbd398f commit e858d73
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion physics/rrtmgp_lw_cloud_optics.F90
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ subroutine rrtmgp_lw_cloud_optics_init(Model, mpicomm, mpirank, mpiroot, lw_clou
integer,parameter :: max_strlen=256
#ifdef MPI
integer :: ierr
#ebdif
#endif

! Initialize
errmsg = ''
Expand Down
2 changes: 1 addition & 1 deletion physics/rrtmgp_lw_gas_optics.F90
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ subroutine rrtmgp_lw_gas_optics_init(Model, mpicomm, mpirank, mpiroot, lw_gas_pr
integer,parameter :: max_strlen=256
#ifdef MPI
integer :: ierr
#ebdif
#endif

! Initialize
errmsg = ''
Expand Down
2 changes: 1 addition & 1 deletion physics/rrtmgp_sw_cloud_optics.F90
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ subroutine rrtmgp_sw_cloud_optics_init(Model,mpicomm, mpirank, mpiroot, sw_cloud
character(len=264) :: sw_cloud_props_file
#ifdef MPI
integer :: ierr
#ebdif
#endif
! Initialize
errmsg = ''
errflg = 0
Expand Down
8 changes: 6 additions & 2 deletions physics/rrtmgp_sw_gas_optics.F90
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ subroutine rrtmgp_sw_gas_optics_init(Model, mpicomm, mpirank, mpiroot, sw_gas_p
character(len=264) :: sw_gas_props_file
#ifdef MPI
integer :: ierr
#ebdif
#endif

! Initialize
errmsg = ''
Expand Down Expand Up @@ -153,9 +153,11 @@ subroutine rrtmgp_sw_gas_optics_init(Model, mpicomm, mpirank, mpiroot, sw_gas_p
status = nf90_close(ncid_sw)
endif
endif

! Broadcast dimensions to all processors
#ifdef MPI
call MPI_BARRIER(mpicomm, ierr)
write(*,*) "ierr0a: ",ierr
write(*,*) "mpiroot: ",mpiroot
write(*,*) "mpicomm: ",mpicomm
call MPI_BCAST(ntemps_sw, 1, MPI_INTEGER, mpiroot, mpicomm, ierr)
Expand Down Expand Up @@ -332,6 +334,8 @@ subroutine rrtmgp_sw_gas_optics_init(Model, mpicomm, mpirank, mpiroot, sw_gas_p

! Broadcast arrays to all processors
#ifdef MPI
call MPI_BARRIER(mpicomm, ierr)
write(*,*) "ierr0b: ",ierr
write (*,*) 'Broadcasting RRTMGP shortwave k-distribution data ... '
call MPI_BCAST(minor_limits_gpt_upper_sw, size(minor_limits_gpt_upper_sw), MPI_INTEGER, mpiroot, mpicomm, ierr)
write(*,*) "ierr15: ",ierr
Expand Down

0 comments on commit e858d73

Please sign in to comment.