SURFEX v8.1
General documentation of Surfex
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(G,KL,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 USE modd_sfx_grid_n, ONLY : grid_t
43 !
44 USE yomhook ,ONLY : lhook, dr_hook
45 USE parkind1 ,ONLY : jprb
46 !
47 USE modi_abor1_sfx
48 !
49 USE modi_latlon_gridtype_cartesian
50 !
51 USE modi_latlon_gridtype_conf_proj
52 !
53 USE modi_latlon_gridtype_gauss
54 !
55 USE modi_latlon_gridtype_ign
56 !
57 USE modi_latlon_gridtype_lonlat_reg
58 !
59 USE modi_latlon_gridtype_lonlatval
60 !
61 USE modi_latlon_gridtype_lonlat_rot
62 IMPLICIT NONE
63 !
64 !* 0.1 Declarations of arguments
65 ! -------------------------
66 !
67 TYPE(grid_t), INTENT(INOUT) :: G
68 INTEGER, INTENT(IN) :: KL ! number of points
69 REAL, DIMENSION(:), INTENT(OUT), OPTIONAL :: PDIR ! direction of main grid Y axis (deg. from N, clockwise)
70 !
71 !* 0.2 Declarations of local variables
72 ! -------------------------------
73 !
74 REAL, DIMENSION(KL) :: ZDIR
75 REAL(KIND=JPRB) :: ZHOOK_HANDLE
76 !---------------------------------------------------------------------------
77 !
78 IF (lhook) CALL dr_hook('LATLON_GRID',0,zhook_handle)
79 SELECT CASE (g%CGRID)
80 !
81 !* 1. Conformal projection grid
82 ! -------------------------
83 !
84  CASE ('CONF PROJ ')
85  CALL latlon_gridtype_conf_proj(g,kl,zdir)
86  IF (PRESENT(pdir)) pdir = zdir
87  ! note that all points of the grid will be kept, whatever the surface
88  ! type under consideration (e.g. sea points will be kept even for
89  ! initialization of continents)
90  !
91 
92 !* 2. latitude/longitude grid
93 ! -----------------------
94 !
95  CASE ('LONLAT REG')
96  CALL latlon_gridtype_lonlat_reg(g,kl,zdir)
97  IF (PRESENT(pdir)) pdir = zdir
98 
99 !
100 !* 3. Cartesian grid
101 ! --------------
102 !
103  CASE ('CARTESIAN ')
104  CALL latlon_gridtype_cartesian(g,kl,zdir)
105  IF (PRESENT(pdir)) pdir = zdir
106  ! note that all points of the grid will be kept, whatever the surface
107  ! type under consideration (e.g. sea points will be kept even for
108  ! initialization of continents)
109  !
110 !* 4. gaussian grid
111 ! -------------
112 !
113  CASE ('GAUSS ')
114  CALL latlon_gridtype_gauss(g,kl,zdir)
115  IF (PRESENT(pdir)) pdir = zdir
116 !
117 !* 5. IGN grid
118 ! --------
119 !
120  CASE ('IGN ')
121  CALL latlon_gridtype_ign(g,kl,zdir)
122  IF (PRESENT(pdir)) pdir = zdir
123 !
124 !* 6. lonlatval grid
125 ! --------
126 !
127  CASE ('LONLATVAL ')
128  CALL latlon_gridtype_lonlatval(g,kl,zdir)
129  IF (PRESENT(pdir)) pdir = zdir
130 !
131 !* 7. Rotated lonlat grid
132 ! -------------------
133 !
134  CASE ('LONLAT ROT')
135  CALL latlon_gridtype_lonlat_rot(g,kl,zdir)
136  IF (PRESENT(pdir)) pdir = zdir
137 !
138 !
139  CASE DEFAULT
140  CALL abor1_sfx('LATLON_GRID: GRID TYPE NOT SUPPORTED '//g%CGRID)
141 
142 END SELECT
143 IF (lhook) CALL dr_hook('LATLON_GRID',1,zhook_handle)
144 !
145 !---------------------------------------------------------------------------
146 !
147 END SUBROUTINE latlon_grid
subroutine latlon_gridtype_gauss(G, KL, PDIR)
subroutine latlon_grid(G, KL, PDIR)
Definition: latlon_grid.F90:7
subroutine latlon_gridtype_lonlatval(G, KL, PDIR)
subroutine latlon_gridtype_ign(G, KL, PDIR)
subroutine abor1_sfx(YTEXT)
Definition: abor1_sfx.F90:7
integer, parameter jprb
Definition: parkind1.F90:32
subroutine latlon_gridtype_lonlat_reg(G, KL, PDIR)
logical lhook
Definition: yomhook.F90:15
subroutine latlon_gridtype_conf_proj(G, KL, PDIR)
subroutine latlon_gridtype_cartesian(G, KL, PDIR)
subroutine latlon_gridtype_lonlat_rot(G, KL, PDIR)