/* !C ********************************************************************* !Description: Routine for filling in snow and ice information in coastal regions. For all coast pixels in the NISE data, search both latitudinally and longitudinally for non-coast pixels which indicate snow or ice. Stop search when non-snow/ice, non-coast pixels are found. For those coast pixels which have snow/ice pixels indicated on their boundaries, set flag to indicate snow/ice. !Input Parameters: h_index Hemisphere index; 1=NH, 2=NH map_nise Input/output snow/ice data grid (granule.h) xsize Size of gris in horizontal direction ysize Size of grid in vertical direction !Output Parameters: map_nise Input/output snow/ice data grid (granule.h) !Revision History: Original subroutine: 03-09-04 R. Frey 10-23-07 R. Frey converted to C !Team-Unique Header: !References and Credits: See Cloud Mask ATBD-MOD-06. !End ******************************************************************/ #include #include #include "granule.h" void massage_snowice(int h_index, int xsize, int ysize) { /* Declarations */ int k[4]; int row; int col; int m; long int idx; unsigned char nise_out; unsigned char *nise_in; unsigned char n; // printf("Entering massage_snowice \n"); // Set pointer to appropriate data. if(h_index == 1) { nise_in = g_nisenorth; } else { nise_in = g_nisesouth; } // Loop through map data. idx = 0; for ( row=0; row 25 && n < 102) ) { nise_out = 200; // printf("processing: %d %d %ld %d %d \n", row, col, idx, *(nise_in+idx), nise_out); } } } if (nise_out == 200) *(nise_in+idx) = nise_out; } idx++; } } }