Home > omviz > uvp_masks.m

uvp_masks

PURPOSE ^

function [umask,vmask,pmask]=uvp_masks(rmask) %

SYNOPSIS ^

function [umask,vmask,pmask]=uvp_masks(rmask);

DESCRIPTION ^

  function [umask,vmask,pmask]=uvp_masks(rmask)                            %
                                                                           %
  This function computes the Land/Sea masks on U-, V-, and PSI-points      %
  from the mask on RHO-points.                                             %
                                                                           %
  On Input:                                                                %
                                                                           %
    rmask        Land/Sea mask on RHO-points (real matrix).                %
                                                                           %
  On Output:                                                               %
                                                                           %
    umask        Land/Sea mask on U-points (real matrix).                  %
    vmask        Land/Sea mask on V-points (real matrix).                  %
    pmask        Land/Sea mask on PSI-points (real matrix).                %
                                                                           %
  Copyright (c) 1996 Rutgers University                                    %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [umask,vmask,pmask]=uvp_masks(rmask);
0002 
0003 %  function [umask,vmask,pmask]=uvp_masks(rmask)                            %
0004 %                                                                           %
0005 %  This function computes the Land/Sea masks on U-, V-, and PSI-points      %
0006 %  from the mask on RHO-points.                                             %
0007 %                                                                           %
0008 %  On Input:                                                                %
0009 %                                                                           %
0010 %    rmask        Land/Sea mask on RHO-points (real matrix).                %
0011 %                                                                           %
0012 %  On Output:                                                               %
0013 %                                                                           %
0014 %    umask        Land/Sea mask on U-points (real matrix).                  %
0015 %    vmask        Land/Sea mask on V-points (real matrix).                  %
0016 %    pmask        Land/Sea mask on PSI-points (real matrix).                %
0017 %                                                                           %
0018 %  Copyright (c) 1996 Rutgers University                                    %
0019 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0020 
0021 [Mp Lp]=size(rmask);
0022 
0023 %  Land/Sea mask on U-points.
0024 
0025 for i=2:Lp,
0026   for j=1:Mp,
0027     umask(j,i-1)=rmask(j,i)*rmask(j,i-1);
0028   end,
0029 end,
0030 
0031 %  Land/Sea mask on V-points.
0032 
0033 for i=1:Lp,
0034   for j=2:Mp,
0035     vmask(j-1,i)=rmask(j,i)*rmask(j-1,i);
0036   end,
0037 end,
0038 
0039 %  Land/Sea mask on PSI-points.
0040 
0041 for i=2:Lp,
0042   for j=2:Mp,
0043     pmask(j-1,i-1)=rmask(j,i)*rmask(j,i-1)*rmask(j-1,i)*rmask(j-1,i-1);
0044   end,
0045 end,
0046 
0047 return

Generated on Thu 01-Dec-2005 08:50:35 by m2html © 2003