SURFEX v8.1
General documentation of Surfex
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
real, save xradius
Definition: modd_csts.F90:54
subroutine gauss_grid_limits(KNLATI, KNLOPA, PXINF, PXSUP, PYINF, PYSUP)
real, save xpi
Definition: modd_csts.F90:43
integer, parameter jprb
Definition: parkind1.F90:32
logical lhook
Definition: yomhook.F90:15
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 get_mesh_dim_gauss(KGRID_PAR, KL, PGRID_PAR, PMESHSIZE, PDX
subroutine map_factor_gauss(PLAPO, PLOPO, PCODIL, PLAT, PLON, PMAP)