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