Commit 92af0ef4 authored by Ricardo Torres's avatar Ricardo Torres 💬

Added tanh to generic read_sigma function corrected indices in sigma_tanh

parent b8dc34cf
......@@ -126,6 +126,10 @@ if ftbverbose
fprintf('zku\t%d\n', zku)
fprintf('zkl\t%d\n', zkl)
end
if strcmpi(sigtype, 'TANH')
fprintf('du\t%d\n', du)
fprintf('dl\t%d\n', dl)
end
end
% Calculate the sigma distributions at each grid node.
......@@ -146,6 +150,8 @@ switch lower(sigtype)
z = repmat(sigma_geo(nlev, 1), [nx, 1]);
case 'geometric'
z = repmat(sigma_geo(nlev, sigpow), [nx, 1]);
case 'tanh'
z = repmat(sigma_tanh(nlev, dl,du), [nx, 1]);
otherwise
error('Don''t recognise sigtype %s (is it supported?)', sigtype)
end
......
......@@ -28,7 +28,7 @@ function dist = sigma_tanh(nlev,dl,du)
dist = zeros(1, nlev);
for k = 1:nlev
for k = 1:nlev-1
x1 = dl+du;
x1 = x1*(nlev-1-k)/(nlev-1);
x1 = x1-dl;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment