1 | function var_u=rho2u_2d(var_rho); |
---|
2 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
3 | % |
---|
4 | % function var_u=rho2u_2d(var_rho); |
---|
5 | % |
---|
6 | % interpole a field at rho points to a field at u points |
---|
7 | % |
---|
8 | % input: |
---|
9 | % |
---|
10 | % var_rho variable at rho-points (2D matrix) |
---|
11 | % |
---|
12 | % output: |
---|
13 | % |
---|
14 | % var_u variable at u-points (2D matrix) |
---|
15 | % |
---|
16 | % Further Information: |
---|
17 | % http://www.brest.ird.fr/Roms_tools/ |
---|
18 | % |
---|
19 | % This file is part of ROMSTOOLS |
---|
20 | % |
---|
21 | % ROMSTOOLS is free software; you can redistribute it and/or modify |
---|
22 | % it under the terms of the GNU General Public License as published |
---|
23 | % by the Free Software Foundation; either version 2 of the License, |
---|
24 | % or (at your option) any later version. |
---|
25 | % |
---|
26 | % ROMSTOOLS is distributed in the hope that it will be useful, but |
---|
27 | % WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
28 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
29 | % GNU General Public License for more details. |
---|
30 | % |
---|
31 | % You should have received a copy of the GNU General Public License |
---|
32 | % along with this program; if not, write to the Free Software |
---|
33 | % Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
---|
34 | % MA 02111-1307 USA |
---|
35 | % |
---|
36 | % Copyright (c) 2001-2006 by Pierrick Penven |
---|
37 | % e-mail:Pierrick.Penven@ird.fr |
---|
38 | % |
---|
39 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
40 | [Mp,Lp]=size(var_rho); |
---|
41 | L=Lp-1; |
---|
42 | var_u=0.5*(var_rho(:,1:L)+var_rho(:,2:Lp)); |
---|
43 | return |
---|
44 | |
---|