function [mystruct_out]=ncep_load_fluxes(ycur,hcur); %loads the fields and does the interpolation to the 1x1 ECCO grid domaine_global_def; mask=squeeze(tmask3D(:,:,1)); rep_in='/net/altix3700/raid4/king/data_1x1_92-03/forcing/'; files_ncep=strvcat('NCEP_R6_ustr_','NCEP_R6_vstr_','NCEP_R6_emp_','NCEP_R6_turbflux_','NCEP_R6_sw_'); var_ecco=strvcat('ustress','vstress','emp','turbflux','swflux'); for fcur=1:size(files_ncep,1); fid=fopen([rep_in deblank(files_ncep(fcur,:)) num2str(ycur)],'r','b'); recl=jpi*jpj*4; position0=recl*(hcur-1); status=fseek(fid,position0,'bof'); field_mod=fread(fid,[jpi jpj],'float32'); fclose(fid); %field_mod=fread(fid,jpi*jpj*4,'float32'); fclose(fid); field_mod=squeeze(mean(reshape(field_mod,[jpi jpj 4]),3)); eval([deblank(var_ecco(fcur,:)) '=field_mod;']); end; rhoConstFresh=999.8; emp=emp*rhoConstFresh; %m/s->kg/m^2/s ustress=-ustress.*mask; vstress=-vstress.*mask; turbflux=turbflux.*mask; emp=emp.*mask; swflux=swflux.*mask; mystruct_out=struct('ustress',ustress,'vstress',vstress,'emp',emp,'turbflux',turbflux,'swflux',swflux);