Changeset 19310


Ignore:
Timestamp:
04/23/15 15:54:25 (10 years ago)
Author:
adhikari
Message:

weighted area integration over the surface of a sphere

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/psl/ocelm.m

    r19296 r19310  
    1 function oce_lm = ocelm(lMax,nPix,ocean,sh)
     1function oce_lm = ocelm(sh,lMax,ocean,areaEle)
    22
    3 %---------------------------------------------------------------------
    4 % ocelm :: a function to compute SH coefficients of "ocean function"
    5 %---------------------------------------------------------------------
    6 % This code is written as a part of the ISSM-PSL project
    7 % (c) S. Adhikari
    8 %     Jet Propulsion Laboratory, Caltech
    9 %     November 3, 2014
    10 %---------------------------------------------------------------------
     3%OCElm :: a function to compute SH coefficients of ocean function
     4%
     5%USAGE: oce_lm = ocelm(sh,lMax,ocean,areaEle);
     6%
     7%sh (spherical harmonics)
     8%lMax (maximum SH degree to be considered)
     9%ocean (ocean function)
     10%areaEle (area of elements)
     11%
     12
    1113p1 = 0;
    1214
    1315oce_lm = zeros(1,(lMax+1)^2);
    1416
     17% weighted area integration
    1518for l=0:lMax
    1619   for m=-l:l
    17       oce_lm(1+p1) = sum(sh(:,1+p1).*ocean');
     20      oce_lm(1+p1) = sum((sh(:,1+p1).*ocean').*areaEle');
    1821      p1 = p1+1;
    1922   end
    2023end
     24oce_lm = oce_lm/sum(areaEle);
    2125
    22 oce_lm = oce_lm*4*pi/nPix;
    23 
Note: See TracChangeset for help on using the changeset viewer.