70 logical (c_bool),
intent(in) :: is_cell_active(:,:)
71 integer (c_int),
intent(in) :: landuse_index(:)
74 integer (c_int) :: status
76 integer (c_int) :: indx
77 integer (c_int) :: inx
78 integer (c_int) :: iny
79 integer (c_int),
allocatable :: landuse_codes(:)
80 integer (c_int) :: number_of_landuses
81 logical (c_bool) :: are_lengths_equal
85 call parameter_list%append(
"LU_Code" )
86 call parameter_list%append(
"Landuse_Code" )
87 call parameter_list%append(
"Landuse_Lookup_Code" )
89 call params%get_parameters( slkeys=parameter_list, ivalues=landuse_codes )
90 number_of_landuses = count( landuse_codes > 0 )
92 call parameter_list%clear()
93 call parameter_list%append(
"Annual_direct_net_infiltration_rate" )
94 call parameter_list%append(
"Annual_direct_recharge_rate" )
95 call parameter_list%append(
"Annual_direct_recharge" )
96 call parameter_list%append(
"Annual_direct_net_infiltration" )
104 call parameter_list%clear()
105 call parameter_list%append(
"Cesspool_direct_net_infiltration" )
106 call parameter_list%append(
"Cesspool_recharge" )
107 call parameter_list%append(
"Cesspool_discharge" )
108 call parameter_list%append(
"Cesspool_leakage" )
126 call parameter_list%clear()
127 call parameter_list%append(
"Water_body_recharge" )
128 call parameter_list%append(
"Water_body_discharge" )
129 call parameter_list%append(
"Water_body_leakage" )
136 call parameter_list%clear()
137 call parameter_list%append(
"Water_main_recharge" )
138 call parameter_list%append(
"Water_main_discharge" )
139 call parameter_list%append(
"Water_main_leakage" )
146 call parameter_list%clear()
147 call parameter_list%append(
"Disposal_well_recharge" )
148 call parameter_list%append(
"Disposal_well_discharge" )
157 call assert( status==0,
"Problem allocating memory", __file__, __line__ )
163 if ( .not. are_lengths_equal ) &
164 call warn( smessage=
"The number of landuses does not match the number of annual direct" &
165 //
" recharge rate values.", smodule=__file__, iline=__line__, lfatal=.
true._c_bool )
168 call assert( status==0,
"Problem allocating memory", __file__, __line__ )
170 do indx=lbound( landuse_index, 1 ), ubound( landuse_index, 1 )
179 allocate(
fcesspool( count( is_cell_active ) ), stat=status )
180 call assert( status==0,
"Problem allocating memory", __file__, __line__ )
184 are_lengths_equal = ( ( ubound(
fcesspool_table,1) == ubound(landuse_codes,1) ) )
186 if ( .not. are_lengths_equal ) &
187 call warn( smessage=
"The number of landuses does not match the number of cesspool discharge/leakage values.", &
188 smodule=__file__, iline=__line__, lfatal=.
true._c_bool )
190 allocate(
fcesspool( count( is_cell_active ) ), stat=status )
191 call assert( status==0,
"Problem allocating memory", __file__, __line__ )
193 do indx=lbound( landuse_index, 1 ), ubound( landuse_index, 1 )
224 call assert( status==0,
"Problem allocating memory", __file__, __line__ )
230 if ( .not. are_lengths_equal ) &
231 call warn( smessage=
"The number of landuses does not match the number of water body recharge/leakage values.", &
232 smodule=__file__, iline=__line__, lfatal=.
true._c_bool )
235 call assert( status==0,
"Problem allocating memory", __file__, __line__ )
237 do indx=lbound( landuse_index, 1 ), ubound( landuse_index, 1 )
246 allocate(
fwater_main( count( is_cell_active ) ), stat=status )
247 call assert( status==0,
"Problem allocating memory", __file__, __line__ )
251 are_lengths_equal = ( ( ubound(
fwater_main_table,1) == ubound(landuse_codes,1) ) )
253 if ( .not. are_lengths_equal ) &
254 call warn( smessage=
"The number of landuses does not match the number of water main leakage values.", &
255 smodule=__file__, iline=__line__, lfatal=.
true._c_bool )
257 allocate(
fwater_main( count( is_cell_active ) ), stat=status )
258 call assert( status==0,
"Problem allocating memory", __file__, __line__ )
260 do indx=lbound( landuse_index, 1 ), ubound( landuse_index, 1 )
269 allocate(
fdisposal_well( count( is_cell_active ) ), stat=status )
270 call assert( status==0,
"Problem allocating memory", __file__, __line__ )
276 if ( .not. are_lengths_equal ) &
277 call warn( smessage=
"The number of landuses does not match the number of discharge well values.", &
278 smodule=__file__, iline=__line__, lfatal=.
true._c_bool )
280 allocate(
fdisposal_well( count( is_cell_active ) ), stat=status )
281 call assert( status==0,
"Problem allocating memory", __file__, __line__ )
283 do indx=lbound( landuse_index, 1 ), ubound( landuse_index, 1 )
299 real (c_float),
intent(inout) :: direct_net_infiltration
300 integer (c_int),
intent(in) :: indx
301 logical (c_bool),
intent(in) :: is_cell_active(:,:)
302 real (c_float),
intent(in) :: nodata_fill_value(:,:)
305 real (c_float) :: ffactor
309 associate( dt =>
sim_dt%curr )
350 direct_net_infiltration = 0.0_c_float
353 direct_net_infiltration = direct_net_infiltration +
fcesspool( indx )
356 direct_net_infiltration = direct_net_infiltration +
fdisposal_well( indx )
359 direct_net_infiltration = direct_net_infiltration +
fwater_main( indx )