SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
prep_watflux_grib.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 prep_watflux_grib(HPROGRAM,HSURF,HFILE,KLUOUT,PFIELD)
7 ! #################################################################################
8 !
9 !!**** *PREP_WATFLUX_GRIB* - prepares WATFLUX field from operational GRIB
10 !!
11 !! PURPOSE
12 !! -------
13 !
14 !!** METHOD
15 !! ------
16 !!
17 !! REFERENCE
18 !! ---------
19 !!
20 !!
21 !! AUTHOR
22 !! ------
23 !! S. Malardel
24 !!
25 !! MODIFICATIONS
26 !! -------------
27 !! Original 01/2004
28 !!------------------------------------------------------------------
29 !
30 !
32 !
34 !
35 USE modi_prep_grib_grid
36 !
37 USE modd_prep, ONLY : cingrid_type, cinterp_type
38 USE modd_grid_grib, ONLY : cgrib_file
39 !
40 !
41 USE yomhook ,ONLY : lhook, dr_hook
42 USE parkind1 ,ONLY : jprb
43 !
44 IMPLICIT NONE
45 !
46 !* 0.1 declarations of arguments
47 !
48  CHARACTER(LEN=6), INTENT(IN) :: hprogram ! program calling surf. schemes
49  CHARACTER(LEN=7), INTENT(IN) :: hsurf ! type of field
50  CHARACTER(LEN=28), INTENT(IN) :: hfile ! name of file
51 INTEGER, INTENT(IN) :: kluout ! logical unit of output listing
52 REAL,DIMENSION(:,:), POINTER :: pfield ! field to interpolate horizontally
53 !
54 !* 0.2 declarations of local variables
55 !
56 TYPE (date_time) :: tztime_grib ! current date and time
57  CHARACTER(LEN=6) :: yinmodel ! model from which GRIB file originates
58 REAL, DIMENSION(:) ,POINTER:: zmask => null() ! Land mask
59 REAL, DIMENSION(:), POINTER :: zfield => null() ! field read
60 !
61 REAL(KIND=JPRB) :: zhook_handle
62 !
63 !-------------------------------------------------------------------------------------
64 !
65 !* 1. Reading of grid
66 ! ---------------
67 !
68 IF (lhook) CALL dr_hook('PREP_WATFLUX_GRIB',0,zhook_handle)
69 !
70 IF (trim(hfile).NE.cgrib_file) cgrib_file=""
71 !
72  CALL prep_grib_grid(hfile,kluout,yinmodel,cingrid_type,tztime_grib)
73 !
74  CALL read_grib_land_mask(hfile,kluout,yinmodel,zmask)
75 !
76 !
77 !* 2. Reading of field
78 ! ----------------
79 !
80 !--------------------
81 SELECT CASE(hsurf)
82 !--------------------
83 !
84 !* 1. Orography
85 ! ---------
86 !
87  CASE('ZS ')
88  SELECT CASE (yinmodel)
89  CASE ('ECMWF ','ARPEGE','ALADIN','MOCAGE')
90  CALL read_grib_zs_land(hfile,kluout,yinmodel,zmask,zfield)
91  ALLOCATE(pfield(SIZE(zfield),1))
92  pfield(:,1) = zfield(:)
93  DEALLOCATE(zfield)
94  END SELECT
95 !
96 !* 3. Temperature profiles
97 ! --------------------
98 !
99  CASE('TSWATER')
100  SELECT CASE (yinmodel)
101  CASE ('ECMWF ','ARPEGE','ALADIN','MOCAGE')
102  CALL read_grib_t2(hfile,kluout,yinmodel,zmask,zfield)
103  ALLOCATE(pfield(SIZE(zfield),1))
104  pfield(:,1) = zfield(:)
105  DEALLOCATE(zfield)
106  END SELECT
107 
108 END SELECT
109 !
110 DEALLOCATE(zmask)
111 !
112 !* 4. Interpolation method
113 ! --------------------
114 !
115  cinterp_type='HORIBL'
116 !
117 IF (lhook) CALL dr_hook('PREP_WATFLUX_GRIB',1,zhook_handle)
118 !
119 !-------------------------------------------------------------------------------------
120 END SUBROUTINE prep_watflux_grib
subroutine read_grib_zs_land(HGRIB, KLUOUT, HINMODEL, PMASK, PZSL)
subroutine read_grib_land_mask(HGRIB, KLUOUT, HINMODEL, PMASK)
subroutine prep_watflux_grib(HPROGRAM, HSURF, HFILE, KLUOUT, PFIELD)
subroutine read_grib_t2(HGRIB, KLUOUT, HINMODEL, PMASK, PT2)
subroutine prep_grib_grid(HGRIB, KLUOUT, HINMODEL, HGRIDTYPE, TPTIME_GRIB)