SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
get_mesh_dim_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_mesh_dim_lonlat_rot(KGRID_PAR,KL,PGRID_PAR,PDX,PDY)
7 ! ##############################################################
8 !
9 !!**** *GET_MESH_DIM_LONLAT_ROT* get the grid mesh dimensions
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 !
35 USE modd_csts, ONLY : xpi, xradius
36 !
38 !
39 !
40 USE yomhook ,ONLY : lhook, dr_hook
41 USE parkind1 ,ONLY : jprb
42 !
43 IMPLICIT NONE
44 !
45 !* 0.1 Declaration of arguments
46 ! ------------------------
47 !
48 INTEGER, INTENT(IN) :: kgrid_par ! size of PGRID_PAR
49 INTEGER, INTENT(IN) :: kl ! number of points
50 REAL, DIMENSION(KGRID_PAR), INTENT(IN) :: pgrid_par ! grid parameters
51 REAL, DIMENSION(KL), INTENT(OUT) :: pdx ! dimension in x dir. (meters)
52 REAL, DIMENSION(KL), INTENT(OUT) :: pdy ! dimension in y dir. (meters)
53 !
54 !* 0.2 Declaration of other local variables
55 ! ------------------------------------
56 !
57 REAL, DIMENSION(KL) :: zlat ! rotated latitude
58 REAL :: zwest ! West longitude in rotated grid (degrees)
59 REAL :: zsouth ! South latitude in rotated grid (degrees)
60 REAL :: zdlon ! Longitudal grid spacing (degrees)
61 REAL :: zdlat ! Latitudal grid spacing (degrees)
62 REAL :: zpolon ! Longitude of rotated pole (degrees)
63 REAL :: zpolat ! Latitude of rotated pole (degrees)
64 INTEGER :: ilon ! number of points in longitude
65 INTEGER :: ilat ! number of points in latitude
66 INTEGER :: jlon, jlat, jl
67 REAL(KIND=JPRB) :: zhook_handle
68 
69 !----------------------------------------------------------------------------
70 !
71 !* 1. Get grid information
72 ! --------------------
73 !
74 IF (lhook) CALL dr_hook('GET_MESH_DIM_LONLAT_ROT',0,zhook_handle)
75 !
76  CALL get_gridtype_lonlat_rot(pgrid_par, &
77  zwest,zsouth,zdlon,zdlat,zpolon,zpolat, &
78  ilon,ilat )
79 !
80 !-----------------------------------------------------------------------------
81 !
82 !* 2. Compute grid size
83 ! -----------------
84 !
85 DO jlat=1,ilat
86  DO jlon=1,ilon
87  jl = jlon + ilon * (jlat-1)
88  zlat(jl) = zsouth + zdlat * (jlat-1)
89  END DO
90 END DO
91 !
92 pdx(:) = zdlon * (xpi / 180.) * xradius * cos(zlat(:)*xpi/180.)
93 pdy(:) = zdlat * (xpi / 180.) * xradius
94 IF (lhook) CALL dr_hook('GET_MESH_DIM_LONLAT_ROT',1,zhook_handle)
95 !
96 !-------------------------------------------------------------------------------
97 !
98 END SUBROUTINE get_mesh_dim_lonlat_rot
subroutine get_gridtype_lonlat_rot(PGRID_PAR, PWEST, PSOUTH, PDLON, PDLAT, PPOLON, PPOLAT, KLON, KLAT, KL, PLON, PLAT)
subroutine get_mesh_dim_lonlat_rot(KGRID_PAR, KL, PGRID_PAR, PDX, PDY)