SURFEX v8.1
General documentation of Surfex
handle_err.F90
Go to the documentation of this file.
1 !SFX_LIC Copyright 1994-2014 CNRS, Meteo-France and Universite Paul Sabatier
2 !SFX_LIC This is part of the SURFEX software governed by the CeCILL-C licence
3 !SFX_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt
4 !SFX_LIC for details. version 1.
5 ! #########
6  SUBROUTINE handle_err(IRET,HNAME)
7 
8 !
9 USE yomhook ,ONLY : lhook, dr_hook
10 USE parkind1 ,ONLY : jprb
11 !
12 USE modi_abor1_sfx
13 !
14 USE netcdf
15 !
16 IMPLICIT NONE
17 !
18 INTEGER, INTENT(IN) :: IRET
19  CHARACTER(LEN=*), INTENT(IN) :: HNAME
20 REAL(KIND=JPRB) :: ZHOOK_HANDLE
21 
22 ! - - - - - - - - - - - - - - - - - - - - - - - - - - -
23 
24  IF (lhook) CALL dr_hook('HANDLE_ERR',0,zhook_handle)
25  IF (iret /= nf90_noerr) THEN
26  WRITE(*,*)'HANDLE_ERR: ',nf90_strerror(iret)
27  CALL abor1_sfx('HANDLE_ERR: ABORTING PROGRAM TO WRITE A NETCDF FILE: '//hname)
28  ENDIF
29 IF (lhook) CALL dr_hook('HANDLE_ERR',1,zhook_handle)
30 
31 END SUBROUTINE handle_err
subroutine handle_err(IRET, HNAME)
Definition: handle_err.F90:7
subroutine abor1_sfx(YTEXT)
Definition: abor1_sfx.F90:7
integer, parameter jprb
Definition: parkind1.F90:32
logical lhook
Definition: yomhook.F90:15