--- MITgcm_contrib/osse/utils/hmaker.m 2004/06/08 19:38:54 1.1 +++ MITgcm_contrib/osse/utils/hmaker.m 2004/06/23 13:28:28 1.4 @@ -1,26 +1,36 @@ + nx=120; ny=31; nz=29; -nf=2; +nf=4; % covers u, v, w, and theta +h=zeros(nf*nz*ny*nx,1); + vectorsize=nx*ny*nz*nf; -dim=1; -fid = fopen('hfile.txt','w') +dim=1; % current dimension in loop +obs=0; % observation counter +fid = fopen('hfile.txt','w'); for i=1:nf for j=1:nz - for k=1:ny % get every other ring + for k=1:ny for l=1:nx - if (any(j==[5 10 15 20 25]) && ... % 5 levels - any(i==[1 2]) && ... % u, v - mod(k,2)==0) -% if mod(dim,359)==0 + if ((any(j==[5 10 15 20 25]) & ... % 5 levels... + any(i==[1 2]) & ... % of u and v... + k>8 & ... % that clear the center... + mod(l,3)==0 ) | ... % every third "spoke", plus... + (i==4 & ... % theta... + any(k==[9 30]))) % in the vert boundary layers + h(dim)=dim; fprintf(fid,'%i\n',dim); + obs=obs+1; end dim=dim+1; end end end end - +fclose(fid); +obs +h3=reshape(h,[nx,ny,nz,nf]);