/[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.3 - (hide annotations) (download)
Fri Jun 24 17:02:05 2011 UTC (14 years, 1 month ago) by gforget
Branch: MAIN
Changes since 1.2: +7 -7 lines
- add headers to gecmfaces_calc routines
- move line_greatC_TUV_mask.m, line_zonal_TUV_MASKS.m, line_zonal_TUV_mask.m to gcmfaces_legacy
- add replacements gcmfaces_calc/gcmfaces_lines_transp.m and gcmfaces_calc/gcmfaces_lines_zonal.m
- now the zonal and transport 'lines' masks are added to mygrid as LATS_MASKS and LINES_MASKS
- accordingly, the old LATS_MASKS is removed from arguments list in calc_overturn.m etc.
  (calc_transports and basic_diags_display_transport still have LINES_MASKS args. for now)
  and basic_diags_compute_v3_or_v4.m etc. now call gcmfaces_lines_zonal and gcmfaces_lines_transp.
- line_greatC_TUV_MASKS_v3.m and line_greatC_TUV_MASKS_v4.m now are in sample_analysis
  and they simply output the 'lines' definitions (rather than the masks off gcmfaces_lines_transp)

1 gforget 1.3 function [FLD]=calc_zonmedian_T(fld);
2 gforget 1.2 %object: compute zonal median
3     %inputs: fld is the field of interest
4     %output: FLD is the zonal median field
5 gforget 1.3 %
6     %notes: mygrid.LATS_MASKS is the set of quasi longitudinal lines along which
7     % medians will be computed, as computed in gcmfaces_lines_zonal
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 gforget 1.3 FLD=NaN*squeeze(zeros(length(mygrid.LATS_MASKS),n3,n4));
14 gforget 1.1
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 gforget 1.3 for iy=1:length(mygrid.LATS_MASKS);
21 gforget 1.1
22     %get list ofpoints that form a zonal band:
23 gforget 1.3 mm=convert2array(mygrid.LATS_MASKS(iy).mmt);
24 gforget 1.1 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