source: issm/oecreview/Archive/19101-20495/ISSM-19323-19324.diff

Last change on this file was 20498, checked in by Mathieu Morlighem, 9 years ago

CHG: done with Archive/19101-20495

File size: 1.7 KB
  • ../trunk-jpl/src/m/psl/icelm.m

     
    1 function ice_lm = icelm(lMax,nPix,ice,sh)
    2 
    3 %---------------------------------------------------------------------
    4 % icelm :: a function to compute SH coefficients of "ice load 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 %---------------------------------------------------------------------
    11 
    12 p1 = 0;
    13 
    14 ice_lm = zeros(1,(lMax+1)^2);
    15 
    16 for l=0:lMax
    17    for m=-l:l
    18       ice_lm(1+p1) = sum(sh(:,1+p1).*ice');
    19       p1 = p1+1;
    20    end
    21 end
    22 
    23 ice_lm = ice_lm*4*pi/nPix;
    24 
  • ../trunk-jpl/src/m/psl/ocelm.m

     
    1 function oce_lm = ocelm(sh,lMax,ocean,areaEle)
    2 
    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 
    13 p1 = 0;
    14 
    15 oce_lm = zeros(1,(lMax+1)^2);
    16 
    17 % weighted area integration
    18 for l=0:lMax
    19    for m=-l:l
    20       oce_lm(1+p1) = sum((sh(:,1+p1).*ocean').*areaEle');
    21       p1 = p1+1;
    22    end
    23 end
    24 oce_lm = oce_lm/sum(areaEle);
    25 
Note: See TracBrowser for help on using the repository browser.