Perturbation with variable correlation length

example figure

Code

% domain size
m = 50;
n = 50;

% grid resolution
dx = 200e3/(m-1);
dy = dx;
[x,y] = ndgrid(dx*[0:m-1],dy*[0:n-1]);

% land-sea mask (true: sea, false: land)
mask = true(m,n);

% metric
pm = ones(m,n)/dx;
pn = ones(m,n)/dy;

% number of ensemble perturbations
Nens = 1;

% number of EOFs retained
k = 100;

% correlation length
len = repmat(linspace(3e3,10e3,m)',[1 n]);

% create ensemble perturbations
[Ep] = wce_simple(mask,{pm,pn},{len,len},Nens,k);


contourf(x/1e3,y/1e3,Ep,50)
shading flat
xlabel('x (km)');
ylabel('y (km)');
title('Perturbation with variable correlation length');

Download wce_example_simple_varlen.m