SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
get_mesh_dim_gauss.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_gauss(KGRID_PAR,KL,PGRID_PAR,PMESHSIZE,PDX,PDY)
7 ! ##############################################################
8 !
9 !!**** *GET_MESH_DIM_GAUSS* 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(IN) :: pmeshsize ! mesh size (m2)
52 REAL, DIMENSION(KL), INTENT(OUT) :: pdx ! mean dimension in x dir. (meters)
53 REAL, DIMENSION(KL), INTENT(OUT) :: pdy ! mean dimension in y dir. (meters)
54 !
55 !* 0.2 Declaration of other local variables
56 ! ------------------------------------
57 !
58 INTEGER :: inlati ! number of pseudo-latitudes
59 REAL :: zlapo ! latitude of the rotated pole (deg)
60 REAL :: zlopo ! longitude of the rotated pole (deg)
61 REAL :: zcodil ! stretching factor (must be greater than or equal to 1)
62 INTEGER, DIMENSION(:), ALLOCATABLE :: inlopa ! number of pseudo-longitudes on each
63  ! pseudo-latitude circle
64 REAL, DIMENSION(KL) :: zlat ! latitudes
65 REAL, DIMENSION(KL) :: zlon ! longitudes
66 REAL, DIMENSION(KL) :: zxinf ! minimum pseudo longitude of the grid point (deg)
67 REAL, DIMENSION(KL) :: zxsup ! maximum pseudo longitude of the grid point (deg)
68 REAL, DIMENSION(KL) :: zyinf ! minimum pseudo latitude of the grid point (deg)
69 REAL, DIMENSION(KL) :: zysup ! maximum pseudo latitude of the grid point (deg)
70 REAL, DIMENSION(KL) :: zmap ! map factor
71 REAL(KIND=JPRB) :: zhook_handle
72 !
73 !----------------------------------------------------------------------------
74 !
75 !* 1. Gets grid definition
76 ! --------------------
77 !
78 IF (lhook) CALL dr_hook('GET_MESH_DIM_GAUSS',0,zhook_handle)
79  CALL get_gridtype_gauss(pgrid_par,inlati)
80 !
81 ALLOCATE(inlopa(inlati))
82  CALL get_gridtype_gauss(pgrid_par,inlati,zlapo,zlopo,zcodil,inlopa(:),plat=zlat,plon=zlon)
83 !
84 !---------------------------------------------------------------------------
85 !
86 !* 2. Computation of pseudo latitude and pseudo longitude limits for each mesh
87 ! ------------------------------------------------------------------------
88 !
89  CALL gauss_grid_limits(inlati,inlopa,zxinf,zxsup,zyinf,zysup)
90 !
91 !-----------------------------------------------------------------------------
92 !
93 !* 3. Map factor
94 ! ----------
95 !
96  CALL map_factor_gauss(zlapo,zlopo,zcodil,zlat,zlon,zmap)
97 !
98 !-----------------------------------------------------------------------------
99 !
100 !* 4. Compute mean grid dimension in each direction
101 ! ---------------------------------------------
102 !
103 pdy(:) = xradius * xpi/180. * (zysup(:)-zyinf(:)) * zmap(:)
104 pdx(:) = pmeshsize(:) / pdy(:)
105 !
106 !-------------------------------------------------------------------------------
107 !
108 DEALLOCATE(inlopa)
109 IF (lhook) CALL dr_hook('GET_MESH_DIM_GAUSS',1,zhook_handle)
110 !
111 !-------------------------------------------------------------------------------
112 !
113 END SUBROUTINE get_mesh_dim_gauss
subroutine get_mesh_dim_gauss(KGRID_PAR, KL, PGRID_PAR, PMESHSIZE, PDX, PDY)
subroutine get_gridtype_gauss(PGRID_PAR, KNLATI, PLAPO, PLOPO, PCODIL, KNLOPA, KL, PLAT, PLON, PLAT_XY, PLON_XY, PMESH_SIZE, PLONINF, PLATINF, PLONSUP, PLATSUP)
subroutine gauss_grid_limits(KNLATI, KNLOPA, PXINF, PXSUP, PYINF, PYSUP)
subroutine map_factor_gauss(PLAPO, PLOPO, PCODIL, PLAT, PLON, PMAP)