43 logical (c_bool),
intent(in) :: active_cells(:,:)
46 integer (c_int) :: inumberoflanduses
47 logical (c_bool) :: larelengthsequal
48 character (len=:),
allocatable :: stemp
52 character (len=32) :: str_buffer
53 real (c_float),
allocatable :: temp_values(:)
54 integer (c_int) :: indx
55 integer (c_int) :: status
59 call params%get_parameters( skey=stemp, &
65 call sl_temp_list%clear()
66 call sl_temp_list%append(
"Growing_season_interception")
67 call sl_temp_list%append(
"Growing_season_interception_a")
68 call sl_temp_list%append(
"Interception_growing")
69 call sl_temp_list%append(
"Interception_a_term_growing_season")
71 call params%get_parameters( slkeys=sl_temp_list, &
72 fvalues=temp_values, &
75 if (all( temp_values >
ftinyval) )
then
77 larelengthsequal = ( ubound(temp_values,1) == ubound(
ilandusecodes,1) )
79 if ( .not. larelengthsequal ) &
80 call warn( smessage=
"The number of landuses does not match the number of interception values " &
81 //
"specified for the 'a' term for use during the growing season.", &
82 smodule=__file__, iline=__line__, lfatal=
true )
89 call sl_temp_list%clear()
90 call sl_temp_list%append(
"Growing_season_interception_b")
91 call sl_temp_list%append(
"Interception_growing_b_term")
92 call sl_temp_list%append(
"Interception_b_term_growing_season")
94 call params%get_parameters( slkeys=sl_temp_list, &
95 fvalues=temp_values, &
98 if (all( temp_values <=
ftinyval) )
then
105 larelengthsequal = ( ubound(temp_values,1) == ubound(
ilandusecodes,1) )
107 if ( .not. larelengthsequal ) &
108 call warn( smessage=
"The number of landuses does not match the number of interception values " &
109 //
"specified for the 'b' term for use during the growing season.", &
110 smodule=__file__, iline=__line__, lfatal=
false )
117 call sl_temp_list%clear()
118 call sl_temp_list%append(
"Growing_season_interception_n")
119 call sl_temp_list%append(
"Interception_growing_n_term")
120 call sl_temp_list%append(
"Interception_n_term_growing_season")
122 call params%get_parameters( slkeys=sl_temp_list, &
123 fvalues=temp_values, &
126 if (all( temp_values <=
ftinyval) )
then
133 larelengthsequal = ( ubound(temp_values,1) == ubound(
ilandusecodes,1) )
135 if ( .not. larelengthsequal ) &
136 call warn( smessage=
"The number of landuses does not match the number of interception values " &
137 //
"specified for the 'n' term for use during the growing season.", &
138 smodule=__file__, iline=__line__, lfatal=
true )
145 call sl_temp_list%clear()
146 call sl_temp_list%append(
"Nongrowing_season_interception")
147 call sl_temp_list%append(
"Nongrowing_season_interception_a")
148 call sl_temp_list%append(
"Interception_nongrowing")
149 call sl_temp_list%append(
"Interception_a_term_nongrowing_season")
151 call params%get_parameters( slkeys=sl_temp_list, &
152 fvalues=temp_values, &
155 if (all( temp_values >
ftinyval) )
then
157 larelengthsequal = ( ubound(temp_values,1) == ubound(
ilandusecodes,1) )
159 if ( .not. larelengthsequal ) &
160 call warn( smessage=
"The number of landuses does not match the number of interception values " &
161 //
"specified for the 'a' term for use during the nongrowing season.", &
162 smodule=__file__, iline=__line__, lfatal=
false )
169 call sl_temp_list%clear()
170 call sl_temp_list%append(
"Nongrowing_season_interception_b")
171 call sl_temp_list%append(
"Interception_nongrowing_b_term")
172 call sl_temp_list%append(
"Interception_b_term_nongrowing_season")
174 call params%get_parameters( slkeys=sl_temp_list, &
175 fvalues=temp_values, &
178 if (all( temp_values <=
ftinyval) )
then
185 larelengthsequal = ( ubound(temp_values,1) == ubound(
ilandusecodes,1) )
187 if ( .not. larelengthsequal ) &
188 call warn( smessage=
"The number of landuses does not match the number of interception values " &
189 //
"specified for the 'b' term for use during the nongrowing season.", &
190 smodule=__file__, iline=__line__, lfatal=
false )
197 call sl_temp_list%clear()
198 call sl_temp_list%append(
"Nongrowing_season_interception_n")
199 call sl_temp_list%append(
"Interception_nongrowing_n_term")
200 call sl_temp_list%append(
"Interception_n_term_nongrowing_season")
202 call params%get_parameters( slkeys=sl_temp_list, &
203 fvalues=temp_values, &
206 if (all( temp_values <=
ftinyval) )
then
213 larelengthsequal = ( ubound(temp_values,1) == ubound(
ilandusecodes,1) )
215 if ( .not. larelengthsequal ) &
216 call warn( smessage=
"The number of landuses does not match the number of interception values " &
217 //
"specified for the 'n' term for use during the nongrowing season.", &
218 smodule=__file__, iline=__line__, lfatal=
false )
225 call sl_temp_list%clear()
226 call sl_temp_list%append(
"Interception_storage_max_nongrowing")
227 call sl_temp_list%append(
"Interception_storage_max_nongrowing_season")
228 call sl_temp_list%append(
"Interception_Storage_Maximum_nongrowing")
230 call params%get_parameters( slkeys=sl_temp_list, &
236 if ( .not. larelengthsequal )
then
237 call warn( smessage=
"The number of landuses does not match the number of interception storage " &
238 //
"maximum values for the NONGROWING season " &
239 //
"('interception_storage_max_nongrowing').", &
240 shints=
"A default value equal to the 'Growing_season_interception_a' was assigned for the" &
241 //
" maximum interception storage", &
242 smodule=__file__, iline=__line__, lfatal=
false )
243 allocate(temp_values(inumberoflanduses), stat=status)
249 call sl_temp_list%clear()
250 call sl_temp_list%append(
"Interception_storage_max_growing")
251 call sl_temp_list%append(
"Interception_storage_max_growing_season")
252 call sl_temp_list%append(
"Interception_Storage_Maximum_growing")
254 call params%get_parameters( slkeys=sl_temp_list, &
260 if ( .not. larelengthsequal )
then
261 call warn( smessage=
"The number of landuses does not match the number of interception storage " &
262 //
"maximum values for the GROWING season " &
263 //
"('interception_storage_max_growing').", &
264 shints=
"A default value equal to the 'Nongrowing_season_interception_a' was" &
265 //
" assigned for the maximum interception storage", &
266 smodule=__file__, iline=__line__, lfatal=
false )
267 allocate(temp_values(inumberoflanduses), stat=status)
279 fCanopy_Cover_Fraction, &
280 it_is_growing_season, &
283 integer (c_int),
intent(in) :: ilanduseindex
284 real (c_float),
intent(in) :: fprecip
285 real (c_float),
intent(in) :: ffog
286 real (c_float),
intent(in) :: fcanopy_cover_fraction
287 logical (c_bool),
intent(in) :: it_is_growing_season
288 real (c_float),
intent(out) :: finterception
291 real (c_float) :: fpotentialinterception
292 real (c_float) :: precip_plus_fog
294 precip_plus_fog = fprecip + ffog
296 if ( it_is_growing_season )
then
312 finterception = min( fpotentialinterception, fprecip + ffog ) * fcanopy_cover_fraction