source: flexpart.git/src/psih.f90

10.4.1_peseiGFS_025bugfixes+enhancementsdevrelease-10release-10.4.1scaling-bug
Last change on this file was 92fab65, checked in by Ignacio Pisso <ip@…>, 4 years ago

add SPDX-License-Identifier to all .f90 files

  • Property mode set to 100644
File size: 2.6 KB
Line 
1! SPDX-FileCopyrightText: FLEXPART 1998-2019, see flexpart_license.txt
2! SPDX-License-Identifier: GPL-3.0-or-later
3
4function psih (z,l)
5
6  !*****************************************************************************
7  !                                                                            *
8  !     Calculation of the stability correction term                           *
9  !                                                                            *
10  !     AUTHOR: Matthias Langer, adapted by Andreas Stohl (6 August 1993)      *
11  !             Update: G. Wotawa, 11 October 1994                             *
12  !                                                                            *
13  !     Literature:                                                            *
14  !     [1] C.A.Paulson (1970), A Mathematical Representation of Wind Speed    *
15  !           and Temperature Profiles in the Unstable Atmospheric Surface     *
16  !           Layer. J.Appl.Met.,Vol.9.(1970), pp.857-861.                     *
17  !                                                                            *
18  !     [2] A.C.M. Beljaars, A.A.M. Holtslag (1991), Flux Parameterization over*
19  !           Land Surfaces for Atmospheric Models. J.Appl.Met. Vol. 30,pp 327-*
20  !           341                                                              *
21  !                                                                            *
22  !     Variables:                                                             *
23  !     L     = Monin-Obukhov-length [m]                                       *
24  !     z     = height [m]                                                     *
25  !     zeta  = auxiliary variable                                             *
26  !                                                                            *
27  !     Constants:                                                             *
28  !     eps   = 1.2E-38, SUN-underflow: to avoid division by zero errors       *
29  !                                                                            *
30  !*****************************************************************************
31
32  use par_mod
33
34  implicit none
35
36  real :: psih,x,z,zeta,l
37  real,parameter :: a=1.,b=0.667,c=5.,d=0.35,eps=1.e-20
38
39  if ((l.ge.0).and.(l.lt.eps)) then
40    l=eps
41  else if ((l.lt.0).and.(l.gt.(-1.*eps))) then
42    l=-1.*eps
43  endif
44
45  if ((log10(z)-log10(abs(l))).lt.log10(eps)) then
46    psih=0.
47  else
48    zeta=z/l
49    if (zeta.gt.0.) then
50      psih = - (1.+0.667*a*zeta)**(1.5) - b*(zeta-c/d)*exp(-d*zeta) &
51           - b*c/d + 1.
52    else
53      x=(1.-16.*zeta)**(.25)
54      psih=2.*log((1.+x*x)/2.)
55    end if
56  end if
57
58end function psih
Note: See TracBrowser for help on using the repository browser.
hosted by ZAMG