SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
get_mesh_corner_ign.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_ign(KGRID_PAR,KL,KC,PGRID_PAR,PCORNER_LAT,PCORNER_LON)
7 ! #######################################################################################
8 !
9 !!**** *GET_MESH_CORNER_IGN* 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 :: jc ! loop on corner
52 !
53 INTEGER :: ilambert ! Lambert type
54 INTEGER :: ini ! Number of point
55 !
56 REAL, DIMENSION(KL) :: zx ! X Lambert coordinate
57 REAL, DIMENSION(KL) :: zy ! Y Lambert coordinate
58 REAL, DIMENSION(KL) :: zdx ! X size of grid mesh
59 REAL, DIMENSION(KL) :: zdy ! Y size of grid mesh
60 REAL, DIMENSION(KL,KC) :: zcx ! Grid corner in X
61 REAL, DIMENSION(KL,KC) :: zcy ! Grid corner in Y
62 !
63 REAL(KIND=JPRB) :: zhook_handle
64 !
65 !----------------------------------------------------------------------------
66 !
67 IF (lhook) CALL dr_hook('GET_MESH_CORNER_IGN',0,zhook_handle)
68 !
69 !* 1. Gets parameters of the projection
70 ! ---------------------------------
71 !
72  CALL get_gridtype_ign(pgrid_par,klambert=ilambert,kl=ini)
73 !
74 IF(kl/=ini)THEN
75  CALL abor1_sfx('GET_MESH_CORNER_IGN: WRONG NUMBER OF POINT')
76 ENDIF
77 !
78  CALL get_gridtype_ign(pgrid_par,px=zx,py=zy,pdx=zdx,pdy=zdy)
79 !
80 !* 2. grid cell corner (counterclockwise sense)
81 ! -----------------------------------------
82 !
83 ! 4_______3
84 ! | |
85 ! | . |
86 ! | |
87 ! |_______|
88 ! 1 2
89 !
90 zcx(:,1) = zx(:)-zdx(:)/2.
91 zcy(:,1) = zy(:)-zdy(:)/2.
92 !
93 zcx(:,3) = zx(:)+zdx(:)/2.
94 zcy(:,3) = zy(:)+zdy(:)/2.
95 !
96 zcx(:,2) = zcx(:,3)
97 zcy(:,2) = zcy(:,1)
98 !
99 zcx(:,4) = zcx(:,1)
100 zcy(:,4) = zcy(:,3)
101 !
102 DO jc=1,kc
103  CALL latlon_ign(ilambert,zcx(:,jc),zcy(:,jc),pcorner_lat(:,jc),pcorner_lon(:,jc))
104 ENDDO
105 !
106 IF (lhook) CALL dr_hook('GET_MESH_CORNER_IGN',1,zhook_handle)
107 !
108 !-------------------------------------------------------------------------------
109 END SUBROUTINE get_mesh_corner_ign
subroutine get_mesh_corner_ign(KGRID_PAR, KL, KC, PGRID_PAR, PCORNER_LAT, PCORNER_LON)
subroutine get_gridtype_ign(PGRID_PAR, KLAMBERT, KL, PX, PY, PDX, PDY, KDIMX, KDIMY, PXALL, PYALL)
subroutine latlon_ign(KLAMBERT, PX, PY, PLAT, PLON)
subroutine abor1_sfx(YTEXT)
Definition: abor1_sfx.F90:6