1 |
|
2 |
|
3 |
nx=120; |
4 |
ny=31; |
5 |
nz=29; |
6 |
nf=4; % covers u, v, w, and theta |
7 |
h=zeros(nf*nz*ny*nx,1); |
8 |
|
9 |
vectorsize=nx*ny*nz*nf; |
10 |
dim=1; % current dimension in loop |
11 |
obs=0; % observation counter |
12 |
fid = fopen('hfile.txt','w'); |
13 |
|
14 |
for i=1:nf |
15 |
for j=1:nz |
16 |
for k=1:ny |
17 |
for l=1:nx |
18 |
if ((any(j==[5 10 15 20 25]) & ... % 5 levels... |
19 |
any(i==[1 2]) & ... % of u and v... |
20 |
k>8 & ... % that clear the center... |
21 |
mod(l,3)==0 ) | ... % every third "spoke", plus... |
22 |
(i==4 & ... % theta... |
23 |
any(k==[9 30]))) % in the vert boundary layers |
24 |
h(dim)=dim; |
25 |
fprintf(fid,'%i\n',dim); |
26 |
obs=obs+1; |
27 |
end |
28 |
dim=dim+1; |
29 |
end |
30 |
end |
31 |
end |
32 |
end |
33 |
fclose(fid); |
34 |
obs |
35 |
h3=reshape(h,[nx,ny,nz,nf]); |
36 |
|