SURFEX v8.1
General documentation of Surfex
get_mesh_corner_cartesian.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_cartesian(KGRID_PAR,KL,KC,PGRID_PAR,PCORNER_LAT,PCORNER_LON)
7 ! #######################################################################################
8 !
9 !!**** *GET_MESH_CORNER_CARTESIAN* 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 :: ZLAT0 ! reference latitude
54 REAL :: ZLON0 ! reference longitude
55 REAL, DIMENSION(KL) :: ZX ! X conformal coordinate
56 REAL, DIMENSION(KL) :: ZY ! Y conformal coordinate
57 REAL, DIMENSION(KL) :: ZDX ! size in X conformal coordinate
58 REAL, DIMENSION(KL) :: ZDY ! size in Y conformal coordinate
59 !
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_CARTESIAN',0,zhook_handle)
68 !
69 !* 1. Gets parameters of the projection
70 ! ---------------------------------
71 !
72  CALL get_gridtype_cartesian(pgrid_par,kl=ini)
73 !
74 IF(kl/=ini)THEN
75  CALL abor1_sfx('GET_MESH_CORNER_CARTESIAN: WRONG NUMBER OF POINT')
76 ENDIF
77 !
78  CALL get_gridtype_cartesian(pgrid_par,zlat0,zlon0,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 !
91 zcx(:,1) = zx(:)-zdx(:)/2.
92 zcy(:,1) = zy(:)-zdy(:)/2.
93 !
94 zcx(:,3) = zx(:)+zdx(:)/2.
95 zcy(:,3) = zy(:)+zdy(:)/2.
96 !
97 zcx(:,2) = zcx(:,3)
98 zcy(:,2) = zcy(:,1)
99 !
100 zcx(:,4) = zcx(:,1)
101 zcy(:,4) = zcy(:,3)
102 !
103 IF (lhook) CALL dr_hook('GET_MESH_CORNER_CARTESIAN',1,zhook_handle)
104 !
105 !-------------------------------------------------------------------------------
106 END SUBROUTINE get_mesh_corner_cartesian
subroutine abor1_sfx(YTEXT)
Definition: abor1_sfx.F90:7
integer, parameter jprb
Definition: parkind1.F90:32
subroutine get_mesh_corner_cartesian(KGRID_PAR, KL, KC, PGRID_PAR, PCO
logical lhook
Definition: yomhook.F90:15
subroutine get_gridtype_cartesian(PGRID_PAR, PLAT0, PLON0,