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

Last change on this file since 4936 was 4853, checked in by idelkadi, 8 months ago

Ecrad update in LMDZ / Implementation of Ecrad double call in LMDZ

  • version 1.6.1 (commit 210d7911380f53a788c3cad73b3cf9b4e022ef87)
  • interface routines between lmdz and ecrad grouped in a new "lmdz" directory
  • double call method redesigned so as to go through the Ecrad initialization and configuration part only once for the entire simulation
  • clean-up in the read.F routine: delete unitules arguments
  • modification of default gas model in namelist (default: ECCKD)
File size: 3.5 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
16#include "ecrad_config.h"
17
18module radiation_cloud_optics_data
19
20  use parkind1, only : jprb
21
22  implicit none
23  public
24
25  !---------------------------------------------------------------------
26  ! This type holds the configuration information to compute
27  ! cloud optical properties
28  type cloud_optics_type
29     ! Band-specific coefficients are provided separately in the
30     ! shortwave and longwave, and are dimensioned (nband,ncoeff),
31     ! where ncoeff depends on the nature of the parameterization
32     real(jprb), allocatable, dimension(:,:) :: &
33          &  liq_coeff_lw, liq_coeff_sw, &
34          &  ice_coeff_lw, ice_coeff_sw
35     ! General coefficients are vectors of length ncoeffgen, which
36     ! depends on the nature of the parameterization; note that most
37     ! parameterizations use only band-specific coefficients
38     real(jprb), allocatable, dimension(:) :: &
39          &  liq_coeff_gen, ice_coeff_gen
40
41   contains
42     procedure :: setup => setup_cloud_optics
43
44  end type cloud_optics_type
45
46contains
47
48  !---------------------------------------------------------------------
49  ! Setup cloud optics coefficients by reading them from a file
50  subroutine setup_cloud_optics(this, liq_file_name, ice_file_name, iverbose)
51   
52    use yomhook,              only : lhook, dr_hook, jphook
53#ifdef EASY_NETCDF_READ_MPI
54    use easy_netcdf_read_mpi, only : netcdf_file
55#else
56    use easy_netcdf,          only : netcdf_file
57#endif
58
59    class(cloud_optics_type), intent(inout) :: this
60    character(len=*), intent(in)            :: liq_file_name, ice_file_name
61    integer, intent(in), optional           :: iverbose
62
63    ! The NetCDF file containing the coefficients
64    type(netcdf_file)  :: file
65    integer            :: iverb
66    real(jphook) :: hook_handle
67
68    if (lhook) call dr_hook('radiation_cloud_optics_data:setup',0,hook_handle)
69
70    if (present(iverbose)) then
71      iverb = iverbose
72    else
73      iverb = 2
74    end if
75
76    ! Open the droplet scattering file and configure the way it is
77    ! read
78    call file%open(trim(liq_file_name), iverbose=iverb)
79    call file%transpose_matrices()
80
81    ! Read the band-specific coefficients
82    call file%get('coeff_lw',this%liq_coeff_lw)
83    call file%get('coeff_sw',this%liq_coeff_sw)
84
85    ! Read the general  coefficients
86    if (file%exists('coeff_gen')) then
87      call file%get('coeff_gen',this%liq_coeff_gen)
88    end if
89
90    ! Close droplet scattering file
91    call file%close()
92
93    ! Open the ice scattering file and configure the way it is read
94    call file%open(trim(ice_file_name), iverbose=iverb)
95    call file%transpose_matrices()
96
97    ! Read the band-specific  coefficients
98    call file%get('coeff_lw',this%ice_coeff_lw)
99    call file%get('coeff_sw',this%ice_coeff_sw)
100
101    ! Read the general  coefficients
102    if (file%exists('coeff_gen')) then
103      call file%get('coeff_gen',this%ice_coeff_gen)
104    end if
105
106    ! Close ice scattering file
107    call file%close()
108
109    if (lhook) call dr_hook('radiation_cloud_optics_data:setup',1,hook_handle)
110
111  end subroutine setup_cloud_optics
112
113end module radiation_cloud_optics_data
Note: See TracBrowser for help on using the repository browser.