SURFEX v8.1
General documentation of Surfex
end_io_surf_ncn.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 end_io_surf_nc_n(HPROGRAM)
7 ! #######################################################
8 !
9 !!**** *END_IO_SURF_NC_n* - routine to close IO files
10 !!
11 !! PURPOSE
12 !! -------
13 !!
14 !!** METHOD
15 !! ------
16 !!
17 !! EXTERNAL
18 !! --------
19 !!
20 !!
21 !! IMPLICIT ARGUMENTS
22 !! ------------------
23 !!
24 !! REFERENCE
25 !! ---------
26 !!
27 !!
28 !! AUTHOR
29 !! ------
30 !! S.Malardel *Meteo France*
31 !!
32 !! MODIFICATIONS
33 !! -------------
34 !! Original 09/2003
35 !-------------------------------------------------------------------------------
36 !
37 !* 0. DECLARATIONS
38 ! ------------
39 !
40 USE modd_surfex_mpi, ONLY : nrank, npio
41 !
44 !
45 USE yomhook ,ONLY : lhook, dr_hook
46 USE parkind1 ,ONLY : jprb
47 !
48 USE netcdf
49 !
50 IMPLICIT NONE
51 !
52 !
53 !* 0.1 Declarations of arguments
54 ! -------------------------
55 !
56  CHARACTER(LEN=6), INTENT(IN) :: HPROGRAM ! main program
57 REAL(KIND=JPRB) :: ZHOOK_HANDLE
58 !
59 !* 0.2 Declarations of local variables
60 ! -------------------------------
61 !
62 INTEGER :: IRET
63 !-------------------------------------------------------------------------------
64 !
65 IF (lhook) CALL dr_hook('END_IO_SURF_NC_N',0,zhook_handle)
66 !
67 IF (cfile_nc==cfileout_nc .AND. nrank==npio .OR. cfile_nc==cfilein_nc) THEN
68  IF (ldef) iret = nf90_enddef(nid_nc)
69  iret = nf90_close(nid_nc)
70 ENDIF
71 !
72 lmask = .false.
73 !
74 nmask=>null()
75 !
76 nfull = 0
77 !
78 nid_nc = 0
79 !
80 CFILE_NC = ' '
81 !
82 IF (lhook) CALL dr_hook('END_IO_SURF_NC_N',1,zhook_handle)
83 !
84 !-------------------------------------------------------------------------------
85 !
86 END SUBROUTINE end_io_surf_nc_n
character(len=28), save cfileout_nc
logical, save lmask
subroutine end_io_surf_nc_n(HPROGRAM)
integer, parameter jprb
Definition: parkind1.F90:32
integer, dimension(:), pointer nmask
logical lhook
Definition: yomhook.F90:15
character(len=28), save cfile_nc
character(len=28), save cfilein_nc