[e200b7a] | 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 | |
---|
[6ecb30a] | 22 | real function obukhov(ps,tsurf,tdsurf,tlev,ustar,hf,akm,bkm,plev,metdata_format) |
---|
[e200b7a] | 23 | |
---|
| 24 | !******************************************************************** |
---|
| 25 | ! * |
---|
| 26 | ! Author: G. WOTAWA * |
---|
| 27 | ! Date: 1994-06-27 * |
---|
| 28 | ! * |
---|
[6ecb30a] | 29 | ! This program calculates Obukhov scale height from surface * |
---|
| 30 | ! meteorological data and sensible heat flux. * |
---|
[e200b7a] | 31 | ! * |
---|
| 32 | !******************************************************************** |
---|
| 33 | ! * |
---|
[6ecb30a] | 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 * |
---|
[e200b7a] | 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 * |
---|
[6ecb30a] | 55 | ! plev * |
---|
| 56 | ! metdata_format format of metdata (ecmwf/gfs) * |
---|
[e200b7a] | 57 | ! * |
---|
| 58 | !******************************************************************** |
---|
| 59 | |
---|
| 60 | use par_mod |
---|
[6ecb30a] | 61 | use class_gribfile |
---|
[e200b7a] | 62 | |
---|
| 63 | implicit none |
---|
| 64 | |
---|
[6ecb30a] | 65 | integer :: metdata_format |
---|
[e200b7a] | 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 |
---|
[6ecb30a] | 74 | if (metdata_format.eq.GRIBFILE_CENTRE_ECMWF) then |
---|
[e200b7a] | 75 | ak1=(akm(1)+akm(2))/2. |
---|
| 76 | bk1=(bkm(1)+bkm(2))/2. |
---|
| 77 | plev=ak1+bk1*ps ! Pressure level 1 |
---|
[6ecb30a] | 78 | end if |
---|
[e200b7a] | 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 | |
---|
| 90 | end function obukhov |
---|