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 9f42d3d6 authored by Pierre Cazenave's avatar Pierre Cazenave

Add support for interpolating the data on alternative grids e.g. the relative...

Add support for interpolating the data on alternative grids e.g. the relative humidity and sea level pressure
parent b95c98c1
......@@ -16,7 +16,10 @@ function fvcom = grid2fvcom(Mobj,vars,data)
% x - x data (probably best in cartesian for the interpolation)
% y - y data (probably best in cartesian for the interpolation)
% The struct must also contain all the variables defined in vars.
% time - time vector (in Modified Julian Days)
% time - time vector (in Modified Julian Days). If you're using some
% of the NCEP surface products (e.g. relative humitidy, sea level
% pressure), you need to supply x and y coordinates for their grids
% as .xalt and .yalt).
% fvcom - struct of the interpolated data values at the model nodes and
......@@ -45,6 +48,10 @@ function fvcom = grid2fvcom(Mobj,vars,data)
% lat/long arrays. Makes invocation a bit cleaner.
% 2012-11-01 Farmed out the creation of the NetCDF file to
% write_FVCOM_forcing.m and made this purely an interpolation script.
% 2013-02-14 Add support for interpolating data on two different grids
% through the .xalt and .yalt fields in the input data structure. This is
% handy if you've got data from NCEP from both the Surface and Gaussian
% products, each of which are on different grids.
......@@ -105,7 +112,17 @@ for vv=1:length(vars)
%fvcom.(vars{vv}).node(:,i) = griddata(wind.x,wind.y,currvar,x,y,'cubic');
%fvcom.(vars{vv}).data(:,i) = griddata(wind.x,wind.y,currvar,xc,yc,'cubic');
% TriScatteredInterp way (with natural neighbour interpolation)
% Use a try/catch to account for the different grids over which
% the humidity and sealevel pressure data are sampled.
ftsin = TriScatteredInterp(data.x(:), data.y(:), currvar(:), 'natural');
catch err
warning([err.identifier, ': Some NCEP data are projected' ...
' onto a different grid. Check you have specified' ...
' data.xalt and data.yalt arrays which are on the' ...
' same grid as the data to be interpolated.'])
ftsin = TriScatteredInterp(data.xalt(:), data.yalt(:), currvar(:), 'natural');
fvcom.(vars{vv}).node(:,i) = ftsin(x,y);
fvcom.(vars{vv}).data(:,i) = ftsin(xc,yc);
nnans(1) = sum(isnan(fvcom.(vars{vv}).node(:,i)));
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