SURFEX v8.1
General documentation of Surfex
close_fileout_ol.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 close_fileout_ol
7 ! #######################################################
8 !!**** *CLOSE_FILEOUT_OL* - closes netcdf files writen by surface
9 !!
10 !! PURPOSE
11 !! -------
12 !!
13 !!** METHOD
14 !! ------
15 !!
16 !! EXTERNAL
17 !! --------
18 !!
19 !!
20 !! IMPLICIT ARGUMENTS
21 !! ------------------
22 !!
23 !! REFERENCE
24 !! ---------
25 !!
26 !!
27 !! AUTHOR
28 !! ------
29 !! S. Faroux *Meteo France*
30 !!
31 !! MODIFICATIONS
32 !! -------------
33 !! Original 06/2010
34 !-------------------------------------------------------------------------------
35 !
36 USE modd_surfex_mpi, ONLY : nrank, npio
37 !
39 !
40 !* 0. DECLARATIONS
41 ! ------------
42 !
43 USE yomhook ,ONLY : lhook, dr_hook
44 USE parkind1 ,ONLY : jprb
45 !
46 USE netcdf
47 !
48 IMPLICIT NONE
49 !
50 INTEGER :: JFILE, IFILE_ID, JRET
51 REAL(KIND=JPRB) :: ZHOOK_HANDLE
52 
53 IF (lhook) CALL dr_hook('CLOSE_FILEOUT_OL',0,zhook_handle)
54 !
55 IF (nrank==npio) THEN
56  !
57  DO jfile = 1,SIZE(xnetcdf_fileid_out)
58  !
59  ifile_id = xnetcdf_fileid_out(jfile)
60  !
61  jret = nf90_close(ifile_id)
62  !
63  ENDDO
64  !
65 ENDIF
66 !
67 IF (lhook) CALL dr_hook('CLOSE_FILEOUT_OL',1,zhook_handle)
68 !
69 END SUBROUTINE close_fileout_ol
subroutine close_fileout_ol
integer, parameter jprb
Definition: parkind1.F90:32
logical lhook
Definition: yomhook.F90:15
integer, dimension(25) xnetcdf_fileid_out