-
Notifications
You must be signed in to change notification settings - Fork 12
/
stats_rad_zm_module.F90
168 lines (120 loc) · 4.91 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
!-----------------------------------------------------------------------
! $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, l_error )
! Description:
! Initializes array indices for stats_rad_zm variables
!-----------------------------------------------------------------------
use constants_clubb, only: &
fstderr ! Constant(s)
use stats_variables, only: &
stats_rad_zm, &
iFrad_LW_rad, & ! Variable(s)
iFrad_SW_rad, &
iFrad_SW_up_rad, &
iFrad_LW_up_rad, &
iFrad_SW_down_rad, &
iFrad_LW_down_rad
use stats_variables, only: &
ifulwcl, ifdlwcl, ifdswcl, ifuswcl ! Variable(s)
use stats_type_utilities, only: &
stat_assign ! Procedure
implicit none
! Input Variable
character(len= * ), dimension(nvarmax_rad_zm), intent(in) :: vars_rad_zm
! Input/Output Variable
logical, intent(inout) :: l_error
! Local Varables
integer :: i, k
! ---- Begin Code ----
! Default initialization for array indices for stats_rad_zm
iFrad_LW_rad = 0
iFrad_SW_rad = 0
iFrad_SW_up_rad = 0
iFrad_LW_up_rad = 0
iFrad_SW_down_rad = 0
iFrad_LW_down_rad = 0
ifulwcl = 0
ifdlwcl = 0
ifdswcl = 0
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')
ifulwcl = k
call stat_assign( var_index=ifulwcl, var_name="fulwcl", &
var_description="Upward clear-sky LW flux [W/m^2]", var_units="W/m^2", &
l_silhs=.false., grid_kind=stats_rad_zm )
k = k + 1
case( 'fdlwcl' )
ifdlwcl = k
call stat_assign( var_index=ifdlwcl, var_name="fdlwcl", &
var_description="Downward clear-sky LW flux [W/m^2]", var_units="W/m^2", &
l_silhs=.false., grid_kind=stats_rad_zm )
k = k + 1
case( 'fdswcl' )
ifdswcl = k
call stat_assign( var_index=ifdswcl, var_name="fdswcl", &
var_description="Downward clear-sky SW flux [W/m^2]", var_units="W/m^2", &
l_silhs=.false., grid_kind=stats_rad_zm )
k = k + 1
case( 'fuswcl' )
ifuswcl = k
call stat_assign( var_index=ifuswcl, var_name="fuswcl", &
var_description="Upward clear-sky SW flux [W/m^2]", var_units="W/m^2", &
l_silhs=.false., grid_kind=stats_rad_zm )
k = k + 1
case ('Frad_LW_rad')
iFrad_LW_rad = k
call stat_assign( var_index=iFrad_LW_rad, var_name="Frad_LW_rad", &
var_description="Net long-wave radiative flux [W/m^2]", var_units="W/m^2", &
l_silhs=.false., grid_kind=stats_rad_zm )
k = k + 1
case ('Frad_SW_rad')
iFrad_SW_rad = k
call stat_assign( var_index=iFrad_SW_rad, var_name="Frad_SW_rad", &
var_description="Net short-wave radiative flux [W/m^2]", var_units="W/m^2", &
l_silhs=.false., grid_kind=stats_rad_zm )
k = k + 1
case ('Frad_SW_up_rad')
iFrad_SW_up_rad = k
call stat_assign( var_index=iFrad_SW_up_rad, var_name="Frad_SW_up_rad", &
var_description="Short-wave upwelling radiative flux [W/m^2]", var_units="W/m^2", &
l_silhs=.false., grid_kind=stats_rad_zm )
k = k + 1
case ('Frad_LW_up_rad')
iFrad_LW_up_rad = k
call stat_assign( var_index=iFrad_LW_up_rad, var_name="Frad_LW_up_rad", &
var_description="Long-wave upwelling radiative flux [W/m^2]", var_units="W/m^2", &
l_silhs=.false., grid_kind=stats_rad_zm )
k = k + 1
case ('Frad_SW_down_rad')
iFrad_SW_down_rad = k
call stat_assign( var_index=iFrad_SW_down_rad, var_name="Frad_SW_down_rad", &
var_description="Short-wave downwelling radiative flux [W/m^2]", var_units="W/m^2", &
l_silhs=.false., grid_kind=stats_rad_zm )
k = k + 1
case ('Frad_LW_down_rad')
iFrad_LW_down_rad = k
call stat_assign( var_index=iFrad_LW_down_rad, var_name="Frad_LW_down_rad", &
var_description="Long-wave downwelling radiative flux [W/m^2]", var_units="W/m^2", &
l_silhs=.false., grid_kind=stats_rad_zm )
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