function [var, LON, LAT] = region(temp,lon,lat,dom_lon,dom_lat);
%[M1,I1] = min(abs(lon - dom_lon(1)));
%[M2,I2] = min(abs(lon - dom_lon(2)));
%ind_lon = [I1 I2];
%[M1,I1] = min(abs(lat - dom_lat(1)));
%[M2,I2] = min(abs(lat - dom_lat(2)));
%ind_lat = [I1 I2];

jj = find(lon>=dom_lon(1) & lon<=dom_lon(2));
ii = find(lat>=dom_lat(1) & lat<=dom_lat(2));

LON = lon(jj);
LAT = lat(ii);

s = size(temp);
if(length(s) == 3)
var = squeeze(temp(:,ii,jj));
elseif(length(s) == 4)
var = squeeze(temp(:,:,ii,jj));
end

