SURFEX v8.1
General documentation of Surfex
old_name.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 old_name (HPROGRAM,HRECIN,HRECOUT,HDIR)
7 ! #######################################################
8 !
9 !!**** *OLD_NAME* - get the old name of a field for reading in an old SURFEX 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 08/2011
35 !-------------------------------------------------------------------------------
36 !
37 !* 0. DECLARATIONS
38 ! ------------
39 !
40 !
41 !
42 !
43 !
44 !
45 USE yomhook ,ONLY : lhook, dr_hook
46 USE parkind1 ,ONLY : jprb
47 !
49 !
50 IMPLICIT NONE
51 !
52 !* 0.1 Declarations of arguments
53 ! -------------------------
54 !
55 !
56 !
57  CHARACTER(LEN=6), INTENT(IN) :: HPROGRAM ! main program
58  CHARACTER(LEN=12), INTENT(IN) :: HRECIN ! name of field to be read
59  CHARACTER(LEN=12), INTENT(OUT) :: HRECOUT ! name of field to be read is old file
60  CHARACTER(LEN=1), INTENT(IN), OPTIONAL :: HDIR
61 !
62 !
63 !* 0.2 Declarations of local variables
64 ! -------------------------------
65 !
66  CHARACTER(LEN=1) :: YDIR
67 INTEGER :: IVERSION ! version of the old file
68 INTEGER :: IBUGFIX ! bugfix of the old file
69 !
70 INTEGER :: IRESP
71 REAL(KIND=JPRB) :: ZHOOK_HANDLE
72 !-------------------------------------------------------------------------------
73 !
74 IF (lhook) CALL dr_hook('OLD_NAME',0,zhook_handle)
75 !
76 ydir = 'H'
77 IF (PRESENT(hdir)) ydir = hdir
78 !
79 hrecout = hrecin
80 IF (hrecin=='COVER_LIST') THEN
81  CALL read_surf(hprogram,'VERSION',iversion,iresp,hdir=ydir)
82  CALL read_surf(hprogram,'BUG', ibugfix ,iresp,hdir=ydir)
83  IF (iversion<7 .OR. (iversion==7 .AND. ibugfix==0)) hrecout='COVER'
84 END IF
85 !
86 IF (lhook) CALL dr_hook('OLD_NAME',1,zhook_handle)
87 !-------------------------------------------------------------------------------
88 END SUBROUTINE old_name
subroutine old_name(HPROGRAM, HRECIN, HRECOUT, HDIR)
Definition: old_name.F90:7
integer, parameter jprb
Definition: parkind1.F90:32
logical lhook
Definition: yomhook.F90:15