% Perturbation aware of land-sea mask

% 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);
m2 = floor(m/2);
mask(1:m2,m2) = false;


% 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 =  20e03;

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

contourf(x/1e3,y/1e3,Ep,50)
shading flat
xlabel('x (km)');
ylabel('y (km)');
title('Perturbation aware of land-sea mask');
