read_parameters_materials_hydrauilic Subroutine

subroutine read_parameters_materials_hydrauilic(self, json, i)

Load the hydraulic parameters from the JSON file

Arguments

Type IntentOptional Attributes Name
class(type_input) :: self
type(json_file), intent(inout) :: json

JSON parser

integer(kind=int32), intent(in) :: i

Material index


Calls

proc~~read_parameters_materials_hydrauilic~~CallsGraph proc~read_parameters_materials_hydrauilic read_parameters_materials_hydrauilic destroy destroy proc~read_parameters_materials_hydrauilic->destroy get get proc~read_parameters_materials_hydrauilic->get interface~value_in_range value_in_range proc~read_parameters_materials_hydrauilic->interface~value_in_range print_error_message print_error_message proc~read_parameters_materials_hydrauilic->print_error_message proc~error_message error_message proc~read_parameters_materials_hydrauilic->proc~error_message proc~join join proc~read_parameters_materials_hydrauilic->proc~join proc~read_parameters_materials_wrf read_parameters_materials_wrf proc~read_parameters_materials_hydrauilic->proc~read_parameters_materials_wrf to_string to_string proc~read_parameters_materials_hydrauilic->to_string proc~value_in_range_int16 value_in_range_int16 interface~value_in_range->proc~value_in_range_int16 proc~value_in_range_int32 value_in_range_int32 interface~value_in_range->proc~value_in_range_int32 proc~value_in_range_int64 value_in_range_int64 interface~value_in_range->proc~value_in_range_int64 proc~value_in_range_int8 value_in_range_int8 interface~value_in_range->proc~value_in_range_int8 proc~value_in_range_real128 value_in_range_real128 interface~value_in_range->proc~value_in_range_real128 proc~value_in_range_real32 value_in_range_real32 interface~value_in_range->proc~value_in_range_real32 proc~value_in_range_real64 value_in_range_real64 interface~value_in_range->proc~value_in_range_real64 log_error log_error proc~error_message->log_error proc~read_parameters_materials_wrf->destroy proc~read_parameters_materials_wrf->get proc~read_parameters_materials_wrf->interface~value_in_range proc~read_parameters_materials_wrf->print_error_message proc~read_parameters_materials_wrf->proc~error_message proc~read_parameters_materials_wrf->proc~join

Called by

proc~~read_parameters_materials_hydrauilic~~CalledByGraph proc~read_parameters_materials_hydrauilic read_parameters_materials_hydrauilic proc~read_parameters_materials read_parameters_materials proc~read_parameters_materials->proc~read_parameters_materials_hydrauilic proc~inout_read_basic_parameters inout_read_basic_parameters proc~inout_read_basic_parameters->proc~read_parameters_materials interface~inout_read_basic_parameters type_input%inout_read_basic_parameters interface~inout_read_basic_parameters->proc~inout_read_basic_parameters proc~initialize_type_input type_input%initialize_type_input proc~initialize_type_input->interface~inout_read_basic_parameters

Source Code

    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