OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
GEO_find_next_flag.c
Go to the documentation of this file.
1 /* file: GEO_find_next_flag.c */
2 
3 #include "GEO_geo.h"
4 #include "GEO_validation.h"
5 
7  int sample_flags[],
8  int const number_of_samples,
9  int const start_sample
10  )
11 {
12 /*
13 !C*****************************************************************************
14 !Description:
15  Routine in Validation group of the Level-1A geolocation
16  software to find the next unflagged sample in a flag array.
17 
18 !Input Parameters:
19  int sample_flags [] - array of flags for data samples
20  int number_of_samples - array size
21  int start_sample - start index for search
22 
23 !Output Parameters:
24 
25 Return parameter:
26  int - index of next unflagged value if found, or
27  FAIL if end of array reached.
28 
29 Global variables:
30  None
31 
32 Call functions:
33  None
34 
35 !Revision History:
36  $Log: GEO_find_next_flag.c,v $
37  Revision 1.6 1997/07/21 16:24:34 kuyper
38  Baselined Version 1
39 
40  * Revision 1.6 1997/03/26 18:04:07 fhliang
41  * Initial revision of SDST delivery of GEO_find_next_flag.c.
42  *
43  Revision 1.5 1996/07/29 14:54:25 kuyper
44  Used GOOD_DATA for flags, rather than SUCCESS (value unchanged).
45 
46  Revision 1.4 1996/07/24 21:00:34 kuyper
47  Declared arguments const.
48 
49  Revision 1.3 1996/07/23 23:02:03 kuyper
50  Inserted required '!' in comments.
51 
52  Revision 1.2 1996/07/18 16:24:14 kuyper
53  Included self-checking header file.
54 
55 
56  6/15/95
57  Frederick S. Patt (patt@modis-xl.gsfc.nasa.gov)
58  Finished coding.
59 
60 !Team-unique Header:
61  This software is developed by the MODIS Science Data Support
62  Team for the National Aeronautics and Space Administration,
63  Goddard Space Flight Center, under contract NAS5-32373.
64 
65 !END*************************************************************************
66 */
67 
68  /* Local variable declarations */
69 
70  int ind = 0; /* index */
71 
72 
73  /* Begin program logic */
74 
75  ind = start_sample;
76  for (ind = start_sample; ind < number_of_samples; ind++) {
77  if (sample_flags[ind] == GOOD_DATA)
78  return ind;
79  }
80 
81  return FAIL;
82 }
83 
84 
85 
#define FAIL
Definition: ObpgReadGrid.h:18
const int GOOD_DATA
int GEO_find_next_flag(int sample_flags[], int const number_of_samples, int const start_sample)