function [basin,X,Y] = basin_CNN(longitude,latitude);
dx=360/length(longitude);
dy=abs(latitude(2)-latitude(1));
lon=longitude;
lat=min(latitude):dy:max(latitude);
[Y,X]=meshgrid(lat,lon);

z=10*ones(size(X));

z(near1(lon,30):near1(lon,100)-1,near1(lat,0):near1(lat,90))=1; % 1 for NIO
z(near1(lon,100):near1(lon,180)-1,near1(lat,0):near1(lat,90))=2; % 2 for WNP
z(near1(lon,180):near1(lon,260)-1,near1(lat,0):near1(lat,90))=3; % 3 for ENP
z(near1(lon,180):near1(lon,270)-1,near1(lat,0):near1(lat,18))=3; % 3 for ENP
z(near1(lon,180):near1(lon,278)-1,near1(lat,0):near1(lat,14))=3; % 3 for ENP
z(near1(lon,180):near1(lon,284)-1,near1(lat,0):near1(lat,8))=3; % 3 for ENP
z(near1(lon,30):near1(lon,135)-1,near1(lat,-90):near1(lat,0))=5; % 5 for SIO
z(near1(lon,135):near1(lon,295)-1,near1(lat,-90):near1(lat,0))=6; % 6 for SPO
z(near1(lon,295):near1(lon,360),near1(lat,-90):near1(lat,0))=7; % 7 for SAT
z(near1(lon,0):near1(lon,30)-1,near1(lat,-90):near1(lat,0))=7; % 7 for SAT
z(z==10)=4; % 4 for NAT

basin=z;

end


