ungrib build
[WPS.git] / ungrib / src / ngl / w3 / lengds.f
blob051aed69f2d48fddb5441393b086b4641a8f3914
1 C-----------------------------------------------------------------------
2 FUNCTION LENGDS(KGDS)
3 C$$$ SUBPROGRAM DOCUMENTATION BLOCK
5 C SUBPROGRAM: LENGDS RETURN THE LENGTH OF A GRID
6 C PRGMMR: IREDELL ORG: W/NMC23 DATE: 96-07-19
8 C ABSTRACT: GIVEN A GRID DESCRIPTION SECTION (IN W3FI63 FORMAT),
9 C RETURN ITS SIZE IN TERMS OF NUMBER OF DATA POINTS.
11 C PROGRAM HISTORY LOG:
12 C 96-07-19 IREDELL
14 C USAGE: CALL LENGDS(KGDS)
15 C INPUT ARGUMENTS:
16 C KGDS INTEGER (200) GDS PARAMETERS IN W3FI63 FORMAT
17 C OUTPUT ARGUMENTS:
18 C LENGDS INTEGER SIZE OF GRID
20 C ATTRIBUTES:
21 C LANGUAGE: FORTRAN
23 C$$$
24 INTEGER KGDS(200)
25 C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
26 C SPECIAL CASE OF STAGGERED ETA
27 IF(KGDS(1).EQ.201) THEN
28 LENGDS=KGDS(7)*KGDS(8)-KGDS(8)/2
29 C SPECIAL CASE OF FILLED ETA
30 ELSEIF(KGDS(1).EQ.202) THEN
31 LENGDS=KGDS(7)*KGDS(8)
32 C SPECIAL CASE OF THINNED WAFS
33 ELSEIF(KGDS(19).EQ.0.AND.KGDS(20).NE.255) THEN
34 LENGDS=KGDS(21)
35 C GENERAL CASE
36 ELSE
37 LENGDS=KGDS(2)*KGDS(3)
38 ENDIF
39 C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
40 END