Commit c90d3207 authored by Pierre Cazenave's avatar Pierre Cazenave

example_FVCOM_tsboc.m now requires only a single argument with regards the...

example_FVCOM_tsboc.m now requires only a single argument with regards the layers as opposed to specifying both layers and levels (number of levels is just number of layers+1). Also improved speed by eliminating unnecessary costly for loop
parent cc491320
function example_FVCOM_tsobc(basename,time,nSiglay,nSiglev) function example_FVCOM_tsobc(basename,time,nSiglay)
% example file for dumping a file to force temperature and salinity at the open b. % example file for dumping a file to force temperature and salinity at the open b.
% %
% function example_FVCOM_tsobc() % function example_FVCOM_tsobc()
...@@ -94,6 +94,7 @@ nTimes = numel(time); ...@@ -94,6 +94,7 @@ nTimes = numel(time);
% set siglev/siglay % set siglev/siglay
% nSiglay = 10; % nSiglay = 10;
% nSiglev = 11; % nSiglev = 11;
nSiglev = nSiglay + 1;
inc = 1./real(nSiglay); inc = 1./real(nSiglay);
siglev = 0:-inc:-1; siglev = 0:-inc:-1;
for i=1:nSiglay for i=1:nSiglay
...@@ -194,10 +195,8 @@ netcdf.putVar(nc,itime2_varid,0,numel(time),mod(time,1)*24*3600*1000); ...@@ -194,10 +195,8 @@ netcdf.putVar(nc,itime2_varid,0,numel(time),mod(time,1)*24*3600*1000);
% Create 3D array from three 1D arrays % Create 3D array from three 1D arrays
for i=1:nObc for i=1:nObc
for j=1:nSiglay for j=1:nSiglay
for k=1:nTimes temp(i,j,:) = obc_temp;
temp(i,j,:) = ones(1,nTimes).*obc_temp; salt(i,j,:) = obc_salt;
salt(i,j,:) = ones(1,nTimes).*obc_salt;
end
end end
end end
netcdf.putVar(nc,obc_temp_varid,temp); netcdf.putVar(nc,obc_temp_varid,temp);
......
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