You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
- USA or view http://www.gnu.org/copyleft/gpl.html.
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**********************************************************************/
/* Get wind vector */
double windmag = 0; //Wind magnitude
double a = 0; //Parabola: Altitude = a*windmag^2 + zoff
+ double x = pow(uref,2.);
- a = zref/pow(uref,2.);
- if (Altitude >= zoff)
+ if (x) {
+ a = zref/x;
+ }
+ if ((Altitude >= zoff) && (a > 0))
windmag = sqrt(Altitude/a);
else
windmag = 0.;