SURFEX v8.1
General documentation of Surfex
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 modd_grid_grib, ONLY : cgrib_file
38 !
39 !
40 USE yomhook ,ONLY : lhook, dr_hook
41 USE parkind1 ,ONLY : jprb
42 !
43 IMPLICIT NONE
44 !
45 !* 0.1 declarations of arguments
46 !
47  CHARACTER(LEN=6), INTENT(IN) :: HPROGRAM ! program calling surf. schemes
48  CHARACTER(LEN=7), INTENT(IN) :: HSURF ! type of field
49  CHARACTER(LEN=28), INTENT(IN) :: HFILE ! name of file
50 INTEGER, INTENT(IN) :: KLUOUT ! logical unit of output listing
51 REAL,DIMENSION(:,:), POINTER :: PFIELD ! field to interpolate horizontally
52 !
53 !* 0.2 declarations of local variables
54 !
55 type(date_time) :: tztime_grib ! current date and time
56  CHARACTER(LEN=6) :: YINMODEL ! model from which GRIB file originates
57 REAL, DIMENSION(:) , POINTER :: ZMASK => null() ! Land mask
58 REAL, DIMENSION(:), POINTER :: ZFIELD => null() ! field read
59 REAL(KIND=JPRB) :: ZHOOK_HANDLE
60 !
61 !-------------------------------------------------------------------------------------
62 !
63 !* 1. Reading of grid
64 ! ---------------
65 !
66 IF (lhook) CALL dr_hook('PREP_FLAKE_GRIB',0,zhook_handle)
67 !
68 IF (trim(hfile).NE.cgrib_file) cgrib_file=""
69 !
70  CALL read_grib_land_mask(hfile,kluout,yinmodel,zmask)
71 !
72 !* 2. Reading of field
73 ! ----------------
74 !
75 !--------------------
76 SELECT CASE(hsurf)
77 !--------------------
78 !
79 !* 1. Orography
80 ! ---------
81 !
82  CASE('ZS ')
83  SELECT CASE (yinmodel)
84  CASE ('ECMWF ','ARPEGE','ALADIN','MOCAGE','HIRLAM')
85  CALL read_grib_zs_land(hfile,kluout,yinmodel,zmask,zfield)
86  ALLOCATE(pfield(SIZE(zfield),1))
87  pfield(:,1) = zfield(:)
88  DEALLOCATE(zfield)
89  END SELECT
90 
91 !
92 !* 3. Temperature profiles
93 ! --------------------
94 !
95  CASE('TS ')
96  SELECT CASE (yinmodel)
97  CASE ('ECMWF ','ARPEGE','ALADIN','MOCAGE','HIRLAM')
98  CALL read_grib_tswater(hfile,kluout,yinmodel,zmask,zfield)
99  ALLOCATE(pfield(SIZE(zfield),1))
100  pfield(:,1) = zfield(:)
101  DEALLOCATE(zfield)
102  END SELECT
103 
104 END SELECT
105 !
106 DEALLOCATE(zmask)
107 !
108 !* 4. Interpolation method
109 ! --------------------
110 !
111 IF (lhook) CALL dr_hook('PREP_FLAKE_GRIB',1,zhook_handle)
112 !
113 !
114 !-------------------------------------------------------------------------------------
115 END SUBROUTINE prep_flake_grib
static const char * trim(const char *name, int *n)
Definition: drhook.c:2383
character(len=28) cgrib_file
subroutine read_grib_tswater(HGRIB, KLUOUT, HINMODEL, PMASK, PTS)
subroutine read_grib_zs_land(HGRIB, KLUOUT, HINMODEL, PMASK, PZSL)
subroutine prep_flake_grib(HPROGRAM, HSURF, HFILE, KLUOUT, PFIELD)
integer, parameter jprb
Definition: parkind1.F90:32
logical lhook
Definition: yomhook.F90:15
subroutine read_grib_land_mask(HGRIB, KLUOUT, HINMODEL, PMASK)