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

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

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


Revision 1.1 - (hide annotations) (download)
Sun Jan 24 13:29:46 2016 UTC (9 years, 6 months ago) by gforget
Branch: MAIN
- rename plot_one_field and plot_std_field as example_display and example_IO

1 gforget 1.1 function []=example_IO();
2     %
3     % EXAMPLE_IO computes and displays a standard deviation field
4     %
5     % stand-alone call: addpath gcmfaces/sample_analysis/; example_IO;
6     %
7     % needed input files:
8     % mkdir release1
9     % wget --recursive ftp://mit.ecco-group.org/ecco_for_las/version_4/release1/nctiles_climatology/ETAN
10     % mv mit.ecco-group.org/ecco_for_las/version_4/release1/nctiles_climatology release1/.
11    
12     p = genpath('gcmfaces/'); addpath(p);
13     p = genpath('MITprof/'); addpath(p);
14    
15     gcmfaces_global;
16    
17     input_list_check('example_IO',nargin);
18    
19     %expected location:
20     myenv.nctilesdir=fullfile(pwd,'/release1/nctiles_climatology/ETAN/');
21     %if ETAN is not found then try old location:
22     if ~isdir(myenv.nctilesdir);
23     %if not found then try old location:
24     tmpdir=fullfile(pwd,'/gcmfaces/sample_input/nctiles_climatology/ETAN/');
25     if isdir(tmpdir); myenv.nctilesdir=tmpdir; end;
26     end;
27     %if ETAN is still not found then issue warning and skip example_IO
28     if ~isdir(myenv.nctilesdir);
29     help example_IO;
30     warning('example_IO requires release1/nctiles_climatology/ETAN that was not found ---> abort!');
31     return;
32     end;
33    
34     %%%%%%%%%%%%%%%%%
35     %load grid:
36     %%%%%%%%%%%%%%%%%
37    
38     mygrid=[];
39     if isempty(mygrid);
40     grid_load;
41     end;
42    
43     %%%%%%%%%%%
44     %get field:
45     %%%%%%%%%%%
46     fld=read_nctiles([myenv.nctilesdir 'ETAN'],'ETAN');
47     fld=std(fld,[],3); fld(find(fld==0))=NaN;
48     cc=[0:0.1:1]*0.10;
49    
50     %%%%%%%%%%%%
51     %plot field:
52     %%%%%%%%%%%%
53     if ~myenv.lessplot;
54     figureL; gcmfaces_sphere(fld,cc,[],[],1);
55     end;
56    
57    

  ViewVC Help
Powered by ViewVC 1.1.22