SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
get_mesh_corner_lonlat_reg.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_lonlat_reg(KGRID_PAR,KL,KC,PGRID_PAR,PCORNER_LAT,PCORNER_LON)
7 ! ###############################################################
8 !
9 !!**** *GET_MESH_CORNER_LONLAT_REG* 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 :: ilat ! Number of lattitude
52 INTEGER :: ilon ! Number of longitude
53 INTEGER :: ini ! Number of point
54 REAL :: zlonmin ! minimum longitude (degrees)
55 REAL :: zlonmax ! maximum longitude (degrees)
56 REAL :: zlatmin ! minimum latitude (degrees)
57 REAL :: zlatmax ! maximum latitude (degrees)
58 REAL :: zdlon ! longitude grid size
59 REAL :: zdlat ! latitude grid size
60 REAL, DIMENSION(KL) :: zlon ! longitude grid
61 REAL, DIMENSION(KL) :: zlat ! latitude grid
62 !
63 REAL(KIND=JPRB) :: zhook_handle
64 !
65 !----------------------------------------------------------------------------
66 !
67 IF (lhook) CALL dr_hook('GET_MESH_CORNER_LONLAT_REG',0,zhook_handle)
68 !
69 !* 1. Uncode parameters of the grid
70 ! -----------------------------
71 !
72  CALL get_gridtype_lonlat_reg(pgrid_par,zlonmin,zlonmax,zlatmin,zlatmax,ilon,ilat,ini)
73 !
74 IF(kl/=ini)THEN
75  CALL abor1_sfx('GET_MESH_CORNER_LONLAT_REG: WRONG NUMBER OF POINT')
76 ENDIF
77 !
78  CALL get_gridtype_lonlat_reg(pgrid_par,plon=zlon,plat=zlat)
79 !
80 zdlon = (zlonmax-zlonmin) / float(ilon)
81 zdlat = (zlatmax-zlatmin) / float(ilat)
82 !
83 !
84 !* 2. grid cell corner (counterclockwise sense)
85 ! -----------------------------------------
86 !
87 ! 4_______3
88 ! | |
89 ! | . |
90 ! | |
91 ! |_______|
92 ! 1 2
93 !
94 !
95 pcorner_lon(:,1) = zlon(:)-zdlon/2.
96 pcorner_lat(:,1) = zlat(:)-zdlat/2.
97 !
98 pcorner_lon(:,3) = zlon(:)+zdlon/2.
99 pcorner_lat(:,3) = zlat(:)+zdlat/2.
100 !
101 pcorner_lon(:,2) = pcorner_lon(:,3)
102 pcorner_lat(:,2) = pcorner_lat(:,1)
103 !
104 pcorner_lon(:,4) = pcorner_lon(:,1)
105 pcorner_lat(:,4) = pcorner_lat(:,3)
106 !
107 IF (lhook) CALL dr_hook('GET_MESH_CORNER_LONLAT_REG',1,zhook_handle)
108 !
109 !-------------------------------------------------------------------------------
110 !
111 END SUBROUTINE get_mesh_corner_lonlat_reg
subroutine abor1_sfx(YTEXT)
Definition: abor1_sfx.F90:6
subroutine get_mesh_corner_lonlat_reg(KGRID_PAR, KL, KC, PGRID_PAR, PCORNER_LAT, PCORNER_LON)
subroutine get_gridtype_lonlat_reg(PGRID_PAR, PLONMIN, PLONMAX, PLATMIN, PLATMAX, KLON, KLAT, KL, PLON, PLAT)