getinv.m
changeset 22 624b1ed6e9c9
parent 17 f5a63c03d9c8
equal deleted inserted replaced
21:bce791a17f4e 22:624b1ed6e9c9
     6 % 
     6 % 
     7 %  Martin Visbeck, LDEO, April-2000
     7 %  Martin Visbeck, LDEO, April-2000
     8 %======================================================================
     8 %======================================================================
     9 %                    G E T I N V . M 
     9 %                    G E T I N V . M 
    10 %                    doc: Thu Jun 17 15:36:21 2004
    10 %                    doc: Thu Jun 17 15:36:21 2004
    11 %                    dlm: Thu Jul 23 14:06:09 2015
    11 %                    dlm: Wed Sep  4 16:55:50 2019
    12 %                    (c) 2004 ladcp@
    12 %                    (c) 2004 ladcp@
    13 %                    uE-Info: 292 1 NIL 0 0 72 0 2 8 NIL ofnI
    13 %                    uE-Info: 35 55 NIL 0 0 72 0 2 8 NIL ofnI
    14 %======================================================================
    14 %======================================================================
    15 
    15 
    16 % CHANGE HISTORY:
    16 % CHANGE HISTORY:
    17 %
    17 %
    18 % Jun 17, 2004: - removed ps.botfac = 0 on lack of magdecl
    18 % Jun 17, 2004: - removed ps.botfac = 0 on lack of magdecl
    30 %		  nearly singular matrices gracefully
    30 %		  nearly singular matrices gracefully
    31 %		- BUG: replaced all imag() by new imagnan()
    31 %		- BUG: replaced all imag() by new imagnan()
    32 % Jul 28, 2014: - modified how to specify smallfac
    32 % Jul 28, 2014: - modified how to specify smallfac
    33 % Aug  9, 2014: - modified how to specify dragfac (+ve for fixed; -ve for scaled Martin's default)
    33 % Aug  9, 2014: - modified how to specify dragfac (+ve for fixed; -ve for scaled Martin's default)
    34 % Jul 23, 2015: - commented on bug below (#!#)
    34 % Jul 23, 2015: - commented on bug below (#!#)
       
    35 %		- rounded default ps.dz (GK suggestion)
    35 
    36 
    36 if nargin<5, iplot=0; end
    37 if nargin<5, iplot=0; end
    37 
    38 
    38 %###  start by defining all processing parameter which are not set by the user
    39 %###  start by defining all processing parameter which are not set by the user
    39 disp('GETINV:  compute best velocity profile')
    40 disp('GETINV:  compute best velocity profile')
    40 
    41 
    41 % resolution of final profile in meter
    42 ps=setdefv(ps,'dz',round(medianan(abs(diff(di.izm(:,1))))));
    42 ps=setdefv(ps,'dz',medianan(abs(diff(di.izm(:,1)))));
       
    43 % how strong shall the bottom track influence the solution
       
    44 ps=setdefv(ps,'botfac',1); 
    43 ps=setdefv(ps,'botfac',1); 
    45 % how strong shall the SADCP velocity influence the solution
       
    46 ps=setdefv(ps,'sadcpfac',1); 
    44 ps=setdefv(ps,'sadcpfac',1); 
    47 % how stong shall the GPS positon influence the barotropic solution
       
    48 ps=setdefv(ps,'barofac',1);
    45 ps=setdefv(ps,'barofac',1);
    49 % how strong do you believe in the simple wire dynamics (not very good yet)
       
    50 %ps=setdefv(ps,'dragfac',tanh(p.maxdepth/3000)*0.2);
       
    51 ps=setdefv(ps,'dragfac',0);
    46 ps=setdefv(ps,'dragfac',0);
    52 
    47 
    53 % negative values weigh Martin's original default
    48 % negative values weigh Martin's original default
    54 if (ps.dragfac < 0)
    49 if (ps.dragfac < 0)
    55   ps.dragfac = -ps.dragfac * tanh(p.maxdepth/3000)*0.2;
    50   ps.dragfac = -ps.dragfac * tanh(p.maxdepth/3000)*0.2;