Hi everyone! I really need some help. I downloaded the Era-interim reanalysis data (total precipitation over Eastern Europe, step 0.125) from 1979 to August 2019 and now I'm trying to write a script with my primitive programming skills. I need to pull out cases of heavy rainfall (>= 50 mm/12 hours) in a table or array representing the year, month, date, coordinates (latitude, longitude) and time. The problem is that after running the script in the displayed result, the decimal values are lost in the coordinate cells, although I use a double type. I split this array into pr50 and th50, thinking that this will solve the problem, but no. Maybe something wrong with my script?
tp=ncread('data.nc','tp'); % 'tp'-153x73x188 824
tp=tp*1000;for i=1:153 for j=1:73 k(i,j,:)=movsum(tp(i,j,:),4); end;end;lon1=load('coords.txt'); % my coordinates of the Ukraine borders
lon1=lon1';lonn=(lon1-22)/0.125+1; lon2=int32(lonn);n=0;for k1=3:118883 for j1=6:69 for i1=lon2(1,j1-5):1:lon2(2,j1-5) if d1.k(i1,j1,k1)>=50 n=n+1; doublelo1=(i1-1)*0.125+22; la1=53-(j1-1)*0.125; pr50(n,:)=double([d1.k(i1,j1,k1),lo1,la1]); th50(n,:)=int32([d1.timehours(k1,1:4)]); end; end; for i1=lon2(3,j1-5):1:lon2(4,j1-5) if d1.k(i1,j1,k1)>=50 n=n+1; lo1=(i1-1)*0.125+22; la1=53-(j1-1)*0.125; pr50(n,:)=double([d1.k(i1,j1,k1),lo1,la1]); th50(n,:)=int32([d1.timehours(k1,1:4)]); end; end; end;end;
Best Answer