source: LMDZ6/trunk/libf/phylmd/ecrad/radiation/radiation_cloud_optics_data.F90 @ 4773

Last change on this file since 4773 was 4773, checked in by idelkadi, 5 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: 3.4 KB
Line 
1! radiation_cloud_optics_data.F90 - Type to store cloud optical properties
2!
3! (C) Copyright 2014- 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! Author:  Robin Hogan
13! Email:   r.j.hogan@ecmwf.int
14!
15
16module radiation_cloud_optics_data
17
18  use parkind1, only : jprb
19
20  implicit none
21  public
22
23  !---------------------------------------------------------------------
24  ! This type holds the configuration information to compute
25  ! cloud optical properties
26  type cloud_optics_type
27     ! Band-specific coefficients are provided separately in the
28     ! shortwave and longwave, and are dimensioned (nband,ncoeff),
29     ! where ncoeff depends on the nature of the parameterization
30     real(jprb), allocatable, dimension(:,:) :: &
31          &  liq_coeff_lw, liq_coeff_sw, &
32          &  ice_coeff_lw, ice_coeff_sw
33     ! General coefficients are vectors of length ncoeffgen, which
34     ! depends on the nature of the parameterization; note that most
35     ! parameterizations use only band-specific coefficients
36     real(jprb), allocatable, dimension(:) :: &
37          &  liq_coeff_gen, ice_coeff_gen
38
39   contains
40     procedure :: setup => setup_cloud_optics
41
42  end type cloud_optics_type
43
44contains
45
46  !---------------------------------------------------------------------
47  ! Setup cloud optics coefficients by reading them from a file
48  subroutine setup_cloud_optics(this, liq_file_name, ice_file_name, iverbose)
49   
50    use yomhook,  only : lhook, dr_hook, jphook
51    use easy_netcdf, only : netcdf_file
52
53    class(cloud_optics_type), intent(inout) :: this
54    character(len=*), intent(in)            :: liq_file_name, ice_file_name
55    integer, intent(in), optional           :: iverbose
56
57    ! The NetCDF file containing the coefficients
58    type(netcdf_file)  :: file
59    integer            :: iverb
60    real(jphook) :: hook_handle
61
62    if (lhook) call dr_hook('radiation_cloud_optics_data:setup',0,hook_handle)
63
64    if (present(iverbose)) then
65      iverb = iverbose
66    else
67      iverb = 2
68    end if
69
70    ! Open the droplet scattering file and configure the way it is
71    ! read
72    call file%open(trim(liq_file_name), iverbose=iverb)
73    call file%transpose_matrices()
74
75    ! Read the band-specific coefficients
76    call file%get('coeff_lw',this%liq_coeff_lw)
77    call file%get('coeff_sw',this%liq_coeff_sw)
78
79    ! Read the general  coefficients
80    if (file%exists('coeff_gen')) then
81      call file%get('coeff_gen',this%liq_coeff_gen)
82    end if
83
84    ! Close droplet scattering file
85    call file%close()
86
87    ! Open the ice scattering file and configure the way it is read
88    call file%open(trim(ice_file_name), iverbose=iverb)
89    call file%transpose_matrices()
90
91    ! Read the band-specific  coefficients
92    call file%get('coeff_lw',this%ice_coeff_lw)
93    call file%get('coeff_sw',this%ice_coeff_sw)
94
95    ! Read the general  coefficients
96    if (file%exists('coeff_gen')) then
97      call file%get('coeff_gen',this%ice_coeff_gen)
98    end if
99
100    ! Close ice scattering file
101    call file%close()
102
103    if (lhook) call dr_hook('radiation_cloud_optics_data:setup',1,hook_handle)
104
105  end subroutine setup_cloud_optics
106
107end module radiation_cloud_optics_data
Note: See TracBrowser for help on using the repository browser.