SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
read_pgd_tsz0_parn.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 read_pgd_tsz0_par_n (&
7  dtz, &
8  hprogram)
9 ! ################################################
10 !
11 !!**** *READ_PGD_TSZ0_PAR_n* - reads SEAFLUX sst
12 !!
13 !!
14 !! PURPOSE
15 !! -------
16 !!
17 !!** METHOD
18 !! ------
19 !!
20 !! EXTERNAL
21 !! --------
22 !!
23 !!
24 !! IMPLICIT ARGUMENTS
25 !! ------------------
26 !!
27 !! REFERENCE
28 !! ---------
29 !!
30 !!
31 !! AUTHOR
32 !! ------
33 !! P. Le Moigne *Meteo France*
34 !!
35 !! MODIFICATIONS
36 !! -------------
37 !! Original 09/2007
38 !! P. Le Moigne 03/2015 tsz0 time management
39 !-------------------------------------------------------------------------------
40 !
41 !* 0. DECLARATIONS
42 ! ------------
43 !
44 !
45 !
46 !
47 !
48 !
49 USE modd_data_tsz0_n, ONLY : data_tsz0_t
50 !
52 !
53 USE yomhook ,ONLY : lhook, dr_hook
54 USE parkind1 ,ONLY : jprb
55 !
56 IMPLICIT NONE
57 !
58 !* 0.1 Declarations of arguments
59 ! -------------------------
60 !
61 !
62 !
63 !
64 TYPE(data_tsz0_t), INTENT(INOUT) :: dtz
65 !
66  CHARACTER(LEN=6), INTENT(IN) :: hprogram ! program calling
67 !
68 !* 0.2 Declarations of local variables
69 ! -------------------------------
70 !
71 INTEGER :: iversion ! surface version
72 INTEGER :: ibugfix ! bugfix of the old file
73 INTEGER :: iresp ! IRESP : return-code if a problem appears
74  CHARACTER(LEN=12) :: yrecfm ! Name of the article to be read
75  CHARACTER(LEN=100):: ycomment ! Comment string
76 REAL(KIND=JPRB) :: zhook_handle
77 !
78 !-------------------------------------------------------------------------------
79 !
80 IF (lhook) CALL dr_hook('READ_PGD_TSZ0_PAR_N',0,zhook_handle)
81 !
82  CALL read_surf(&
83  hprogram,'VERSION',iversion,iresp)
84  CALL read_surf(&
85  hprogram,'BUG', ibugfix ,iresp)
86 !
87 IF (iversion.GT.7 .OR. (iversion==7 .AND. ibugfix.GT.1)) THEN
88  yrecfm='ND_TSZ0_TIME'
89  ycomment = '(-)'
90  CALL read_surf(&
91  hprogram,yrecfm,dtz%NTIME,iresp,hcomment=ycomment)
92 ELSE
93  dtz%NTIME=37
94 ENDIF
95 !
96 ALLOCATE(dtz%XDATA_DTS (dtz%NTIME))
97 ALLOCATE(dtz%XDATA_DHUGRD(dtz%NTIME))
98 !
99 IF (iversion.GT.7 .OR. (iversion==7 .AND. ibugfix.GT.1)) THEN
100  !
101  yrecfm = 'D_DTS'
102  ycomment = 'X_Y_DATA_DTS'
103  CALL read_surf(&
104  hprogram,yrecfm,dtz%XDATA_DTS(:),iresp,hcomment=ycomment,hdir='-')
105  !
106  yrecfm='D_DHUGRD'
107  ycomment = 'X_Y_DATA_DHUGRD'
108  CALL read_surf(&
109  hprogram,yrecfm,dtz%XDATA_DHUGRD(:),iresp,hcomment=ycomment,hdir='-')
110  !
111 ELSE
112  !
113  dtz%XDATA_DTS (:) = 0.0
114  dtz%XDATA_DHUGRD(:) = 0.0
115  !
116 ENDIF
117 !
118 IF (lhook) CALL dr_hook('READ_PGD_TSZ0_PAR_N',1,zhook_handle)
119 !-------------------------------------------------------------------------------
120 END SUBROUTINE read_pgd_tsz0_par_n
subroutine read_pgd_tsz0_par_n(DTZ, HPROGRAM)