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