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_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