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 8cd9daa5 authored by Pierre Cazenave's avatar Pierre Cazenave

Fix times when writing the nesting forcing.

parent cd5f46ce
function write_FVCOM_nested_forcing(nest, ncfile, nesttype)
% Creates an FVCOM nesting file.
% function write_nesting_struct_fvcom(Mobj, out_nesting, N)
% function write_FVCOM_nested_forcing(nest, ncfile, nesttype)
% Uses timeseries data from structured grid already interpolated into
......@@ -11,7 +11,7 @@ function write_FVCOM_nested_forcing(nest, ncfile, nesttype)
% Optionally specify nesting type:
% 1/2: DIRECT/INDIRECT nesting:
% - Full variables/no surface elevation respectively.
% 3: RELAXATION nesting:
% - Nesting with a relaxation method.
......@@ -303,27 +303,28 @@ netcdf.endDef(nc);
% write time data
nStringOut = char();
[nYr, nMon, nDay, nHour, nMin, nSec] = mjulian2greg(nest.time);
for i = 1:ntimes
[nYr, nMon, nDay, nHour, nMin, nSec] = mjulian2greg(nest.time(i));
if strcmp(sprintf('%02i', nSec), '60')
% Fix some weirdness with mjulian2greg. I think this is caused by
% rounding errors. My testing suggests this is not a problem around
% midnight, so the number of days (and thus possibly months and
% years) is unaffected.
if mod(nMin + 1, 60) == 0
if mod(nMin(i) + 1, 60) == 0
% Up the hour by one too
nHour = mod(nHour + 1, 24);
nHour(i) = mod(nHour(i) + 1, 24);
nMin = mod(nMin + 1, 60);
nSec = 0;
nMin(i) = mod(nMin(i) + 1, 60);
nSec(i) = 0;
nDate = [nYr, nMon, nDay, nHour, nMin, nSec];
nStringOut = [nStringOut, sprintf('%04i/%02i/%02i %02i:%02i:%02i ', nDate)];
nDate = [nYr(i), nMon(i), nDay(i), nHour(i), nMin(i), nSec(i)];
nStringOut = [nStringOut, sprintf('%-026s', datestr(datenum(nDate), 'yyyy-mm-dd HH:MM:SS.FFF'))];
netcdf.putVar(nc, itime_varid, 0, numel(nest.time), floor(nest.time));
netcdf.putVar(nc, itime2_varid, 0, numel(nest.time), ...
mod(nest.time, 1)*24*3600*1000);
netcdf.putVar(nc, Times_varid, nStringOut);
netcdf.putVar(nc, time_varid, nest.time);
% write grid information
netcdf.putVar(nc, nv_varid, nest.nv);
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