/[MITgcm]/MITgcm_contrib/gael/comm/course-idma2016/matlab/idma_box_subset.m
ViewVC logotype

Annotation of /MITgcm_contrib/gael/comm/course-idma2016/matlab/idma_box_subset.m

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


Revision 1.1 - (hide annotations) (download)
Fri Jan 8 05:05:17 2016 UTC (10 years, 7 months ago) by gforget
Branch: MAIN
- idma_float_plot.m: switch to 4900828 etc
- idma_box_subset.m (new): extact profiles in a geographic area (box)
- idma_box_mean.m (new): build monthly time series of box averages

1 gforget 1.1
2     %%add MITprof routines to matlab path:
3     dir_MITprof=[pwd filesep 'c65r_MITprof' filesep];
4     p = genpath(dir_MITprof); addpath(p);%TBE
5    
6     %%demo: load a netcdf file
7     dir_nc='/net/harbor/raid6/ecco/ecco_for_las/version_4/release1/MITprof_inputs/';
8     ncload([dir_nc 'argo_feb2013_1992_to_2007.nc']);%TBE
9     clear;
10    
11     %%set box location
12     box_l=[-180 -140]; box_L=[-10 10]-30; box_D=[0 300];%TBE
13     fprintf('\n box definition: \n');
14     fprintf(' longitude range: %d %d \n',box_l);
15     fprintf(' latitude range: %d %d \n',box_L);
16     fprintf(' depth range: %d %d \n\n',box_D);
17    
18     %%demo: MITprof_load and MITprof_subset
19     dir_nc='/net/harbor/raid6/ecco/ecco_for_las/version_4/release1/MITprof_inputs/';
20     tmp1=MITprof_load([dir_nc 'argo_feb2013_1992_to_2007.nc']);%TBE
21    
22     tmp2=MITprof_subset(tmp1,'lon',box_l,'lat',box_L,'depth',box_D);%TBE
23     figure; set(gca,'FontSize',12);
24     plot(tmp1.prof_lon,tmp1.prof_lat,'.');
25     hold on; plot(tmp2.prof_lon,tmp2.prof_lat,'r.');
26     axis([-180 180 -90 90]); title('selected profile locations');
27     xlabel('longitude'); ylabel('latitude')
28     clear tmp*;
29    
30     %%load complete data set for select variables
31     dir_nc='/net/harbor/raid6/ecco/ecco_for_las/version_4/release1/MITprof_inputs/';
32     list_nc={'argo_feb2013_1992_to_2007.nc','argo_feb2013_2008_to_2010.nc','argo_feb2013_2011_to_2012.nc',...
33     'climode_feb2013.nc','itp_feb2013.nc','seals_feb2013.nc'};
34     %note: ctd_feb2013.nc and xbt_feb2013.nc are left out here for simplicity
35     %note: it takes a couple minutes to load all of the data
36    
37     list_var={'prof_T','prof_Testim','prof_Tweight',...
38     'prof_S','prof_Sestim','prof_Sweight'};%TBE
39    
40     for vv=1:length(list_var);
41     tmp1=MITprof_stats_load(dir_nc,list_nc,'',list_var{vv});%TBE
42     tmp1=MITprof_subset(tmp1,'lon',box_l,'lat',box_L,'depth',box_D);%TBE
43     eval([list_var{vv} '=tmp1;']);%TBE
44     end;
45    
46     clear tmp1 vv;
47    

  ViewVC Help
Powered by ViewVC 1.1.22