% Load Parent grid grdin=rnt_gridload('nena'); files=rnt_getfilenames('/share/2/output/fennelk/nena/out_856c','avg'); ctl=rnt_timectl( files,'ocean_time','r'); % Load destination grd=rnt_gridload('mabgom4'); grd.zr=rnt_setdepth(0,grd); mask3d=repmat(grd.maskr, [1 1 grd.N]); load pmap_nena_2_mabgom4.mat load pmap_psi_nena_2_mabgom4.mat for irec=1:length(ctl.time) fileout=['/home/edl/3D_Mapping/mabgom4_hycom_files/mabgom_nena_',num2str(irec),'.nc']; ctli = rnt_grid2grid(grdin, grd, ctl, irec, fileout, pmap, pmap_psi) end files=rnt_getfilenames('/home/edl/3D_Mapping/mabgom4_hycom_files','mabgom_nena'); ctli=rnt_timectl(files, 'ocean_time','r'); % Create boundary condition file bryfile='bry.nc'; opt.bry_time = length(ctli.time)/(24*60*60); opt.bry_time_cycle=0; opt.bry_timeVal = ctli.time; rnc_CreateBryFile(grd,bryfile, opt); % Now extract boundary values from the extracted fields timerange=1:length(ctli.time); sub_I=1:grd.Lp; sub_J=1:grd.Mp; opt.npzd=0; rnc_SubBryEx(ctli,grd,grd,timerange,bryfile,sub_I,sub_J, opt);