SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
prep_flake_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_flake_grib(HPROGRAM,HSURF,HFILE,KLUOUT,PFIELD)
7 ! #################################################################################
8 !
9 !!**** *PREP_FLAKE_GRIB* - prepares FLAKE 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 !salgado - Is equal to prep_watflux_grib.f90
30 ! - The other variables are not read from grib files
31 ! - may be changed in future, namely if AROME will use FLAKE
32 !
34 !
36 !
37 USE modi_prep_grib_grid
38 !
39 USE modd_prep, ONLY : cingrid_type, cinterp_type
40 USE modd_grid_grib, ONLY : cgrib_file
41 !
42 !
43 USE yomhook ,ONLY : lhook, dr_hook
44 USE parkind1 ,ONLY : jprb
45 !
46 IMPLICIT NONE
47 !
48 !* 0.1 declarations of arguments
49 !
50  CHARACTER(LEN=6), INTENT(IN) :: hprogram ! program calling surf. schemes
51  CHARACTER(LEN=7), INTENT(IN) :: hsurf ! type of field
52  CHARACTER(LEN=28), INTENT(IN) :: hfile ! name of file
53 INTEGER, INTENT(IN) :: kluout ! logical unit of output listing
54 REAL,DIMENSION(:,:), POINTER :: pfield ! field to interpolate horizontally
55 !
56 !* 0.2 declarations of local variables
57 !
58 TYPE (date_time) :: tztime_grib ! current date and time
59  CHARACTER(LEN=6) :: yinmodel ! model from which GRIB file originates
60 REAL, DIMENSION(:) , POINTER :: zmask => null() ! Land mask
61 REAL, DIMENSION(:), POINTER :: zfield => null() ! field read
62 REAL(KIND=JPRB) :: zhook_handle
63 !
64 !-------------------------------------------------------------------------------------
65 !
66 !* 1. Reading of grid
67 ! ---------------
68 !
69 IF (lhook) CALL dr_hook('PREP_FLAKE_GRIB',0,zhook_handle)
70 !
71 IF (trim(hfile).NE.cgrib_file) cgrib_file=""
72 !
73  CALL prep_grib_grid(hfile,kluout,yinmodel,cingrid_type,tztime_grib)
74 !
75  CALL read_grib_land_mask(hfile,kluout,yinmodel,zmask)
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 !
97 !* 3. Temperature profiles
98 ! --------------------
99 !
100  CASE('TS ')
101  SELECT CASE (yinmodel)
102  CASE ('ECMWF ','ARPEGE','ALADIN','MOCAGE')
103  CALL read_grib_t2(hfile,kluout,yinmodel,zmask,zfield)
104  ALLOCATE(pfield(SIZE(zfield),1))
105  pfield(:,1) = zfield(:)
106  DEALLOCATE(zfield)
107  END SELECT
108 
109 END SELECT
110 !
111 DEALLOCATE(zmask)
112 !
113 !* 4. Interpolation method
114 ! --------------------
115 !
116  cinterp_type='HORIBL'
117 !
118 IF (lhook) CALL dr_hook('PREP_FLAKE_GRIB',1,zhook_handle)
119 !
120 !
121 !-------------------------------------------------------------------------------------
122 END SUBROUTINE prep_flake_grib
subroutine read_grib_zs_land(HGRIB, KLUOUT, HINMODEL, PMASK, PZSL)
subroutine read_grib_land_mask(HGRIB, KLUOUT, HINMODEL, PMASK)
subroutine prep_flake_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)