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