Commit f5ac8b93 authored by Pierre Cazenave's avatar Pierre Cazenave

Make all the netCDF history global attributes consistent.

parent 40aa8f64
......@@ -67,7 +67,7 @@ nc = netcdf.create(file, 'clobber');
netcdf.putAtt(nc, netcdf.getConstant('NC_GLOBAL'), 'references', 'http://fvcom.smast.umassd.edu, http://pml.ac.uk')
netcdf.putAtt(nc, netcdf.getConstant('NC_GLOBAL'), 'source', 'init_lag.m')
netcdf.putAtt(nc, netcdf.getConstant('NC_GLOBAL'), 'info', 'debugging')
netcdf.putAtt(nc, netcdf.getConstant('NC_GLOBAL'), 'history', 'File generated using init_lag.m from the MATLAB fvcom-toolbox')
netcdf.putAtt(nc, netcdf.getConstant('NC_GLOBAL'), 'history', sprintf('File created with %s from the MATLAB fvcom-toolbox', subname))
% Dimensions
nlag_dimid = netcdf.defDim(nc, 'nparticles', nLag);
......
......@@ -86,7 +86,7 @@ end
% Define global attributes.
nc.type = 'FVCOM METEO FORCING FILE';
nc.title = 'WRF model forcing';
nc.history = sprintf('FILE CREATED using wrf2fvcom.m from the MATLAB fvcom-toolbox on %s', datestr(now, 31));
nc.history = sprintf('File created with %s from the MATLAB fvcom-toolbox', subname);
nc.source = grid_source;
nc.START_DATE = datestr(wrf.mtime(1, 1), 31);
nc.END_DATE = datestr(wrf.mtime(end, 1), 31);
......
......@@ -51,7 +51,7 @@ end;
nc = netcdf.create(filename,'clobber');
netcdf.putAtt(nc,netcdf.getConstant('NC_GLOBAL'),'title',mytitle)
netcdf.putAtt(nc,netcdf.getConstant('NC_GLOBAL'),'history', 'File created using write_FVCOM_TT.m from the MATLAB fvcom-toolbox')
netcdf.putAtt(nc,netcdf.getConstant('NC_GLOBAL'),'history', sprintf('File created with %s from the MATLAB fvcom-toolbox', subname))
% dimensions
nele_dimid=netcdf.defDim(nc,'nele',nElems);
......
......@@ -117,7 +117,7 @@ nc=netcdf.create(ElevationFile,'clobber');
% define global attributes
netcdf.putAtt(nc,netcdf.getConstant('NC_GLOBAL'),'type','FVCOM TIME SERIES ELEVATION FORCING FILE')
netcdf.putAtt(nc,netcdf.getConstant('NC_GLOBAL'),'title',MyTitle)
netcdf.putAtt(nc,netcdf.getConstant('NC_GLOBAL'),'history','File created using write_FVCOM_elevtide from the MATLAB fvcom-toolbox')
netcdf.putAtt(nc,netcdf.getConstant('NC_GLOBAL'),'history', sprintf('File created with %s from the MATLAB fvcom-toolbox', subname))
% define dimensions
nobc_dimid=netcdf.defDim(nc,'nobc',nObcs);
......
......@@ -199,7 +199,7 @@ for i=1:length(suffixes)
netcdf.putAtt(nc,netcdf.getConstant('NC_GLOBAL'),'title','FVCOM Forcing File')
netcdf.putAtt(nc,netcdf.getConstant('NC_GLOBAL'),'institution','Plymouth Marine Laboratory')
netcdf.putAtt(nc,netcdf.getConstant('NC_GLOBAL'),'source','FVCOM grid (unstructured) surface forcing')
netcdf.putAtt(nc,netcdf.getConstant('NC_GLOBAL'),'history',['File created on ', datestr(now, 'yyyy-mm-dd HH:MM:SS'), ' with write_FVCOM_forcing.m from the MATLAB fvcom-toolbox (https://github.com/pwcazenave/fvcom-toolbox)'])
netcdf.putAtt(nc,netcdf.getConstant('NC_GLOBAL'),'history', sprintf('File created with %s from the MATLAB fvcom-toolbox', subname))
netcdf.putAtt(nc,netcdf.getConstant('NC_GLOBAL'),'references','http://fvcom.smast.umassd.edu, http://codfish.smast.umassd.edu')
netcdf.putAtt(nc,netcdf.getConstant('NC_GLOBAL'),'Conventions','CF-1.0')
% netcdf.putAtt(nc,netcdf.getConstant('NC_GLOBAL'),'infos',infos)
......
......@@ -83,7 +83,7 @@ nc = netcdf.create([fileprefix, '_hfx.nc'], 'clobber');
netcdf.putAtt(nc, netcdf.getConstant('NC_GLOBAL'), 'title', 'FVCOM Forcing File')
netcdf.putAtt(nc, netcdf.getConstant('NC_GLOBAL'), 'institution', 'Plymouth Marine Laboratory')
netcdf.putAtt(nc, netcdf.getConstant('NC_GLOBAL'), 'source', 'FVCOM grid (unstructured) surface forcing')
netcdf.putAtt(nc, netcdf.getConstant('NC_GLOBAL'), 'history', ['File created on ', datestr(now, 'yyyy-mm-dd HH:MM:SS'), ' with write_FVCOM_forcing.m from the MATLAB fvcom-toolbox (https://github.com/pwcazenave/fvcom-toolbox)'])
netcdf.putAtt(nc, netcdf.getConstant('NC_GLOBAL'), 'history', sprintf('File created with %s from the MATLAB fvcom-toolbox', subname))
netcdf.putAtt(nc, netcdf.getConstant('NC_GLOBAL'), 'references', 'http://fvcom.smast.umassd.edu, http://codfish.smast.umassd.edu')
netcdf.putAtt(nc, netcdf.getConstant('NC_GLOBAL'), 'Conventions', 'CF-1.0')
netcdf.putAtt(nc, netcdf.getConstant('NC_GLOBAL'), 'CoordinateSystem', Mobj.nativeCoords)
......
......@@ -44,7 +44,7 @@ nc = netcdf.create(ncfile, 'clobber');
% define global attributes
netcdf.putAtt(nc,netcdf.getConstant('NC_GLOBAL'), 'type', 'FVCOM MEANFLOW TIME SERIES FILE')
netcdf.putAtt(nc,netcdf.getConstant('NC_GLOBAL'), 'title', 'FVCOM MEANFLOW TIME SERIES data for open boundary')
netcdf.putAtt(nc,netcdf.getConstant('NC_GLOBAL'), 'history', 'File created using write_FVCOM_meanflow.m from the MATLAB fvcom-toolbox')
netcdf.putAtt(nc,netcdf.getConstant('NC_GLOBAL'), 'history', sprintf('File created with %s from the MATLAB fvcom-toolbox', subname))
netcdf.putAtt(nc,netcdf.getConstant('NC_GLOBAL'), 'filename', ncfile)
netcdf.putAtt(nc,netcdf.getConstant('NC_GLOBAL'), 'Conventions', 'CF-1.0')
......
......@@ -119,8 +119,7 @@ netcdf.putAtt(nc, netcdf.getConstant('NC_GLOBAL'), 'title', ...
sprintf('FVCOM nestING TYPE %d TIME SERIES data for open boundary', ...
nesttype))
netcdf.putAtt(nc, netcdf.getConstant('NC_GLOBAL'), 'history', ...
['File created using write_FVCOM_nested_forcing.m', ...
'from the MATLAB fvcom-toolbox'])
sprintf('File created using %s from the MATLAB fvcom-toolbox', subname))
netcdf.putAtt(nc, netcdf.getConstant('NC_GLOBAL'), 'filename', ncfile)
netcdf.putAtt(nc, netcdf.getConstant('NC_GLOBAL'), 'Conventions', 'CF-1.0')
......
......@@ -34,6 +34,12 @@ function write_FVCOM_obs_TS(time,zsl,nverts,tsl,ssl,filename,mytitle)
%
%==============================================================================
global ftbverbose
subname = 'write_FVCOM_obc_TS'
if ftbverbose
fprintf('\nbegin : %s \n', subname);
end
% check dimensions
ksl = numel(zsl);
......@@ -54,7 +60,7 @@ fprintf('Size of T/S array: %d\n',ksl);
nc = netcdf.create(filename,'clobber');
netcdf.putAtt(nc,netcdf.getConstant('NC_GLOBAL'),'title',mytitle)
netcdf.putAtt(nc,netcdf.getConstant('NC_GLOBAL'),'history','File created with the write_FVCOM_obs_TS.m from the MATLAB fvcom-toolbox')
netcdf.putAtt(nc,netcdf.getConstant('NC_GLOBAL'),'history', sprintf('File created with %s from the MATLAB fvcom-toolbox', subname))
% define dimensions
ksl_dimid=netcdf.defDim(nc,'ksl',ksl);
......@@ -115,6 +121,9 @@ netcdf.putVar(nc,ssl_varid,ssl);
% Close the NetCDF file(s)
netcdf.close(nc);
if ftbverbose
fprintf('end : %s \n', subname)
end
......@@ -76,7 +76,7 @@ nc = netcdf.create(RiverFile, 'clobber');
netcdf.putAtt(nc, netcdf.getConstant('NC_GLOBAL'), 'type', 'FVCOM RIVER FORCING FILE')
netcdf.putAtt(nc, netcdf.getConstant('NC_GLOBAL'), 'title', RiverInfo1)
netcdf.putAtt(nc, netcdf.getConstant('NC_GLOBAL'), 'info', RiverInfo2)
netcdf.putAtt(nc, netcdf.getConstant('NC_GLOBAL'), 'history', 'File created using write_FVCOM_river.m from the MATLAB fvcom-toolbox')
netcdf.putAtt(nc, netcdf.getConstant('NC_GLOBAL'), 'history', sprintf('File created using %s from the MATLAB fvcom-toolbox', subname))
% dimensions
namelen_dimid = netcdf.defDim(nc, 'namelen', 80);
......
......@@ -76,7 +76,7 @@ nc = netcdf.create(RiverFile, 'clobber');
netcdf.putAtt(nc, netcdf.getConstant('NC_GLOBAL'), 'type', 'FVCOM RIVER FORCING FILE')
netcdf.putAtt(nc, netcdf.getConstant('NC_GLOBAL'), 'title', RiverInfo1)
netcdf.putAtt(nc, netcdf.getConstant('NC_GLOBAL'), 'info', RiverInfo2)
netcdf.putAtt(nc, netcdf.getConstant('NC_GLOBAL'), 'history', 'File created using write_FVCOM_river.m from the MATLAB fvcom-toolbox')
netcdf.putAtt(nc, netcdf.getConstant('NC_GLOBAL'), 'history', sprintf('File created using %s from the MATLAB fvcom-toolbox', subname))
% dimensions
namelen_dimid = netcdf.defDim(nc, 'namelen', 80);
......
......@@ -84,7 +84,7 @@ for i=1:nComponents
end
end
netcdf.putAtt(nc,netcdf.getConstant('NC_GLOBAL'),'components',ComponentsOut)
netcdf.putAtt(nc,netcdf.getConstant('NC_GLOBAL'),'history','File created using write_FVCOM_spectide.m from the MATLAB fvcom-toolbox')
netcdf.putAtt(nc,netcdf.getConstant('NC_GLOBAL'),'history', sprintf('File created using %s from the MATLAB fvcom-toolbox', subname))
% define dimensions
one_dimid=netcdf.defDim(nc,'one',1);
......
......@@ -204,7 +204,7 @@ nc = netcdf.create(tsOBCFile, 'clobber');
% define global attributes
netcdf.putAtt(nc,netcdf.getConstant('NC_GLOBAL'),'title','Open boundary temperature and salinity nudging')
netcdf.putAtt(nc,netcdf.getConstant('NC_GLOBAL'),'type','FVCOM TIME SERIES OBC TS FILE')
netcdf.putAtt(nc,netcdf.getConstant('NC_GLOBAL'),'history','File generated using write_FVCOM_tsobc.m from the MATLAB fvcom-toolbox')
netcdf.putAtt(nc,netcdf.getConstant('NC_GLOBAL'),'history', sprintf('File created with %s from the MATLAB fvcom-toolbox', subname))
% define dimensions
......
......@@ -176,7 +176,7 @@ nc = netcdf.create(tsOBCFile, 'clobber');
netcdf.putAtt(nc,netcdf.getConstant('NC_GLOBAL'),'type','FVCOM RIVER FORCING FILE')
netcdf.putAtt(nc,netcdf.getConstant('NC_GLOBAL'),'title','simple open boundary hydrography test')
netcdf.putAtt(nc,netcdf.getConstant('NC_GLOBAL'),'type','FVCOM TIME SERIES OBC BIO FILE') %% THIS IS IMPORTANT
netcdf.putAtt(nc,netcdf.getConstant('NC_GLOBAL'),'history','File generated using write_FVCOM_tsobcERSEM.m from the MATLAB fvcom-toolbox')
netcdf.putAtt(nc,netcdf.getConstant('NC_GLOBAL'),'history', sprintf('File created with %s from the MATLAB fvcom-toolbox', subname))
% define dimensions
......
......@@ -61,7 +61,7 @@ netcdf.putAtt(nc,netcdf.getConstant('NC_GLOBAL'),'references','http://fvcom.smas
% netcdf.putAtt(nc,netcdf.getConstant('NC_GLOBAL'),'source','single-point time-dependent surface forcing')
netcdf.putAtt(nc,netcdf.getConstant('NC_GLOBAL'),'source','fvcom grid (unstructured) surface forcing')
netcdf.putAtt(nc,netcdf.getConstant('NC_GLOBAL'),'institution','Plymouth Marine Laboratory')
netcdf.putAtt(nc,netcdf.getConstant('NC_GLOBAL'),'history','File generated using the write_FVCOM_wind_ts_speed.m from the MATLAB fvcom-toolbox')
netcdf.putAtt(nc,netcdf.getConstant('NC_GLOBAL'),'history', sprintf('File created with %s from the MATLAB fvcom-toolbox', subname))
% dimensions
nele_dimid=netcdf.defDim(nc,'nele',nElems);
......
......@@ -65,7 +65,7 @@ end;
nc = netcdf.create(filename,'clobber');
netcdf.putAtt(nc,netcdf.getConstant('NC_GLOBAL'),'title',mytitle)
netcdf.putAtt(nc,netcdf.getConstant('NC_GLOBAL'),'history', 'File created using write_FVCOM_z0.m from the MATLAB fvcom-toolbox')
netcdf.putAtt(nc,netcdf.getConstant('NC_GLOBAL'),'history', sprintf('File created with %s from the MATLAB fvcom-toolbox', subname))
% dimensions
nele_dimid=netcdf.defDim(nc,'nele',nElems);
......
......@@ -82,7 +82,7 @@ nc = netcdf.create(filename, 'clobber');
netcdf.putAtt(nc, netcdf.getConstant('NC_GLOBAL'), 'type', 'FVCOM METEO FORCING FILE')
netcdf.putAtt(nc, netcdf.getConstant('NC_GLOBAL'), 'title', [filename, ' forcing'])
netcdf.putAtt(nc, netcdf.getConstant('NC_GLOBAL'), 'gauge', 'Met Office Unified Model forcing')
netcdf.putAtt(nc, netcdf.getConstant('NC_GLOBAL'), 'history', ['File created on ', datestr(now, 'yyyy-mm-dd HH:MM:SS'), ' with write_WRF_forcing.m from the MATLAB fvcom-toolbox (https://github.com/pwcazenave/fvcom-toolbox)'])
netcdf.putAtt(nc, netcdf.getConstant('NC_GLOBAL'), 'history', sprintf('File with %s from the MATLAB fvcom-toolbox', subname))
netcdf.putAtt(nc, netcdf.getConstant('NC_GLOBAL'), 'source', 'wrf grid (structured) surface forcing')
netcdf.putAtt(nc, netcdf.getConstant('NC_GLOBAL'), 'START_DATE', datestr(datenum(sgYr, sgMon, sgDay, sgHr, sgMin, sgSec), 'yyyy-mm-dd HH:MM:SS'))
netcdf.putAtt(nc, netcdf.getConstant('NC_GLOBAL'), 'END_DATE', datestr(datenum(egYr, egMon, egDay, egHr, egMin, egSec), 'yyyy-mm-dd HH:MM:SS'))
......
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