SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
get_mesh_dim_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_dim_lonlat_reg(KGRID_PAR,KL,PGRID_PAR,PDX,PDY)
7 ! ##############################################################
8 !
9 !!**** *GET_MESH_DIM_LONLAT_REG* get the grid mesh dimensions
10 !!
11 !! PURPOSE
12 !! -------
13 !!
14 !! METHOD
15 !! ------
16 !!
17 !! REFERENCE
18 !! ---------
19 !!
20 !! AUTHOR
21 !! ------
22 !!
23 !! V. Masson Meteo-France
24 !!
25 !! MODIFICATION
26 !! ------------
27 !!
28 !! Original 03/2004
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 ! latitude
58 REAL, DIMENSION(KL) :: zlon ! longitude
59 REAL :: zlonmin ! minimum longitude (degrees)
60 REAL :: zlonmax ! maximum longitude (degrees)
61 REAL :: zlatmin ! minimum latitude (degrees)
62 REAL :: zlatmax ! maximum latitude (degrees)
63 INTEGER :: ilon ! number of points in longitude
64 INTEGER :: ilat ! number of points in latitude
65 REAL(KIND=JPRB) :: zhook_handle
66 
67 !----------------------------------------------------------------------------
68 !
69 !* 1. Get grid information
70 ! --------------------
71 !
72 IF (lhook) CALL dr_hook('GET_MESH_DIM_LONLAT_REG',0,zhook_handle)
73  CALL get_gridtype_lonlat_reg(pgrid_par,zlonmin,zlonmax, &
74  zlatmin,zlatmax,ilon,ilat,plon=zlon,plat=zlat )
75 !
76 !-----------------------------------------------------------------------------
77 !
78 !* 2. Compute grid size
79 ! -----------------
80 !
81 pdx(:) = (zlonmax-zlonmin)/float(ilon) * (xpi / 180.) * xradius * cos(zlat(:)*xpi/180.)
82 pdy(:) = (zlatmax-zlatmin)/float(ilat) * (xpi / 180.) * xradius
83 IF (lhook) CALL dr_hook('GET_MESH_DIM_LONLAT_REG',1,zhook_handle)
84 !
85 !-------------------------------------------------------------------------------
86 !
87 END SUBROUTINE get_mesh_dim_lonlat_reg
subroutine get_mesh_dim_lonlat_reg(KGRID_PAR, KL, PGRID_PAR, PDX, PDY)
subroutine get_gridtype_lonlat_reg(PGRID_PAR, PLONMIN, PLONMAX, PLATMIN, PLATMAX, KLON, KLAT, KL, PLON, PLAT)