X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FRadio%2Fitm.cpp;h=1ad10d4d8f60e97a69fc8c376c6d63932082849b;hb=cff6b2034de866df70a2b29feb3383ee8ccbbef6;hp=184ac37657a90a54bd29a9eb462c9c15fd7903c7;hpb=26011dd9c630f69e0267ed98d61c749754ce1e68;p=flightgear.git diff --git a/src/Radio/itm.cpp b/src/Radio/itm.cpp index 184ac3765..1ad10d4d8 100644 --- a/src/Radio/itm.cpp +++ b/src/Radio/itm.cpp @@ -39,12 +39,14 @@ #include #include -const double THIRD = (1.0/3.0); -const double f_0 = 47.7; // 47.7 MHz from [Alg 1.1], to convert frequency into wavenumber and vica versa - using namespace std; +namespace ITM { + +const double THIRD = (1.0/3.0); +const double f_0 = 47.7; // 47.7 MHz from [Alg 1.1], to convert frequency into wavenumber and vica versa + struct prop_type { // General input @@ -133,7 +135,7 @@ double FORTRAN_DIM(const double &x, const double &y) } //#define set_warn(txt, err) printf("%s:%d %s\n", __func__, __LINE__, txt); -#define set_warn(txt, err) 1; +#define set_warn(txt, err) // :13: single-knife attenuation, page 6 /* @@ -811,6 +813,7 @@ void qlra(int kst[], int klimx, int mdvarx, prop_type &prop, propv_type &propv) * computers," Princeton Univ. Press, 1955) and the maximum error should be * 4.5e-4. */ +#if 1 static double qerfi(double q) { @@ -832,6 +835,7 @@ double qerfi(double q) return v; } +#endif // :41: preparatory routine, page 20 @@ -848,6 +852,7 @@ double qerfi(double q) * surface impedance @zgnd * It may be used with either the area prediction or the point-to-point mode. */ +#if 1 static void qlrps(double fmhz, double zsys, double en0, int ipol, double eps, double sgm, prop_type &prop) @@ -880,6 +885,7 @@ void qlrps(double fmhz, double zsys, double en0, int ipol, double eps, double sg prop.Z_g_real = prop_zgnd.real(); prop.Z_g_imag = prop_zgnd.imag(); } +#endif // :30: Function curv, page 15 @@ -899,6 +905,7 @@ double curve(double const &c1, double const &c2, double const &x1, double const // :28: Area variablity, page 14 +#if 1 static double avar(double zzt, double zzl, double zzc, prop_type &prop, propv_type &propv) { @@ -1165,7 +1172,7 @@ double avar(double zzt, double zzl, double zzc, prop_type &prop, propv_type &pro return avarv; } - +#endif // :45: Find to horizons, page 24 /* @@ -1378,7 +1385,7 @@ double dlthx(double pfl[], const double &x1, const double &x2) n = 10 * ka - 5; kb = n - ka + 1; sn = n - 1; - assert((s = new double[n+2]) != 0); + s = new double[n+2]; s[0] = sn; s[1] = 1.0; xb = (xb - xa) / sn; @@ -1426,6 +1433,7 @@ double dlthx(double pfl[], const double &x1, const double &x2) * pfl[0] = np, the number of points in the path * pfl[1] = xi, the length of each increment */ +#if 1 static void qlrpfl(double pfl[], int klimx, int mdvarx, prop_type &prop, propv_type &propv) { @@ -1496,6 +1504,7 @@ void qlrpfl(double pfl[], int klimx, int mdvarx, prop_type &prop, propv_type &pr lrprop(0.0, prop); } +#endif //******************************************************** @@ -1543,7 +1552,6 @@ void point_to_point(double elev[], double zc, zr; double q = eno; long ja, jb, i, np; - double dkm, xkm; double fs; prop.h_g[0] = tht_m; // Tx height above ground level @@ -1555,8 +1563,10 @@ void point_to_point(double elev[], zc = qerfi(conf); zr = qerfi(rel); np = (long)elev[0]; - dkm = (elev[1] * elev[0]) / 1000.0; - xkm = elev[1] / 1000.0; +#if 0 + double dkm = (elev[1] * elev[0]) / 1000.0; + double xkm = elev[1] / 1000.0; +#endif ja = (long)(3.0 + 0.1 * elev[0]); jb = np - ja + 6; @@ -1849,3 +1859,5 @@ void area(long ModVar, double deltaH, double tht_m, double rht_m, double dist_km errnum = prop.kwx; } #endif + +}