OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
init_L1A_HDF_sdss.c
Go to the documentation of this file.
1 #include "L1A_prototype.h"
2 #include "PGS_MODIS_35005.h"
3 #include "mapi.h"
4 #include "PGS_SMF.h"
5 
6 
7 PGSt_SMF_status init_L1A_HDF_sdss ( MODFILE *L1A_file_ptr,
8  int16 nscans )
9 
10 /*
11 !C*****************************************************************************
12 
13 !Description: This function calls other procedures to create all of the SDSs
14  that will be written to by the L1A processing.
15 
16 !Input Parameters:
17  MODFILE *L1A_file_ptr ** Pointer to the L1A file **
18  int16 nscans ** Number of scans in this granule **
19 
20 !Output Parameters:
21  None
22 
23 Return Values:
24  MODIS_S_SUCCESS (PGS_MODIS_35005.h)
25  MODIS_E_SDS_CREATE_FAILED (PGS_MODIS_35005.h)
26 
27 Externally Defined:
28  None
29 
30 Called By:
31  create_L1A_granule
32 
33 Routines Called:
34  init_L1A_scan_meta_HDF_sdss
35  init_L1A_pix_qual_HDF_sdss
36  init_L1A_scan_data_HDF_sdss
37  log_fmt_msg
38 
39 !Revision History:
40  revision 1.0 1997/09/05 17:30:00
41  Qi Huang/RDC (qhuang@ltpmail.gsfc.nasa.gov)
42  Original development
43 
44 !Team-unique Header:
45  This software is developed by the MODIS Science
46  Data Support Team (SDST) for the National Aeronautics
47  and Space Administration (NASA), Goddard Space Flight
48  Center (GSFC), under contract NAS5-32373.
49 
50 !References and Credits:
51  None
52 
53 !Design Notes:
54  None
55 
56 !END***************************************************************************
57 */
58 {
59  /*****************************************************************************/
60  /* */
61  /* Define and Initialize Local Variables */
62  /* */
63  /*****************************************************************************/
64 
65  char *routine = "init_L1A_HDF_sdss";
66  PGSt_SMF_status returnStatus;
67 
68 
69  /*****************************************************************************/
70  /* */
71  /* Set returnStatus to MODIS_S_SUCCESS */
72  /* */
73  /*****************************************************************************/
74 
75  returnStatus = MODIS_S_SUCCESS;
76 
77 
78  /*****************************************************************************/
79  /* */
80  /* CALL init_L1A_scan_meta_HDF_sdss to create all of the SDSs for the Scan */
81  /* Level Metadata (section 2 of the MODIS Level 1A Data Product Format) */
82  /* INPUT: L1A_file_ptr, nscans */
83  /* OUTPUT: None */
84  /* RETURN: returnStatus */
85  /* */
86  /*****************************************************************************/
87 
88  returnStatus = init_L1A_scan_meta_HDF_sdss(L1A_file_ptr, nscans);
89 
90 
91  /*****************************************************************************/
92  /* */
93  /* IF returnStatus is not equal to MODIS_S_SUCCESS */
94  /* THEN */
95  /* CALL log_fmt_msg to report that not all of the Scan Level Metadata */
96  /* SDSs could be created */
97  /* INPUT: returnStatus, routine, msg */
98  /* OUTPUT: None */
99  /* RETURN: None */
100  /* ELSE */
101  /* */
102  /* CALL init_L1A_pix_qual_HDF_sdss to create all of the SDSs for the */
103  /* Pixel Quality Data (section 3 of the MODIS Level 1A Data Product */
104  /* Format) */
105  /* INPUT: L1A_file_ptr, nscans */
106  /* OUTPUT: None */
107  /* RETURN: returnStatus */
108  /* */
109  /* IF returnStatus is not equal to MODIS_S_SUCCESS */
110  /* THEN */
111  /* CALL log_fmt_msg to report that not all of the Pixel Quality Data */
112  /* SDSs could be created */
113  /* INPUT: returnStatus, routine, msg */
114  /* OUTPUT: None */
115  /* RETURN: None */
116  /* ELSE */
117  /* */
118  /* CALL init_L1A_scan_data_HDF_sdss to create all of the SDSs for the */
119  /* Scan Data (section 4 of the MODIS Level 1A Data Product Format) */
120  /* INPUT: L1A_file_ptr, nscans */
121  /* OUTPUT: None */
122  /* RETURN: returnStatus */
123  /* */
124  /* IF returnStatus is not equal to MODIS_S_SUCCESS */
125  /* THEN */
126  /* CALL log_fmt_msg to report that not all of the Scan Data SDSs */
127  /* could be created */
128  /* INPUT: returnStatus, routine, msg */
129  /* OUTPUT: None */
130  /* RETURN: None */
131  /* ENDIF */
132  /* ENDIF */
133  /* ENDIF */
134  /* */
135  /*****************************************************************************/
136 
137  if (returnStatus != MODIS_S_SUCCESS)
139  "Not all of the Scan Level Metadata SDSs could be created");
140  else
141  {
142  returnStatus = init_L1A_pix_qual_HDF_sdss(L1A_file_ptr, nscans);
143  if (returnStatus != MODIS_S_SUCCESS)
145  "Not all of the Pixel Quality Data SDSs could be created");
146  else
147  {
148  returnStatus = init_L1A_scan_data_HDF_sdss(L1A_file_ptr, nscans);
149  if (returnStatus != MODIS_S_SUCCESS)
151  "Not all of the Scan Data SDSs could be created");
152  }
153  }
154 
155  /*****************************************************************************/
156  /* */
157  /* RETURN returnStatus */
158  /* */
159  /*****************************************************************************/
160 
161  return (returnStatus);
162 }
integer, parameter int16
Definition: cubeio.f90:3
#define MODIS_E_SDS_CREATE_FAILED
void log_fmt_msg(PGSt_SMF_status code, const char *routine, const char *msg_fmt,...)
Definition: log_fmt_msg.c:6
PGSt_SMF_status init_L1A_scan_meta_HDF_sdss(MODFILE *mfile, int nscans)
PGSt_SMF_status init_L1A_pix_qual_HDF_sdss(MODFILE *mfile, int nscans)
PGSt_SMF_status init_L1A_scan_data_HDF_sdss(MODFILE *mfile, int nscans)
PGSt_SMF_status init_L1A_HDF_sdss(MODFILE *L1A_file_ptr, int16 nscans)
#define MODIS_S_SUCCESS