SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
hor_interpol.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 hor_interpol (DTCO, U, &
7  kluout,pfieldin,pfieldout)
8 ! #################################################################################
9 !
10 !!**** *HOR_INTERPOL * - Call the interpolation of a surface field
11 !!
12 !! PURPOSE
13 !! -------
14 !
15 !!** METHOD
16 !! ------
17 !!
18 !! REFERENCE
19 !! ---------
20 !!
21 !!
22 !! AUTHOR
23 !! ------
24 !! V. Masson
25 !!
26 !! MODIFICATIONS
27 !! -------------
28 !! Original 01/2004
29 !! P. Le Moigne 10/2005, Phasage Arome
30 !!------------------------------------------------------------------
31 !
32 !
33 !
34 !
36 USE modd_surf_atm_n, ONLY : surf_atm_t
37 !
38 USE modd_prep, ONLY : cingrid_type, cinterp_type
39 !
40 USE modi_hor_interpol_gauss
41 USE modi_hor_interpol_rotlatlon
42 USE modi_hor_interpol_arome
43 USE modi_hor_interpol_conf_proj
44 USE modi_hor_interpol_cartesian
45 USE modi_hor_interpol_latlon
46 !
47 !
48 USE yomhook ,ONLY : lhook, dr_hook
49 USE parkind1 ,ONLY : jprb
50 !
51 USE modi_abor1_sfx
52 !
53 USE modi_hor_interpol_buffer
54 IMPLICIT NONE
55 !
56 !* 0.1 declarations of arguments
57 !
58 !
59 TYPE(data_cover_t), INTENT(INOUT) :: dtco
60 TYPE(surf_atm_t), INTENT(INOUT) :: u
61 !
62 INTEGER, INTENT(IN) :: kluout ! logical unit of output listing
63 REAL, DIMENSION(:,:), INTENT(IN) :: pfieldin ! field to interpolate horizontally
64 REAL, DIMENSION(:,:), INTENT(OUT) :: pfieldout ! interpolated field
65 !
66 !* 0.2 declarations of local variables
67 !
68 INTEGER :: jl ! loop counter
69 REAL(KIND=JPRB) :: zhook_handle
70 !
71 !-------------------------------------------------------------------------------------
72 !
73 IF (lhook) CALL dr_hook('HOR_INTERPOL',0,zhook_handle)
74 SELECT CASE (cinterp_type)
75 !
76 !* 1. Interpolation with horibl (from gaussian, Legendre or regular grid)
77 ! -------------------------------------------------------------------
78 !
79  CASE('HORIBL')
80  SELECT CASE(cingrid_type)
81 !
82 !* 1.1 Interpolation from gaussian or Legendre
83 !
84  CASE ('GAUSS ')
85  CALL hor_interpol_gauss(kluout,pfieldin,pfieldout)
86 !
87 !* 1.2 Interpolation from regular grid
88 !
89  CASE ('AROME ')
90  CALL hor_interpol_arome(kluout,pfieldin,pfieldout)
91 !
92 !* 1.3 Interpolation from regular lat/lon coord
93 !
94  CASE ('LATLON ')
95  CALL hor_interpol_latlon(kluout,pfieldin,pfieldout)
96 !
97 !* 1.4 Interpolation from rotated lat/lon coord
98 !
99  CASE ('ROTLATLON ')
100  CALL hor_interpol_rotlatlon(kluout,pfieldin,pfieldout)
101 
102  CASE default
103  CALL abor1_sfx('HOR_INTERPOL: WRONG GRID TYPE'//cingrid_type)
104 
105  END SELECT
106 !
107 !* 2. Prescribed uniform field
108 ! ------------------------
109 !
110  CASE('UNIF ')
111  DO jl=1,SIZE(pfieldin,2)
112  pfieldout(:,jl) = pfieldin(1,jl)
113  END DO
114 !
115 !* 3. Bilinear interpolation
116 ! ----------------------
117 !
118  CASE('BILIN ')
119  SELECT CASE(cingrid_type)
120  CASE ('CONF PROJ ')
121  CALL hor_interpol_conf_proj(kluout,pfieldin,pfieldout)
122  CASE ('CARTESIAN ')
123  CALL hor_interpol_cartesian(kluout,pfieldin,pfieldout)
124  END SELECT
125 !
126 !* 4. no interpolation, only packing
127 ! ------------------------------
128 !
129  CASE('BUFFER')
130  CALL hor_interpol_buffer(dtco, u, &
131  kluout,pfieldin,pfieldout)
132 
133 !
134 !* 4. no interpolation
135 ! ----------------
136 !
137  CASE('NONE ')
138  DO jl=1,SIZE(pfieldin,2)
139  pfieldout(:,jl) = pfieldin(:,jl)
140  END DO
141 
142  CASE default
143  CALL abor1_sfx('HOR_INTERPOL: WRONG INTERPOLATION TYPE'//cinterp_type)
144 
145 END SELECT
146 IF (lhook) CALL dr_hook('HOR_INTERPOL',1,zhook_handle)
147 !
148 !-------------------------------------------------------------------------------------
149 END SUBROUTINE hor_interpol
subroutine hor_interpol_gauss(KLUOUT, PFIELDIN, PFIELDOUT)
subroutine abor1_sfx(YTEXT)
Definition: abor1_sfx.F90:6
subroutine hor_interpol(DTCO, U, KLUOUT, PFIELDIN, PFIELDOUT)
Definition: hor_interpol.F90:6
subroutine hor_interpol_cartesian(KLUOUT, PFIELDIN, PFIELDOUT)
subroutine hor_interpol_buffer(DTCO, U, KLUOUT, PFIELDIN, PFIELDOUT)
subroutine hor_interpol_arome(KLUOUT, PFIELDIN, PFIELDOUT)
subroutine hor_interpol_latlon(KLUOUT, PFIELDIN, PFIELDOUT)
subroutine hor_interpol_conf_proj(KLUOUT, PFIELDIN, PFIELDOUT)
subroutine hor_interpol_rotlatlon(KLUOUT, PFIELDIN, PFIELDOUT)