source: flexpart.git/src/obukhov.f90 @ 02095e3

10.4.1_peseiGFS_025bugfixes+enhancementsdevrelease-10release-10.4.1scaling-bugunivie
Last change on this file since 02095e3 was 6ecb30a, checked in by Espen Sollum ATMOS <eso@…>, 7 years ago

Merged changes from CTBTO project

  • Property mode set to 100644
File size: 4.9 KB
Line 
1!**********************************************************************
2! Copyright 1998,1999,2000,2001,2002,2005,2007,2008,2009,2010         *
3! Andreas Stohl, Petra Seibert, A. Frank, Gerhard Wotawa,             *
4! Caroline Forster, Sabine Eckhardt, John Burkhart, Harald Sodemann   *
5!                                                                     *
6! This file is part of FLEXPART.                                      *
7!                                                                     *
8! FLEXPART is free software: you can redistribute it and/or modify    *
9! it under the terms of the GNU General Public License as published by*
10! the Free Software Foundation, either version 3 of the License, or   *
11! (at your option) any later version.                                 *
12!                                                                     *
13! FLEXPART is distributed in the hope that it will be useful,         *
14! but WITHOUT ANY WARRANTY; without even the implied warranty of      *
15! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the       *
16! GNU General Public License for more details.                        *
17!                                                                     *
18! You should have received a copy of the GNU General Public License   *
19! along with FLEXPART.  If not, see <http://www.gnu.org/licenses/>.   *
20!**********************************************************************
21
22real function obukhov(ps,tsurf,tdsurf,tlev,ustar,hf,akm,bkm,plev,metdata_format)
23
24  !********************************************************************
25  !                                                                   *
26  !                       Author: G. WOTAWA                           *
27  !                       Date:   1994-06-27                          *
28  !                                                                   *
29  !     This program calculates Obukhov scale height from surface     *
30  !     meteorological data and sensible heat flux.                   *
31  !                                                                   *
32  !********************************************************************
33  !                                                                   *
34  !  Update: A. Stohl, 2000-09-25, avoid division by zero by          *
35  !  setting ustar to minimum value                                   *
36  !  CHANGE: 17/11/2005 Caroline Forster NCEP GFS version             *
37  !                                                                   *
38  !   Unified ECMWF and GFS builds                                    *
39  !   Marian Harustak, 12.5.2017                                      *
40  !     - Merged obukhov and obukhov_gfs into one routine using       *
41  !       if-then for meteo-type dependent code                       *
42  !                                                                   *
43  !********************************************************************
44  !                                                                   *
45  !     INPUT:                                                        *
46  !                                                                   *
47  !     ps      surface pressure [Pa]                                 *
48  !     tsurf   surface temperature [K]                               *
49  !     tdsurf  surface dew point [K]                                 *
50  !     tlev    temperature first model level [K]                     *
51  !     ustar   scale velocity [m/s]                                  *
52  !     hf      surface sensible heat flux [W/m2]                     *
53  !     akm     ECMWF vertical discretization parameter               *
54  !     bkm     ECMWF vertical discretization parameter               *
55  !     plev                                                          *
56  !     metdata_format format of metdata (ecmwf/gfs)                  *
57  !                                                                   *
58  !********************************************************************
59
60  use par_mod
61  use class_gribfile
62
63  implicit none
64
65  integer :: metdata_format
66  real :: akm(nwzmax),bkm(nwzmax)
67  real :: ps,tsurf,tdsurf,tlev,ustar,hf,e,ew,tv,rhoa,plev
68  real :: ak1,bk1,theta,thetastar
69
70
71  e=ew(tdsurf)                           ! vapor pressure
72  tv=tsurf*(1.+0.378*e/ps)               ! virtual temperature
73  rhoa=ps/(r_air*tv)                      ! air density
74  if (metdata_format.eq.GRIBFILE_CENTRE_ECMWF) then
75  ak1=(akm(1)+akm(2))/2.
76  bk1=(bkm(1)+bkm(2))/2.
77  plev=ak1+bk1*ps                        ! Pressure level 1
78  end if
79  theta=tlev*(100000./plev)**(r_air/cpa) ! potential temperature
80  if (ustar.le.0.) ustar=1.e-8
81  thetastar=hf/(rhoa*cpa*ustar)           ! scale temperature
82  if(abs(thetastar).gt.1.e-10) then
83     obukhov=theta*ustar**2/(karman*ga*thetastar)
84  else
85     obukhov=9999                        ! zero heat flux
86  endif
87  if (obukhov.gt. 9999.) obukhov= 9999.
88  if (obukhov.lt.-9999.) obukhov=-9999.
89
90end function obukhov
Note: See TracBrowser for help on using the repository browser.
hosted by ZAMG