/*gbar0 compute g-bar gaunt factor for neutrals */ #include "cddefines.h" #include "phycon.h" #include "gbar0.h" void gbar0(double ex, float *g) { double a, b, c, d, y; # ifdef DEBUG_FUN fputs( "<+>gbar0()\n", debug_fp ); # endif /* written by Dima Verner * * Calculation of the effective Gaunt-factor by use of * Van Regemorter (1962, ApJ 136, 906) fits for neutrals * Input parameters: * ex - energy ryd - now K * t - temperature in K * Output parameter: * g - effective Gaunt factor * */ /* y = ex*157813.7/te */ y = ex/phycon.te; if( y < 0.01 ) { *g = (float)(0.29*(log(1.0+1.0/y) - 0.4/POW2(y + 1.0))/exp(y)); } else { if( y > 10.0 ) { *g = (float)(0.066/sqrt(y)); } else { a = 1.5819068e-02; b = 1.3018207e00; c = 2.6896230e-03; d = 2.5486007e00; d = log(y/c)/d; *g = (float)(a + b*exp(-0.5*POW2(d))); } } # ifdef DEBUG_FUN fputs( " <->gbar0()\n", debug_fp ); # endif return; }