1 |
afe |
1.3 |
nx=120;ny=31;nz=29;n=nx*ny*nz;nens=30; |
2 |
|
|
%iter=68; |
3 |
afe |
1.2 |
z=15; |
4 |
afe |
1.7 |
disp=1; |
5 |
|
|
disprms=0; |
6 |
afe |
1.6 |
jpg=0; |
7 |
afe |
1.7 |
vars=['U' 'V' 'W' 'P' 'T']; |
8 |
afe |
1.6 |
U=find(vars=='U'); |
9 |
|
|
V=find(vars=='V'); |
10 |
|
|
W=find(vars=='W'); |
11 |
|
|
P=find(vars=='P'); |
12 |
afe |
1.7 |
T=find(vars=='T'); |
13 |
afe |
1.6 |
varnum= size(vars,2); |
14 |
afe |
1.1 |
|
15 |
|
|
|
16 |
afe |
1.5 |
%filename=sprintf('%s','../da/00/assimilate/pickup.in') |
17 |
afe |
1.6 |
filename=sprintf('%s%03i%s','../da/00/assimilate/pickup.',iter,'.out'); |
18 |
|
|
%filename=sprintf('%s','../da/i90/00/assimilate/pickup.0000016820.001.001.data') |
19 |
|
|
fid=fopen(filename,'r','ieee-be'); |
20 |
afe |
1.1 |
foo=fread(fid,13*n+ny*nx,'float64'); |
21 |
afe |
1.6 |
i=0;tru(:,:,:,U)=reshape(foo(i*n+1:(i+1)*n),[nx ny nz]); |
22 |
|
|
i=3;tru(:,:,:,V)=reshape(foo(i*n+1:(i+1)*n),[nx ny nz]); |
23 |
|
|
i=6;tru(:,:,:,W)=reshape(foo(i*n+1:(i+1)*n),[nx ny nz]); |
24 |
afe |
1.7 |
i=7;tru(:,:,:,T)=reshape(foo(i*n+1:(i+1)*n),[nx ny nz]); |
25 |
afe |
1.8 |
fclose(fid); |
26 |
afe |
1.1 |
|
27 |
|
|
|
28 |
|
|
for k=1:nens |
29 |
|
|
%k=0; |
30 |
afe |
1.6 |
%filename=sprintf('%s%02i%s','../da/',k,'/assimilate/pickup.in') |
31 |
afe |
1.2 |
filename=sprintf('%s%02i%s%03i%s','../da/',k,'/assimilate/pickup.',iter,'.out') |
32 |
afe |
1.6 |
%filename=sprintf('%s%02i%s','../da/i90/',k,'/assimilate/pickup.0000016820.001.001.data') |
33 |
afe |
1.1 |
fid=fopen(filename,'r','ieee-be'); |
34 |
|
|
foo=fread(fid,13*n+ny*nx,'float64'); |
35 |
afe |
1.4 |
fclose(fid); |
36 |
afe |
1.6 |
filename=sprintf('%s%02i%s%03i%s','../da/',k,'/assimilate/pickup_nh.',iter,'.out') |
37 |
|
|
fid=fopen(filename,'r','ieee-be'); |
38 |
|
|
foonh=fread(fid,2*n,'float64'); |
39 |
|
|
fclose(fid); |
40 |
|
|
i=0;mem(:,U,k)=foo(i*n+1:(i+1)*n); |
41 |
|
|
i=3;mem(:,V,k)=foo(i*n+1:(i+1)*n); |
42 |
|
|
i=6;mem(:,W,k)=foo(i*n+1:(i+1)*n); |
43 |
afe |
1.7 |
i=7;mem(:,T,k)=foo(i*n+1:(i+1)*n); |
44 |
afe |
1.6 |
i=0;mem(:,P,k)=foonh(i*n+1:(i+1)*n); |
45 |
afe |
1.1 |
end |
46 |
afe |
1.2 |
|
47 |
afe |
1.6 |
ens=reshape(mean(mem,3),[nx ny nz varnum]); |
48 |
afe |
1.2 |
|
49 |
afe |
1.6 |
rms=reshape(std(mem,0,3),[nx ny nz varnum]); |
50 |
afe |
1.2 |
|
51 |
afe |
1.6 |
iterstr=sprintf('%i',iter); |
52 |
afe |
1.4 |
if(disprms) |
53 |
afe |
1.6 |
for i=1:varnum |
54 |
|
|
figure(i);imagesc(rms(:,:,z,i));colorbar; |
55 |
|
|
title(strcat(vars(i),' ensemble rms, iter ',iterstr)); |
56 |
|
|
end |
57 |
afe |
1.5 |
end |
58 |
|
|
|
59 |
afe |
1.6 |
|
60 |
|
|
if (jpg) |
61 |
|
|
for i=1:varnum |
62 |
afe |
1.5 |
set(i,'PaperPositionMode', 'manual'); |
63 |
|
|
set(i,'PaperPosition',[0.25 0.25 8 10.5]); |
64 |
|
|
t=get(get(get(i,'CurrentAxes'),'Title'),'String'); |
65 |
|
|
outfilename=sprintf('%s%s%i','rms',t(1),iter); |
66 |
|
|
print('-djpeg', outfilename); |
67 |
|
|
end |
68 |
afe |
1.4 |
end |
69 |
afe |
1.3 |
|
70 |
|
|
if (disp) |
71 |
afe |
1.7 |
subplot(4,2,1);imagesc(tru(:,:,z,U));colorbar; |
72 |
|
|
subplot(4,2,3);imagesc(tru(:,:,z,V));colorbar; |
73 |
|
|
subplot(4,2,5);imagesc(tru(:,:,z,W));colorbar; |
74 |
|
|
subplot(4,2,7);imagesc(tru(:,:,z,T));colorbar; |
75 |
|
|
|
76 |
|
|
subplot(4,2,2);imagesc(ens(:,:,z,U));colorbar; |
77 |
|
|
subplot(4,2,4);imagesc(ens(:,:,z,V));colorbar; |
78 |
|
|
subplot(4,2,6);imagesc(ens(:,:,z,W));colorbar; |
79 |
|
|
subplot(4,2,8);imagesc(ens(:,:,z,T));colorbar; |
80 |
afe |
1.5 |
title(sprintf('%s%i','truth and ensemble mean after assim ',iter)); |
81 |
afe |
1.3 |
end |