SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
get_adj_mes_lonlat_rot.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_adj_mes_lonlat_rot(KGRID_PAR,KL,PGRID_PAR,KLEFT,KRIGHT,KTOP,KBOTTOM)
7 ! ##############################################################
8 !
9 !!**** *GET_ADJ_MES_LONLAT_ROT* get the near grid mesh indices
10 !!
11 !! PURPOSE
12 !! -------
13 !!
14 !! METHOD
15 !! ------
16 !!
17 !! REFERENCE
18 !! ---------
19 !!
20 !! AUTHOR
21 !! ------
22 !!
23 !! P. Samuelsson SMHI
24 !!
25 !! MODIFICATION
26 !! ------------
27 !!
28 !! Original 12/2012
29 !!
30 !----------------------------------------------------------------------------
31 !
32 !* 0. DECLARATION
33 ! -----------
34 !
36 !
37 !
38 USE yomhook ,ONLY : lhook, dr_hook
39 USE parkind1 ,ONLY : jprb
40 !
41 IMPLICIT NONE
42 !
43 !* 0.1 Declaration of arguments
44 ! ------------------------
45 !
46 INTEGER, INTENT(IN) :: kgrid_par ! size of PGRID_PAR
47 INTEGER, INTENT(IN) :: kl ! number of points
48 REAL, DIMENSION(KGRID_PAR), INTENT(IN) :: pgrid_par ! grid parameters
49 INTEGER, DIMENSION(KL), INTENT(OUT) :: kleft ! left mesh index
50 INTEGER, DIMENSION(KL), INTENT(OUT) :: kright ! right mesh index
51 INTEGER, DIMENSION(KL), INTENT(OUT) :: ktop ! top mesh index
52 INTEGER, DIMENSION(KL), INTENT(OUT) :: kbottom ! bottom mesh index
53 !
54 !* 0.2 Declaration of other local variables
55 ! ------------------------------------
56 !
57 INTEGER :: ilon ! number of points in longitude
58 INTEGER :: ilat ! number of points in latitude
59 INTEGER :: jlat, jlon
60 INTEGER :: jl
61 REAL(KIND=JPRB) :: zhook_handle
62 !----------------------------------------------------------------------------
63 !
64 IF (lhook) CALL dr_hook('GET_ADJ_MES_LONLAT_ROT',0,zhook_handle)
65  CALL get_gridtype_lonlat_rot(pgrid_par, &
66  klon=ilon,klat=ilat )
67 !
68 kleft(:) = 0
69 kright(:) = 0
70 ktop(:) = 0
71 kbottom(:) = 0
72 !
73 IF (ilon*ilat==kl) THEN
74  DO jlat=1,ilat
75  DO jlon=1,ilon
76  jl = jlon + ilon * (jlat-1)
77  IF (jlon>1 ) kleft(jl) = jl-1
78  IF (jlon<ilon) kright(jl) = jl+1
79  IF (jlat>1 ) kbottom(jl) = jl-ilon
80  IF (jlat<ilat) ktop(jl) = jl+ilon
81  END DO
82  END DO
83 END IF
84 IF (lhook) CALL dr_hook('GET_ADJ_MES_LONLAT_ROT',1,zhook_handle)
85 !
86 !-------------------------------------------------------------------------------
87 !
88 END SUBROUTINE get_adj_mes_lonlat_rot
subroutine get_gridtype_lonlat_rot(PGRID_PAR, PWEST, PSOUTH, PDLON, PDLAT, PPOLON, PPOLAT, KLON, KLAT, KL, PLON, PLAT)
subroutine get_adj_mes_lonlat_rot(KGRID_PAR, KL, PGRID_PAR, KLEFT, KRIGHT, KTOP, KBOTTOM)