source: LMDZ6/trunk/libf/phylmd/ecrad/radiation/radiation_optical_depth_scaling.h @ 5408

Last change on this file since 5408 was 4773, checked in by idelkadi, 12 months ago
  • Update of Ecrad in LMDZ The same organization of the Ecrad offline version is retained in order to facilitate the updating of Ecrad in LMDZ and the comparison between online and offline results. version 1.6.1 of Ecrad (https://github.com/lguez/ecrad.git)
  • Implementation of the double call of Ecrad in LMDZ


File size: 2.7 KB
Line 
1! radiation_optical_depth_scaling.h - Cloud optical-depth scaling for Tripleclouds
2!
3! (C) Copyright 2016- ECMWF.
4!
5! This software is licensed under the terms of the Apache Licence Version 2.0
6! which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
7!
8! In applying this licence, ECMWF does not waive the privileges and immunities
9! granted to it by virtue of its status as an intergovernmental organisation
10! nor does it submit to any jurisdiction.
11!
12!
13! Author:  Robin Hogan
14! Email:   r.j.hogan@ecmwf.int
15!
16! Modifications
17!   2017-07-14  R. Hogan  Incorporate gamma distribution option
18!
19! This file is intended to be included inside a module to ensure that
20! this simple routine may be inlined
21
22!---------------------------------------------------------------------
23! Compute the optical depth scalings for the optically "thick" and
24! "thin" regions of a Tripleclouds representation of a sub-grid PDF of
25! cloud optical depth. Following Shonk and Hogan (2008), the 16th
26! percentile is used for the thin region, and the formulas estimate
27! this for both lognormal and gamma distributions.
28pure subroutine optical_depth_scaling(nreg, frac_std, do_gamma, od_scaling)
29
30  use parkind1, only : jprb
31
32  ! Number of regions
33  integer, intent(in)     :: nreg
34
35  ! Fractional standard deviation of in-cloud water content
36  real(jprb), intent(in)  :: frac_std
37
38  ! Do we do a lognormal or gamma distribution?
39  logical, intent(in) :: do_gamma
40
41  ! Optical depth scaling for the cloudy regions
42  real(jprb), intent(out) :: od_scaling(2:nreg)
43
44  if (nreg == 2) then
45    ! Only one clear-sky and one cloudy region: cloudy region is
46    ! homogeneous
47    od_scaling(2) = 1.0_jprb
48  else
49    ! Two cloudy regions with optical depth scaled by 1-x and
50    ! 1+x.
51    ! Simple version which fails when fractional_std >= 1:
52    !od_scaling(2) = 1.0_jprb-cloud%fractional_std(jcol,jlev)
53    ! According to Shonk and Hogan (2008), 1-x should correspond to
54    ! the 16th percentile. 
55    if (.not. do_gamma) then
56      ! If we treat the distribution as a lognormal such that the
57      ! equivalent Normal has a mean mu and standard deviation sigma,
58      ! then the 16th percentile of the lognormal is very close to
59      ! exp(mu-sigma).
60      od_scaling(2) &
61           &  = exp(-sqrt(log(frac_std**2+1))) / sqrt(frac_std**2+1)
62    else
63      ! If we treat the distribution as a gamma then the 16th
64      ! percentile is close to the following
65      od_scaling(2) = exp(-frac_std*(1.0_jprb + 0.5_jprb*frac_std &
66           &                                   *(1.0_jprb+0.5_jprb*frac_std)))
67    end if
68
69    ! Ensure mean optical depth is conserved
70    od_scaling(3) = 2.0_jprb-od_scaling(2)
71  end if
72
73end subroutine optical_depth_scaling
Note: See TracBrowser for help on using the repository browser.