/[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.4 - (hide annotations) (download)
Wed Apr 18 20:14:34 2012 UTC (13 years, 3 months ago) by gforget
Branch: MAIN
Changes since 1.3: +27 -19 lines
- basic_diags_ecco.m :
  include dirMat/dirModel in listSubdirs, with implication for v4_diff_snapshots
  fix parms.recInAve
- v4_diff_snapshots.m :
  now writes to [dirMat 'BUDG/'] rather than [dirModel 'diags/BUDG/']
- comp_driver.m :
  now writes to [dirMat 'profiles/'] rather than [dirModel 'diags/profiles/']
  use dirMat/dirModel in costs & xx & insitu
  change lchunk to 52 for budget diags (set 'D' of basic_diags_ecco.m)
- plot_driver.m
  use dirMat/dirModel in costs & xx & insitu
- cost_altimeter.m, cost_altimeter_disp.m, cost_bp.m, cost_sst.m, cost_xx.m :
  use dirMat/dirTex

1 gforget 1.4 function []=cost_altimeter_disp(dirMat,choicePlot,suf,dirTex);
2 gforget 1.1 %object: compute or plot the various sea level statistics
3     % (std model-obs, model, obs, leading to cost function terms)
4 gforget 1.4 %inputs: dirMat is the model run directory
5 gforget 1.1 % doComp is the switch from computation to plot
6    
7     %if doDifObsOrMod==1; suf='modMobs'; elseif doDifObsOrMod==2; suf='obs'; else; suf='mod'; end;
8    
9 gforget 1.4 gcmfaces_global;
10     %here we always reload the grid from dirMat to make sure the same one is used throughout
11     eval(['load ' dirMat 'basic_diags_ecco_mygrid.mat;']);
12 gforget 1.1
13 gforget 1.4 %determine if and where to create tex and figures files
14     dirMat=[dirMat '/'];
15     if isempty(who('dirTex'));
16     addToTex=0;
17     else;
18     if ~ischar(dirTex); error('mis-specified dirTex'); end;
19     addToTex=1; fileTex=[dirTex 'myPlots.tex'];
20     end;
21 gforget 1.1
22     %%%%%%%%%%%%%%%
23     %define pathes:
24     %%%%%%%%%%%%%%%
25    
26 gforget 1.3 % dirData='/net/altix3700/raid4/gforget/mysetups/ecco_v4/INPUTS_90x50/';
27 gforget 1.1 dirData='/net/altix3700/raid4/gforget/mysetups/ecco_v4/INPUTS_90x50/';
28 gforget 1.4 if isempty(dirMat); dirMat=[dirModel 'mat/']; else; dirMat=[dirMat '/']; end;
29 gforget 1.1 runName=pwd; tmp1=strfind(runName,'/'); runName=runName(tmp1(end)+1:end);
30    
31     %%%%%%%%%%%%%%%%%
32     %do computations:
33     %%%%%%%%%%%%%%%%%
34    
35 gforget 1.4 eval(['load ' dirMat 'cost_altimeter_' suf '.mat myflds;']);
36 gforget 1.1
37     if strcmp(suf,'modMobs'); tit='modeled-observed';
38     elseif strcmp(suf,'obs'); tit='observed';
39     elseif strcmp(suf,'mod'); tit='modeled';
40     else; error('unknown field');
41     end
42    
43 gforget 1.2 if choicePlot==1; tit=[tit ' rms']; uni='(cm)';
44     elseif choicePlot==2; tit='prior uncertainty'; uni='(cm)';
45     else; tit=[tit ' cost']; uni='';
46 gforget 1.1 end;
47    
48     if choicePlot==1;%rms
49    
50     if strcmp(suf,'modMobs');
51     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];
52     figure; m_map_gcmfaces(100*myflds.dif_mdt,0,{'myCaxis',100*cc}); drawnow;
53 gforget 1.2 tmp1=strfind(tit,'rms');
54     if ~isempty(tmp1); tit2=[tit(1:tmp1-1) 'difference' tit(tmp1+3:end)]; else; tit2=tit; end;
55     myCaption={tit2,'-- mean dynamic topography ',uni};
56 gforget 1.4 if addToTex; write2tex(fileTex,2,myCaption,gcf); end;
57 gforget 1.1 end;
58    
59     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];
60     figure; m_map_gcmfaces(100*myflds.rms_sladiff_smooth,0,{'myCaxis',100*cc}); drawnow;
61 gforget 1.2 myCaption={tit,'-- sea level anomaly ',uni,' -- large space/time scales'};
62 gforget 1.4 if addToTex; write2tex(fileTex,2,myCaption,gcf); end;
63 gforget 1.1
64     %figure; m_map_gcmfaces(100*myflds.rms_sladiff_point35d,0,{'myCaxis',100*cc}); drawnow;
65 gforget 1.2 %myCaption={tit,'-- sea level anomaly ',uni,' -- large time scales'};
66 gforget 1.4 %if addToTex; write2tex(fileTex,2,myCaption,gcf); end;
67 gforget 1.1
68     figure; m_map_gcmfaces(100*myflds.rms_sladiff_point,0,{'myCaxis',100*cc}); drawnow;
69 gforget 1.2 myCaption={tit,'-- sea level anomaly ',uni,' -- pointwise'};
70 gforget 1.4 if addToTex; write2tex(fileTex,2,myCaption,gcf); end;
71 gforget 1.1
72     elseif choicePlot==2;%uncertainty fields
73    
74     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];
75     figure; m_map_gcmfaces(100*myflds.sig_mdt,0,{'myCaxis',100*cc}); drawnow;
76 gforget 1.2 myCaption={tit,'-- mean dynamic topography ',uni};
77 gforget 1.4 if addToTex; write2tex(fileTex,2,myCaption,gcf); end;
78 gforget 1.1
79     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];
80     figure; m_map_gcmfaces(100*myflds.sig_sladiff_smooth,0,{'myCaxis',100*cc}); drawnow;
81 gforget 1.2 myCaption={tit,'-- sea level anomaly ',uni,' -- large space/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.sig_sladiff_point,0,{'myCaxis',100*cc}); drawnow;
85 gforget 1.2 %myCaption={tit,'-- sea level anomaly ',uni,' -- large time scales'};
86 gforget 1.4 %if addToTex; write2tex(fileTex,2,myCaption,gcf); end;
87 gforget 1.1
88     figure; m_map_gcmfaces(100*myflds.sig_sladiff_point,0,{'myCaxis',100*cc}); drawnow;
89 gforget 1.2 myCaption={tit,'-- sea level anomaly ',uni,' -- pointwise'};
90 gforget 1.4 if addToTex; write2tex(fileTex,2,myCaption,gcf); end;
91 gforget 1.1
92     else;%cost
93    
94     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;
95    
96     figure; m_map_gcmfaces(((myflds.dif_mdt.^2)./(myflds.sig_mdt.^2)),0,{'myCaxis',cc}); drawnow;
97 gforget 1.2 myCaption={tit,'-- mean dynamic topography ',uni};
98 gforget 1.4 if addToTex; write2tex(fileTex,2,myCaption,gcf); end;
99 gforget 1.1
100     figure; m_map_gcmfaces(((myflds.rms_sladiff_smooth.^2)./(myflds.sig_sladiff_smooth.^2)),0,{'myCaxis',cc}); drawnow;
101 gforget 1.2 myCaption={tit,'-- sea level anomaly ',uni,' -- large space/time scales'};
102 gforget 1.4 if addToTex; write2tex(fileTex,2,myCaption,gcf); end;
103 gforget 1.1
104     %figure; m_map_gcmfaces(((myflds.rms_sladiff_point35d.^2)./(myflds.sig_sladiff_point.^2)),0,{'myCaxis',cc}); drawnow;
105 gforget 1.2 %myCaption={tit,'-- sea level anomaly ',uni,' -- large time scales'};
106 gforget 1.4 %if addToTex; write2tex(fileTex,2,myCaption,gcf); end;
107 gforget 1.1
108     figure; m_map_gcmfaces(((myflds.rms_sladiff_point.^2)./(myflds.sig_sladiff_point.^2)),0,{'myCaxis',cc}); drawnow;
109 gforget 1.2 myCaption={tit,'-- sea level anomaly ',uni,' -- pointwise'};
110 gforget 1.4 if addToTex; write2tex(fileTex,2,myCaption,gcf); end;
111 gforget 1.1
112     end;
113    
114    
115    
116    
117    

  ViewVC Help
Powered by ViewVC 1.1.22