C ********************************************************************** C * * C * SOFTWARE LICENSING * C * * C * This program is free software; you can redistribute * C * it and/or modify it under the terms of the GNU * C * General Public License as published by the Free * C * Software Foundation, either Version 2 of the * C * license, or (at your option) any later version. * C * * C * This program is distributed in the hope that it * C * will be useful, but without any warranty; without * C * even the implied warranty of merchantability or * C * fitness for a particular purpose. See the GNU * C * General Public License for more details. * C * * C * A copy of the GNU General Public License is * C * available at http://www.gnu.org/copyleft/gpl.html * C * or by writing to the Free Software Foundation, Inc.,* C * 59 Temple Place - Suite 330, Boston, MA 02111, USA. * C * * C ********************************************************************** F=1. G=9.8 DO DD=-1,1,1.E-3 SS=WNUMYOU(F,DD,G) WRITE (*,*) DD,SS ENDDO END FUNCTION WNUMYOU(F,DD,G) ! NG12022009 CNG CNG APPROXIMATE SOLUTION OF WAVE DISPERSION EQUATION CNG CNG F = FREQUENCY (HZ) CNG DD = DEPTH (M) CNG WNUMYOU = WAVENUMBER (1/M) CNG CNG Reference: Zai-Jin You, 2008 CNG "A close approximation of wave dispersion relation for CNG direct calculation of wavelength in any coastal water depth." CNG Equations 3 and 2 (or 3 and 4). CNG Applied Ocean Research CNG Provides 0.01% (0.1%) maximum relative error. CNG CNG Note that the YOU (2) equation can be analytically rewritten BUT CNG the resulting simpler expression becomes numerically indefinite CNG because it involves ~inf/~inf expressions like cosh*sinh. CNG DATA TPI/6.283185/ HK0=DD*TPI*F*TPI*F/G X0=SQRT(HK0)*(1.+HK0/6.+HK0*HK0/30.) ! YOU (3) Y=X0*( (HK0+X0/COSH(X0)*X0/COSH(X0)) / + (X0*TANH(X0)+X0/COSH(X0)*X0/COSH(X0)) ) ! YOU (2) NEWTON-RAPHSON CNG Y=HK0/TANH(X0) ! YOU (4), SOMEWHAT FASTER ~ HUNT IN ACCURACY AND SPEED WNUMYOU=Y/(DD+1.E-10) RETURN END