Skip to content

Commit

Permalink
Check def var in restart. #34
Browse files Browse the repository at this point in the history
  • Loading branch information
nichannah committed Nov 18, 2020
1 parent 7c74942 commit d45eb2b
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion io_pio/ice_restart.F90
Original file line number Diff line number Diff line change
Expand Up @@ -619,12 +619,30 @@ subroutine define_rest_field(File, vname, dims)
integer (kind=int_kind) :: &
status ! status variable from netCDF routine

status = pio_def_var(File,trim(vname),pio_double,dims,vardesc)
call check(pio_def_var(File,trim(vname),pio_double,dims,vardesc), &
'def var: '//trim(vname))

end subroutine define_rest_field


subroutine check(status, msg)

use netcdf, only: nf90_noerr, nf90_strerror

integer, intent (in) :: status
character(len=*), intent (in) :: msg

if(status /= nf90_noerr) then
call abort_ice('ice: NetCDF error '//trim(nf90_strerror(status)//' '//trim(msg)))
end if

end subroutine check


!=======================================================================

end module ice_restart



!=======================================================================

0 comments on commit d45eb2b

Please sign in to comment.