%  Ecrit sur ciclad (12 2014)

   clear all; close all;

   ys_fich=2000;
   ye_fich=2008;
   dur_plot=[num2str(ys_fich) '-' num2str(ye_fich)];

   mini=150;
   maxi=250;

   file_exp='/loceanfs/pulsation/cholod/peru12_nemo/outputs/p12n_bdy_tr12n_quik/20000101_20081231/p12n_bdy_tr12n_quik_1m_20000101_20081231_grid_T_2D_annual_mean.nc';
   file_TROPFLUX='/loceanfs/pulsation/cholod/data/TROPFLUX/swr_tropflux_annual_mean_2000_2008.nc';
   file_COADS05='/loceanfs/pulsation/cholod/data/COADS05/shortrad_annual_mean.cdf';

% Input erai peru12_now
   nc1=netcdf(file_exp,'r');
   lon1=nc1{'nav_lon'}(:);
   lat1=nc1{'nav_lat'}(:);
   sw1=squeeze(nc1{'rsntds'}(1,:,:));
   close(nc1);

   figure(1);
   pcolor(lon1,lat1,sw1); shading flat
   set(gca,'FontS',14); set(gca,'PlotBoxAspectRatio',[0.7 1 1]); box on;
   caxis ([mini maxi]); hcc=colorbar; set(hcc,'FontS',14);
   title(['SW flux downward (W/m2) - Input peru12\_nemo - ('  dur_plot ')'],'FontSize',12);
   figname1=['swdwn_erai_out_peru12_nemo_' dur_plot];
   print ('-dpng',figname1)


% TROPFLUX
   nc2=netcdf(file_TROPFLUX,'r');
   lon2=nc2{'longitude'}(:)-360;
   lat2=nc2{'latitude'}(:);
   sw2=squeeze(nc2{'swr'}(1,:,:));
   close(nc2);

   figure(2);
   pcolor(lon2(230:261),lat2(1:41),sw2(1:41,230:261)); shading flat
   set(gca,'FontS',14); set(gca,'PlotBoxAspectRatio',[0.7 1 1]); box on;
   caxis ([mini maxi]); hcc=colorbar; set(hcc,'FontS',14);
   title(['Net SW (W/m2) - TROPFLUX'],'FontSize',12);
   figname2='netsw_TROPFLUX';
   print ('-dpng',figname2)


% COADS05
   nc3=netcdf(file_COADS05,'r');
   lon3=nc3{'X'}(:)-360;
   lat3=nc3{'Y'}(:);
   sw3=squeeze(nc3{'shortrad'}(1,:,:));
   close(nc3);

   figure(3);
   pcolor(lon3(160:221),lat3(120:201),sw3(120:201,160:221)); shading flat
   set(gca,'FontS',14); set(gca,'PlotBoxAspectRatio',[0.7 1 1]); box on;
   caxis ([mini maxi]); hcc=colorbar; set(hcc,'FontS',14);
   title(['Net SW (W/m2) - COADS05'],'FontSize',12);
   figname3='netsw_COADS05';
   print ('-dpng',figname3)

