Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=8), | intent(in) | :: | f |
FUNCTION Franc_Garr( f ) ! Francois Garrison formulas for attenuation ! Based on a Matlab version by D. Jackson APL-UW ! mbp Feb. 2019 ! Verified using F-G Table IV ! alpha = attenuation (dB/km) ! f = frequency (kHz) ! T = temperature (deg C) ! S = salinity (psu) ! pH = 7 for neutral water ! z_bar = depth (m) ! Returns ! alpha = volume attenuation in dB/km REAL (KIND=8), INTENT( IN ) :: f REAL (KIND=8) :: Franc_Garr REAL (KIND=8) :: c, A1, A2, A3, P1, P2, P3, f1, f2 ! LP: Bug (at least technically): Single-precision and double-precision ! literals are all mixed together here, both including values which are ! not representable as floats, thus leading to different results. ! Practically, these are approximate, experimentally-derived constants, so ! errors at the 1e-7 scale are completely not meaningful. c = 1412 + 3.21 * T + 1.19 * Salinity + 0.0167 * z_bar ! Boric acid contribution A1 = 8.86 / c * 10 ** ( 0.78 * pH - 5 ) P1 = 1 f1 = 2.8 * sqrt( Salinity / 35 ) * 10 ** ( 4 - 1245 / ( T + 273 ) ) ! Magnesium sulfate contribution A2 = 21.44 * Salinity / c * ( 1 + 0.025 * T ) P2 = 1 - 1.37D-4 * z_bar + 6.2D-9 * z_bar ** 2 f2 = 8.17 * 10 ** ( 8 - 1990 / ( T + 273 ) ) / ( 1 + 0.0018 * ( Salinity - 35 ) ) ! Viscosity P3 = 1 - 3.83D-5 * z_bar + 4.9D-10 * z_bar ** 2 if ( T < 20 ) THEN A3 = 4.937D-4 - 2.59D-5 * T + 9.11D-7 * T ** 2 - 1.5D-8 * T ** 3 else A3 = 3.964D-4 -1.146D-5 * T + 1.45D-7 * T ** 2 - 6.5D-10 * T ** 3 end if Franc_Garr = A1 * P1 * ( f1 * f ** 2 ) / ( f1 ** 2 + f ** 2 ) + A2 * P2 * ( f2 * f ** 2 ) / ( f2 ** 2 + f ** 2 ) + & A3 * P3 * f ** 2 END FUNCTION Franc_Garr