SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
latlon_gridtype_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 latlon_gridtype_lonlat_reg(KGRID_PAR,KL,PGRID_PAR,PLAT,PLON,PMESH_SIZE,PDIR)
7 ! #########################################################################
8 !
9 !!**** *LATLON_GRIDTYPE_LONLAT_REG* - 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, xradius
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 :: zlonmin ! minimum longitude (degrees)
66 REAL :: zlonmax ! maximum longitude (degrees)
67 REAL :: zlatmin ! minimum latitude (degrees)
68 REAL :: zlatmax ! maximum latitude (degrees)
69 INTEGER :: ilon ! number of points in longitude
70 INTEGER :: ilat ! number of points in latitude
71 !
72 REAL :: zdlat ! grid size in latitude unit
73 REAL :: zdlon ! grid size in longitude unit
74 REAL(KIND=JPRB) :: zhook_handle
75 !---------------------------------------------------------------------------
76 !
77 !* 1. Grid parameters
78 ! ---------------
79 !
80 IF (lhook) CALL dr_hook('LATLON_GRIDTYPE_LONLAT_REG',0,zhook_handle)
81  CALL get_gridtype_lonlat_reg(pgrid_par,zlonmin,zlonmax, &
82  zlatmin,zlatmax,ilon,ilat,plon=plon,plat=plat )
83 !
84 !-----------------------------------------------------------------------------
85 !
86 !* 2. Compute grid size
87 ! -----------------
88 !
89 zdlat = (zlatmax-zlatmin)/float(ilat)
90 zdlon = (zlonmax-zlonmin)/float(ilon)
91 !
92 pmesh_size(:) = xradius**2 * xpi/180.*(zdlon) &
93  * (sin((plat(:)+zdlat/2.)*xpi/180.)-sin((plat(:)-zdlat/2.)*xpi/180.))
94 !
95 !-----------------------------------------------------------------------------
96 !
97 !* 4. Direction of of grid from North for each grid point
98 ! ---------------------------------------------------
99 !
100 pdir(:) = 0.
101 IF (lhook) CALL dr_hook('LATLON_GRIDTYPE_LONLAT_REG',1,zhook_handle)
102 !
103 !---------------------------------------------------------------------------
104 !
105 END SUBROUTINE latlon_gridtype_lonlat_reg
106 
subroutine latlon_gridtype_lonlat_reg(KGRID_PAR, KL, PGRID_PAR, PLAT, PLON, PMESH_SIZE, PDIR)
subroutine get_gridtype_lonlat_reg(PGRID_PAR, PLONMIN, PLONMAX, PLATMIN, PLATMAX, KLON, KLAT, KL, PLON, PLAT)