SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
prep_seaflux_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_seaflux_grib(HPROGRAM,HSURF,HFILE,KLUOUT,PFIELD)
7 ! #################################################################################
8 !
9 !!**** *PREP_SEAFLUX_GRIB* - prepares SEAFLUX fields 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 
31 !
33 !
35 !
36 USE modi_prep_grib_grid
37 !
38 USE modd_prep, ONLY : cingrid_type, cinterp_type
39 USE modd_grid_grib, ONLY : cgrib_file, nni
40 !
41 !
42 USE yomhook ,ONLY : lhook, dr_hook
43 USE parkind1 ,ONLY : jprb
44 !
45 IMPLICIT NONE
46 !
47 !* 0.1 declarations of arguments
48 !
49  CHARACTER(LEN=6), INTENT(IN) :: hprogram ! program calling surf. schemes
50  CHARACTER(LEN=7), INTENT(IN) :: hsurf ! type of field
51  CHARACTER(LEN=28), INTENT(IN) :: hfile ! name of file
52 INTEGER, INTENT(IN) :: kluout ! logical unit of output listing
53 REAL,DIMENSION(:,:), POINTER :: pfield ! field to interpolate horizontally
54 !
55 !* 0.2 declarations of local variables
56 !
57 TYPE (date_time) :: tztime_grib ! current date and time
58  CHARACTER(LEN=6) :: yinmodel ! model from which GRIB file originates
59 REAL, DIMENSION(:) , POINTER :: zmask => null() ! Land mask
60 REAL, DIMENSION(:), POINTER :: zfield => null() ! field read
61 REAL(KIND=JPRB) :: zhook_handle
62 !
63 !-------------------------------------------------------------------------------------
64 !
65 !* 1. Reading of grid
66 ! ---------------
67 !
68 IF (lhook) CALL dr_hook('PREP_SEAFLUX_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 !* 2. Reading of field
77 ! ----------------
78 !-----------------
79 SELECT CASE(hsurf)
80 !-----------------
81 !
82 !* 1. Orography
83 ! ---------
84 !
85  CASE('ZS ')
86  SELECT CASE (yinmodel)
87  CASE ('ECMWF ','ARPEGE','ALADIN','MOCAGE')
88  CALL read_grib_zs_sea(hfile,kluout,yinmodel,zmask,zfield)
89  ALLOCATE(pfield(SIZE(zfield),1))
90  pfield(:,1) = zfield(:)
91  DEALLOCATE(zfield)
92  END SELECT
93 
94 !
95 !* 2. Temperature profiles
96 ! --------------------
97 !
98  CASE('SST ')
99  SELECT CASE (yinmodel)
100  CASE ('ECMWF ','ARPEGE','ALADIN','MOCAGE')
101  CALL read_grib_sst(hfile,kluout,yinmodel,zmask,zfield)
102  ALLOCATE(pfield(SIZE(zfield),1))
103  pfield(:,1) = zfield(:)
104  DEALLOCATE(zfield)
105  END SELECT
106 !
107 !* 3. Sea surface salinity and ice fraction
108 ! -------------------------------------
109 !
110  CASE('SSS ','SIC ')
111  ALLOCATE(pfield(nni,1))
112  pfield = 0.0
113 !
114 END SELECT
115 !
116 DEALLOCATE(zmask)
117 !
118 !* 4. Interpolation method
119 ! --------------------
120 !
121  cinterp_type='HORIBL'
122 IF (lhook) CALL dr_hook('PREP_SEAFLUX_GRIB',1,zhook_handle)
123 !
124 !-------------------------------------------------------------------------------------
125 END SUBROUTINE prep_seaflux_grib
subroutine read_grib_zs_sea(HGRIB, KLUOUT, HINMODEL, PMASK, PZSS)
subroutine read_grib_land_mask(HGRIB, KLUOUT, HINMODEL, PMASK)
subroutine read_grib_sst(HGRIB, KLUOUT, HINMODEL, PMASK, PSST)
subroutine prep_grib_grid(HGRIB, KLUOUT, HINMODEL, HGRIDTYPE, TPTIME_GRIB)
subroutine prep_seaflux_grib(HPROGRAM, HSURF, HFILE, KLUOUT, PFIELD)