source: trunk/WRF.COMMON/WRFV2/external/io_grib1/MEL_grib1/init_dec_struct.c

Last change on this file was 11, checked in by aslmd, 14 years ago

spiga@svn-planeto:ajoute le modele meso-echelle martien

File size: 2.2 KB
Line 
1/* FILENAME:   init_dec_struct.c
2   DATE:         05 FEB 1996
3   PROGRAMMER:   STEVE LOWE, SAIC
4   Revisions:
5   17apr96 Alice Nakajima, SAIC: added BMS initialization
6   11jun96 Nakajima: replaced with Memset
7   10oct96 Nakajima: renamed from init_struct() to init_dec_struct()
8*/
9#include <stdio.h>
10#include <stdlib.h>
11#include <string.h>
12#include "dprints.h"    /* for dprints */
13#include "gribfuncs.h"          /* prototypes */
14
15/*
16*
17*
18*************************************************************************
19* A. FUNCTION:  init_dec_struct
20*       initializes the four internal Decoder structures
21*   
22*    INTERFACE:
23*       void init_dec_struct ( pds, gds, bms, bds_head)
24*
25*    ARGUMENTS (I=input, O=output, I&O=input and output):
26*      (O)  PDS_INPUT      *pds;      internal PDS struct to be initialized
27*      (O)  grid_desc_sec  *gds;      internal GDS struct to be initialized
28*      (O)  BMS_INPUT      *bms;      internal BMS struct to be initialized
29*      (O)  BDS_HEAD_INPUT *bds_head; internal BDS struct to be initialized
30*
31*    RETURN CODE:  none
32*************************************************************************
33*/
34#if PROTOTYPE_NEEDED
35void init_dec_struct (  PDS_INPUT      *pds, grid_desc_sec  *gds,
36                        BMS_INPUT      *bms, BDS_HEAD_INPUT *bds_head)
37#else
38void init_dec_struct (pds,gds,bms,bds_head)
39        PDS_INPUT      *pds;
40        grid_desc_sec  *gds;
41        BMS_INPUT      *bms;
42        BDS_HEAD_INPUT *bds_head;
43#endif
44{
45/*
46*
47* A.0       DEBUG printing
48*/
49  DPRINT0 ("Inside init_dec_struct()\n");
50
51/*
52*
53* A.1       INITIALIZE Product Description Section struct elements
54*/
55  memset ((void *)pds, '\0', sizeof(PDS_INPUT)); 
56
57/*
58*
59* A.2       INITIALIZE Grid Description Section struct elements
60*
61* A.3       INITIALIZE Bitmap Map Section  header struct elements to zero
62*
63* A.4       INITIALIZE Binary Data Section Header Struct elements  to zero
64*/
65  memset ((void *)gds, '\0', sizeof(grid_desc_sec)); 
66  gds->head.usData_type = 255;
67  memset ((void *)bms, '\0', sizeof(BMS_INPUT));
68  memset ((void *)bds_head, '\0', sizeof(BDS_HEAD_INPUT));
69
70/*
71*
72* A.5       DEBUG printing
73*/
74  DPRINT0("Leaving init_dec_struct(), no return code\n");
75/*
76* END OF FUNCTION
77*/
78}
Note: See TracBrowser for help on using the repository browser.