/[MITgcm]/MITgcm_contrib/gael/matlab_class/ecco_v4/cost_altimeter_disp.m
ViewVC logotype

Annotation of /MITgcm_contrib/gael/matlab_class/ecco_v4/cost_altimeter_disp.m

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


Revision 1.7 - (hide annotations) (download)
Sat Jan 18 23:35:57 2014 UTC (11 years, 6 months ago) by gforget
Branch: MAIN
Changes since 1.6: +2 -0 lines
- allow for 'mat/cost/' subdirectory

1 gforget 1.5 function []=cost_altimeter_disp(dirMat,choicePlot,suf,dirTex,nameTex);
2     %object: plot the various sea level statistics
3 gforget 1.1 % (std model-obs, model, obs, leading to cost function terms)
4 gforget 1.4 %inputs: dirMat is the model run directory
5 gforget 1.5 % choicePlot is 1 (rms) 2 (prior uncertainty) or 3 (cost)
6     % suf is 'modMobs', 'obs' or 'mod'
7     %optional: dirTex is the directory where tex and figures files are created
8     % (if not specified then display all results to screen instead)
9     % nameTex is the tex file name (default : 'myPlots')
10 gforget 1.1
11 gforget 1.5 gcmfaces_global;
12    
13     %backward compatibility test
14     test1=~isempty(dir([dirMat 'basic_diags_ecco_mygrid.mat']));
15     test2=~isempty(dir([dirMat 'diags_grid_parms.mat']));
16     if ~test1&~test2;
17     error('missing diags_grid_parms.mat')
18     elseif test2;
19     nameGrid='diags_grid_parms.mat';
20     else;
21     nameGrid='basic_diags_ecco_mygrid.mat';
22     end;
23 gforget 1.1
24 gforget 1.4 %here we always reload the grid from dirMat to make sure the same one is used throughout
25 gforget 1.5 eval(['load ' dirMat nameGrid ';']);
26 gforget 1.1
27 gforget 1.4 %determine if and where to create tex and figures files
28     dirMat=[dirMat '/'];
29     if isempty(who('dirTex'));
30     addToTex=0;
31     else;
32     if ~ischar(dirTex); error('mis-specified dirTex'); end;
33 gforget 1.5 addToTex=1;
34     if isempty(who('nameTex')); nameTex='myPlots'; end;
35     fileTex=[dirTex nameTex '.tex'];
36 gforget 1.4 end;
37 gforget 1.1
38     %%%%%%%%%%%%%%%
39     %define pathes:
40     %%%%%%%%%%%%%%%
41    
42 gforget 1.4 if isempty(dirMat); dirMat=[dirModel 'mat/']; else; dirMat=[dirMat '/']; end;
43 gforget 1.1 runName=pwd; tmp1=strfind(runName,'/'); runName=runName(tmp1(end)+1:end);
44    
45 gforget 1.7 if isdir([dirMat 'cost/']); dirMat=[dirMat 'cost/']; end;
46    
47 gforget 1.1 %%%%%%%%%%%%%%%%%
48     %do computations:
49     %%%%%%%%%%%%%%%%%
50    
51 gforget 1.4 eval(['load ' dirMat 'cost_altimeter_' suf '.mat myflds;']);
52 gforget 1.1
53     if strcmp(suf,'modMobs'); tit='modeled-observed';
54     elseif strcmp(suf,'obs'); tit='observed';
55     elseif strcmp(suf,'mod'); tit='modeled';
56     else; error('unknown field');
57     end
58    
59 gforget 1.2 if choicePlot==1; tit=[tit ' rms']; uni='(cm)';
60     elseif choicePlot==2; tit='prior uncertainty'; uni='(cm)';
61     else; tit=[tit ' cost']; uni='';
62 gforget 1.1 end;
63    
64     if choicePlot==1;%rms
65    
66     if strcmp(suf,'modMobs');
67     cc=[-0.4:0.05:-0.25 -0.2:0.03:-0.05 -0.03:0.01:0.03 0.05:0.03:0.2 0.25:0.05:0.4];
68     figure; m_map_gcmfaces(100*myflds.dif_mdt,0,{'myCaxis',100*cc}); drawnow;
69 gforget 1.2 tmp1=strfind(tit,'rms');
70     if ~isempty(tmp1); tit2=[tit(1:tmp1-1) 'difference' tit(tmp1+3:end)]; else; tit2=tit; end;
71     myCaption={tit2,'-- mean dynamic topography ',uni};
72 gforget 1.4 if addToTex; write2tex(fileTex,2,myCaption,gcf); end;
73 gforget 1.1 end;
74    
75     cc=[0:0.005:0.02 0.03:0.01:0.05 0.06:0.02:0.1 0.14:0.03:0.2 0.25:0.05:0.4];
76     figure; m_map_gcmfaces(100*myflds.rms_sladiff_smooth,0,{'myCaxis',100*cc}); drawnow;
77 gforget 1.2 myCaption={tit,'-- sea level anomaly ',uni,' -- large space/time scales'};
78 gforget 1.4 if addToTex; write2tex(fileTex,2,myCaption,gcf); end;
79 gforget 1.1
80     %figure; m_map_gcmfaces(100*myflds.rms_sladiff_point35d,0,{'myCaxis',100*cc}); drawnow;
81 gforget 1.2 %myCaption={tit,'-- sea level anomaly ',uni,' -- large time scales'};
82 gforget 1.4 %if addToTex; write2tex(fileTex,2,myCaption,gcf); end;
83 gforget 1.1
84     figure; m_map_gcmfaces(100*myflds.rms_sladiff_point,0,{'myCaxis',100*cc}); drawnow;
85 gforget 1.2 myCaption={tit,'-- sea level anomaly ',uni,' -- pointwise'};
86 gforget 1.4 if addToTex; write2tex(fileTex,2,myCaption,gcf); end;
87 gforget 1.1
88     elseif choicePlot==2;%uncertainty fields
89    
90     cc=[0:0.005:0.02 0.03:0.01:0.05 0.06:0.02:0.1 0.14:0.03:0.2 0.25:0.05:0.4];
91     figure; m_map_gcmfaces(100*myflds.sig_mdt,0,{'myCaxis',100*cc}); drawnow;
92 gforget 1.2 myCaption={tit,'-- mean dynamic topography ',uni};
93 gforget 1.4 if addToTex; write2tex(fileTex,2,myCaption,gcf); end;
94 gforget 1.1
95     cc=[0:0.005:0.02 0.03:0.01:0.05 0.06:0.02:0.1 0.14:0.03:0.2 0.25:0.05:0.4];
96     figure; m_map_gcmfaces(100*myflds.sig_sladiff_smooth,0,{'myCaxis',100*cc}); drawnow;
97 gforget 1.2 myCaption={tit,'-- sea level anomaly ',uni,' -- large space/time scales'};
98 gforget 1.4 if addToTex; write2tex(fileTex,2,myCaption,gcf); end;
99 gforget 1.1
100     %figure; m_map_gcmfaces(100*myflds.sig_sladiff_point,0,{'myCaxis',100*cc}); drawnow;
101 gforget 1.2 %myCaption={tit,'-- sea level anomaly ',uni,' -- large time scales'};
102 gforget 1.4 %if addToTex; write2tex(fileTex,2,myCaption,gcf); end;
103 gforget 1.1
104     figure; m_map_gcmfaces(100*myflds.sig_sladiff_point,0,{'myCaxis',100*cc}); drawnow;
105 gforget 1.2 myCaption={tit,'-- sea level anomaly ',uni,' -- pointwise'};
106 gforget 1.4 if addToTex; write2tex(fileTex,2,myCaption,gcf); end;
107 gforget 1.1
108     else;%cost
109    
110     cc=[0:0.005:0.02 0.03:0.01:0.05 0.06:0.02:0.1 0.14:0.03:0.2 0.25:0.05:0.4]*100;
111    
112     figure; m_map_gcmfaces(((myflds.dif_mdt.^2)./(myflds.sig_mdt.^2)),0,{'myCaxis',cc}); drawnow;
113 gforget 1.2 myCaption={tit,'-- mean dynamic topography ',uni};
114 gforget 1.4 if addToTex; write2tex(fileTex,2,myCaption,gcf); end;
115 gforget 1.1
116     figure; m_map_gcmfaces(((myflds.rms_sladiff_smooth.^2)./(myflds.sig_sladiff_smooth.^2)),0,{'myCaxis',cc}); drawnow;
117 gforget 1.2 myCaption={tit,'-- sea level anomaly ',uni,' -- large space/time scales'};
118 gforget 1.4 if addToTex; write2tex(fileTex,2,myCaption,gcf); end;
119 gforget 1.1
120     %figure; m_map_gcmfaces(((myflds.rms_sladiff_point35d.^2)./(myflds.sig_sladiff_point.^2)),0,{'myCaxis',cc}); drawnow;
121 gforget 1.2 %myCaption={tit,'-- sea level anomaly ',uni,' -- large time scales'};
122 gforget 1.4 %if addToTex; write2tex(fileTex,2,myCaption,gcf); end;
123 gforget 1.1
124     figure; m_map_gcmfaces(((myflds.rms_sladiff_point.^2)./(myflds.sig_sladiff_point.^2)),0,{'myCaxis',cc}); drawnow;
125 gforget 1.2 myCaption={tit,'-- sea level anomaly ',uni,' -- pointwise'};
126 gforget 1.4 if addToTex; write2tex(fileTex,2,myCaption,gcf); end;
127 gforget 1.1
128     end;
129    
130    
131    
132    
133    

  ViewVC Help
Powered by ViewVC 1.1.22