1 |
|
2 |
|
3 |
global dmod_ref vec_lon vec_lat tmask3D; |
4 |
global T_climatology S_climatology T_climatology2 S_climatology2; |
5 |
global T_climatology3 S_climatology3 T_climatology4 S_climatology4; |
6 |
global T_weights S_weights; |
7 |
|
8 |
if isempty(T_climatology) |
9 |
|
10 |
% a) ECCOv2 depth levels |
11 |
dmod_ref=1.0e+03 * [ 0.0050 0.0150 0.0275 0.0450 0.0650 0.0875 0.1175 ... |
12 |
0.1600 0.2225 0.3100 0.4350 0.6100 0.8475 1.1600 1.5425 1.9750 ... |
13 |
2.4500 2.9500 3.4500 3.9500 4.4500 4.9500 5.4500 ]; |
14 |
|
15 |
% b) ECCOv2 grid point coordinates : |
16 |
vec_lon=[0.5:359.5]; vec_lat=[-79.5:79.5]; |
17 |
|
18 |
% c) load (ECCOv2-grid) monthly atlases : |
19 |
rep_clim='/bay/data1/king/GOURETSKI_climatology/gridded/outliers/', rep_clim2='/bay/data1/king/NCEP_model/LEVITUS/', |
20 |
rep_clim3='/raid0/gforget/DATAbin/HYDROatlases/woa2005/',rep_clim4='/net/ross/raid2/gforget/gaelmodel0406clim/', |
21 |
T_climatology=zeros(12,360,160,23); S_climatology=T_climatology; |
22 |
T_climatology2=zeros(12,360,160,23); S_climatology2=T_climatology2; |
23 |
T_climatology3=zeros(12,360,160,23); S_climatology3=T_climatology3; |
24 |
T_climatology4=zeros(12,360,160,23); S_climatology4=T_climatology4; |
25 |
fid0=fopen([rep_clim 'LEV_wghc_ptmp_r4'],'r','b'); |
26 |
fid1=fopen([rep_clim 'LEV_wghc_salt_r4'],'r','b'); |
27 |
fid02=fopen([rep_clim2 'LEVITUS_1x1_ptmp_NEW_corK'],'r','b'); |
28 |
fid12=fopen([rep_clim2 'LEVITUS_1x1_salt_NEW_corK'],'r','b'); |
29 |
fid03=fopen([rep_clim3 'wod05_ptmp23'],'r','b'); |
30 |
fid13=fopen([rep_clim3 'wod05_salt23'],'r','b'); |
31 |
fid04=fopen([rep_clim4 'gm0406_ptmp23'],'r','b'); |
32 |
fid14=fopen([rep_clim4 'gm0406_salt23'],'r','b'); |
33 |
for tcur=1:12 |
34 |
field_tmp=fread(fid0,[360 160*23],'float32'); |
35 |
T_climatology(tcur,:,:,:)=reshape(field_tmp,[360 160 23]); |
36 |
field_tmp=fread(fid1,[360 160*23],'float32'); |
37 |
S_climatology(tcur,:,:,:)=reshape(field_tmp,[360 160 23]); |
38 |
field_tmp=fread(fid02,[360 160*23],'float32'); |
39 |
T_climatology2(tcur,:,:,:)=reshape(field_tmp,[360 160 23]); |
40 |
field_tmp=fread(fid12,[360 160*23],'float32'); |
41 |
S_climatology2(tcur,:,:,:)=reshape(field_tmp,[360 160 23]); |
42 |
field_tmp=fread(fid03,[360 160*23],'float32'); |
43 |
T_climatology3(tcur,:,:,:)=reshape(field_tmp,[360 160 23]); |
44 |
field_tmp=fread(fid13,[360 160*23],'float32'); |
45 |
S_climatology3(tcur,:,:,:)=reshape(field_tmp,[360 160 23]); |
46 |
field_tmp=fread(fid04,[360 160*23],'float32'); |
47 |
T_climatology4(tcur,:,:,:)=reshape(field_tmp,[360 160 23]); |
48 |
field_tmp=fread(fid14,[360 160*23],'float32'); |
49 |
S_climatology4(tcur,:,:,:)=reshape(field_tmp,[360 160 23]); |
50 |
end%for tcur=1:12 |
51 |
fclose(fid0);fclose(fid1); fclose(fid02);fclose(fid12); |
52 |
fclose(fid03);fclose(fid13); fclose(fid04);fclose(fid14); |
53 |
|
54 |
test1=find((T_climatology.*S_climatology)==0); |
55 |
T_climatology(test1)=NaN; S_climatology(test1)=NaN; |
56 |
test1=find((T_climatology2.*S_climatology2)==0); |
57 |
T_climatology2(test1)=NaN; S_climatology2(test1)=NaN; |
58 |
test1=find((T_climatology3.*S_climatology3)==0); |
59 |
T_climatology3(test1)=NaN; S_climatology3(test1)=NaN; |
60 |
test1=find((T_climatology4.*S_climatology4)==0); |
61 |
T_climatology4(test1)=NaN; S_climatology4(test1)=NaN; |
62 |
|
63 |
% d) load (ECCOv2-grid) monthly atlases : |
64 |
% |
65 |
% by assumption: the uncertainty field contains non-zero values |
66 |
% (which avoid the complication of handling horiz interpolation here) |
67 |
% and we do not mask the data (the model will do this, given a mask) |
68 |
rep_weight='/net/ross/raid0/gforget/MYweights/'; |
69 |
T_weights=zeros(360,160,23); S_weights=T_weights; |
70 |
fid0=fopen([rep_weight 'wvar_Tr3.bin'],'r','b'); |
71 |
fid1=fopen([rep_weight 'wvar_Sr3.bin'],'r','b'); |
72 |
field_tmp=fread(fid0,[360 160*23],'float32'); |
73 |
T_weights=reshape(field_tmp,[360 160 23]); |
74 |
field_tmp=fread(fid1,[360 160*23],'float32'); |
75 |
S_weights=reshape(field_tmp,[360 160 23]); |
76 |
|
77 |
% e) compute mask for tests: |
78 |
tmask3D=squeeze(mean(S_climatology,1)).*squeeze(mean(S_climatology2,1)).*... |
79 |
squeeze(mean(S_climatology3,1)).*squeeze(mean(S_climatology4,1)).*... |
80 |
squeeze(mean(T_climatology,1)).*squeeze(mean(T_climatology2,1)).*... |
81 |
squeeze(mean(T_climatology3,1)).*squeeze(mean(T_climatology4,1)); |
82 |
tmask3D(find(~isnan(tmask3D)))=1; |
83 |
|
84 |
for tcur=1:12 |
85 |
T_climatology(tcur,:,:,:)=squeeze(T_climatology(tcur,:,:,:)).*tmask3D; S_climatology(tcur,:,:,:)=squeeze(S_climatology(tcur,:,:,:)).*tmask3D; |
86 |
T_climatology2(tcur,:,:,:)=squeeze(T_climatology2(tcur,:,:,:)).*tmask3D; S_climatology2(tcur,:,:,:)=squeeze(S_climatology2(tcur,:,:,:)).*tmask3D; |
87 |
T_climatology3(tcur,:,:,:)=squeeze(T_climatology3(tcur,:,:,:)).*tmask3D; S_climatology3(tcur,:,:,:)=squeeze(S_climatology3(tcur,:,:,:)).*tmask3D; |
88 |
T_climatology4(tcur,:,:,:)=squeeze(T_climatology4(tcur,:,:,:)).*tmask3D; S_climatology4(tcur,:,:,:)=squeeze(S_climatology4(tcur,:,:,:)).*tmask3D; |
89 |
end |
90 |
|
91 |
end |
92 |
|