SURFEX v8.1
General documentation of Surfex
interpol_field.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 interpol_field (UG, U, &
7  HPROGRAM,KLUOUT,KCODE,PFIELD,HFIELD,PDEF,KNPTS)
8 ! ################################################
9 !
10 !
11 !
12 !
14 USE modd_surf_atm_n, ONLY : surf_atm_t
15 !
16 USE yomhook ,ONLY : lhook, dr_hook
17 USE parkind1 ,ONLY : jprb
18 !
19 USE modd_surf_par, ONLY : xundef
20 !
21 USE modi_abor1_sfx
22 USE modi_interpol_field2d
23 !
24 IMPLICIT NONE
25 !
26 !* 0.1 Declaration of arguments
27 ! ------------------------
28 !
29 !
30 TYPE(surf_atm_grid_t), INTENT(INOUT) :: UG
31 TYPE(surf_atm_t), INTENT(INOUT) :: U
32 !
33  CHARACTER(LEN=6), INTENT(IN) :: HPROGRAM ! host program
34 INTEGER, INTENT(IN) :: KLUOUT ! output listing logical unit
35 INTEGER,DIMENSION(:), INTENT(INOUT):: KCODE ! code for each point
36  ! >0 point used for interpolation
37  ! 0 point to interpolate
38  ! -1 point not used
39  ! -2 point not used
40 ! ! -3 if spline is no computed
41 ! ! for this point
42 REAL, DIMENSION(:), INTENT(INOUT):: PFIELD ! pgd field on grid mesh
43  CHARACTER(LEN=*), INTENT(IN) :: HFIELD ! name of the field for prints
44 REAL, OPTIONAL,INTENT(IN) :: PDEF ! default value if not enough data
45 INTEGER, OPTIONAL, INTENT(IN) :: KNPTS ! number of points to interpolate with
46 !
47 !* 0.2 Declaration of local variables
48 ! ------------------------------
49 !
50 REAL, DIMENSION(SIZE(PFIELD),1) :: ZFIELD
51 REAL, DIMENSION(1) :: ZDEF
52 INTEGER :: INPTS ! number of points to interpolate with
53 REAL(KIND=JPRB) :: ZHOOK_HANDLE
54 !
55 !----------------------------------------------------------------------------
56 IF (lhook) CALL dr_hook('INTERPOL_FIELD',0,zhook_handle)
57 !
58 inpts = 3
59 IF (PRESENT(knpts)) inpts = knpts
60 !
61 zfield(:,1) = pfield(:)
62 !
63 IF (PRESENT(pdef)) THEN
64  zdef = pdef
65  CALL interpol_field2d(ug, u, &
66  hprogram,kluout,kcode,zfield,hfield,zdef,knpts=inpts)
67 ELSE
68  CALL interpol_field2d(ug, u, &
69  hprogram,kluout,kcode,zfield,hfield,knpts=inpts)
70 END IF
71 !
72 pfield(:) = zfield(:,1)
73 IF (lhook) CALL dr_hook('INTERPOL_FIELD',1,zhook_handle)
74 !----------------------------------------------------------------------------
75 END SUBROUTINE interpol_field
76 
real, parameter xundef
integer, parameter jprb
Definition: parkind1.F90:32
logical lhook
Definition: yomhook.F90:15
subroutine interpol_field2d(UG, U, HPROGRAM, KLUOUT, KCODE, PFIELD, HFIELD, P
subroutine interpol_field(UG, U, HPROGRAM, KLUOUT, KCODE, PFIELD, HFIELD, PDE