Load the hydraulic parameters from the JSON file
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(type_input) | :: | self | ||||
type(json_file), | intent(inout) | :: | json |
JSON parser |
||
integer(kind=int32), | intent(in) | :: | i |
Material index |
subroutine read_parameters_materials_hydrauilic(self, json, i) !> Load the hydraulic parameters from the JSON file implicit none class(type_input) :: self type(json_file), intent(inout) :: json !! JSON parser integer(int32), intent(in) :: i !! Material index logical :: found character(:), allocatable :: key character(:), allocatable :: key_material key_material = join([materials//"("//to_string(i)//")", hydraulic]) key = join([key_material, hydraulic_conductivity_model, model_number]) call json%get(key, self%basic%materials(i)%hydraulic%model_number, found) call json%print_error_message(output_unit) if (.not. found) then call json%destroy() call error_message(904, c_opt=key) else if (.not. value_in_range(self%basic%materials(i)%hydraulic%model_number, 1, 5)) then call json%destroy() call error_message(905, c_opt=key) end if key = join([key_material, hydraulic_conductivity_model, saturated_conductivity]) call json%get(key, self%basic%materials(i)%hydraulic%hydraulic_conductivity, found) call json%print_error_message(output_unit) if (.not. found) then call json%destroy() call error_message(904, c_opt=key) else if (self%basic%materials(i)%hydraulic%hydraulic_conductivity <= 0.0d0) then call json%destroy() call error_message(905, c_opt=key) end if select case (self%basic%materials(i)%hydraulic%model_number) case (1) key = join([key_material, impedance_factor]) call json%get(key, self%basic%materials(i)%hydraulic%impedance_factor, found) call json%print_error_message(output_unit) if (.not. found) then call json%destroy() call error_message(904, c_opt=key) else if (self%basic%materials(i)%hydraulic%impedance_factor <= 0.0d0) then call json%destroy() call error_message(905, c_opt=key) end if case (2) key = join([key_material, water_retention_model]) call read_parameters_materials_wrf(self%basic%materials(i)%hydraulic%hcf, json, key) case (3) key = join([key_material, water_retention_model]) call read_parameters_materials_wrf(self%basic%materials(i)%hydraulic%hcf, json, key) key = join([key_material, water_viscosity_model]) call json%get(key, self%basic%materials(i)%hydraulic%water_viscosity_model, found) call json%print_error_message(output_unit) if (.not. found) then call json%destroy() call error_message(904, c_opt=key) else if (.not. value_in_range(self%basic%materials(i)%hydraulic%water_viscosity_model, 0, 2)) then call json%destroy() call error_message(905, c_opt=key) end if case (4) key = join([key_material, impedance_factor]) call json%get(key, self%basic%materials(i)%hydraulic%impedance_factor, found) call json%print_error_message(output_unit) if (.not. found) then call json%destroy() call error_message(904, c_opt=key) else if (self%basic%materials(i)%hydraulic%impedance_factor <= 0.0d0) then call json%destroy() call error_message(905, c_opt=key) end if key = join([key_material, water_retention_model]) call read_parameters_materials_wrf(self%basic%materials(i)%hydraulic%hcf, json, key) case (5) key = join([key_material, impedance_factor]) call json%get(key, self%basic%materials(i)%hydraulic%impedance_factor, found) call json%print_error_message(output_unit) if (.not. found) then call json%destroy() call error_message(904, c_opt=key) else if (self%basic%materials(i)%hydraulic%impedance_factor <= 0.0d0) then call json%destroy() call error_message(905, c_opt=key) end if key = join([key_material, water_retention_model]) call read_parameters_materials_wrf(self%basic%materials(i)%hydraulic%hcf, json, key) key = join([key_material, water_viscosity_model]) call json%get(key, self%basic%materials(i)%hydraulic%water_viscosity_model, found) call json%print_error_message(output_unit) if (.not. found) then call json%destroy() call error_message(904, c_opt=key) else if (.not. value_in_range(self%basic%materials(i)%hydraulic%water_viscosity_model, 0, 2)) then call json%destroy() call error_message(905, c_opt=key) end if end select end subroutine read_parameters_materials_hydrauilic