1 |
gforget |
1.1 |
function [mystruct_out]=ncep_load_fluxes(ycur,hcur); |
2 |
|
|
%loads the fields and does the interpolation to the 1x1 ECCO grid |
3 |
|
|
domaine_global_def; |
4 |
|
|
|
5 |
|
|
mask=squeeze(tmask3D(:,:,1)); |
6 |
|
|
|
7 |
|
|
rep_in='/net/altix3700/raid4/king/data_1x1_92-03/forcing/'; |
8 |
|
|
files_ncep=strvcat('NCEP_R6_ustr_','NCEP_R6_vstr_','NCEP_R6_emp_','NCEP_R6_turbflux_','NCEP_R6_sw_'); |
9 |
|
|
var_ecco=strvcat('ustress','vstress','emp','turbflux','swflux'); |
10 |
|
|
|
11 |
|
|
for fcur=1:size(files_ncep,1); |
12 |
|
|
fid=fopen([rep_in deblank(files_ncep(fcur,:)) num2str(ycur)],'r','b'); |
13 |
|
|
recl=jpi*jpj*4; position0=recl*(hcur-1); status=fseek(fid,position0,'bof'); |
14 |
|
|
field_mod=fread(fid,[jpi jpj],'float32'); fclose(fid); |
15 |
|
|
%field_mod=fread(fid,jpi*jpj*4,'float32'); fclose(fid); field_mod=squeeze(mean(reshape(field_mod,[jpi jpj 4]),3)); |
16 |
|
|
eval([deblank(var_ecco(fcur,:)) '=field_mod;']); |
17 |
|
|
end; |
18 |
|
|
|
19 |
|
|
rhoConstFresh=999.8; |
20 |
|
|
emp=emp*rhoConstFresh; %m/s->kg/m^2/s |
21 |
|
|
ustress=-ustress.*mask; |
22 |
|
|
vstress=-vstress.*mask; |
23 |
|
|
|
24 |
|
|
turbflux=turbflux.*mask; |
25 |
|
|
emp=emp.*mask; |
26 |
|
|
swflux=swflux.*mask; |
27 |
|
|
|
28 |
|
|
mystruct_out=struct('ustress',ustress,'vstress',vstress,'emp',emp,'turbflux',turbflux,'swflux',swflux); |
29 |
|
|
|