Skip to content

Commit abd13c4

Browse files
committed
Fix mpi_bcast calls
* support mpich 4.3 * check iostat when reading namelist fire block
1 parent 8ed5056 commit abd13c4

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

io/namelist_mod.F90

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -319,9 +319,10 @@ subroutine Broadcast_integer (val)
319319
integer, intent(in) :: val
320320

321321
integer :: ierr
322+
integer :: sendbuf(1)
322323

323-
324-
call Mpi_bcast(val, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
324+
sendbuf(1) = val
325+
call Mpi_bcast(sendbuf, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
325326

326327
if (ierr /= MPI_SUCCESS) &
327328
call Stop_simulation ('Error broadcasting integer value')
@@ -335,9 +336,10 @@ subroutine Broadcast_logical (val)
335336
logical, intent(in) :: val
336337

337338
integer :: ierr
339+
logical :: sendbuf(1)
338340

339-
340-
call Mpi_bcast (val, 1, MPI_LOGICAL, 0, MPI_COMM_WORLD, ierr)
341+
sendbuf(1) = val
342+
call Mpi_bcast (sendbuf, 1, MPI_LOGICAL, 0, MPI_COMM_WORLD, ierr)
341343

342344
if (ierr /= MPI_SUCCESS) &
343345
call Stop_simulation ('Error broadcasting logical value')
@@ -351,9 +353,10 @@ subroutine Broadcast_real (val)
351353
real, intent(in) :: val
352354

353355
integer :: ierr
356+
real :: sendbuf(1)
354357

355-
356-
call Mpi_bcast (val, 1, MPI_REAL, 0, MPI_COMM_WORLD, ierr)
358+
sendbuf(1) = val
359+
call Mpi_bcast (sendbuf, 1, MPI_REAL, 0, MPI_COMM_WORLD, ierr)
357360

358361
if (ierr /= MPI_SUCCESS) &
359362
call Stop_simulation ('Error broadcasting real value')
@@ -585,7 +588,7 @@ subroutine Init_fire_block (this, file_name)
585588
call Stop_simulation (msg)
586589
end if
587590

588-
read (unit_nml, nml = fire)
591+
read (unit_nml, nml = fire, iostat = io_stat)
589592
if (io_stat /= 0) call Stop_simulation ('Problems reading namelist fire block')
590593

591594
close (unit_nml)

0 commit comments

Comments
 (0)