SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
close_file.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(HPROGRAM,KUNIT)
7 ! #######################################################
8 !
9 !!**** *CLOSE_FILE* - generic routine to close a file
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/2004
35 !-------------------------------------------------------------------------------
36 !
37 !* 0. DECLARATIONS
38 ! ------------
39 !
40 #if defined(SFX_ASC) || defined(SFX_ARO) || defined(SFX_MNH) || defined(SFX_NC)
41 USE modi_close_file_asc
42 #endif
43 #ifdef SFX_FA
44 USE modi_close_file_fa
45 #endif
46 #ifdef SFX_OL
47 USE modi_close_file_ol
48 #endif
49 #ifdef SFX_LFI
50 USE modi_close_file_lfi
51 #endif
52 !
53 #ifdef SFX_MNH
54 USE modi_close_file_mnh
55 #endif
56 !
57 USE yomhook ,ONLY : lhook, dr_hook
58 USE parkind1 ,ONLY : jprb
59 !
60 IMPLICIT NONE
61 !
62 !* 0.1 Declarations of arguments
63 ! -------------------------
64 !
65  CHARACTER(LEN=6), INTENT(IN) :: hprogram ! main program
66 INTEGER, INTENT(IN) :: kunit ! logical unit of file
67 REAL(KIND=JPRB) :: zhook_handle
68 !
69 !* 0.2 Declarations of local variables
70 ! -------------------------------
71 !
72 !-------------------------------------------------------------------------------
73 !
74 IF (lhook) CALL dr_hook('CLOSE_FILE',0,zhook_handle)
75 IF (hprogram=='MESONH') THEN
76 #ifdef SFX_MNH
77  CALL close_file_mnh(hprogram,kunit)
78 #endif
79 ELSE IF (hprogram=='OFFLIN') THEN
80 #ifdef SFX_OL
81  CALL close_file_ol(hprogram,kunit)
82 #endif
83 ELSE IF (hprogram=='FA ') THEN
84 #ifdef SFX_FA
85  CALL close_file_fa(hprogram,kunit)
86 #endif
87 ELSE IF (hprogram=='LFI ') THEN
88 #ifdef SFX_LFI
89  CALL close_file_lfi(hprogram,kunit)
90 #endif
91 ELSE
92 #if defined(SFX_ASC) || defined(SFX_ARO) || defined(SFX_MNH) || defined(SFX_NC)
93  CALL close_file_asc(hprogram,kunit)
94 #endif
95 END IF
96 IF (lhook) CALL dr_hook('CLOSE_FILE',1,zhook_handle)
97 !
98 !-------------------------------------------------------------------------------
99 !
100 END SUBROUTINE close_file
subroutine close_file_fa(HPROGRAM, KUNIT)
subroutine close_file(HPROGRAM, KUNIT)
Definition: close_file.F90:6
subroutine close_file_ol(HPROGRAM, KUNIT)
subroutine close_file_lfi(HPROGRAM, KUNIT)
subroutine close_file_asc(HPROGRAM, KUNIT)