Commit 274af834 authored by Pierre Cazenave's avatar Pierre Cazenave

Fix variable name clash between the data read in from the NetCDF file and the...

Fix variable name clash between the data read in from the NetCDF file and the data supplied to the function (i.e. the interpolated data)
parent f8cda907
function write_FVCOM_restart(fv_restart, out_restart, data) function write_FVCOM_restart(fv_restart, out_restart, indata)
% Duplicate an FVCOM restart file, replacing variable values with those % Duplicate an FVCOM restart file, replacing variable values with those
% specified in the struct data. % specified in the struct data.
% %
% function write_FVCOM_restart(fv_restart, out_restart, data) % function write_FVCOM_restart(fv_restart, out_restart, indata)
% %
% DESCRIPTION: % DESCRIPTION:
% Use an existing FVCOM restart file as a template, export all existing % Use an existing FVCOM restart file as a template, export all existing
...@@ -19,9 +19,9 @@ function write_FVCOM_restart(fv_restart, out_restart, data) ...@@ -19,9 +19,9 @@ function write_FVCOM_restart(fv_restart, out_restart, data)
% FVCOM restart file. % FVCOM restart file.
% %
% EXAMPLE USAGE: % EXAMPLE USAGE:
% data.temp = interpolated_temp; % indata.temp = interpolated_temp;
% data.salinity = interpolated_salinity; % indata.salinity = interpolated_salinity;
% write_FVCOM_restart('/tmp/fvcom_restart.nc', data) % write_FVCOM_restart('/tmp/fvcom_restart.nc', indata)
% %
% Author(s): % Author(s):
% Pierre Cazenave (Plymouth Marine Laboratory) % Pierre Cazenave (Plymouth Marine Laboratory)
...@@ -41,7 +41,7 @@ end ...@@ -41,7 +41,7 @@ end
% Get the fieldnames which must match the variable names to be replaced % Get the fieldnames which must match the variable names to be replaced
% (case sensitive). % (case sensitive).
fnames = fieldnames(data); fnames = fieldnames(indata);
nf = length(fnames); nf = length(fnames);
nc = netcdf.open(fv_restart, 'NOWRITE'); nc = netcdf.open(fv_restart, 'NOWRITE');
......
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