SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
latlon_gridtype_cartesian.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 latlon_gridtype_cartesian(KGRID_PAR,KL,PGRID_PAR,PLAT,PLON,PMESH_SIZE,PDIR)
7 ! #########################################################################
8 !
9 !!**** *LATLON_GRIDTYPE_CARTESIAN* - routine to compute the horizontal geographic fields
10 !!
11 !! PURPOSE
12 !! -------
13 !!
14 !!** METHOD
15 !! ------
16 !!
17 !! EXTERNAL
18 !! --------
19 !!
20 !!
21 !! IMPLICIT ARGUMENTS
22 !! ------------------
23 !!
24 !! REFERENCE
25 !! ---------
26 !!
27 !!
28 !! AUTHOR
29 !! ------
30 !! V. Masson *Meteo France*
31 !!
32 !! MODIFICATIONS
33 !! -------------
34 !! Original 01/2004
35 !-------------------------------------------------------------------------------
36 !
37 !* 0. DECLARATIONS
38 ! ------------
39 !
40 USE modd_csts, ONLY : xpi
41 !
43 !
44 !
45 !
46 USE yomhook ,ONLY : lhook, dr_hook
47 USE parkind1 ,ONLY : jprb
48 !
49 IMPLICIT NONE
50 !
51 !* 0.1 Declarations of arguments
52 ! -------------------------
53 !
54 INTEGER, INTENT(IN) :: kgrid_par ! size of PGRID_PAR
55 INTEGER, INTENT(IN) :: kl ! number of points
56 REAL, DIMENSION(KGRID_PAR), INTENT(IN) :: pgrid_par ! parameters defining this grid
57 REAL, DIMENSION(KL), INTENT(OUT) :: plat ! latitude (degrees)
58 REAL, DIMENSION(KL), INTENT(OUT) :: plon ! longitude (degrees)
59 REAL, DIMENSION(KL), INTENT(OUT) :: pmesh_size ! mesh size (m2)
60 REAL, DIMENSION(KL), INTENT(OUT) :: pdir ! direction of main grid Y axis (deg. from N, clockwise)
61 !
62 !* 0.2 Declarations of local variables
63 ! -------------------------------
64 !
65 REAL :: zlat0 ! reference latitude
66 REAL :: zlon0 ! reference longitude
67 REAL, DIMENSION(:), ALLOCATABLE :: zdx ! size in X conformal coordinate
68 REAL, DIMENSION(:), ALLOCATABLE :: zdy ! size in Y conformal coordinate
69 REAL(KIND=JPRB) :: zhook_handle
70 !
71 !---------------------------------------------------------------------------
72 !
73 !* 1. Projection and 2D grid parameters
74 ! ---------------------------------
75 !
76 IF (lhook) CALL dr_hook('LATLON_GRIDTYPE_CARTESIAN',0,zhook_handle)
77 ALLOCATE(zdx(SIZE(plat)))
78 ALLOCATE(zdy(SIZE(plat)))
79 !
80  CALL get_gridtype_cartesian(pgrid_par,zlat0,zlon0, &
81  pdx=zdx,pdy=zdy )
82 !
83 !---------------------------------------------------------------------------
84 !
85 !* 2. Computation of latitude and longitude
86 ! -------------------------------------
87 !
88  CALL latlon_cartesian(zlat0,zlon0,plat,plon)
89 !
90 !-----------------------------------------------------------------------------
91 !
92 !* 3. Compute grid size (2D array)
93 ! -----------------
94 !
95 pmesh_size(:) = zdx(:) * zdy(:)
96 !
97 !-----------------------------------------------------------------------------
98 !
99 !* 4. Direction of Y axis (from North) for each grid point
100 ! ----------------------------------------------------
101 !
102 pdir(:) = 0.
103 !
104 !---------------------------------------------------------------------------
105 DEALLOCATE(zdx)
106 DEALLOCATE(zdy)
107 IF (lhook) CALL dr_hook('LATLON_GRIDTYPE_CARTESIAN',1,zhook_handle)
108 !---------------------------------------------------------------------------
109 !
110 END SUBROUTINE latlon_gridtype_cartesian
111 
subroutine latlon_gridtype_cartesian(KGRID_PAR, KL, PGRID_PAR, PLAT, PLON, PMESH_SIZE, PDIR)
subroutine latlon_cartesian(PLAT0, PLON0, PLAT, PLON)
subroutine get_gridtype_cartesian(PGRID_PAR, PLAT0, PLON0, KIMAX, KJMAX, PX, PY, PDX, PDY, KL)