SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
close_file_lfi.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_file_lfi(HPROGRAM,KUNIT )
7 ! #######################################################
8 !
9 !!**** *CLOSE_FILE_LFI* - closes files read by surface in MESOHN
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 !! V. Masson *Meteo France*
31 !!
32 !! MODIFICATIONS
33 !! -------------
34 !! Original 01/2003
35 !-------------------------------------------------------------------------------
36 !
37 !* 0. DECLARATIONS
38 ! ------------
39 !
40 #ifdef SFX_LFI
41 USE modd_fmdeclar, ONLY : cnamfi
42 #endif
43 USE modd_io_surf_lfi, ONLY : cluout_lfi
44 !
45 USE yomhook ,ONLY : lhook, dr_hook
46 USE parkind1 ,ONLY : jprb
47 !
48 IMPLICIT NONE
49 !
50 !* 0.1 Declarations of arguments
51 ! -------------------------
52 !
53  CHARACTER(LEN=6), INTENT(IN) :: hprogram ! main program
54 INTEGER, INTENT(IN) :: kunit ! logical unit of file
55 REAL(KIND=JPRB) :: zhook_handle
56 !
57 !* 0.2 Declarations of local variables
58 ! -------------------------------
59 !
60 INTEGER :: iresp
61 !-------------------------------------------------------------------------------
62 !
63 !* closes the file
64 ! -------------------
65 !
66 IF (lhook) CALL dr_hook('CLOSE_FILE_LFI',0,zhook_handle)
67 #ifdef SFX_LFI
68  CALL fmfree(cnamfi(kunit),cluout_lfi,iresp)
69 #endif
70  CLOSE(kunit)
71 IF (lhook) CALL dr_hook('CLOSE_FILE_LFI',1,zhook_handle)
72 !
73 !-------------------------------------------------------------------------------
74 !
75 END SUBROUTINE close_file_lfi
subroutine close_file_lfi(HPROGRAM, KUNIT)