Skip to content

Commit

Permalink
make sure variables are allocated before deallocating
Browse files Browse the repository at this point in the history
  • Loading branch information
jedwards4b committed Jul 9, 2024
1 parent c2ef06d commit 8477bc7
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion mediator/med_io_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1086,7 +1086,15 @@ subroutine med_io_write_FB(io_file, FB, whead, wdata, nx, ny, nt, &
call pio_syncfile(io_file)
call pio_freedecomp(io_file, iodesc)
endif
deallocate(ownedElemCoords, ownedElemCoords_x, ownedElemCoords_y)
if(allocated(ownedElemCoords)) then
deallocate(ownedElemCoords)
endif
if(allocated(ownedElemCoords_x)) then
deallocate(ownedElemCoords_x)
endif
if(allocated(ownedElemCoords_y)) then
deallocate(ownedElemCoords_y)
endif

if (dbug_flag > 5) then
call ESMF_LogWrite(trim(subname)//": done", ESMF_LOGMSG_INFO)
Expand Down

0 comments on commit 8477bc7

Please sign in to comment.