check_stat.f90 848 B

123456789101112131415161718192021222324252627
  1. SUBROUTINE check_stat(Kstat,Hmessage)
  2. !
  3. ! ============================================================================
  4. ! This routine check if there is errors during Netcdf interfacing and in case
  5. ! of error write the error message.
  6. !
  7. ! Author : Virginie Guemas
  8. ! Created : January 2007
  9. ! ============================================================================
  10. IMPLICIT NONE
  11. INCLUDE'netcdf.inc'
  12. INTEGER,INTENT(IN) :: Kstat
  13. CHARACTER*60,INTENT(IN) :: Hmessage
  14. !
  15. ! ============================================================================
  16. !
  17. IF ( Kstat /= NF_NOERR ) THEN
  18. PRINT*,NF_STRERROR(Kstat)
  19. PRINT*,'ERROR in Netcdf: '//TRIM(Hmessage)
  20. STOP
  21. END IF
  22. !
  23. ! ============================================================================
  24. !
  25. END SUBROUTINE check_stat