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