!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!! Subroutine for inter-conversion of winds .... !!! !!! Forward Transformation ( U and V to WS and WD ): UV --> WS,WD !!! !!! Reverse Transformation ( WS and WD to U AND V ): WS,WD --> UV !!! !!! Version: March 25, 2010 (ATJ/DBS) !!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! u = zonal component of winds (m/s) ! v = meridional component of winds (m/s) ! ws = mean wind speed (m/s) ! wd = mean wind direction (degree) ! iflag = 1 for forward; -1 for reverse transformation Subroutine winds (u, v, ws, wd, iflag) r_d = 180.0/3.14159265359 ! radian to degree conversion d_r = 3.14159265359/180.0 ! degree to radian conversion If (iflag == 1) Go to 201 If (iflag == -1) Go to 202 201 Continue ws = sqrt ( (u*u) + (v*v) ) wd = ( atan2(u,v) * r_d ) + 180.0 Go to 210 202 Continue u = -1. * ws * Sind(wd) v = -1. * ws * Cosd(wd) Go to 210 210 Return End