/[MITgcm]/MITgcm_contrib/gael/matlab_class/sample_analysis/plot_std_field.m
ViewVC logotype

Annotation of /MITgcm_contrib/gael/matlab_class/sample_analysis/plot_std_field.m

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


Revision 1.9 - (hide annotations) (download)
Tue Jun 21 21:20:26 2011 UTC (15 years, 4 months ago) by gforget
Branch: MAIN
Changes since 1.8: +12 -12 lines
- plot_one_field etc. are now functions.
- added m_map_gcmfaces example in plot_one_field
- always reload grid
- update grid_load and rdmds2gcmfaces calls (argument lists)

1 gforget 1.9 function []=plot_std_field(choiceV3orV4);
2     %object: compute and display a standard deviation field
3     %inputs: choiceV3orV4 ('v3' or 'v4') selects the sample GRID
4    
5     input_list_check('plot_std_field',nargin);
6 gforget 1.1
7     %%%%%%%%%%%%%%%%%
8     %load parameters:
9     %%%%%%%%%%%%%%%%%
10 gforget 1.9 gcmfaces_path;
11     dir0=[gcmfaces_dir '/sample_input/'];
12     dirGrid=[dir0 '/GRID' choiceV3orV4 '/'];
13     dirIn=[dir0 '/SAMPLE' choiceV3orV4 '/'];
14     if strcmp(choiceV3orV4,'v4'); nF=5; fileFormat='compact'; else; nF=1; fileFormat='straight'; end;
15     global mygrid; mygrid=[]; grid_load(dirGrid,nF,fileFormat);
16 gforget 1.1
17     %%%%%%%%%%%
18     %get field:
19     %%%%%%%%%%%
20     nameFld='DDetan'; tt=[53:78]*336; cc=[0 0.10];
21 gforget 1.9 fld=rdmds2gcmfaces([dirIn nameFld],tt);
22 gforget 1.1 fld=std(fld,[],3); msk=mygrid.hFacC(:,:,1); fld(find(msk==0))=NaN;
23    
24     %%%%%%%%%%%%
25     %plot field:
26     %%%%%%%%%%%%
27     figure; set(gcf,'Units','Normalized','Position',[0.1 0.3 0.4 0.6]);
28     [X,Y,FLD]=convert2pcol(mygrid.XC,mygrid.YC,fld);
29     pcolor(X,Y,FLD); axis([-180 180 -90 90]); shading flat; caxis(cc); colorbar;
30    
31    

  ViewVC Help
Powered by ViewVC 1.1.22