%ovrtrn.
clear all;
close all;
%% ---%% Below Should Be Modified According to Different Cases
EXPID='H03';
YEAR=1990;                  %start of the year
YEAREND=1990;
%% ---%%
ovrtrn=zeros(12,305,157);
num=1;
MONTH=1;
while YEAR<=YEAREND
	
	while MONTH<=9
		
		var=getnc(strcat('ovrtrn.',int2str(YEAR),'.',...
		'0',int2str(MONTH),'.nc'),'ovrtd');
		var=squeeze(var(1,:,:));
		ovrtrn(num,:,:)=var;
		num=num+1;
		MONTH=MONTH+1;
	end
	while MONTH<=12
		var=getnc(strcat('ovrtrn.',int2str(YEAR),'.',...
		int2str(MONTH),'.nc'),'ovrtd');
		var=squeeze(var(1,:,:));
		ovrtrn(num,:,:)=var;
		num=num+1;
		MONTH=MONTH+1;
	end

	MONTH=1;
	display('The Year Is :');
	YEAR
	YEAR=YEAR+1;
end
ovrtrn=squeeze(mean(ovrtrn,1));
save (strcat(EXPID,'_ave_ovrtrn','.mat'),'ovrtrn');
contourf(flipud(ovrtrn(:,50:157)))
shading flat;colorbar;

title ('Atlantic Meridonal Overturning Circulation:Sv','fontsize',12,'fontweight','bold')
xlabel('Lat')
ylabel('Depth');
set(gca,'xtick',[1,22,76],'xticklabel',{'28S','EQ','54'},'fontsize',12,'fontweight','bold');
%set(gca,'xtick',[1,241],'xticklabel',{'1948','1968'},'fontsize',12,'fontweight','bold');
axis tight
saveas(gcf, strcat(EXPID,'_ave_ovrtrn'), 'png');

%ovrtl,ovrtd,hfogo,slto,amoc
