cd /nas/edl/OFES_UV_KOE/matlib matlab2012 -nodesktop -nosplash clear YEAR=1979; exp_name='SB'; for YEAR=1966:1974 [Pstore, Ptime, grd]=ADVOFF_main_fwd(YEAR, exp_name); end exp_name='SB'; for YEAR=1975:1982 [Pstore, Ptime, grd]=ADVOFF_main_fwd(YEAR, exp_name); end exp_name='SB'; for YEAR=1983:1991 [Pstore, Ptime, grd]=ADVOFF_main_fwd(YEAR, exp_name); end exp_name='SB'; for YEAR=1993:1999 [Pstore, Ptime, grd]=ADVOFF_main_fwd(YEAR, exp_name); end %% Process Forward tracer output clear load KOE_GRD.mat grd.L=399; grd.P=249; for yr=1966:2000 str=['pstore_mat/',num2str(yr),'_Pstore_SB.mat']; load (str); grd.T=length(Ptime); Ptime(1)=Ptime(2)-5; filename=['pstore_nc/pstore_SB_',num2str(yr),'.nc']; disp(filename); Convert2NC_tracer(grd,filename); nc=netcdf(filename, 'w'); nc{'time'}(:)=Ptime; nc{'P'}(:,:,:)=perm(Pstore); close(nc) end %% Running the inverse Adjoint Calculations clear YEAR=1979; exp_name='TR'; for YEAR=1966:1969 [Pstore, Ptime, grd]=ADVOFF_main_adj(YEAR, exp_name); end exp_name='OY'; for YEAR=1966:2000 [Pstore, Ptime, grd]=ADVOFF_main_adj(YEAR, exp_name); end %% Process Inverse tracer output clear load KOE_GRD.mat grd.L=399; grd.P=249; for yr=1966:2000 str=['pstore_mat/',num2str(yr),'_Pstore_TR.mat']; load (str); grd.T=length(Ptime); Ptime(1)=Ptime(2)+5; filename=['pstore_nc/pstore_TR_',num2str(yr),'.nc']; disp(filename); Convert2NC_tracer(grd,filename); nc=netcdf(filename, 'w'); nc{'time'}(:)=Ptime(end:-1:1); nc{'P'}(:,:,:)=perm(Pstore(:,:,end:-1:1)); close(nc) end for yr=1966:2000 str=['pstore_mat/',num2str(yr),'_Pstore_OY.mat']; load (str); grd.T=length(Ptime); Ptime(1)=Ptime(2)+5; filename=['pstore_nc/pstore_OY_',num2str(yr),'.nc']; disp(filename); Convert2NC_tracer(grd,filename); nc=netcdf(filename, 'w'); nc{'time'}(:)=Ptime(end:-1:1); nc{'P'}(:,:,:)=perm(Pstore(:,:,end:-1:1)); close(nc) end %% Functions % ADVOFF_GetGrid_DataStruct.m [grd, ctl]=ADVOFF_GetGrid_DataStruct(); % Load grid and velocity ctl % The ctl are stored in matrix load load KOE_GRD.mat % if you add more velocity data open the function and update ctl. % Process.m % This function contains code to re-write mat files into netcdf. To apply % both for the tracers and velocity data