SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
get_mesh_corner_conf_proj.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_conf_proj(KGRID_PAR,KL,KC,PGRID_PAR,PCORNER_LAT,PCORNER_LON)
7 ! #######################################################################################
8 !
9 !!**** *GET_MESH_CORNER_CONF_PROJ* 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 :: ini ! Number of point
54 !
55 REAL :: zlat0 ! reference latitude
56 REAL :: zlon0 ! reference longitude
57 REAL :: zrpk ! projection parameter
58 REAL :: zbeta ! angle between grid and reference longitude
59 REAL :: zlator ! latitude of point of coordinates X=0, Y=0
60 REAL :: zlonor ! longitude of point of coordinates X=0, Y=0
61 REAL, DIMENSION(KL) :: zx ! X conformal coordinate
62 REAL, DIMENSION(KL) :: zy ! Y conformal coordinate
63 REAL, DIMENSION(KL) :: zdx ! size in X conformal coordinate
64 REAL, DIMENSION(KL) :: zdy ! size in Y conformal coordinate
65 !
66 REAL, DIMENSION(KL,KC) :: zcx ! Grid corner in X
67 REAL, DIMENSION(KL,KC) :: zcy ! Grid corner in Y
68 !
69 REAL(KIND=JPRB) :: zhook_handle
70 !
71 !----------------------------------------------------------------------------
72 !
73 IF (lhook) CALL dr_hook('GET_MESH_CORNER_CONF_PROJ',0,zhook_handle)
74 !
75 !* 1. Gets parameters of the projection
76 ! ---------------------------------
77 !
78  CALL get_gridtype_conf_proj(pgrid_par,kl=ini)
79 !
80 IF(kl/=ini)THEN
81  CALL abor1_sfx('GET_MESH_CORNER_CONF_PROJ: WRONG NUMBER OF POINT')
82 ENDIF
83 !
84  CALL get_gridtype_conf_proj(pgrid_par,zlat0,zlon0,zrpk,zbeta,zlator, &
85  zlonor,px=zx,py=zy,pdx=zdx,pdy=zdy )
86 !
87 !* 2. grid cell corner (counterclockwise sense)
88 ! -----------------------------------------
89 !
90 ! 4_______3
91 ! | |
92 ! | . |
93 ! | |
94 ! |_______|
95 ! 1 2
96 !
97 !
98 zcx(:,1) = zx(:)-zdx(:)/2.
99 zcy(:,1) = zy(:)-zdy(:)/2.
100 !
101 zcx(:,3) = zx(:)+zdx(:)/2.
102 zcy(:,3) = zy(:)+zdy(:)/2.
103 !
104 zcx(:,2) = zcx(:,3)
105 zcy(:,2) = zcy(:,1)
106 !
107 zcx(:,4) = zcx(:,1)
108 zcy(:,4) = zcy(:,3)
109 !
110 DO jc=1,kc
111  CALL latlon_conf_proj(zlat0,zlon0,zrpk,zbeta,zlator,zlonor,zcx(:,jc), &
112  zcy(:,jc),pcorner_lat(:,jc),pcorner_lon(:,jc) )
113 ENDDO
114 !
115 IF (lhook) CALL dr_hook('GET_MESH_CORNER_CONF_PROJ',1,zhook_handle)
116 !
117 !-------------------------------------------------------------------------------
118 END SUBROUTINE get_mesh_corner_conf_proj
subroutine abor1_sfx(YTEXT)
Definition: abor1_sfx.F90:6
subroutine latlon_conf_proj(PLAT0, PLON0, PRPK, PBETA, PLATOR, PLONOR, PX, PY, PLAT, PLON)
subroutine get_mesh_corner_conf_proj(KGRID_PAR, KL, KC, PGRID_PAR, PCORNER_LAT, PCORNER_LON)
subroutine get_gridtype_conf_proj(PGRID_PAR, PLAT0, PLON0, PRPK, PBETA, PLATOR, PLONOR, KIMAX, KJMAX, PX, PY, PDX, PDY, KL)