% **�年ERA-Interim Monthly means of daily means
clear
clc
pn='J:\WQQ\DATA\DATA_ERA-Interim\monthly data\';
% 1.read CAPE
filename='MonthlyMeans_2003-2013_CAPE.nc'; % 00:00:00 12:00:00
ncdisp([pn,filename]);
fid1=netcdf.open([pn,filename],'nowrite');
DATA.Description='Monthly means of daily means - CAPE data; lat*lon*mon*year; CAPE unit: J/kg ';
DATA.Lat=netcdf.getVar(fid1,1);
DATA.Lon=netcdf.getVar(fid1,0);
DATA.Lon=[DATA.Lon(241:480);DATA.Lon(1:240)];
DATA.Lon(1:240)=DATA.Lon(1:240)-360;
DATA.Mon=1:12;
DATA.Year=2003:2013;
time=netcdf.getVar(fid1,2);
cape=netcdf.getVar(fid1,3);
gf1=find(cape==-32767);
cape(gf1)=NaN;
cape=cape*0.10431+3417.82;
gf2=find(cape<0);
cape(gf2)=0;
cape=[cape(241:480,:,:);cape(1:240,:,:)];
for yr=1:11
for mon=1:12
temp=(yr-1)*12+mon;
DATA.CAPE(:,:,mon,yr)=cape(:,:,temp)';
end
end