Parent Directory | Revision Log | Revision Graph
initial checkin of topography and hydrography interpolation scripts for the llc-grid, based on old matlab scripts by Alistair Adcroft Let's hope, they are useful.
1 | function [d] = correct_for_linintep(d) |
2 | |
3 | nd=ndims(d); |
4 | |
5 | if size(d,nd)~=12 |
6 | error('Last dimension must correspond to month number') |
7 | end |
8 | |
9 | n=size(d); |
10 | nx=n(1:nd-1); |
11 | N=prod(nx); |
12 | |
13 | e=ones(12,1); |
14 | A = spdiags([e 6*e e], -1:1, 12, 12); |
15 | A(12,1)=1; |
16 | A(1,12)=1; |
17 | A=A/8; |
18 | B=inv(A); |
19 | |
20 | d=reshape(d,[N 12]); |
21 | d=d*B; |
22 | d=reshape(d,n); |
ViewVC Help | |
Powered by ViewVC 1.1.22 |