/[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.2 - (hide annotations) (download)
Sun Jan 24 16:25:51 2016 UTC (9 years, 6 months ago) by gforget
Branch: MAIN
CVS Tags: checkpoint65x, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a
Changes since 1.1: +0 -4 lines
- gcmfaces_demo.m: improve help section, add comments wrt gcmfaces_global etc
- example*.m: homogeneize treatment of mygrid (don't reload if not needed)
  and path (use just gcmfaces_global)

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     gcmfaces_global;
13    
14     input_list_check('example_IO',nargin);
15    
16     %expected location:
17     myenv.nctilesdir=fullfile(pwd,'/release1/nctiles_climatology/ETAN/');
18     %if ETAN is not found then try old location:
19     if ~isdir(myenv.nctilesdir);
20     %if not found then try old location:
21     tmpdir=fullfile(pwd,'/gcmfaces/sample_input/nctiles_climatology/ETAN/');
22     if isdir(tmpdir); myenv.nctilesdir=tmpdir; end;
23     end;
24     %if ETAN is still not found then issue warning and skip example_IO
25     if ~isdir(myenv.nctilesdir);
26     help example_IO;
27     warning('example_IO requires release1/nctiles_climatology/ETAN that was not found ---> abort!');
28     return;
29     end;
30    
31     %%%%%%%%%%%%%%%%%
32     %load grid:
33     %%%%%%%%%%%%%%%%%
34    
35     if isempty(mygrid);
36     grid_load;
37     end;
38    
39     %%%%%%%%%%%
40     %get field:
41     %%%%%%%%%%%
42     fld=read_nctiles([myenv.nctilesdir 'ETAN'],'ETAN');
43     fld=std(fld,[],3); fld(find(fld==0))=NaN;
44     cc=[0:0.1:1]*0.10;
45    
46     %%%%%%%%%%%%
47     %plot field:
48     %%%%%%%%%%%%
49     if ~myenv.lessplot;
50     figureL; gcmfaces_sphere(fld,cc,[],[],1);
51     end;
52    
53    

  ViewVC Help
Powered by ViewVC 1.1.22