Skip to content

Commit

Permalink
Merge branch 'concepts/restart-netcdf-error-check' into 'concepts/mai…
Browse files Browse the repository at this point in the history
…n' (!31)

io_netcdf: do check exit status of nf90_close in final_restart
  • Loading branch information
phil-blain committed Sep 12, 2023
2 parents 0758416 + a6d44a1 commit 0232d02
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cicecore/cicedynB/infrastructure/io/io_netcdf/ice_restart.F90
Original file line number Diff line number Diff line change
Expand Up @@ -822,10 +822,14 @@ subroutine final_restart()
character(len=*), parameter :: subname = '(final_restart)'

#ifdef USE_NETCDF
status = nf90_close(ncid)

if (my_task == master_task) &
if (my_task == master_task) then
status = nf90_close(ncid)
if (status /= nf90_noerr) call abort_ice(subname// &
'ERROR: closing restart ncfile: ' // trim(nf90_strerror(status)))

write(nu_diag,*) 'Restart read/written ',istep1,idate
endif

#else
call abort_ice(subname//'ERROR: USE_NETCDF cpp not defined', &
Expand Down

0 comments on commit 0232d02

Please sign in to comment.