clc;clear all;close all

% file='/data3/yiwen/matlab_coawst/particle_tracking/202301_log/Bitou_ocean_his.nc'
file='/data3/yiwen/matlab_coawst/particle_tracking/202307_log/Bitou_ocean_his.nc' 

Uwind=ncread(file,'Uwind');Vwind=ncread(file,'Vwind');
Uwind=nanmean(Uwind,3);Vwind=nanmean(Vwind,3);
sustr=ncread(file,'sustr');svstr=ncread(file,'svstr'); %newton meter-2
U=nanmean(sustr,3);V=nanmean(svstr,3);
pcolor(U');shading flat;hold on;colorbar


ana_U01=nanmean(nanmean(U));
ana_V01=nanmean(nanmean(V));


%%
init_file='/data3/yiwen/matlab_coawst/bitou_202301_14D/romsforc_GFS_N202301.nc'
Uwind=ncread(init_file,'Uwind');Vwind=ncread(init_file,'Vwind');
Uwind=nanmean(Uwind,3);Vwind=nanmean(Vwind,3);
ana_U=nanmean(nanmean(Uwind));
ana_V=nanmean(nanmean(Vwind));

u=ncread(init_file,'Uwind');
v=ncread(init_file,'Vwind');
Uwind=34.3*ones(size(u));
Vwind=25.0*ones(size(v));

ncwrite(init_file,'Uwind',Uwind);
ncwrite(init_file,'Vwind',Vwind);



time=ncread(init_file,'ocean_time');





















