function [apresd,mask,longitude,latitude,yfrac]=load_SLA(name)

%function plot_OHC(num)
addpath /WSmounts/phodnet/share/mgoes/matlab2/Time_transform/       
addpath /data/mgoes/matlab/timeplt
addpath /data/mgoes/matlab/Seawater
addpath /data/mgoes/matlab/drtoolbox/

%    filename = 'ETAT_NA.nc';
%    filename = 'ETAT_FAFHEAT_NA.nc';
%    filename = 'ETAT_FAFSTRESS_NA.nc';
%    filename = 'ETAT_FAFWATER_NA.nc';
    title1 = 'EOF1 (SLA)'

   %filename = strcat('ETAT_FAF',name,'_NA.nc')
   filename = strcat('ETA_T_FAF',name,'.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,'ETA_T');
disp('NORTH ATLANTIC')
%ilat = find(latitude>5&latitude<65);
ilat = find(latitude>5&latitude<75);
A_apress = A_apress(:,ilat,:);
latitude = latitude(ilat);
[nx,ny,nt] = size(A_apress);

%ANOMALIES
apressa = A_apress;
if 0
apresm = A_apress*nan;
disp('Calc Anomalies')
for jj=1:12
    ii = jj:12:nt;
    aux = mean(A_apress(:,:,ii),3);
    apresm(:,:,ii) = aux(:,:,ones(1,length(ii)));
   
end 
apressa = A_apress-apresm;
end %0

apressa = permute(apressa,[3 2 1]);
apressa = apressa*100; %(meter to cm)

%PACIFIC AREA
ilat = latitude<10;
ilon = longitude<-70;
apressa(:,ilat,ilon)=nan;
%oo = std(apressa);
%apressa(:,oo==0)=nan;

clear apresm A_apress oo

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

%PREWHITEN
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;

