/[MITgcm]/MITgcm_contrib/gael/matlab_class/gcmfaces_smooth/diffsmooth2D.m
ViewVC logotype

Diff of /MITgcm_contrib/gael/matlab_class/gcmfaces_smooth/diffsmooth2D.m

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

revision 1.1 by gforget, Wed Feb 10 14:48:13 2010 UTC revision 1.3 by gforget, Thu Oct 20 20:58:31 2011 UTC
# Line 1  Line 1 
1  function [FLD]=diffsmooth2D(fld,dxCsm,dyCsm);  function [FLD]=diffsmooth2D(fld,dxCsm,dyCsm);
2    
3  %object: implementation (gforget@mit.edu) of a diffusive smoother (Weaver and Courtier 2001)  %object: implementation (gforget@mit.edu) of a diffusive smoother (Weaver and Courtier 2001)
4    %
5  %input: fld     field to be smoothed (masked with NaN)  %input: fld     field to be smoothed (masked with NaN)
6  %       dxCsm,dyCsm     scale in first/second direction  %       dxCsm,dyCsm     scale in first/second direction
7  %output:FLD     smoothed field  %output:FLD     smoothed field
8    %
9  %asumption: dxCsm/dyCsm are assumed to be given at the positions of U/V points  %asumption: dxCsm/dyCsm are assumed to be given at the positions of U/V points
10    
11  global mygrid;  global mygrid;
# Line 29  smooth2D_Kvy=dyCsm.*dyCsm/smooth2D_T/2; Line 29  smooth2D_Kvy=dyCsm.*dyCsm/smooth2D_T/2;
29  FLD=fld;  FLD=fld;
30    
31  for it=1:smooth2D_nbt;  for it=1:smooth2D_nbt;
32      if mod(it,ceil(smooth2D_nbt/50))==0; fprintf([num2str(it) '/' num2str(smooth2D_nbt) ' done\n']); end;  %    if mod(it,ceil(smooth2D_nbt/50))==0; fprintf([num2str(it) '/' num2str(smooth2D_nbt) ' done\n']); end;
33    
34      [dTdxAtU,dTdyAtV]=calc_T_grad(FLD,0);      [dTdxAtU,dTdyAtV]=calc_T_grad(FLD,0);
35      tmpU=dTdxAtU.*smooth2D_Kux;      tmpU=dTdxAtU.*smooth2D_Kux;
36      tmpV=dTdyAtV.*smooth2D_Kvy;      tmpV=dTdyAtV.*smooth2D_Kvy;
37      [fldDIV]=calc_UV_div(tmpU,tmpV);      [fldDIV]=calc_UV_div(tmpU,tmpV,{'dh'});
38      dFLDdt=smooth2D_dt*fldDIV./rA;      dFLDdt=smooth2D_dt*fldDIV./rA;
39      FLD=FLD-dFLDdt;      FLD=FLD-dFLDdt;
40    

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.3

  ViewVC Help
Powered by ViewVC 1.1.22