read_parameters_materials_thermal Subroutine

subroutine read_parameters_materials_thermal(self, json, i)

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_thermal~~CallsGraph proc~read_parameters_materials_thermal read_parameters_materials_thermal destroy destroy proc~read_parameters_materials_thermal->destroy get get proc~read_parameters_materials_thermal->get interface~allocate_array allocate_array proc~read_parameters_materials_thermal->interface~allocate_array print_error_message print_error_message proc~read_parameters_materials_thermal->print_error_message proc~error_message error_message proc~read_parameters_materials_thermal->proc~error_message proc~join join proc~read_parameters_materials_thermal->proc~join proc~read_parameters_materials_wrf read_parameters_materials_wrf proc~read_parameters_materials_thermal->proc~read_parameters_materials_wrf to_string to_string proc~read_parameters_materials_thermal->to_string proc~allocate_rank1_int16 allocate_rank1_int16 interface~allocate_array->proc~allocate_rank1_int16 proc~allocate_rank1_int32 allocate_rank1_int32 interface~allocate_array->proc~allocate_rank1_int32 proc~allocate_rank1_int64 allocate_rank1_int64 interface~allocate_array->proc~allocate_rank1_int64 proc~allocate_rank1_int8 allocate_rank1_int8 interface~allocate_array->proc~allocate_rank1_int8 proc~allocate_rank1_logical1 allocate_rank1_logical1 interface~allocate_array->proc~allocate_rank1_logical1 proc~allocate_rank1_logical4 allocate_rank1_logical4 interface~allocate_array->proc~allocate_rank1_logical4 proc~allocate_rank1_logical8 allocate_rank1_logical8 interface~allocate_array->proc~allocate_rank1_logical8 proc~allocate_rank1_real128 allocate_rank1_real128 interface~allocate_array->proc~allocate_rank1_real128 proc~allocate_rank1_real32 allocate_rank1_real32 interface~allocate_array->proc~allocate_rank1_real32 proc~allocate_rank1_real64 allocate_rank1_real64 interface~allocate_array->proc~allocate_rank1_real64 proc~allocate_rank2_int16 allocate_rank2_int16 interface~allocate_array->proc~allocate_rank2_int16 proc~allocate_rank2_int32 allocate_rank2_int32 interface~allocate_array->proc~allocate_rank2_int32 proc~allocate_rank2_int64 allocate_rank2_int64 interface~allocate_array->proc~allocate_rank2_int64 proc~allocate_rank2_int8 allocate_rank2_int8 interface~allocate_array->proc~allocate_rank2_int8 proc~allocate_rank2_logical1 allocate_rank2_logical1 interface~allocate_array->proc~allocate_rank2_logical1 proc~allocate_rank2_logical4 allocate_rank2_logical4 interface~allocate_array->proc~allocate_rank2_logical4 proc~allocate_rank2_logical8 allocate_rank2_logical8 interface~allocate_array->proc~allocate_rank2_logical8 proc~allocate_rank2_real128 allocate_rank2_real128 interface~allocate_array->proc~allocate_rank2_real128 proc~allocate_rank2_real32 allocate_rank2_real32 interface~allocate_array->proc~allocate_rank2_real32 proc~allocate_rank2_real64 allocate_rank2_real64 interface~allocate_array->proc~allocate_rank2_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->print_error_message proc~read_parameters_materials_wrf->proc~error_message proc~read_parameters_materials_wrf->proc~join interface~value_in_range value_in_range proc~read_parameters_materials_wrf->interface~value_in_range 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 proc~allocate_rank1_int16->proc~error_message proc~allocate_rank1_int32->proc~error_message proc~allocate_rank1_int64->proc~error_message proc~allocate_rank1_int8->proc~error_message proc~allocate_rank1_logical1->proc~error_message proc~allocate_rank1_logical4->proc~error_message proc~allocate_rank1_logical8->proc~error_message proc~allocate_rank1_real128->proc~error_message proc~allocate_rank1_real32->proc~error_message proc~allocate_rank1_real64->proc~error_message proc~allocate_rank2_int16->proc~error_message proc~allocate_rank2_int32->proc~error_message proc~allocate_rank2_int64->proc~error_message proc~allocate_rank2_int8->proc~error_message proc~allocate_rank2_logical1->proc~error_message proc~allocate_rank2_logical4->proc~error_message proc~allocate_rank2_logical8->proc~error_message proc~allocate_rank2_real128->proc~error_message proc~allocate_rank2_real32->proc~error_message proc~allocate_rank2_real64->proc~error_message

Called by

proc~~read_parameters_materials_thermal~~CalledByGraph proc~read_parameters_materials_thermal read_parameters_materials_thermal proc~read_parameters_materials read_parameters_materials proc~read_parameters_materials->proc~read_parameters_materials_thermal 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_thermal(self, json, i)
        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)//")", thermal])

        key = join([key_material, denstiy])
        call json%get(key, self%basic%materials(i)%thermal%density, found)
        call json%print_error_message(output_unit)
        if (.not. found) then
            call json%destroy()
            call error_message(904, c_opt=key)
        else if (any(self%basic%materials(i)%thermal%density(:) <= 0.0d0) .or. &
                 size(self%basic%materials(i)%thermal%density(:)) /= self%basic%materials(i)%phase) then
            call json%destroy()
            call error_message(905, c_opt=key)
        end if

        key = join([key_material, specific_heat])
        call json%get(key, self%basic%materials(i)%thermal%specific_heat, found)
        call json%print_error_message(output_unit)
        if (.not. found) then
            call json%destroy()
            call error_message(904, c_opt=key)
        else if (any(self%basic%materials(i)%thermal%specific_heat(:) <= 0.0d0) .or. &
                 size(self%basic%materials(i)%thermal%specific_heat(:)) /= self%basic%materials(i)%phase) then
            call json%destroy()
            call error_message(905, c_opt=key)
        end if

        key = join([key_material, thermal_conductivity])
        call json%get(key, self%basic%materials(i)%thermal%thermal_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 (any(self%basic%materials(i)%thermal%thermal_conductivity(:) <= 0.0d0) .or. &
                 size(self%basic%materials(i)%thermal%thermal_conductivity(:)) /= self%basic%materials(i)%phase) then
            call json%destroy()
            call error_message(905, c_opt=key)
        end if

        if (self%basic%materials(i)%is_dispersed) then
            key = join([key_material, dispersivity])
            call json%get(key, self%basic%materials(i)%thermal%thermal_conductivity_dispersity, found)
            call json%print_error_message(output_unit)
            if (.not. found) then
                call json%destroy()
                call error_message(904, c_opt=key)
            else if (any(self%basic%materials(i)%thermal%thermal_conductivity_dispersity(:) < 0.0d0) .or. &
                     size(self%basic%materials(i)%thermal%thermal_conductivity_dispersity(:)) /= 2) then
                call json%destroy()
                call error_message(905, c_opt=key)
            end if
        else
            call allocate_array(self%basic%materials(i)%thermal%thermal_conductivity_dispersity, 1)
            self%basic%materials(i)%thermal%thermal_conductivity_dispersity = 0.0d0
        end if

        if (self%basic%materials(i)%is_frozen) then
            key = join([key_material, phase_change, latent_heat, fusion])
            call json%get(key, self%basic%materials(i)%thermal%phase_change%latent_heat_fusion, found)
            call json%print_error_message(output_unit)
            if (.not. found) then
                call json%destroy()
                call error_message(904, c_opt=key)
            end if
            if (self%basic%materials(i)%thermal%phase_change%latent_heat_fusion <= 0.0d0) then
                call json%destroy()
                call error_message(905, c_opt=key)
            end if

            key = join([key_material, phase_change, freezeing_temperature])
            call json%get(key, self%basic%materials(i)%thermal%phase_change%freezing_temperature, 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)%thermal%phase_change%freezing_temperature > 0.0d0) then
                call json%destroy()
                call error_message(905, c_opt=key)
            end if

            key = join([key_material, phase_change, unfrozen_water_model])
            call read_parameters_materials_wrf(self%basic%materials(i)%thermal%phase_change%wrf, json, key)

            key = join([key_material, phase_change, equilibrium_model, segregation])
            call json%get(key, self%basic%materials(i)%thermal%phase_change%gcc%is_segregation, found)
            call json%print_error_message(output_unit)
            if (.not. found) then
                call json%destroy()
                call error_message(904, c_opt=key)
            end if

            key = join([key_material, phase_change, equilibrium_model, unit])
            call json%get(key, self%basic%materials(i)%thermal%phase_change%gcc%unit, 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. any(valid_gcc_units(:) == self%basic%materials(i)%thermal%phase_change%gcc%unit)) then
                call json%destroy()
                call error_message(905, c_opt=key)
            end if

        end if

    end subroutine read_parameters_materials_thermal