Skip to content

Commit

Permalink
make sure variables are allocated before deallocating (#480)
Browse files Browse the repository at this point in the history
  • Loading branch information
jedwards4b authored Jul 11, 2024
1 parent 1b8920c commit e4a5e58
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 e4a5e58

Please sign in to comment.