1C Copyright 1981-2016 ECMWF.
2C
3C This software is licensed under the terms of the Apache Licence
4C Version 2.0 which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
5C
6C In applying this licence, ECMWF does not waive the privileges and immunities
7C granted to it by virtue of its status as an intergovernmental organisation
8C nor does it submit to any jurisdiction.
9C
10
11      SUBROUTINE JNUMGG( KNUM, HTYPE, KPTS, KRET)
12C
13C---->
14C**** JNUMGG
15C
16C     PURPOSE
17C     _______
18C
19C     This routine returns the number of points in each latitude of
20C     a gaussian grid.
21C
22C
23C     INTERFACE
24C     _________
25C
26C     CALL JNUMGG( KNUM, HTYPE, KPTS, KRET)
27C
28C
29C     Input parameters
30C     ________________
31C
32C     KNUM     - Gaussian grid number
33C     HTYPE    - Gaussian grid type
34C                = 'R' for reduced ("quasi-regular"),
35C                = 'O' for reduced/octahedral,
36C                = 'F' for full,
37C                = 'U' for user-defined reduced gaussian grid
38C
39C
40C     Output parameters
41C     ________________
42C
43C     KPTS    - Array giving number of points at each gaussian latitude
44C               (both hemispheres)
45C     KRET     - Return status code
46C                0 = OK
47C
48C     Common block usage
49C     __________________
50C
51C     None.
52C
53C     Method
54C     ______
55C
56C     Simplified interface to JGETGG.
57C
58C
59C     Externals
60C     _________
61C
62C     JGETGG     - Get the gaussian grid definition.
63C     INTLOG   - Output log message
64C
65C
66C     Reference
67C     _________
68C
69C     None
70C
71C
72C     Comments
73C     ________
74C
75C     None
76C
77C
78C     AUTHOR
79C     ______
80C
81C     J.D.Chambers      *ECMWF*      Feb 1994
82C
83C
84C     MODIFICATIONS
85C     _____________
86C
87C     None.
88C
89C----<
90C
91      IMPLICIT NONE
92#include "jparams.h"
93#include "parim.h"
94C
95C     Subroutine arguments
96C
97      INTEGER KNUM, KPTS, KRET
98      CHARACTER*1 HTYPE
99      DIMENSION KPTS(*)
100C
101C     Parameters
102      INTEGER JPROUTINE
103      PARAMETER ( JPROUTINE = 30700 )
104C
105C     Local variables
106C
107      REAL ZLAT
108      DIMENSION ZLAT(JPMAX)
109C     _______________________________________________________
110C
111C*    Section 1.    Get the information.
112C     _______________________________________________________
113C
114  100 CONTINUE
115C
116      KRET = 0
117C
118C     Make sure local array is big enough for return values.
119C
120      IF( KNUM .GT. (JPMAX/2) ) THEN
121        CALL INTLOG(JP_ERROR,
122     X    'JNUMGG - Local array too small for return values.',JPMAX/2)
123        KRET = JPROUTINE + 1
124        GOTO 900
125      ENDIF
126C
127      CALL JGETGG(KNUM, HTYPE, ZLAT, KPTS, KRET)
128C
129C     _______________________________________________________
130C
131C*    Section 9. Return to calling routine. Format statements
132C     _______________________________________________________
133C
134 900  CONTINUE
135C
136      RETURN
137      END
138