function x = logn_inv(P,medX,covX)
% x = logn_inv(P, medX, covX )
% return inverse CDF of lognormal distribution with
% median M and coefficent of variation C, for nonexceedance probability P

  P(find(P<=0)) = eps;
  P(find(P>=1)) = 1-eps;

  Vlnx = log(1 + covX^2);			% variance of log x

  x = exp( log(medX) + sqrt(2*Vlnx)*erfinv(2*P-1) );

% ------------------------------------------------------------------- logn_inv 
% HP Gavin 2020-03-30, 2021-04-26 
