/[MITgcm]/MITgcm_contrib/gael/matlab_class/gcmfaces_calc/calc_zonmedian_T.m
ViewVC logotype

Annotation of /MITgcm_contrib/gael/matlab_class/gcmfaces_calc/calc_zonmedian_T.m

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


Revision 1.2 - (hide annotations) (download)
Fri Jun 24 01:55:42 2011 UTC (14 years, 1 month ago) by gforget
Branch: MAIN
Changes since 1.1: +6 -1 lines
- added headers

1 gforget 1.1 function [FLD]=calc_zonmedian_T(fld,LATS_MASKS);
2 gforget 1.2 %object: compute zonal median
3     %inputs: fld is the field of interest
4     % LATS_MASKS is the set of quasi longitudinal lines along
5     % which transports will integrated (LATS_MASKS should
6     % have been produced by line_zonal_TUV_MASKS.m)
7     %output: FLD is the zonal median field
8 gforget 1.1
9     global mygrid;
10    
11     %initialize output:
12     n3=max(size(fld.f1,3),1); n4=max(size(fld.f1,4),1);
13     FLD=NaN*squeeze(zeros(length(LATS_MASKS),n3,n4));
14    
15     %use array format to speed up computation below:
16     fld=convert2array(fld.*mygrid.mskC);
17     n1=size(fld,1); n2=size(fld,2);
18     fld=reshape(fld,n1*n2,n3*n4);
19    
20     for iy=1:length(LATS_MASKS);
21    
22     %get list ofpoints that form a zonal band:
23     mm=convert2array(LATS_MASKS(iy).mmt);
24     mm=find(~isnan(mm));
25    
26     %do the median along this band:
27     tmp1=nanmedian(fld(mm,:),1);
28    
29     %store:
30     FLD(iy,:,:)=reshape(tmp1,n3,n4);
31    
32     end;
33    
34    

  ViewVC Help
Powered by ViewVC 1.1.22