source: flexpart.git/src/obukhov.f90 @ 3481cc1

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

move license from headers to a different file

  • Property mode set to 100644
File size: 3.5 KB
Line 
1real function obukhov(ps,tsurf,tdsurf,tlev,ustar,hf,akm,bkm,plev,metdata_format)
2
3  !********************************************************************
4  !                                                                   *
5  !                       Author: G. WOTAWA                           *
6  !                       Date:   1994-06-27                          *
7  !                                                                   *
8  !     This program calculates Obukhov scale height from surface     *
9  !     meteorological data and sensible heat flux.                   *
10  !                                                                   *
11  !********************************************************************
12  !                                                                   *
13  !  Update: A. Stohl, 2000-09-25, avoid division by zero by          *
14  !  setting ustar to minimum value                                   *
15  !  CHANGE: 17/11/2005 Caroline Forster NCEP GFS version             *
16  !                                                                   *
17  !   Unified ECMWF and GFS builds                                    *
18  !   Marian Harustak, 12.5.2017                                      *
19  !     - Merged obukhov and obukhov_gfs into one routine using       *
20  !       if-then for meteo-type dependent code                       *
21  !                                                                   *
22  !********************************************************************
23  !                                                                   *
24  !     INPUT:                                                        *
25  !                                                                   *
26  !     ps      surface pressure [Pa]                                 *
27  !     tsurf   surface temperature [K]                               *
28  !     tdsurf  surface dew point [K]                                 *
29  !     tlev    temperature first model level [K]                     *
30  !     ustar   scale velocity [m/s]                                  *
31  !     hf      surface sensible heat flux [W/m2]                     *
32  !     akm     ECMWF vertical discretization parameter               *
33  !     bkm     ECMWF vertical discretization parameter               *
34  !     plev                                                          *
35  !     metdata_format format of metdata (ecmwf/gfs)                  *
36  !                                                                   *
37  !********************************************************************
38
39  use par_mod
40  use class_gribfile
41
42  implicit none
43
44  integer :: metdata_format
45  real :: akm(nwzmax),bkm(nwzmax)
46  real :: ps,tsurf,tdsurf,tlev,ustar,hf,e,ew,tv,rhoa,plev
47  real :: ak1,bk1,theta,thetastar
48
49
50  e=ew(tdsurf)                           ! vapor pressure
51  tv=tsurf*(1.+0.378*e/ps)               ! virtual temperature
52  rhoa=ps/(r_air*tv)                      ! air density
53  if (metdata_format.eq.GRIBFILE_CENTRE_ECMWF) then
54  ak1=(akm(1)+akm(2))/2.
55  bk1=(bkm(1)+bkm(2))/2.
56  plev=ak1+bk1*ps                        ! Pressure level 1
57  end if
58  theta=tlev*(100000./plev)**(r_air/cpa) ! potential temperature
59  if (ustar.le.0.) ustar=1.e-8
60  thetastar=hf/(rhoa*cpa*ustar)           ! scale temperature
61  if(abs(thetastar).gt.1.e-10) then
62     obukhov=theta*ustar**2/(karman*ga*thetastar)
63  else
64     obukhov=9999                        ! zero heat flux
65  endif
66  if (obukhov.gt. 9999.) obukhov= 9999.
67  if (obukhov.lt.-9999.) obukhov=-9999.
68
69end function obukhov
Note: See TracBrowser for help on using the repository browser.
hosted by ZAMG