Skip to content

Commit

Permalink
Check if irqrs is associated before use in w3iorsmd.F90 (#1001)
Browse files Browse the repository at this point in the history
  • Loading branch information
DeniseWorthen authored Apr 25, 2023
1 parent e219907 commit 0392615
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions model/src/w3iorsmd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -822,10 +822,12 @@ SUBROUTINE W3IORS ( INXOUT, NDSR, DUMFPI, IMOD, FLRSTRT )
IF ( IAPROC .EQ. NAPRST ) THEN
!
#ifdef W3_MPI
ALLOCATE ( STAT2(MPI_STATUS_SIZE,NRQRS) )
CALL MPI_WAITALL &
( NRQRS, IRQRS , STAT2, IERR_MPI )
DEALLOCATE ( STAT2 )
if (associated(irqrs)) then
ALLOCATE ( STAT2(MPI_STATUS_SIZE,NRQRS) )
CALL MPI_WAITALL &
( NRQRS, IRQRS , STAT2, IERR_MPI )
DEALLOCATE ( STAT2 )
end if
#endif
!
RPOS = 1_8 + LRECL*(NREC-1_8)
Expand Down

0 comments on commit 0392615

Please sign in to comment.