/[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.2 by gforget, Sun Feb 14 17:29:28 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 34  for it=1:smooth2D_nbt; Line 34  for it=1:smooth2D_nbt;
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.2  
changed lines
  Added in v.1.3

  ViewVC Help
Powered by ViewVC 1.1.22