/[MITgcm]/MITgcm_contrib/osse/utils/ensavg.m
ViewVC logotype

Annotation of /MITgcm_contrib/osse/utils/ensavg.m

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.6 - (hide annotations) (download)
Wed Jun 16 21:03:04 2004 UTC (21 years, 1 month ago) by afe
Branch: MAIN
Changes since 1.5: +34 -37 lines
cleaner diagnosticater

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.5 disp=0;
5 afe 1.6 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 afe 1.1
14    
15 afe 1.5 %filename=sprintf('%s','../da/00/assimilate/pickup.in')
16 afe 1.6 filename=sprintf('%s%03i%s','../da/00/assimilate/pickup.',iter,'.out');
17     %filename=sprintf('%s','../da/i90/00/assimilate/pickup.0000016820.001.001.data')
18     fid=fopen(filename,'r','ieee-be');
19 afe 1.1 foo=fread(fid,13*n+ny*nx,'float64');
20 afe 1.6 i=0;tru(:,:,:,U)=reshape(foo(i*n+1:(i+1)*n),[nx ny nz]);
21     i=3;tru(:,:,:,V)=reshape(foo(i*n+1:(i+1)*n),[nx ny nz]);
22     i=6;tru(:,:,:,W)=reshape(foo(i*n+1:(i+1)*n),[nx ny nz]);
23 afe 1.1
24    
25    
26     for k=1:nens
27     %k=0;
28 afe 1.6 %filename=sprintf('%s%02i%s','../da/',k,'/assimilate/pickup.in')
29 afe 1.2 filename=sprintf('%s%02i%s%03i%s','../da/',k,'/assimilate/pickup.',iter,'.out')
30 afe 1.6 %filename=sprintf('%s%02i%s','../da/i90/',k,'/assimilate/pickup.0000016820.001.001.data')
31 afe 1.1 fid=fopen(filename,'r','ieee-be');
32     foo=fread(fid,13*n+ny*nx,'float64');
33 afe 1.4 fclose(fid);
34 afe 1.6 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 afe 1.1 end
43 afe 1.2
44 afe 1.6 ens=reshape(mean(mem,3),[nx ny nz varnum]);
45 afe 1.2
46 afe 1.6 rms=reshape(std(mem,0,3),[nx ny nz varnum]);
47 afe 1.2
48 afe 1.6 iterstr=sprintf('%i',iter);
49 afe 1.4 if(disprms)
50 afe 1.6 for i=1:varnum
51     figure(i);imagesc(rms(:,:,z,i));colorbar;
52     title(strcat(vars(i),' ensemble rms, iter ',iterstr));
53     end
54 afe 1.5 end
55    
56 afe 1.6
57     if (jpg)
58     for i=1:varnum
59 afe 1.5 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 afe 1.4 end
66 afe 1.3
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 afe 1.5 title(sprintf('%s%i','truth and ensemble mean after assim ',iter));
76 afe 1.3 end

  ViewVC Help
Powered by ViewVC 1.1.22