| 1 | function [induction,gradx,grady] = diag_induction(ustar,vstar,h,dxc,dyc); | 
| 2 | %function [induction,gradx,grady] = diag_induction(ustar,vstar,h,dxc,dyc) | 
| 3 | % | 
| 4 | % Diagnose lateral induction u_h . grad h | 
| 5 | % | 
| 6 | % G. Gebbie, 2003. | 
| 7 |  | 
| 8 | [nx,ny] = size(ustar); | 
| 9 |  | 
| 10 | gradx(2:nx,:) = (h(2:nx,:)  - h(1:nx-1,:)); | 
| 11 | grady(:,2:ny) =  h(:,2:ny)  - h(:,1:ny-1); | 
| 12 |  | 
| 13 | gradx = gradx ./ dxc; | 
| 14 | grady = grady ./ dyc; | 
| 15 |  | 
| 16 | udelh = ustar .* gradx; | 
| 17 | vdelh = vstar .* grady; | 
| 18 |  | 
| 19 | %% now move udelh from U points to H points, in order to match up with W*. | 
| 20 | %% involves an average. | 
| 21 | udelh2 = (udelh(2:nx,:)+udelh(1:nx-1,:))./2; | 
| 22 | vdelh2 = (vdelh(:,2:ny)+vdelh(:,1:ny-1))./2; | 
| 23 |  | 
| 24 | udelh2(nx,:) = 0; | 
| 25 | vdelh2(:,ny)=0; | 
| 26 |  | 
| 27 | induction = udelh2 + vdelh2; | 
| 28 |  |