;$Id$ pro bayes_sfc_type_2d, land_class, snow_class, sfc_type, sst_back_uni, lon,lat, sfc_emiss_375, sfc_type_mask print, 'STARTING sfc type definition' SHALLOW_OCEAN = 0 LAND = 1 COASTLINE = 2 SHALLOW_INLAND_WATER = 3 EPHEMERAL_WATER = 4 DEEP_INLAND_WATER = 5 MODERATE_OCEAN = 6 DEEP_OCEAN = 7 SNOW = 2 SEA_ICE = 3 nx = n_elements(land_class[*,0]) ny = n_elements(land_class[0,*]) sfc_type_mask = make_array(nx,ny,/BYTE,VALUE=0) for i = 0L, nx -1 do begin for j = 0L, ny -1 do begin ;--- default LAND/OCEAN values if (land_class[i,j] eq LAND) then begin sfc_type_mask[i,j] = 3 endif else begin sfc_type_mask[i,j] = 1 endelse ;--- #2 - Shallow Ocean if (land_class[i,j] eq MODERATE_OCEAN or $ land_class[i,j] eq DEEP_INLAND_WATER or $ land_class[i,j] eq SHALLOW_INLAND_WATER or $ land_class[i,j] eq SHALLOW_OCEAN) then begin sfc_type_mask[i,j] = 2 endif ;--- include into Shallow Ocean SST fronts if (land_class[i,j] ne LAND and $ sst_back_uni[i,j] gt 0.5) then begin sfc_type_mask[i,j] = 1 endif ;--- #3 Unfrozen Land if (land_class[i,j] eq LAND or $ land_class[i,j] eq COASTLINE or $ land_class[i,j] eq EPHEMERAL_WATER) then begin sfc_type_mask[i,j] = 3 endif ;--- #4 Frozen Land if (snow_class[i,j] eq SNOW and lat[i,j] gt -60.0) then begin sfc_type_mask[i,j] = 4 endif ;--- #5 - Arctic if (lat[i,j] gt 0 and snow_class[i,j] eq SEA_ICE) then begin sfc_type_mask[i,j] = 5 endif ;---- #6 - Antarctica if (lat[i,j] lt 0 and snow_class[i,j] eq SEA_ICE) then begin sfc_type_mask[i,j] = 6 endif if (lat[i,j] lt -60 and snow_class[i,j] eq SNOW) then begin sfc_type_mask[i,j] = 6 endif if (lat[i,j] gt 60 and lon[i,j] gt -75.0 and lon[i,j] lt -10 and $ (land_class[i,j] eq LAND or land_class[i,j] eq COASTLINE) and $ snow_class[i,j] eq SNOW) then begin sfc_type_mask[i,j] = 6 endif ;--- #7 Desert - subset of unfrozen land if (sfc_type_mask[i,j] eq 3 and abs(lat[i,j]) lt 60.0) then begin if(sfc_emiss_375[i,j] lt 0.93) then begin if(sfc_type[i,j] eq 8 or sfc_type[i,j] eq 9 or sfc_type[i,j] eq 10 or sfc_type[i,j] eq 12) then begin sfc_type_mask[i,j] = 7 endif endif endif endfor endfor end