diff --git a/template_combine_adcp_up_and_down.m b/template_combine_adcp_up_and_down.m index 63fe098f2fbdb7c662b7343fa7e103246f3eb81a..09b343036d98f948bba09b996529360e90538209 100644 --- a/template_combine_adcp_up_and_down.m +++ b/template_combine_adcp_up_and_down.m @@ -124,14 +124,14 @@ rmpath('.\moored_adcp_proc'); clear all; close all; %% Write netcdf file -[yr_start , ~, ~] = gregorian(inttim(1)); -[yr_end, ~, ~] = gregorian(inttim(length(inttim))); +[yr_start , ~, ~] = gregorian(down_time(1)); +[yr_end, ~, ~] = gregorian(down_time(length(down_time))); ncid=netcdf.create([fpath_output,'ADCP_',mooring.name, '_',num2str(yr_start),'_',num2str(yr_end),'_1d.nc'],'NC_WRITE'); %create dimension -dimidt = netcdf.defDim(ncid,'time',length(inttim)); -dimidz = netcdf.defDim(ncid,'depth',length(Z)); +dimidt = netcdf.defDim(ncid,'time',length(down_time)); +dimidz = netcdf.defDim(ncid,'depth',length(z_final)); %Define IDs for the dimension variables (pressure,time,latitude,...) time_ID=netcdf.defVar(ncid,'time','double',dimidt); depth_ID=netcdf.defVar(ncid,'depth','double',dimidz);