| 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.4 | 
disp=1; | 
| 5 | 
  | 
  | 
disprms=0; | 
| 6 | 
afe | 
1.1 | 
 | 
| 7 | 
  | 
  | 
 | 
| 8 | 
afe | 
1.2 | 
%filename=sprintf('%s','../00/assimilate/pickup.in') | 
| 9 | 
  | 
  | 
filename=sprintf('%s%03i%s','../da/00/assimilate/pickup.',iter,'.out') | 
| 10 | 
afe | 
1.1 | 
fid=fopen(filename,'r','ieee-be'); | 
| 11 | 
  | 
  | 
foo=fread(fid,13*n+ny*nx,'float64'); | 
| 12 | 
  | 
  | 
%s=0; mn(k+1)=mean(foo(s*n+1:s*n+n)); | 
| 13 | 
  | 
  | 
i=0;truu=reshape(foo(i*n+1:(i+1)*n),[nx ny nz]); | 
| 14 | 
  | 
  | 
i=3;truv=reshape(foo(i*n+1:(i+1)*n),[nx ny nz]); | 
| 15 | 
  | 
  | 
i=6;truw=reshape(foo(i*n+1:(i+1)*n),[nx ny nz]); | 
| 16 | 
  | 
  | 
 | 
| 17 | 
  | 
  | 
 | 
| 18 | 
  | 
  | 
 | 
| 19 | 
  | 
  | 
for k=1:nens | 
| 20 | 
  | 
  | 
%k=0; | 
| 21 | 
afe | 
1.2 | 
filename=sprintf('%s%02i%s%03i%s','../da/',k,'/assimilate/pickup.',iter,'.out') | 
| 22 | 
  | 
  | 
%filename=sprintf('%s%02i%s','../',k,'/assimilate/pickup.in') | 
| 23 | 
afe | 
1.1 | 
fid=fopen(filename,'r','ieee-be'); | 
| 24 | 
  | 
  | 
foo=fread(fid,13*n+ny*nx,'float64'); | 
| 25 | 
afe | 
1.4 | 
fclose(fid); | 
| 26 | 
  | 
  | 
filename=sprintf('%s%02i%s%03i%s','../da/',k,'/assimilate/pickup_nh.',iter,'.out') | 
| 27 | 
afe | 
1.1 | 
%s=0; mn(k+1)=mean(foo(s*n+1:s*n+n)); | 
| 28 | 
afe | 
1.4 | 
fid=fopen(filename,'r','ieee-be'); | 
| 29 | 
  | 
  | 
foonh=fread(fid,2*n,'float64'); | 
| 30 | 
  | 
  | 
fclose(fid); | 
| 31 | 
afe | 
1.1 | 
i=0;memu(:,k)=foo(i*n+1:(i+1)*n); | 
| 32 | 
  | 
  | 
i=3;memv(:,k)=foo(i*n+1:(i+1)*n); | 
| 33 | 
  | 
  | 
i=6;memw(:,k)=foo(i*n+1:(i+1)*n); | 
| 34 | 
afe | 
1.4 | 
i=0;memp(:,k)=foonh(i*n+1:(i+1)*n); | 
| 35 | 
afe | 
1.1 | 
end | 
| 36 | 
afe | 
1.2 | 
 | 
| 37 | 
afe | 
1.1 | 
ensu(:,:,:)=reshape(mean(memu,2),[nx ny nz]); | 
| 38 | 
  | 
  | 
ensv(:,:,:)=reshape(mean(memv,2),[nx ny nz]); | 
| 39 | 
  | 
  | 
ensw(:,:,:)=reshape(mean(memw,2),[nx ny nz]); | 
| 40 | 
afe | 
1.4 | 
ensp(:,:,:)=reshape(mean(memp,2),[nx ny nz]); | 
| 41 | 
afe | 
1.2 | 
 | 
| 42 | 
  | 
  | 
 | 
| 43 | 
afe | 
1.3 | 
rmsu=reshape(std(memu,0,2),[nx ny nz]); | 
| 44 | 
  | 
  | 
rmsv=reshape(std(memv,0,2),[nx ny nz]); | 
| 45 | 
  | 
  | 
rmsw=reshape(std(memw,0,2),[nx ny nz]); | 
| 46 | 
afe | 
1.4 | 
rmsp=reshape(std(memp,0,2),[nx ny nz]); | 
| 47 | 
afe | 
1.3 | 
 | 
| 48 | 
afe | 
1.4 | 
if(disprms) | 
| 49 | 
  | 
  | 
figure(1);imagesc(rmsu(:,:,z));colorbar;title('U ensemble rms'); | 
| 50 | 
  | 
  | 
figure(2);imagesc(rmsv(:,:,z));colorbar;title('V ensemble rms'); | 
| 51 | 
  | 
  | 
figure(3);imagesc(rmsw(:,:,z));colorbar;title('W ensemble rms'); | 
| 52 | 
  | 
  | 
figure(4);imagesc(rmsp(:,:,z));colorbar;title('Phi ensemble rms'); | 
| 53 | 
  | 
  | 
end | 
| 54 | 
afe | 
1.3 | 
 | 
| 55 | 
  | 
  | 
if (disp) | 
| 56 | 
  | 
  | 
  subplot(3,2,1);imagesc(truu(:,:,z));colorbar; | 
| 57 | 
  | 
  | 
  subplot(3,2,3);imagesc(truv(:,:,z));colorbar; | 
| 58 | 
  | 
  | 
  subplot(3,2,5);imagesc(truw(:,:,z));colorbar; | 
| 59 | 
  | 
  | 
 | 
| 60 | 
  | 
  | 
  subplot(3,2,2);imagesc(ensu(:,:,z));colorbar; | 
| 61 | 
  | 
  | 
  subplot(3,2,4);imagesc(ensv(:,:,z));colorbar; | 
| 62 | 
  | 
  | 
  subplot(3,2,6);imagesc(ensw(:,:,z));colorbar; | 
| 63 | 
  | 
  | 
  title(sprintf('%s%i','truth and ensemble mean after assim',iter)); | 
| 64 | 
  | 
  | 
end |