/[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.2 - (hide annotations) (download)
Fri Jul 8 13:18:04 2011 UTC (14 years ago) by gforget
Branch: MAIN
Changes since 1.1: +17 -15 lines
- added: cost_xx.m that compute/plot the mean and variance of controls.
- cost_bp.m, cost_sst.m, cost_altimeter_disp.m : revised captions for wrote2tex.
- plot_driver.m : add title, sections, cost_xx. split basic_diags_ecco_disp.
- cost_altimeter.m : mask out data poleward of 66. resolve divide by zero
  warnings by applying masks, and switching off the warning.
- basic_diags_ecco.m : split in three using new setDiags paramater; speed-up I/O
  by using rdmds2workspace_list.m; fix heat and salt transport computations (missing
  factors); include time averaging for setDiags='B'; save mygrid to basic_diags_ecco_mygrid.mat
- basic_diags_ecco_disp.m : split in three using new setDiags paramater; load mygrid
  from basic_diags_ecco_mygrid.mat; improve captions for write2tex; set time averaging
  period to 92-07; include computation of zonal mean climatology for setDiags='C';
  use depthStretchPlot for section; add air-sea fluxes and ice plots; fix transports
  time series plots;

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

  ViewVC Help
Powered by ViewVC 1.1.22