-
Notifications
You must be signed in to change notification settings - Fork 0
/
stats_rad_zm_module.F90
181 lines (132 loc) · 6.33 KB
/
stats_rad_zm_module.F90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
!-----------------------------------------------------------------------
! $Id$
!===============================================================================
module stats_rad_zm_module
implicit none
private ! Default Scope
public :: stats_init_rad_zm
! Constant parameters
integer, parameter, public :: nvarmax_rad_zm = 250 ! Maximum variables allowed
contains
!-----------------------------------------------------------------------
subroutine stats_init_rad_zm( vars_rad_zm, & ! intent(in)
l_error, & ! intent(in)
stats_metadata, stats_rad_zm ) ! intent(inout)
! Description:
! Initializes array indices for stats_rad_zm variables
!-----------------------------------------------------------------------
use constants_clubb, only: &
fstderr ! Constant(s)
use stats_type_utilities, only: &
stat_assign ! Procedure
use stats_type, only: &
stats ! Type
use stats_variables, only: &
stats_metadata_type
implicit none
!------------------------ Input Variable ------------------------
character(len= * ), dimension(nvarmax_rad_zm), intent(in) :: vars_rad_zm
!--------------------- InOut Variables ---------------------
type (stats), target, intent(inout) :: &
stats_rad_zm
type (stats_metadata_type), intent(inout) :: &
stats_metadata
logical, intent(inout) :: l_error
!------------------------ Local Varables ------------------------
integer :: i, k
!------------------------ Begin Code ------------------------
! Default initialization for array indices for stats_rad_zm
stats_metadata%iFrad_LW_rad = 0
stats_metadata%iFrad_SW_rad = 0
stats_metadata%iFrad_SW_up_rad = 0
stats_metadata%iFrad_LW_up_rad = 0
stats_metadata%iFrad_SW_down_rad = 0
stats_metadata%iFrad_LW_down_rad = 0
stats_metadata%ifulwcl = 0
stats_metadata%ifdlwcl = 0
stats_metadata%ifdswcl = 0
stats_metadata%ifuswcl = 0
! Assign pointers for statistics variables stats_rad_zm
k = 1
do i=1,stats_rad_zm%num_output_fields
select case ( trim(vars_rad_zm(i)) )
case('fulwcl')
stats_metadata%ifulwcl = k
call stat_assign( var_index=stats_metadata%ifulwcl, var_name="fulwcl", & ! intent(in)
var_description="Upward clear-sky LW flux [W/m^2]", var_units="W/m^2", & ! intent(in)
l_silhs=.false., & ! intent(in)
grid_kind=stats_rad_zm ) ! intent(inout)
k = k + 1
case( 'fdlwcl' )
stats_metadata%ifdlwcl = k
call stat_assign( var_index=stats_metadata%ifdlwcl, var_name="fdlwcl", & ! intent(in)
var_description="Downward clear-sky LW flux [W/m^2]", var_units="W/m^2", & !intent(in)
l_silhs=.false., & ! intent(in)
grid_kind=stats_rad_zm ) ! intent(inout)
k = k + 1
case( 'fdswcl' )
stats_metadata%ifdswcl = k
call stat_assign( var_index=stats_metadata%ifdswcl, var_name="fdswcl", & ! intent(in)
var_description="Downward clear-sky SW flux [W/m^2]", var_units="W/m^2", & !intent(in)
l_silhs=.false., & ! intent(in)
grid_kind=stats_rad_zm ) ! intent(inout)
k = k + 1
case( 'fuswcl' )
stats_metadata%ifuswcl = k
call stat_assign( var_index=stats_metadata%ifuswcl, var_name="fuswcl", & ! intent(in)
var_description="Upward clear-sky SW flux [W/m^2]", var_units="W/m^2", & ! intent(in)
l_silhs=.false., & ! intent(in)
grid_kind=stats_rad_zm ) ! intent(inout)
k = k + 1
case ('Frad_LW_rad')
stats_metadata%iFrad_LW_rad = k
call stat_assign( var_index=stats_metadata%iFrad_LW_rad, var_name="Frad_LW_rad", & ! intent(in)
var_description="Net long-wave radiative flux [W/m^2]", var_units="W/m^2", & ! In
l_silhs=.false., & ! intent(in)
grid_kind=stats_rad_zm ) ! intent(inout)
k = k + 1
case ('Frad_SW_rad')
stats_metadata%iFrad_SW_rad = k
call stat_assign( var_index=stats_metadata%iFrad_SW_rad, var_name="Frad_SW_rad", & ! intent(in)
var_description="Net short-wave radiative flux [W/m^2]", var_units="W/m^2", & ! In
l_silhs=.false., & ! intent(in)
grid_kind=stats_rad_zm ) ! intent(inout)
k = k + 1
case ('Frad_SW_up_rad')
stats_metadata%iFrad_SW_up_rad = k
call stat_assign( var_index=stats_metadata%iFrad_SW_up_rad, var_name="Frad_SW_up_rad", & ! intent(in)
var_description="Short-wave upwelling radiative flux [W/m^2]", var_units="W/m^2", &!In
l_silhs=.false., & ! intent(in)
grid_kind=stats_rad_zm ) ! intent(inout)
k = k + 1
case ('Frad_LW_up_rad')
stats_metadata%iFrad_LW_up_rad = k
call stat_assign( var_index=stats_metadata%iFrad_LW_up_rad, var_name="Frad_LW_up_rad", & ! intent(in)
var_description="Long-wave upwelling radiative flux [W/m^2]", var_units="W/m^2", &!In
l_silhs=.false., & ! intent(in)
grid_kind=stats_rad_zm ) ! intent(inout)
k = k + 1
case ('Frad_SW_down_rad')
stats_metadata%iFrad_SW_down_rad = k
call stat_assign( var_index=stats_metadata%iFrad_SW_down_rad, var_name="Frad_SW_down_rad", & ! intent(in)
var_description="Short-wave downwelling radiative flux [W/m^2]", & ! intent(in)
var_units="W/m^2", & ! intent(in)
l_silhs=.false., & ! intent(in)
grid_kind=stats_rad_zm ) ! intent(inout)
k = k + 1
case ('Frad_LW_down_rad')
stats_metadata%iFrad_LW_down_rad = k
call stat_assign( var_index=stats_metadata%iFrad_LW_down_rad, var_name="Frad_LW_down_rad", & ! intent(in)
var_description="Long-wave downwelling radiative flux [W/m^2]", & ! intent(in)
var_units="W/m^2", & ! intent(in)
l_silhs=.false., & ! intent(in)
grid_kind=stats_rad_zm ) ! intent(inout)
k = k + 1
case default
write(fstderr,*) 'Error: unrecognized variable in vars_rad_zm: ', trim( vars_rad_zm(i) )
l_error = .true. ! This will stop the run.
end select
end do
return
end subroutine stats_init_rad_zm
end module stats_rad_zm_module