50 logical (c_bool),
intent(in) :: is_cell_active(:,:)
51 integer (c_int),
intent(in) :: landuse_index(:)
54 integer (c_int) :: istat
57 integer (c_int),
allocatable :: landuse_codes(:)
58 integer (c_int) :: soils_indx
59 integer (c_int) :: landuse_indx
60 integer (c_int) :: number_of_landuses
61 integer (c_int) :: number_of_soils
62 real (c_float) :: value
68 plulc =>
dat%find(
"LAND_USE")
69 phsg =>
dat%find(
"HYDROLOGIC_SOILS_GROUP")
71 call assert(
associated( plulc),
"Possible INTERNAL PROGRAMMING ERROR -- Null pointer" &
72 //
" detected for pLULC", __file__, __line__ )
74 call assert(
associated( plulc%pGrdBase ), &
75 "Possible INTERNAL PROGRAMMING ERROR -- Null pointer detected for pLULC%pGrdBase", &
78 call assert(
allocated( plulc%pGrdBase%iData ), &
79 "Possible INTERNAL PROGRAMMING ERROR -- Unallocated array detected for pLULC%pGrdBase%iData", &
82 call assert(
associated( phsg),
"Possible INTERNAL PROGRAMMING ERROR -- Null pointer" &
83 //
" detected for pHSG", __file__, __line__ )
85 call assert(
associated( phsg%pGrdBase ), &
86 "Possible INTERNAL PROGRAMMING ERROR -- Null pointer detected for pHSG%pGrdBase", &
89 call assert(
allocated( phsg%pGrdBase%iData ), &
90 "Possible INTERNAL PROGRAMMING ERROR -- Unallocated array detected for pHSG%pGrdBase%iData", &
98 max_net_infiltration_list =
params%grep_name(
"max_net_infil", lfatal=
true )
104 call assert( istat==0,
"Problem allocating memory", __file__, __line__ )
106 associate( dt =>
sim_dt%curr )
117 elseif ( max_net_infiltration_list%get(1) /=
"<NA>" )
then
119 call parameter_list%append(
"LU_Code")
120 call parameter_list%append(
"Landuse_Code")
121 call parameter_list%append(
"Landuse_Lookup_Code")
124 call params%get_parameters( slkeys=parameter_list, ivalues=landuse_codes )
125 number_of_landuses = count( landuse_codes >= 0 )
128 sprefix=
"max_net_infil", &
129 inumrows=number_of_landuses, &
134 call logs%WRITE(
"| Landuse Code | Soils Code | Number of Matches | Maximum net infiltration (in) |", &
136 call logs%WRITE(
"|-------------|--------------|-------------------|--------------------------------| ", &
140 call assert( istat == 0,
"Failed to allocate memory for maximum potential recharge table", &
143 do soils_indx = 1, number_of_soils
144 do landuse_indx = 1, number_of_landuses
147 ascharacter(count( plulc%pGrdBase%iData == landuse_codes( landuse_indx) &
148 .and. phsg%pGrdBase%iData == soils_indx ) )//
" | " &
154 where ( plulc%pGrdBase%iData == landuse_codes( landuse_indx) .and. phsg%pGrdBase%iData == soils_indx )
169 call parameter_list%clear()
175 call assert( istat==0,
"Problem allocating memory", __file__, __line__ )
179 call warn(
"Did not find any valid maximum net infiltration rate parameters.", &
189 rejected_net_infiltration, &
192 real ( c_float),
intent(inout) :: net_infiltration
193 real (c_float),
intent(inout) :: rejected_net_infiltration
194 integer (c_int),
intent(in) :: indx
203 rejected_net_infiltration = 0.0_c_float
This module contains physical constants and convenience functions aimed at performing unit conversion...
logical(c_bool), parameter, public true
logical(c_bool), parameter, public false
Defines the DATA_CATALOG_T data type, which contains type-bound procedures to add,...
type(data_catalog_t), public dat
DAT is a global to hold data catalog entries.
This module contains the DATETIME_T class and associated time and date-related routines,...
subroutine, public warn(smessage, smodule, iline, shints, lfatal, iloglevel, lecho)
Provides support for input and output of gridded ASCII data, as well as for creation and destruction ...
type(logfile_t), public logs
Module maximum_net_infiltration__gridded_data provides support for adding miscellaneous source and si...
real(c_float), dimension(:,:), allocatable fmaximum_net_infiltration_table
subroutine, public maximum_net_infiltration_initialize(is_cell_active, landuse_index)
Initialize the routine to establish maximum potential recharge rates.
type(data_catalog_entry_t), pointer pmaximum_net_infiltration
real(c_float), dimension(:,:), allocatable fmaximum_net_infiltration_array
real(c_float), dimension(:), allocatable fmaximum_net_infiltration
elemental subroutine, public maximum_net_infiltration_calculate(net_infiltration, rejected_net_infiltration, indx)
Provide support for use of netCDF files as input for time-varying, gridded meteorlogic data,...
type(parameters_t), public params
type(date_range_t), public sim_dt