/[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.1 - (hide annotations) (download)
Wed Dec 22 00:43:23 2010 UTC (14 years, 7 months ago) by gforget
Branch: MAIN
calc_boxmean_T.m	compute weighted averages over lat/lon boxes
calc_zonmedian_T.m	compute median zonal lines
gcmfaces_section.m	extract section along lat/lon poins pair

1 gforget 1.1 function [FLD]=calc_zonmedian_T(fld,LATS_MASKS);
2    
3     %by assumption: zonmean_TUV_mask is done, and grid_load is done
4     global mygrid;
5    
6     %initialize output:
7     n3=max(size(fld.f1,3),1); n4=max(size(fld.f1,4),1);
8     FLD=NaN*squeeze(zeros(length(LATS_MASKS),n3,n4));
9    
10     %use array format to speed up computation below:
11     fld=convert2array(fld.*mygrid.mskC);
12     n1=size(fld,1); n2=size(fld,2);
13     fld=reshape(fld,n1*n2,n3*n4);
14    
15     for iy=1:length(LATS_MASKS);
16    
17     %get list ofpoints that form a zonal band:
18     mm=convert2array(LATS_MASKS(iy).mmt);
19     mm=find(~isnan(mm));
20    
21     %do the median along this band:
22     tmp1=nanmedian(fld(mm,:),1);
23    
24     %store:
25     FLD(iy,:,:)=reshape(tmp1,n3,n4);
26    
27     end;
28    
29    

  ViewVC Help
Powered by ViewVC 1.1.22