m_nf90_err.F90 457 B

12345678910111213141516171819202122232425
  1. module m_nf90_err
  2. contains
  3. subroutine nf90_err(errcode,chars)
  4. use netcdf
  5. implicit none
  6. integer, intent(in) :: errcode
  7. character(len=*), optional :: chars
  8. character(len=80) :: hint
  9. hint =''
  10. if (present(chars)) hint=chars
  11. if (errcode/=NF90_NOERR) then
  12. write(6,'(a)') NF90_STRERROR(errcode)//' '//trim(hint)
  13. stop '(handle_err)'
  14. end if
  15. end subroutine
  16. end module m_nf90_err