SURFEX v8.1
General documentation of Surfex
prep_output_grid.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_output_grid (UG, G, KSIZE_FULL, KLUOUT)
7 ! #######################################
8 !!
9 !! PURPOSE
10 !! -------
11 !! Computes variables used for interpolation
12 !!
13 !! METHOD
14 !! ------
15 !!
16 !! EXTERNAL
17 !! --------
18 !!
19 !!
20 !! IMPLICIT ARGUMENTS
21 !! ------------------
22 !!
23 !!
24 !! REFERENCE
25 !! ---------
26 !!
27 !! AUTHOR
28 !! ------
29 !!
30 !! V. Masson Meteo-France
31 !!
32 !! MODIFICATION
33 !! ------------
34 !!
35 !! Original 01/2004
36 !----------------------------------------------------------------------------
37 !
38 !* 0. DECLARATION
39 ! -----------
40 !
41 USE modd_sfx_grid_n, ONLY : grid_t
42 !
43 USE modi_get_grid_coord
44 !
46 !
47 !
48 USE yomhook ,ONLY : lhook, dr_hook
49 USE parkind1 ,ONLY : jprb
50 !
51 IMPLICIT NONE
52 !
53 !* 0.1 Declaration of dummy arguments
54 ! ------------------------------
55 !
56 !
57 TYPE(grid_t), INTENT(INOUT) :: UG
58 TYPE(grid_t), INTENT(INOUT) :: G
59 INTEGER, INTENT(IN) :: KSIZE_FULL
60 !
61 INTEGER, INTENT(IN) :: KLUOUT ! output listing logical unit
62 !
63 !* 0.2 Declaration of local variables
64 ! ------------------------------
65 !
66 REAL(KIND=JPRB) :: ZHOOK_HANDLE
67 !------------------------------------------------------------------------------
68 !
69 IF (lhook) CALL dr_hook('PREP_OUTPUT_GRID',0,zhook_handle)
70 !
71 IF (.NOT.ALLOCATED(xlat_out)) ALLOCATE(xlat_out(SIZE(g%XLAT)))
72 IF (.NOT.ALLOCATED(xlon_out)) ALLOCATE(xlon_out(SIZE(g%XLAT)))
73 IF (.NOT.ALLOCATED(xx_out)) ALLOCATE(xx_out(SIZE(g%XLAT)))
74 IF (.NOT.ALLOCATED(xy_out)) ALLOCATE(xy_out(SIZE(g%XLAT)))
75 !
76 IF (.NOT.ALLOCATED(linterp)) ALLOCATE(linterp(SIZE(g%XLAT)))
77 !
78 IF (SIZE(g%XLAT)==0) THEN
79  IF (lhook) CALL dr_hook('PREP_OUTPUT_GRID',1,zhook_handle)
80  RETURN
81 ENDIF
82 !
83 xlat_out = g%XLAT
84 xlon_out = g%XLON
85 linterp = .true.
86 !
87  CALL get_grid_coord(ug%CGRID, ug%NGRID_PAR, ug%XGRID_PAR, ksize_full, &
88  kluout,xx_out,xy_out,SIZE(g%XLAT),g%CGRID,g%XGRID_PAR)
89 !
90 IF (lhook) CALL dr_hook('PREP_OUTPUT_GRID',1,zhook_handle)
91 !-------------------------------------------------------------------------------
92 !
93 END SUBROUTINE prep_output_grid
real, dimension(:), allocatable xlon_out
Definition: modd_prep.F90:48
real, dimension(:), allocatable xy_out
Definition: modd_prep.F90:51
logical, dimension(:), allocatable linterp
Definition: modd_prep.F90:43
integer, parameter jprb
Definition: parkind1.F90:32
real, dimension(:), allocatable xlat_out
Definition: modd_prep.F90:47
subroutine get_grid_coord(HGRID_IN, KGRID_PAR_IN, PGRID_PAR_IN, K
subroutine prep_output_grid(UG, G, KSIZE_FULL, KLUOUT)
real, dimension(:), allocatable xx_out
Definition: modd_prep.F90:50
logical lhook
Definition: yomhook.F90:15