1 | function [ar, vo] = calculate_grid_area_eff(header)
|
---|
2 |
|
---|
3 | % calculates volumn and area for FLEXPART OUTGRID adapted from outgrid_init.f
|
---|
4 | % June 07 Sabine Eckhardt
|
---|
5 | %
|
---|
6 |
|
---|
7 | r_earth=6.371e6;
|
---|
8 | pi180=pi/180;
|
---|
9 | ar=zeros(header.numygrid,header.numxgrid);
|
---|
10 | vo=zeros(header.numygrid,header.numxgrid,header.numzgrid);
|
---|
11 |
|
---|
12 | hzone=zeros(length(header.latp),1);
|
---|
13 | ylatp=header.latp+.5*header.dyout;
|
---|
14 | ylatm=header.latp-.5*header.dyout;
|
---|
15 | ind=find(ylatm<0 & ylatp>0);
|
---|
16 | hzone(ind)=header.dyout*r_earth*pi180;
|
---|
17 | cosfactp=cos(ylatp*pi180)*r_earth;
|
---|
18 | cosfactm=cos(ylatm*pi180)*r_earth;
|
---|
19 | ind=find(cosfactp<cosfactm);
|
---|
20 |
|
---|
21 | hzone(ind)=(r_earth.^2-cosfactp(ind).^2).^.5-(r_earth.^2-cosfactm(ind).^2).^.5;
|
---|
22 | ind=find(cosfactp>=cosfactm);
|
---|
23 | hzone(ind)=(r_earth.^2-cosfactm(ind).^2).^.5-(r_earth.^2-cosfactp(ind).^2).^.5;
|
---|
24 | gridarea=2.*pi*r_earth*hzone*header.dxout/360;
|
---|
25 |
|
---|
26 | for ix=1:header.numxgrid
|
---|
27 | ar(:,ix)=gridarea;
|
---|
28 | end
|
---|
29 |
|
---|
30 | vo(:,:,1)=ar*header.outheight(1);
|
---|
31 | for kz=2:header.numzgrid
|
---|
32 | vo(:,:,kz)=ar*(header.outheight(kz)-header.outheight(kz-1));
|
---|
33 | end %kz
|
---|
34 |
|
---|
35 | ar=ar';
|
---|