subroutine check(status)

  implicit none

  include 'netcdf.inc'

  integer, intent(in) :: status

  if(status /= nf_noerr) then
      print *, trim(nf_strerror(status))
      stop 2
  end if

end subroutine check  
