function d_approx_air (millibar, Celsius, Z {cm2V-1s-1} : real) : real; {NB: valid when Z < 2.5} Uses external function "Z_approx_air". If failed then result = 0} var c, d, test : real; n : integer; begin c := 100; n := 0; repeat n := n + 1; d := (0.6 + sqrt (0.36 + 200 * c * Z)) / (c * Z) - 0.4; test := Z_approx_air (millibar, Celsius, d); c := (1.2 / (d + 0.4) + 200 / sqr (d + 0.4)) / test; until (abs (test / Z - 1) < 1e-6) or (n = 99); if n < 99 then d_approx_air := d else d_approx_air := 0; end;