43 logical (c_bool),
intent(in) :: active_cells(:,:)
46 integer (c_int) :: inumberoflanduses
47 logical (c_bool) :: larelengthsequal
48 character (len=:),
allocatable :: stemp
50 real (c_float),
allocatable :: temp_values(:)
51 integer (c_int) :: status
55 call params%get_parameters( skey=stemp, &
61 call sl_temp_list%clear()
62 call sl_temp_list%append(
"Growing_season_interception")
63 call sl_temp_list%append(
"Growing_season_interception_a")
64 call sl_temp_list%append(
"Interception_growing")
65 call sl_temp_list%append(
"Interception_a_term_growing_season")
67 call params%get_parameters( slkeys=sl_temp_list, &
68 fvalues=temp_values, &
71 if (all( temp_values >
ftinyval) )
then
73 larelengthsequal = ( ubound(temp_values,1) == ubound(
ilandusecodes,1) )
75 if ( .not. larelengthsequal ) &
76 call warn( smessage=
"The number of landuses does not match the number of interception values " &
77 //
"specified for the 'a' term for use during the growing season.", &
78 smodule=__file__, iline=__line__, lfatal=
true )
85 call sl_temp_list%clear()
86 call sl_temp_list%append(
"Growing_season_interception_b")
87 call sl_temp_list%append(
"Interception_growing_b_term")
88 call sl_temp_list%append(
"Interception_b_term_growing_season")
90 call params%get_parameters( slkeys=sl_temp_list, &
91 fvalues=temp_values, &
94 if (all( temp_values <=
ftinyval) )
then
101 larelengthsequal = ( ubound(temp_values,1) == ubound(
ilandusecodes,1) )
103 if ( .not. larelengthsequal ) &
104 call warn( smessage=
"The number of landuses does not match the number of interception values " &
105 //
"specified for the 'b' term for use during the growing season.", &
106 smodule=__file__, iline=__line__, lfatal=
false )
113 call sl_temp_list%clear()
114 call sl_temp_list%append(
"Growing_season_interception_n")
115 call sl_temp_list%append(
"Interception_growing_n_term")
116 call sl_temp_list%append(
"Interception_n_term_growing_season")
118 call params%get_parameters( slkeys=sl_temp_list, &
119 fvalues=temp_values, &
122 if (all( temp_values <=
ftinyval) )
then
129 larelengthsequal = ( ubound(temp_values,1) == ubound(
ilandusecodes,1) )
131 if ( .not. larelengthsequal ) &
132 call warn( smessage=
"The number of landuses does not match the number of interception values " &
133 //
"specified for the 'n' term for use during the growing season.", &
134 smodule=__file__, iline=__line__, lfatal=
true )
141 call sl_temp_list%clear()
142 call sl_temp_list%append(
"Nongrowing_season_interception")
143 call sl_temp_list%append(
"Nongrowing_season_interception_a")
144 call sl_temp_list%append(
"Interception_nongrowing")
145 call sl_temp_list%append(
"Interception_a_term_nongrowing_season")
147 call params%get_parameters( slkeys=sl_temp_list, &
148 fvalues=temp_values, &
151 if (all( temp_values >
ftinyval) )
then
153 larelengthsequal = ( ubound(temp_values,1) == ubound(
ilandusecodes,1) )
155 if ( .not. larelengthsequal ) &
156 call warn( smessage=
"The number of landuses does not match the number of interception values " &
157 //
"specified for the 'a' term for use during the nongrowing season.", &
158 smodule=__file__, iline=__line__, lfatal=
false )
165 call sl_temp_list%clear()
166 call sl_temp_list%append(
"Nongrowing_season_interception_b")
167 call sl_temp_list%append(
"Interception_nongrowing_b_term")
168 call sl_temp_list%append(
"Interception_b_term_nongrowing_season")
170 call params%get_parameters( slkeys=sl_temp_list, &
171 fvalues=temp_values, &
174 if (all( temp_values <=
ftinyval) )
then
181 larelengthsequal = ( ubound(temp_values,1) == ubound(
ilandusecodes,1) )
183 if ( .not. larelengthsequal ) &
184 call warn( smessage=
"The number of landuses does not match the number of interception values " &
185 //
"specified for the 'b' term for use during the nongrowing season.", &
186 smodule=__file__, iline=__line__, lfatal=
false )
193 call sl_temp_list%clear()
194 call sl_temp_list%append(
"Nongrowing_season_interception_n")
195 call sl_temp_list%append(
"Interception_nongrowing_n_term")
196 call sl_temp_list%append(
"Interception_n_term_nongrowing_season")
198 call params%get_parameters( slkeys=sl_temp_list, &
199 fvalues=temp_values, &
202 if (all( temp_values <=
ftinyval) )
then
209 larelengthsequal = ( ubound(temp_values,1) == ubound(
ilandusecodes,1) )
211 if ( .not. larelengthsequal ) &
212 call warn( smessage=
"The number of landuses does not match the number of interception values " &
213 //
"specified for the 'n' term for use during the nongrowing season.", &
214 smodule=__file__, iline=__line__, lfatal=
false )
221 call sl_temp_list%clear()
222 call sl_temp_list%append(
"Interception_storage_max_nongrowing")
223 call sl_temp_list%append(
"Interception_storage_max_nongrowing_season")
224 call sl_temp_list%append(
"Interception_Storage_Maximum_nongrowing")
226 call params%get_parameters( slkeys=sl_temp_list, &
232 if ( .not. larelengthsequal )
then
233 call warn( smessage=
"The number of landuses does not match the number of interception storage " &
234 //
"maximum values for the NONGROWING season " &
235 //
"('interception_storage_max_nongrowing').", &
236 shints=
"A default value equal to the 'Growing_season_interception_a' was assigned for the" &
237 //
" maximum interception storage", &
238 smodule=__file__, iline=__line__, lfatal=
false )
239 allocate(temp_values(inumberoflanduses), stat=status)
245 call sl_temp_list%clear()
246 call sl_temp_list%append(
"Interception_storage_max_growing")
247 call sl_temp_list%append(
"Interception_storage_max_growing_season")
248 call sl_temp_list%append(
"Interception_Storage_Maximum_growing")
250 call params%get_parameters( slkeys=sl_temp_list, &
256 if ( .not. larelengthsequal )
then
257 call warn( smessage=
"The number of landuses does not match the number of interception storage " &
258 //
"maximum values for the GROWING season " &
259 //
"('interception_storage_max_growing').", &
260 shints=
"A default value equal to the 'Nongrowing_season_interception_a' was" &
261 //
" assigned for the maximum interception storage", &
262 smodule=__file__, iline=__line__, lfatal=
false )
263 allocate(temp_values(inumberoflanduses), stat=status)
275 fCanopy_Cover_Fraction, &
276 it_is_growing_season, &
279 integer (c_int),
intent(in) :: ilanduseindex
280 real (c_float),
intent(in) :: fprecip
281 real (c_float),
intent(in) :: ffog
282 real (c_float),
intent(in) :: fcanopy_cover_fraction
283 logical (c_bool),
intent(in) :: it_is_growing_season
284 real (c_float),
intent(out) :: finterception
287 real (c_float) :: fpotentialinterception
288 real (c_float) :: precip_plus_fog
290 precip_plus_fog = fprecip + ffog
292 if ( it_is_growing_season )
then
308 finterception = min( fpotentialinterception, fprecip + ffog ) * fcanopy_cover_fraction