SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
latlon_grid.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_grid(HGRID,KGRID_PAR,KL,KLUOUT,PGRID_PAR,PLAT,PLON,PMESH_SIZE,PDIR)
7 ! #########################################################################
8 !
9 !!**** *LATLON_GRID* - 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 !! 10/2007 (E. Martin) IGN grids
36 !! 12/2012 (P. Samuelsson SMHI) Rotated lonlat
37 !-------------------------------------------------------------------------------
38 !
39 !* 0. DECLARATIONS
40 ! ------------
41 !
42 !
43 USE yomhook ,ONLY : lhook, dr_hook
44 USE parkind1 ,ONLY : jprb
45 !
46 USE modi_abor1_sfx
47 !
48 USE modi_latlon_gridtype_cartesian
49 !
50 USE modi_latlon_gridtype_conf_proj
51 !
52 USE modi_latlon_gridtype_gauss
53 !
54 USE modi_latlon_gridtype_ign
55 !
56 USE modi_latlon_gridtype_lonlat_reg
57 !
58 USE modi_latlon_gridtype_lonlatval
59 !
60 USE modi_latlon_gridtype_lonlat_rot
61 IMPLICIT NONE
62 !
63 !* 0.1 Declarations of arguments
64 ! -------------------------
65 !
66  CHARACTER(LEN=10), INTENT(IN) :: hgrid ! grid type
67 INTEGER, INTENT(IN) :: kgrid_par ! size of PGRID_PAR
68 INTEGER, INTENT(IN) :: kl ! number of points
69 INTEGER, INTENT(IN) :: kluout ! output listing logical unit
70 REAL, DIMENSION(:), INTENT(IN) :: pgrid_par ! parameters defining this grid
71 REAL, DIMENSION(:), INTENT(OUT) :: plat ! latitude (degrees)
72 REAL, DIMENSION(:), INTENT(OUT) :: plon ! longitude (degrees)
73 REAL, DIMENSION(:), INTENT(OUT) :: pmesh_size ! mesh size (m2)
74 REAL, DIMENSION(:), INTENT(OUT), OPTIONAL :: pdir ! direction of main grid Y axis (deg. from N, clockwise)
75 !
76 !* 0.2 Declarations of local variables
77 ! -------------------------------
78 !
79 REAL, DIMENSION(KL) :: zdir
80 REAL(KIND=JPRB) :: zhook_handle
81 !---------------------------------------------------------------------------
82 !
83 IF (lhook) CALL dr_hook('LATLON_GRID',0,zhook_handle)
84 SELECT CASE (hgrid)
85 !
86 !* 1. Conformal projection grid
87 ! -------------------------
88 !
89  CASE ('CONF PROJ ')
90  CALL latlon_gridtype_conf_proj(kgrid_par,kl,pgrid_par,plat,plon,pmesh_size,zdir)
91  IF (present(pdir)) pdir = zdir
92  ! note that all points of the grid will be kept, whatever the surface
93  ! type under consideration (e.g. sea points will be kept even for
94  ! initialization of continents)
95  !
96 
97 !* 2. latitude/longitude grid
98 ! -----------------------
99 !
100  CASE ('LONLAT REG')
101  CALL latlon_gridtype_lonlat_reg(kgrid_par,kl,pgrid_par,plat,plon,pmesh_size,zdir)
102  IF (present(pdir)) pdir = zdir
103 
104 !
105 !* 3. Cartesian grid
106 ! --------------
107 !
108  CASE ('CARTESIAN ')
109  CALL latlon_gridtype_cartesian(kgrid_par,kl,pgrid_par,plat,plon,pmesh_size,zdir)
110  IF (present(pdir)) pdir = zdir
111  ! note that all points of the grid will be kept, whatever the surface
112  ! type under consideration (e.g. sea points will be kept even for
113  ! initialization of continents)
114  !
115 !* 4. gaussian grid
116 ! -------------
117 !
118  CASE ('GAUSS ')
119  CALL latlon_gridtype_gauss(kgrid_par,kl,pgrid_par,plat,plon,pmesh_size,zdir)
120  IF (present(pdir)) pdir = zdir
121 !
122 !* 5. IGN grid
123 ! --------
124 !
125  CASE ('IGN ')
126  CALL latlon_gridtype_ign(kgrid_par,kl,pgrid_par,plat,plon,pmesh_size,zdir)
127  IF (present(pdir)) pdir = zdir
128 !
129 !* 6. lonlatval grid
130 ! --------
131 !
132  CASE ('LONLATVAL ')
133  CALL latlon_gridtype_lonlatval(kgrid_par,kl,pgrid_par,plat,plon,pmesh_size,zdir)
134  IF (present(pdir)) pdir = zdir
135 !
136 !* 7. Rotated lonlat grid
137 ! -------------------
138 !
139  CASE ('LONLAT ROT')
140  CALL latlon_gridtype_lonlat_rot(kgrid_par,kl,pgrid_par,plat,plon,pmesh_size,zdir)
141  IF (present(pdir)) pdir = zdir
142 !
143 !
144  CASE default
145  CALL abor1_sfx('LATLON_GRID: GRID TYPE NOT SUPPORTED '//hgrid)
146 
147 END SELECT
148 IF (lhook) CALL dr_hook('LATLON_GRID',1,zhook_handle)
149 !
150 !---------------------------------------------------------------------------
151 !
152 END SUBROUTINE latlon_grid
subroutine latlon_gridtype_gauss(KGRID_PAR, KL, PGRID_PAR, PLAT, PLON, PMESH_SIZE, PDIR)
subroutine latlon_grid(HGRID, KGRID_PAR, KL, KLUOUT, PGRID_PAR, PLAT, PLON, PMESH_SIZE, PDIR)
Definition: latlon_grid.F90:6
subroutine latlon_gridtype_conf_proj(KGRID_PAR, KL, PGRID_PAR, PLAT, PLON, PMESH_SIZE, PDIR)
subroutine latlon_gridtype_ign(KGRID_PAR, KL, PGRID_PAR, PLAT, PLON, PMESH_SIZE, PDIR)
subroutine abor1_sfx(YTEXT)
Definition: abor1_sfx.F90:6
subroutine latlon_gridtype_cartesian(KGRID_PAR, KL, PGRID_PAR, PLAT, PLON, PMESH_SIZE, PDIR)
subroutine latlon_gridtype_lonlatval(KGRID_PAR, KL, PGRID_PAR, PLAT, PLON, PMESH_SIZE, PDIR)
subroutine latlon_gridtype_lonlat_rot(KGRID_PAR, KL, PGRID_PAR, PLAT, PLON, PMESH_SIZE, PDIR)
subroutine latlon_gridtype_lonlat_reg(KGRID_PAR, KL, PGRID_PAR, PLAT, PLON, PMESH_SIZE, PDIR)