function mapGLOBAL(X,Y,Z,f)
% X=X(:,1:2:end);
% Y=Y(:,1:2:end);
% Z=S;

%[X,Y]=meshgrid(-180:180,-90:-30);
% Y=flipud(Y);
% Z=nan(size(Y));

% Load Colormaps
%addpath(genpath('/Volumes/palisade/scripts/MATLABfunctions/functions'));
% load('MyColormapCorr.mat');
% barracolor=corrbluelightwred;
load('MyColormapCorr_new.mat');
barracolor=bluelightwred;
mini=nanmin(nanmin(Z));
maxi=nanmax(nanmax(Z));

if f==1
% Load Orsis' fronts
% % cd /Volumes/apricot/mcarranza_data_apricot/correlaciones/OrsisFronts/Archive
% % cd ~/mcarranza_data_apricot/correlaciones/OrsisFronts/Archive
% cd /Users/Mau/Documents/correlaciones/apricot/OrsisFronts/Archive
% % cd /home/m2carranza/MATLABfunctions/OrsisFronts/Archive
PF=load(['/Users/Mau/Documents/MATLABhelp_new/OrsisFronts/Archive/','pf.txt']);
STF=load(['/Users/Mau/Documents/MATLABhelp_new/OrsisFronts/Archive/','stf.txt']);
SAF=load(['/Users/Mau/Documents/MATLABhelp_new/OrsisFronts/Archive/','saf.txt']);
SACCF=importdata(['/Users/Mau/Documents/MATLABhelp_new/OrsisFronts/Archive/','Orsi_SACCF.txt']);
SB=importdata(['/Users/Mau/Documents/MATLABhelp_new/OrsisFronts/','Orsi_SBoundary.txt']);
% cd /Users/Mau/Documents/correlaciones/apricot
% cd ..
end
% m_quiver(X(1:10:end,1:20:end),Y(1:10:end,1:20:end),U(1:10:end,1:20:end),V(1:10:end,1:20:end),'k');
%% Colors Frentes Orsi

% Dark grey line:
   colPF  = [0.2 0.2 0.2];
   colSAF = [0.2 0.2 0.2];
   colSTF = [0.2 0.2 0.2];%[0.99 1 1];
   colSACCF = [0.2 0.2 0.2];%[0.99 1 1];
   colSB = [0.2 0.2 0.2];%[0.99 1 1];
   coldots= [0 0 0];%[0 0 0];%[0.6 0.6 0.6];
   
% % white lines:   
%    colPF  = [0.99 1 1];% [0.2 0.2 0.2];%
%    colSAF = [0.99 1 1];
%    colSTF = [0.99 1 1];
%    colSACCF = [0.99 1 1];
%    colSB = [0.99 1 1];
%    coldots= [0 0 0];


% m_proj('lambert','long',[-90 -30],'lat',[-70 -40]);
% m_proj('Azimuthal Equal-area','lat',-90,'long',-60,'radius',60);%'alt',2); 
% m_proj('Azimuthal Equal-area','lat',-90,'long',0,'radius',60);%'long',-60,'alt',2);

m_proj('robinson','lon',[0 360]); %[-180 180]); %[-330 30]);

hold on
%h=m_pcolor([X(:,end) X X(:,1)],[Y(:,end) Y Y(:,1)],[Z(:,end) Z Z(:,1)]);

[LON,indx]= sort(X,1);
LAT=Y;
VAR=Z(indx(:,1),:);

% LON=padarray(LON,[2 2],'circular');
% LAT=padarray(LAT,[2 2],'circular');
% VAR=padarray(VAR,[2 2],'circular');

h=m_pcolor(LON,LAT,VAR);

hold on
set(h,'linestyle','none');
% m_plot(x3,y3,'.','color',coldots,'markersize',0.5,'linestyle','none');
if f==1;
m_plot(STF(:,1),STF(:,2),'color',colSTF,...
     'linestyle','-','linewidth',2)%3) %'-.','color','w','markersize',4);
m_plot(PF(:,1),PF(:,2),'color',colPF,...
     'linestyle','-','linewidth',2)%3) %'-.','color','w','markersize',4);
m_plot(SAF(:,1),SAF(:,2),'color',colSAF,...
     'linestyle','-','linewidth',2)%3)% '-.','color','w','markersize',4);
% m_plot(SACCF(:,1),SACCF(:,2),'color',colSACCF,...
%      'linestyle','-.','linewidth',3)% '-','color','w','markersize',4);
% m_plot(SB(:,1),SB(:,2),'color',colSB,...
%      'linestyle','-.','linewidth',3)% '-','color','w','markersize',4);
end
hold on


%% Adjust colormap
%[C,h] = m_contour(X,Y,rho3,[-0.6:0.2:0.6],'k');
%if cl == 1    %clabel(C,h,'manual')
%end
colormap(barracolor);%bluegred);%bluegyellow)
% caxis([mini maxi])
% h=colorbar('vert','fontsize',16);%40); 
% set(get(h,'Title'),'String','Chl-a vs WSPD','fontsize',20);

% Grid and coast
% m_coast('patch',[0.5 0.5 .5]);
% m_elev('contourf',[0:100:6000]);
m_grid; %
% ('tickdir','out','xaxislocation','bottom','yaxislocation','left','linestyle','--',...
%     'xtick',[-180:45:180],...
%     'ytick',[-60:10:-60],'fontsize',16);%40); %'box','fancy'
% m_grid('tickdir','in','xaxislocation','top','yaxislocation','right','linestyle','--',...
%     'xtick',[-180:90:180],...
%     'ytick',[-60:20:-40],'fontsize',22);%40); %'box','fancy'


% m_grid('tickdir','in','xaxislocation','top','yaxislocation','right','linestyle','--',...
%     'xtick',[-180+45:90:180-45],...
%     'ytick',[-70:10:-30],'fontsize',22);%22); %'box','fancy'

% m_grid('tickdir','in','xaxislocation','top','yaxislocation','right','linestyle','none',...
%     'xtick',[],...
%     'ytick',[],'fontsize',22);%22); %'box','fancy'

% m_tbase('contour',[-3000 -1000],'edgecolor','k');

% m_gshhs_l('patch',[0.5 0.5 .5]); % high res coaslines
m_coast('patch',[0.5 0.5 .5]);

% maximize;
set(gcf,'PaperPositionMode','auto')


% %%     % This is a perceptually uniform jet-like color scale, but in m_colmap
%     % we can add some simple graduated steps to make the pcolor look a little
%     % more like a contourf
% %    colormap(m_colmap('jet','step',10));
% 
%     h=colorbar('southoutside');
%     
%     %% title(h,'\deltaSA/(g/kg) at 2000 dbar','fontsize',14);
%     % set(h,'pos',get(h,'pos')+[.2 .05 -.4 0],'tickdir','out')
% 
%     set(gcf,'color','w');   % Need to do this otherwise 'print' turns the lakes black