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