source: flexpart.git/src/obukhov.f90 @ c0884a8

univie
Last change on this file since c0884a8 was c0884a8, checked in by pesei <petra seibert at univie ac at>, 6 years ago

replace CTBTO code for checking type of GRIB

  • Property mode set to 100644
File size: 5.2 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,id_centre)
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  !  Petra Seibert, 2018-06-26:                                       *
45  !    simplified version met data format detection                   *
46  !                                                                   *
47  !********************************************************************
48  !                                                                   *
49  !     INPUT:                                                        *
50  !                                                                   *
51  !     ps      surface pressure [Pa]                                 *
52  !     tsurf   surface temperature [K]                               *
53  !     tdsurf  surface dew point [K]                                 *
54  !     tlev    temperature first model level [K]                     *
55  !     ustar   scale velocity [m/s]                                  *
56  !     hf      surface sensible heat flux [W/m2]                     *
57  !     akm     ECMWF vertical discretization parameter               *
58  !     bkm     ECMWF vertical discretization parameter               *
59  !     plev                                                          *
60  !     id_centre format of metdata (ecmwf/gfs)                  *
61  !                                                                   *
62  !********************************************************************
63
64  use par_mod
65  use check_gribfile_mod
66
67  implicit none
68
69  integer :: id_centre
70  real :: akm(nwzmax),bkm(nwzmax)
71  real :: ps,tsurf,tdsurf,tlev,ustar,hf,e,ew,tv,rhoa,plev
72  real :: ak1,bk1,theta,thetastar
73
74
75  e=ew(tdsurf)                           ! vapor pressure
76  tv=tsurf*(1.+0.378*e/ps)               ! virtual temperature
77  rhoa=ps/(r_air*tv)                      ! air density
78  if (id_centre.eq.icg_id_ecmwf) then
79  ak1=(akm(1)+akm(2))/2.
80  bk1=(bkm(1)+bkm(2))/2.
81  plev=ak1+bk1*ps                        ! Pressure level 1
82  end if
83  theta=tlev*(100000./plev)**(r_air/cpa) ! potential temperature
84  if (ustar.le.0.) ustar=1.e-8
85  thetastar=hf/(rhoa*cpa*ustar)           ! scale temperature
86  if(abs(thetastar).gt.1.e-10) then
87     obukhov=theta*ustar**2/(karman*ga*thetastar)
88  else
89     obukhov=9999                        ! zero heat flux
90  endif
91  if (obukhov.gt. 9999.) obukhov= 9999.
92  if (obukhov.lt.-9999.) obukhov=-9999.
93
94end function obukhov
Note: See TracBrowser for help on using the repository browser.
hosted by ZAMG