/[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.6 - (hide annotations) (download)
Tue Apr 2 22:51:57 2013 UTC (12 years, 3 months ago) by gforget
Branch: MAIN
Changes since 1.5: +0 -2 lines
cost_altimeter.m :
- update to latest ecco v4 inputs.
- set listRecs automatically.
- set maxLatObs to 90 to incl. full Arctic and SO.
cost_altimeter_disp.m : avoid raid4 / gforget reference.
cost_xx.m : avoid raid3 / gforget reference.
v4_basin.m : avoid raid3 / gforget reference.

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     %%%%%%%%%%%%%%%%%
46     %do computations:
47     %%%%%%%%%%%%%%%%%
48    
49 gforget 1.4 eval(['load ' dirMat 'cost_altimeter_' suf '.mat myflds;']);
50 gforget 1.1
51     if strcmp(suf,'modMobs'); tit='modeled-observed';
52     elseif strcmp(suf,'obs'); tit='observed';
53     elseif strcmp(suf,'mod'); tit='modeled';
54     else; error('unknown field');
55     end
56    
57 gforget 1.2 if choicePlot==1; tit=[tit ' rms']; uni='(cm)';
58     elseif choicePlot==2; tit='prior uncertainty'; uni='(cm)';
59     else; tit=[tit ' cost']; uni='';
60 gforget 1.1 end;
61    
62     if choicePlot==1;%rms
63    
64     if strcmp(suf,'modMobs');
65     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];
66     figure; m_map_gcmfaces(100*myflds.dif_mdt,0,{'myCaxis',100*cc}); drawnow;
67 gforget 1.2 tmp1=strfind(tit,'rms');
68     if ~isempty(tmp1); tit2=[tit(1:tmp1-1) 'difference' tit(tmp1+3:end)]; else; tit2=tit; end;
69     myCaption={tit2,'-- mean dynamic topography ',uni};
70 gforget 1.4 if addToTex; write2tex(fileTex,2,myCaption,gcf); end;
71 gforget 1.1 end;
72    
73     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];
74     figure; m_map_gcmfaces(100*myflds.rms_sladiff_smooth,0,{'myCaxis',100*cc}); drawnow;
75 gforget 1.2 myCaption={tit,'-- sea level anomaly ',uni,' -- large space/time scales'};
76 gforget 1.4 if addToTex; write2tex(fileTex,2,myCaption,gcf); end;
77 gforget 1.1
78     %figure; m_map_gcmfaces(100*myflds.rms_sladiff_point35d,0,{'myCaxis',100*cc}); drawnow;
79 gforget 1.2 %myCaption={tit,'-- sea level anomaly ',uni,' -- large time scales'};
80 gforget 1.4 %if addToTex; write2tex(fileTex,2,myCaption,gcf); end;
81 gforget 1.1
82     figure; m_map_gcmfaces(100*myflds.rms_sladiff_point,0,{'myCaxis',100*cc}); drawnow;
83 gforget 1.2 myCaption={tit,'-- sea level anomaly ',uni,' -- pointwise'};
84 gforget 1.4 if addToTex; write2tex(fileTex,2,myCaption,gcf); end;
85 gforget 1.1
86     elseif choicePlot==2;%uncertainty fields
87    
88     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];
89     figure; m_map_gcmfaces(100*myflds.sig_mdt,0,{'myCaxis',100*cc}); drawnow;
90 gforget 1.2 myCaption={tit,'-- mean dynamic topography ',uni};
91 gforget 1.4 if addToTex; write2tex(fileTex,2,myCaption,gcf); end;
92 gforget 1.1
93     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];
94     figure; m_map_gcmfaces(100*myflds.sig_sladiff_smooth,0,{'myCaxis',100*cc}); drawnow;
95 gforget 1.2 myCaption={tit,'-- sea level anomaly ',uni,' -- large space/time scales'};
96 gforget 1.4 if addToTex; write2tex(fileTex,2,myCaption,gcf); end;
97 gforget 1.1
98     %figure; m_map_gcmfaces(100*myflds.sig_sladiff_point,0,{'myCaxis',100*cc}); drawnow;
99 gforget 1.2 %myCaption={tit,'-- sea level anomaly ',uni,' -- large time scales'};
100 gforget 1.4 %if addToTex; write2tex(fileTex,2,myCaption,gcf); end;
101 gforget 1.1
102     figure; m_map_gcmfaces(100*myflds.sig_sladiff_point,0,{'myCaxis',100*cc}); drawnow;
103 gforget 1.2 myCaption={tit,'-- sea level anomaly ',uni,' -- pointwise'};
104 gforget 1.4 if addToTex; write2tex(fileTex,2,myCaption,gcf); end;
105 gforget 1.1
106     else;%cost
107    
108     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;
109    
110     figure; m_map_gcmfaces(((myflds.dif_mdt.^2)./(myflds.sig_mdt.^2)),0,{'myCaxis',cc}); drawnow;
111 gforget 1.2 myCaption={tit,'-- mean dynamic topography ',uni};
112 gforget 1.4 if addToTex; write2tex(fileTex,2,myCaption,gcf); end;
113 gforget 1.1
114     figure; m_map_gcmfaces(((myflds.rms_sladiff_smooth.^2)./(myflds.sig_sladiff_smooth.^2)),0,{'myCaxis',cc}); drawnow;
115 gforget 1.2 myCaption={tit,'-- sea level anomaly ',uni,' -- large space/time scales'};
116 gforget 1.4 if addToTex; write2tex(fileTex,2,myCaption,gcf); end;
117 gforget 1.1
118     %figure; m_map_gcmfaces(((myflds.rms_sladiff_point35d.^2)./(myflds.sig_sladiff_point.^2)),0,{'myCaxis',cc}); drawnow;
119 gforget 1.2 %myCaption={tit,'-- sea level anomaly ',uni,' -- large time scales'};
120 gforget 1.4 %if addToTex; write2tex(fileTex,2,myCaption,gcf); end;
121 gforget 1.1
122     figure; m_map_gcmfaces(((myflds.rms_sladiff_point.^2)./(myflds.sig_sladiff_point.^2)),0,{'myCaxis',cc}); drawnow;
123 gforget 1.2 myCaption={tit,'-- sea level anomaly ',uni,' -- pointwise'};
124 gforget 1.4 if addToTex; write2tex(fileTex,2,myCaption,gcf); end;
125 gforget 1.1
126     end;
127    
128    
129    
130    
131    

  ViewVC Help
Powered by ViewVC 1.1.22