function [apresd,mask,lon1,lat1,yfrac] = load_PSL;

addpath /WSmounts/phodnet/share/mgoes/matlab2/Time_transform/       
addpath /data/mgoes/matlab/timeplt
addpath /data/mgoes/matlab/Seawater
addpath /data/mgoes/matlab/drtoolbox/
addpath /data/mgoes/ARGO/IPRC

    filename1 = 'PSL_fafstress.nc';
    filename1 = 'PSL_fafheat.nc';
    filename1 = 'PSL_fafwater.nc';
    title1 = 'EOF1 (SLP)'

lat1  = double(ncread(filename1,'LAT'));
lon1  = double(ncread(filename1,'LON'));
time  = double(ncread(filename1,'TIME'));
yfrac = 1:length(time);
disp('Load Data')
Data1 = ncread(filename1,'PSL');
lon1(lon1>180) = lon1(lon1>180)-360;
[lon1,ilon]=sort(lon1);
Data1= Data1(ilon,:,:);

disp('NORTH ATLANTIC')
ilon = (lon1>-100&lon1<40);
ilat = (lat1>0&lat1<80);
Data1 = Data1(ilon,ilat,:);
lon1=lon1(ilon);
lat1=lat1(ilat);
[nx,ny,nt] = size(Data1);

clear ilon ilat
%LOAD ICE PRESSURE
if 0
  filename = 'PATMT_NA.nc'
  latitude  = double(ncread(filename,'YT_OCEAN138_267'));
  longitude = double(ncread(filename,'XT_OCEAN181_310'));
%  time      = double(ncread(filename,'TIME'));
%  yfrac = 1:length(time);

  longitude(longitude>180) = longitude(longitude>180)-360;

  disp('Load Data')
  A_apress = ncread(filename,'PATM_T');
  [X,Y] = meshgrid(latitude,longitude);
  [x,y] = meshgrid(lat1,lon1);
  Data2 = A_apress*nan;
  for ii=1:length(time)
      aux = Data1(:,:,ii);
     acha = ~isnan(aux);
   F = scatteredInterpolant(x(acha),y(acha),aux(acha));
     Data2(:,:,ii) = F(X,Y);
  end
 A_apress(isnan(A_apress))=0;
 Data1 = Data2 + A_apress;   %ADD ICE
 lat1 = latitude;
 lon1 = longitude;
clear A_apress latitude longitude Data2 X Y x y F aux acha
end
%keyboard
apresm = Data1*nan;
disp('Anomalies')
for jj=1:12
    ii = jj:12:nt;
    aux = mean(Data1(:,:,ii),3);
    apresm(:,:,ii) = aux(:,:,ones(1,length(ii)));
   
end 
apressa = Data1-apresm;
apressa = permute(apressa,[3 2 1]);
oo = std(apressa);
apressa(:,oo==0)=nan;
apressa = apressa/1e1; %1e2 is Pascal to hectopascal 
clear apresm Data1 oo aux ii jj 


disp('SPATIAL')
mask = ~isnan(squeeze(apressa(1,:,:)));
if 1
  W = sw_area(lon1,lat1);
  %keyboard
  %W=W.*mask;
  W=W./max(W(:));
  W = shiftdim(W,-1);
  apressa=apressa.*W(ones(1,nt),:,:);
end
apresd = map2mat(mask,apressa);%/1e2;

%PREWHITEN - Mean=0 std=1
if 0
for ii = 1:size(apresd,2)
      aux = apresd(:,ii);
      if ~isnan(aux)
      apresd(:,ii) = prewhiten(aux);
      end
end
end


apresd(isnan(apresd))=0;

clear W

