Due to a shift in policy, from 0900 GMT on Wednesday 14th July 2021, we will be disabling ssh access to the server for external users. External users who wish to continue to access code repositories on the server will need to switch to using https. This can be accomplished in the following way: 1) On the repo on gitlab, use the clone dialogue and select ‘Clone with HTTPS’ to get the address of the repo; 2) From within the checkout of your repo run: $ git remote set-url origin HTTPS_ADDRESS. Here, replace HTTPS_ADDRESS with the address you have just copied from GitLab. Pulls and pushes will now require you to enter a username and password rather than using a ssh key. If you would prefer not to enter a password each time, you might consider caching your login credentials.

Commit f7ab1d84 authored by Pierre Cazenave's avatar Pierre Cazenave

Make the code handle nodes and elements more seamlessly (and, critically, correctly).

parent 8c3f1fd4
......@@ -59,6 +59,9 @@ function Mobj = get_HYCOM_tsobc(Mobj, hycom, varlist)
% significant performance improvement (both in memory usage and time).
% 2017-02-16 Further performance improvement by only using the coarse
% data in the vicinity of the open boundary nodes.
% 2017-10-12 Fix bug in indexing the open boundary positions which may
% have caused the interpolation to fail as the identified positions
% would be too far from the open boundary nodes.
%
%==========================================================================
......@@ -171,6 +174,10 @@ for v = 1:length(fields)
fvlon = Mobj.lonc(oElems);
fvlat = Mobj.latc(oElems);
sigma = Mobj.siglayzc;
grid_ids = oElems;
% Number of boundary elements to process
nf = length(oElems);
if ftbverbose
fprintf('Variable %s on elements (%d positions)\n', fields{v}, length(fvlon))
end
......@@ -180,14 +187,15 @@ for v = 1:length(fields)
fvlon = Mobj.lon(oNodes);
fvlat = Mobj.lat(oNodes);
sigma = Mobj.siglayz;
grid_ids = oNodes;
% Number of boundary nodes
nf = length(oNodes);
if ftbverbose
fprintf('Variable %s on nodes (%d positions)\n', fields{v}, length(fvlon))
end
end
% Number of boundary nodes
nf = length(oNodes);
fvtemp = nan(nf, fz, nt); % FVCOM interpolated data
for t = 1:nt
......@@ -440,8 +448,8 @@ for v = 1:length(fields)
fvtempz = nan(nf, fz);
for pp = 1:nf
% Get the FVCOM depths at this node
tfz = sigma(oNodes(pp), :);
% Get the FVCOM depths at this position
tfz = sigma(grid_ids(pp), :); % grid_ids is oNodes or oElems
% The HYCOM data is unusual in that the depths are fixed and
% data are only saved at the depths shallower than the
......
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