SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
get_mesh_corner_lonlaval.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 get_mesh_corner_lonlatval(KGRID_PAR,KL,KC,PGRID_PAR,PCORNER_LAT,PCORNER_LON)
7 ! ###############################################################
8 !
9 !!**** *GET_MESH_CORNER_LONLATVAL* get the grid mesh where point (lat,lon) is located
10 !!
11 !! PURPOSE
12 !! -------
13 !!
14 !! AUTHOR
15 !! ------
16 !!
17 !! B. Decharme Meteo-France
18 !!
19 !! MODIFICATION
20 !! ------------
21 !!
22 !! Original 10/2013
23 !!
24 !----------------------------------------------------------------------------
25 !
26 !* 0. DECLARATION
27 ! -----------
28 !
30 !
31 USE modi_abor1_sfx
32 !
33 USE yomhook ,ONLY : lhook, dr_hook
34 USE parkind1 ,ONLY : jprb
35 !
36 IMPLICIT NONE
37 !
38 !* 0.1 Declaration of arguments
39 ! ------------------------
40 !
41 INTEGER, INTENT(IN) :: kgrid_par ! size of PGRID_PAR
42 INTEGER, INTENT(IN) :: kl ! number of points
43 INTEGER, INTENT(IN) :: kc ! number of grid point corner
44 REAL, DIMENSION(KGRID_PAR), INTENT(IN) :: pgrid_par ! grid parameters
45 REAL, DIMENSION(KL,KC), INTENT(OUT) :: pcorner_lat ! Grid corner Latitude
46 REAL, DIMENSION(KL,KC), INTENT(OUT) :: pcorner_lon ! Grid corner Longitude
47 !
48 !* 0.2 Declaration of other local variables
49 ! ------------------------------------
50 !
51 INTEGER :: ini ! Number of point
52 !
53 REAL, DIMENSION(KL) :: zlon ! longitude grid
54 REAL, DIMENSION(KL) :: zlat ! latitude grid
55 !
56 REAL, DIMENSION(KL) :: zdlon ! longitude grid size
57 REAL, DIMENSION(KL) :: zdlat ! latitude grid size
58 !
59 REAL(KIND=JPRB) :: zhook_handle
60 !
61 !----------------------------------------------------------------------------
62 !
63 IF (lhook) CALL dr_hook('GET_MESH_CORNER_LONLATVAL',0,zhook_handle)
64 !
65 !* 1. Uncode parameters of the grid
66 ! -----------------------------
67 !
68  CALL get_gridtype_lonlatval(pgrid_par,kl=ini,px=zlon,py=zlat,pdx=zdlon,pdy=zdlat)
69 !
70 IF(kl/=ini)THEN
71  CALL abor1_sfx('GET_GRIDTYPE_LONLATVAL: WRONG NUMBER OF POINT')
72 ENDIF
73 !
74 !* 2. grid cell corner (counterclockwise sense)
75 ! -----------------------------------------
76 !
77 ! 4_______3
78 ! | |
79 ! | . |
80 ! | |
81 ! |_______|
82 ! 1 2
83 !
84 pcorner_lon(:,1) = zlon(:)-zdlon(:)/2.
85 pcorner_lat(:,1) = zlat(:)-zdlat(:)/2.
86 !
87 pcorner_lon(:,3) = zlon(:)+zdlon(:)/2.
88 pcorner_lat(:,3) = zlat(:)+zdlat(:)/2.
89 !
90 pcorner_lon(:,2) = pcorner_lon(:,3)
91 pcorner_lat(:,2) = pcorner_lat(:,1)
92 !
93 pcorner_lon(:,4) = pcorner_lon(:,1)
94 pcorner_lat(:,4) = pcorner_lat(:,3)
95 !
96 IF (lhook) CALL dr_hook('GET_MESH_CORNER_LONLATVAL',1,zhook_handle)
97 !
98 !-------------------------------------------------------------------------------
99 !
100 END SUBROUTINE get_mesh_corner_lonlatval
subroutine get_mesh_corner_lonlatval(KGRID_PAR, KL, KC, PGRID_PAR, PCORNER_LAT, PCORNER_LON)
subroutine abor1_sfx(YTEXT)
Definition: abor1_sfx.F90:6
subroutine get_gridtype_lonlatval(PGRID_PAR, KL, PX, PY, PDX, PDY)