handle_err.f90 407 B

12345678910111213141516171819202122
  1. module handerr
  2. contains
  3. subroutine handle_err(errcode, var)
  4. implicit none
  5. include 'netcdf.inc'
  6. integer,intent(in) :: errcode
  7. character*20,intent(in),optional :: var
  8. if (present(var)) then
  9. print *, 'Error: ', nf_strerror(errcode), " var: ", var
  10. else
  11. print *, 'Error: ', nf_strerror(errcode)
  12. endif
  13. stop 2
  14. end subroutine handle_err
  15. end module handerr