[6ecb30a] | 1 | real function obukhov(ps,tsurf,tdsurf,tlev,ustar,hf,akm,bkm,plev,metdata_format) |
---|
[e200b7a] | 2 | |
---|
| 3 | !******************************************************************** |
---|
| 4 | ! * |
---|
| 5 | ! Author: G. WOTAWA * |
---|
| 6 | ! Date: 1994-06-27 * |
---|
| 7 | ! * |
---|
[6ecb30a] | 8 | ! This program calculates Obukhov scale height from surface * |
---|
| 9 | ! meteorological data and sensible heat flux. * |
---|
[e200b7a] | 10 | ! * |
---|
| 11 | !******************************************************************** |
---|
| 12 | ! * |
---|
[6ecb30a] | 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 * |
---|
[e200b7a] | 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 * |
---|
[6ecb30a] | 34 | ! plev * |
---|
| 35 | ! metdata_format format of metdata (ecmwf/gfs) * |
---|
[e200b7a] | 36 | ! * |
---|
| 37 | !******************************************************************** |
---|
| 38 | |
---|
| 39 | use par_mod |
---|
[6ecb30a] | 40 | use class_gribfile |
---|
[e200b7a] | 41 | |
---|
| 42 | implicit none |
---|
| 43 | |
---|
[6ecb30a] | 44 | integer :: metdata_format |
---|
[e200b7a] | 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 |
---|
[6ecb30a] | 53 | if (metdata_format.eq.GRIBFILE_CENTRE_ECMWF) then |
---|
[e200b7a] | 54 | ak1=(akm(1)+akm(2))/2. |
---|
| 55 | bk1=(bkm(1)+bkm(2))/2. |
---|
| 56 | plev=ak1+bk1*ps ! Pressure level 1 |
---|
[6ecb30a] | 57 | end if |
---|
[e200b7a] | 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 | |
---|
| 69 | end function obukhov |
---|