OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
get_ice_frac.c
Go to the documentation of this file.
1 /* --------------------------------------------------------------- */
2 /* get_ice_frac.c - dump the ice fraction ancillary data */
3 /* */
4 /* Inputs: */
5 /* l2rec - level-2 structure containing one complete scan */
6 /* after atmospheric correction. */
7 /* */
8 /* Outputs: */
9 /* ice - array where ice data is written */
10 /* */
11 /* Written By: Don Shea, OBPG, 23 Apr 2009 */
12 /* */
13 /* --------------------------------------------------------------- */
14 
15 #include "l12_proto.h"
16 
17 void get_ice_frac(l2str *l2rec, float ice[]) {
18  int32_t ip;
19  l1str *l1rec = l2rec->l1rec;
20 
21 /* WDR make current set-up so that the proc_cloud ice will not be blocked over land */
22  for (ip = 0; ip < l1rec->npix; ip++) {
23  if( input->proc_cloud ) {
24  ice[ip] = l1rec->icefr[ip];
25  } else {
26  if (l1rec->flags[ip] & LAND) {
27  ice[ip] = 0.0;
28  } else {
29  ice[ip] = ice_fraction(l1rec->lon[ip], l1rec->lat[ip]);
30  }
31  }
32  }
33 
34 }
35 
read l1rec
instr * input
void get_ice_frac(l2str *l2rec, float ice[])
Definition: get_ice_frac.c:17
#define LAND
Definition: l2_flags.h:12
float ice_fraction(float lon, float lat)
Definition: ice_mask.c:1018