% * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
% Description:
% the Transformation from Cartesian coordinates X, Y, Z to ellipsoidal
% coordinates lam, phi, elh. On Occam subroutine transf.
%
% Input:
% pos=[x, y, z] [m, m, m]
% can be a matrix: number of rows=number of crisis
%
% Output:
% coor_ell=[lat, lon, h] [rad, rad, m]
%
% External calls:
% global a_... Equatorial radius of the Earth [m]
% f_... Flattening factor of the Earth
%
% Coded for VieVS:
% 17 Dec 2008 by Lucia Plank
%
% Revision:
%
% * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
The function/lat, lon, h=xyz2ell (pos)
% choose reference ellipsoid
The % 1... Tide free
% 2... GRS80
Refell=1;
The switch refell
Case 1
% IERS 2003 numerical standards (tide free crust)
% ellipsoid parameters for xyz2ellip. M