Line data Source code
1 : !---------------------------------------------------------------------------
2 : ! $Id$
3 : !===============================================================================
4 : module hydromet_pdf_parameter_module
5 :
6 : ! Description:
7 : ! This module defines the derived type hydromet_pdf_parameter.
8 :
9 : ! References:
10 : ! None
11 : !-------------------------------------------------------------------------
12 :
13 : use clubb_precision, only: &
14 : core_rknd ! Variable(s)
15 :
16 : implicit none
17 :
18 : private ! Default scope
19 :
20 : public :: hydromet_pdf_parameter, & ! Variable type
21 : precipitation_fractions, &
22 : init_hydromet_pdf_params, & ! Procedure
23 : init_precip_fracs
24 :
25 : integer, parameter, private :: &
26 : max_hydromet_dim = 8
27 :
28 : type hydromet_pdf_parameter
29 :
30 : real( kind = core_rknd ), dimension(max_hydromet_dim) :: &
31 : hm_1, & ! Mean of hydrometeor, hm (1st PDF component) [un vary]
32 : hm_2, & ! Mean of hydrometeor, hm (2nd PDF component) [un vary]
33 : mu_hm_1, & ! Mean of hm (1st PDF component) in-precip (ip) [un vary]
34 : mu_hm_2, & ! Mean of hm (2nd PDF component) ip [un vary]
35 : sigma_hm_1, & ! Standard deviation of hm (1st PDF comp.) ip [un vary]
36 : sigma_hm_2, & ! Standard deviation of hm (2nd PDF comp.) ip [un vary]
37 : corr_w_hm_1, & ! Correlation of w and hm (1st PDF component) ip [-]
38 : corr_w_hm_2, & ! Correlation of w and hm (2nd PDF component) ip [-]
39 : corr_chi_hm_1, & ! Correlation of chi and hm (1st PDF component) ip [-]
40 : corr_chi_hm_2, & ! Correlation of chi and hm (2nd PDF component) ip [-]
41 : corr_eta_hm_1, & ! Correlation of eta and hm (1st PDF component) ip [-]
42 : corr_eta_hm_2 ! Correlation of eta and hm (2nd PDF component) ip [-]
43 :
44 : real( kind = core_rknd ), dimension(max_hydromet_dim,max_hydromet_dim) :: &
45 : corr_hmx_hmy_1, & ! Correlation of hmx and hmy (1st PDF component) ip [-]
46 : corr_hmx_hmy_2 ! Correlation of hmx and hmy (2nd PDF component) ip [-]
47 :
48 : real( kind = core_rknd ) :: &
49 : mu_Ncn_1, & ! Mean of Ncn (1st PDF component) [num/kg]
50 : mu_Ncn_2, & ! Mean of Ncn (2nd PDF component) [num/kg]
51 : sigma_Ncn_1, & ! Standard deviation of Ncn (1st PDF component) [num/kg]
52 : sigma_Ncn_2 ! Standard deviation of Ncn (2nd PDF component) [num/kg]
53 :
54 : end type hydromet_pdf_parameter
55 :
56 : type precipitation_fractions
57 :
58 : real( kind = core_rknd ), dimension(:,:), allocatable :: &
59 : precip_frac, & ! Precipitation fraction (overall) [-]
60 : precip_frac_1, & ! Precipitation fraction (1st PDF component) [-]
61 : precip_frac_2 ! Precipitation fraction (2nd PDF component) [-]
62 :
63 : end type
64 :
65 :
66 : contains
67 :
68 : !=============================================================================
69 0 : subroutine init_hydromet_pdf_params( hydromet_pdf_params )
70 :
71 : ! Description:
72 : ! Initialize the elements of hydromet_pdf_params.
73 :
74 : ! References:
75 : !-----------------------------------------------------------------------
76 :
77 : use constants_clubb, only: &
78 : zero ! Constant(s)
79 :
80 : implicit none
81 :
82 : ! Output Variable
83 : type(hydromet_pdf_parameter), intent(out) :: &
84 : hydromet_pdf_params ! Hydrometeor PDF parameters [units vary]
85 :
86 : ! Initialize hydromet_pdf_params.
87 0 : hydromet_pdf_params%hm_1 = zero
88 0 : hydromet_pdf_params%hm_2 = zero
89 0 : hydromet_pdf_params%mu_hm_1 = zero
90 0 : hydromet_pdf_params%mu_hm_2 = zero
91 0 : hydromet_pdf_params%sigma_hm_1 = zero
92 0 : hydromet_pdf_params%sigma_hm_2 = zero
93 0 : hydromet_pdf_params%corr_w_hm_1 = zero
94 0 : hydromet_pdf_params%corr_w_hm_2 = zero
95 0 : hydromet_pdf_params%corr_chi_hm_1 = zero
96 0 : hydromet_pdf_params%corr_chi_hm_2 = zero
97 0 : hydromet_pdf_params%corr_eta_hm_1 = zero
98 0 : hydromet_pdf_params%corr_eta_hm_2 = zero
99 :
100 0 : hydromet_pdf_params%corr_hmx_hmy_1 = zero
101 0 : hydromet_pdf_params%corr_hmx_hmy_2 = zero
102 :
103 0 : hydromet_pdf_params%mu_Ncn_1 = zero
104 0 : hydromet_pdf_params%mu_Ncn_2 = zero
105 0 : hydromet_pdf_params%sigma_Ncn_1 = zero
106 0 : hydromet_pdf_params%sigma_Ncn_2 = zero
107 :
108 0 : return
109 :
110 : end subroutine init_hydromet_pdf_params
111 :
112 : !=============================================================================
113 0 : subroutine init_precip_fracs( nz, ngrdcol, &
114 : precip_fracs )
115 :
116 : ! Description:
117 : ! Initialize the elements of precip_fracs.
118 :
119 : ! References:
120 : !-----------------------------------------------------------------------
121 :
122 : use constants_clubb, only: &
123 : zero ! Constant(s)
124 :
125 : implicit none
126 :
127 : ! Input Variable(s)
128 : integer, intent(in) :: &
129 : nz, & ! Number of vertical grid levels [-]
130 : ngrdcol ! Number of grid columns [-]
131 :
132 : ! Output Variable
133 : type(precipitation_fractions), intent(out) :: &
134 : precip_fracs ! Hydrometeor PDF parameters [units vary]
135 :
136 : ! Allocate precip frac arrays
137 0 : allocate( precip_fracs%precip_frac(ngrdcol,nz), &
138 0 : precip_fracs%precip_frac_1(ngrdcol,nz), &
139 0 : precip_fracs%precip_frac_2(ngrdcol,nz) )
140 :
141 : ! Initialize precip_fracs.
142 0 : precip_fracs%precip_frac = zero
143 0 : precip_fracs%precip_frac_1 = zero
144 0 : precip_fracs%precip_frac_2 = zero
145 :
146 0 : return
147 :
148 : end subroutine init_precip_fracs
149 :
150 : !===============================================================================
151 :
152 0 : end module hydromet_pdf_parameter_module
|