SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
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 
subroutine interpol_field2d(UG, U, HPROGRAM, KLUOUT, KCODE, PFIELD, HFIELD, PDEF, KNPTS)
subroutine interpol_field(UG, U, HPROGRAM, KLUOUT, KCODE, PFIELD, HFIELD, PDEF, KNPTS)