--- MITgcm_contrib/osse/utils/ensavg.m 2004/06/10 13:45:30 1.2 +++ MITgcm_contrib/osse/utils/ensavg.m 2004/06/12 22:15:40 1.4 @@ -1,5 +1,8 @@ -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; +%iter=68; z=15; +disp=1; +disprms=0; %filename=sprintf('%s','../00/assimilate/pickup.in') @@ -19,23 +22,43 @@ %filename=sprintf('%s%02i%s','../',k,'/assimilate/pickup.in') fid=fopen(filename,'r','ieee-be'); foo=fread(fid,13*n+ny*nx,'float64'); +fclose(fid); +filename=sprintf('%s%02i%s%03i%s','../da/',k,'/assimilate/pickup_nh.',iter,'.out') %s=0; mn(k+1)=mean(foo(s*n+1:s*n+n)); +fid=fopen(filename,'r','ieee-be'); +foonh=fread(fid,2*n,'float64'); +fclose(fid); 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); -fclose(fid); +i=0;memp(:,k)=foonh(i*n+1:(i+1)*n); 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]); +ensp(:,:,:)=reshape(mean(memp,2),[nx ny nz]); -subplot(3,2,1);imagesc(truu(:,:,z)); -subplot(3,2,3);imagesc(truv(:,:,z)); -subplot(3,2,5);imagesc(truw(:,:,z)); - -subplot(3,2,2);imagesc(ensu(:,:,z)); -subplot(3,2,4);imagesc(ensv(:,:,z)); -subplot(3,2,6);imagesc(ensw(:,:,z)); -title(sprintf('%s%i','truth and ensemble mean after assim',iter)); +rmsu=reshape(std(memu,0,2),[nx ny nz]); +rmsv=reshape(std(memv,0,2),[nx ny nz]); +rmsw=reshape(std(memw,0,2),[nx ny nz]); +rmsp=reshape(std(memp,0,2),[nx ny nz]); + +if(disprms) +figure(1);imagesc(rmsu(:,:,z));colorbar;title('U ensemble rms'); +figure(2);imagesc(rmsv(:,:,z));colorbar;title('V ensemble rms'); +figure(3);imagesc(rmsw(:,:,z));colorbar;title('W ensemble rms'); +figure(4);imagesc(rmsp(:,:,z));colorbar;title('Phi ensemble rms'); +end + +if (disp) + subplot(3,2,1);imagesc(truu(:,:,z));colorbar; + subplot(3,2,3);imagesc(truv(:,:,z));colorbar; + subplot(3,2,5);imagesc(truw(:,:,z));colorbar; + + subplot(3,2,2);imagesc(ensu(:,:,z));colorbar; + subplot(3,2,4);imagesc(ensv(:,:,z));colorbar; + subplot(3,2,6);imagesc(ensw(:,:,z));colorbar; + title(sprintf('%s%i','truth and ensemble mean after assim',iter)); +end