68 logical (c_bool),
intent(in) :: is_cell_active(:,:)
69 integer (c_int),
intent(in) :: landuse_index(:)
72 integer (c_int) :: status
74 integer (c_int) :: indx
75 integer (c_int),
allocatable :: landuse_codes(:)
76 integer (c_int) :: number_of_landuses
77 logical (c_bool) :: are_lengths_equal
81 call parameter_list%append(
"LU_Code" )
82 call parameter_list%append(
"Landuse_Code" )
83 call parameter_list%append(
"Landuse_Lookup_Code" )
85 call params%get_parameters( slkeys=parameter_list, ivalues=landuse_codes )
86 number_of_landuses = count( landuse_codes > 0 )
88 call parameter_list%clear()
89 call parameter_list%append(
"Annual_direct_net_infiltration_rate" )
90 call parameter_list%append(
"Annual_direct_recharge_rate" )
91 call parameter_list%append(
"Annual_direct_recharge" )
92 call parameter_list%append(
"Annual_direct_net_infiltration" )
100 call parameter_list%clear()
101 call parameter_list%append(
"Cesspool_direct_net_infiltration" )
102 call parameter_list%append(
"Cesspool_recharge" )
103 call parameter_list%append(
"Cesspool_discharge" )
104 call parameter_list%append(
"Cesspool_leakage" )
122 call parameter_list%clear()
123 call parameter_list%append(
"Water_body_recharge" )
124 call parameter_list%append(
"Water_body_discharge" )
125 call parameter_list%append(
"Water_body_leakage" )
132 call parameter_list%clear()
133 call parameter_list%append(
"Water_main_recharge" )
134 call parameter_list%append(
"Water_main_discharge" )
135 call parameter_list%append(
"Water_main_leakage" )
142 call parameter_list%clear()
143 call parameter_list%append(
"Disposal_well_recharge" )
144 call parameter_list%append(
"Disposal_well_discharge" )
153 call assert( status==0,
"Problem allocating memory", __file__, __line__ )
159 if ( .not. are_lengths_equal ) &
160 call warn( smessage=
"The number of landuses does not match the number of annual direct" &
161 //
" recharge rate values.", smodule=__file__, iline=__line__, lfatal=.
true._c_bool )
164 call assert( status==0,
"Problem allocating memory", __file__, __line__ )
166 do indx=lbound( landuse_index, 1 ), ubound( landuse_index, 1 )
175 allocate(
fcesspool( count( is_cell_active ) ), stat=status )
176 call assert( status==0,
"Problem allocating memory", __file__, __line__ )
180 are_lengths_equal = ( ( ubound(
fcesspool_table,1) == ubound(landuse_codes,1) ) )
182 if ( .not. are_lengths_equal ) &
183 call warn( smessage=
"The number of landuses does not match the number of cesspool discharge/leakage values.", &
184 smodule=__file__, iline=__line__, lfatal=.
true._c_bool )
186 allocate(
fcesspool( count( is_cell_active ) ), stat=status )
187 call assert( status==0,
"Problem allocating memory", __file__, __line__ )
189 do indx=lbound( landuse_index, 1 ), ubound( landuse_index, 1 )
220 call assert( status==0,
"Problem allocating memory", __file__, __line__ )
226 if ( .not. are_lengths_equal ) &
227 call warn( smessage=
"The number of landuses does not match the number of water body recharge/leakage values.", &
228 smodule=__file__, iline=__line__, lfatal=.
true._c_bool )
231 call assert( status==0,
"Problem allocating memory", __file__, __line__ )
233 do indx=lbound( landuse_index, 1 ), ubound( landuse_index, 1 )
242 allocate(
fwater_main( count( is_cell_active ) ), stat=status )
243 call assert( status==0,
"Problem allocating memory", __file__, __line__ )
247 are_lengths_equal = ( ( ubound(
fwater_main_table,1) == ubound(landuse_codes,1) ) )
249 if ( .not. are_lengths_equal ) &
250 call warn( smessage=
"The number of landuses does not match the number of water main leakage values.", &
251 smodule=__file__, iline=__line__, lfatal=.
true._c_bool )
253 allocate(
fwater_main( count( is_cell_active ) ), stat=status )
254 call assert( status==0,
"Problem allocating memory", __file__, __line__ )
256 do indx=lbound( landuse_index, 1 ), ubound( landuse_index, 1 )
265 allocate(
fdisposal_well( count( is_cell_active ) ), stat=status )
266 call assert( status==0,
"Problem allocating memory", __file__, __line__ )
272 if ( .not. are_lengths_equal ) &
273 call warn( smessage=
"The number of landuses does not match the number of discharge well values.", &
274 smodule=__file__, iline=__line__, lfatal=.
true._c_bool )
276 allocate(
fdisposal_well( count( is_cell_active ) ), stat=status )
277 call assert( status==0,
"Problem allocating memory", __file__, __line__ )
279 do indx=lbound( landuse_index, 1 ), ubound( landuse_index, 1 )
295 real (c_float),
intent(inout) :: direct_net_infiltration
296 integer (c_int),
intent(in) :: indx
297 logical (c_bool),
intent(in) :: is_cell_active(:,:)
298 real (c_float),
intent(in) :: nodata_fill_value(:,:)
304 associate( dt =>
sim_dt%curr )
345 direct_net_infiltration = 0.0_c_float
348 direct_net_infiltration = direct_net_infiltration +
fcesspool( indx )
351 direct_net_infiltration = direct_net_infiltration +
fdisposal_well( indx )
354 direct_net_infiltration = direct_net_infiltration +
fwater_main( indx )