51 logical (c_bool),
intent(in) :: is_cell_active(:,:)
52 integer (c_int),
intent(in) :: landuse_index(:)
55 integer (c_int) :: istat
58 real (c_float),
allocatable :: max_net_infiltration_vector(:)
59 integer (c_int),
allocatable :: sequence_nums(:)
60 integer (c_int),
allocatable :: landuse_codes(:)
61 logical (c_bool) :: larelengthsequal
62 integer (c_int) :: soils_indx
63 integer (c_int) :: landuse_indx
64 integer (c_int) :: number_of_landuses
65 integer (c_int) :: number_of_soils
66 real (c_float) :: value
68 character( len=:),
allocatable :: text_str
74 plulc =>
dat%find(
"LAND_USE")
75 phsg =>
dat%find(
"HYDROLOGIC_SOILS_GROUP")
77 call assert(
associated( plulc),
"Possible INTERNAL PROGRAMMING ERROR -- Null pointer" &
78 //
" detected for pLULC", __file__, __line__ )
80 call assert(
associated( plulc%pGrdBase ), &
81 "Possible INTERNAL PROGRAMMING ERROR -- Null pointer detected for pLULC%pGrdBase", &
84 call assert(
allocated( plulc%pGrdBase%iData ), &
85 "Possible INTERNAL PROGRAMMING ERROR -- Unallocated array detected for pLULC%pGrdBase%iData", &
88 call assert(
associated( phsg),
"Possible INTERNAL PROGRAMMING ERROR -- Null pointer" &
89 //
" detected for pHSG", __file__, __line__ )
91 call assert(
associated( phsg%pGrdBase ), &
92 "Possible INTERNAL PROGRAMMING ERROR -- Null pointer detected for pHSG%pGrdBase", &
95 call assert(
allocated( phsg%pGrdBase%iData ), &
96 "Possible INTERNAL PROGRAMMING ERROR -- Unallocated array detected for pHSG%pGrdBase%iData", &
104 max_net_infiltration_list =
params%grep_name(
"max_net_infil", lfatal=
true )
110 call assert( istat==0,
"Problem allocating memory", __file__, __line__ )
112 associate( dt =>
sim_dt%curr )
123 elseif ( max_net_infiltration_list%get(1) /=
"<NA>" )
then
125 call parameter_list%append(
"LU_Code")
126 call parameter_list%append(
"Landuse_Code")
127 call parameter_list%append(
"Landuse_Lookup_Code")
130 call params%get_parameters( slkeys=parameter_list, ivalues=landuse_codes )
131 number_of_landuses = count( landuse_codes >= 0 )
134 sprefix=
"max_net_infil", &
135 inumrows=number_of_landuses, &
140 call logs%WRITE(
"| Landuse Code | Soils Code | Number of Matches | Maximum net infiltration (in) |", &
142 call logs%WRITE(
"|-------------|--------------|-------------------|--------------------------------| ", &
146 call assert( istat == 0,
"Failed to allocate memory for maximum potential recharge table", &
149 do soils_indx = 1, number_of_soils
150 do landuse_indx = 1, number_of_landuses
153 ascharacter(count( plulc%pGrdBase%iData == landuse_codes( landuse_indx) &
154 .and. phsg%pGrdBase%iData == soils_indx ) )//
" | " &
160 where ( plulc%pGrdBase%iData == landuse_codes( landuse_indx) .and. phsg%pGrdBase%iData == soils_indx )
175 call parameter_list%clear()
181 call assert( istat==0,
"Problem allocating memory", __file__, __line__ )
185 call warn(
"Did not find any valid maximum net infiltration rate parameters.", &
195 rejected_net_infiltration, &
198 real ( c_float),
intent(inout) :: net_infiltration
199 real (c_float),
intent(inout) :: rejected_net_infiltration
200 integer (c_int),
intent(in) :: indx
209 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,...
integer(c_int) function, public julian_day(iyear, imonth, iday, iorigin, sinputitemname)
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
type(datetime_t), pointer date_of_last_retrieval
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