Load the basic material 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_basic(self, json, i) !> Load the basic material 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)//")"]) key = join([key_material, id]) call json%get(key, self%basic%materials(i)%id, 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, name]) call json%get(key, self%basic%materials(i)%name, found) call json%print_error_message(output_unit) if (.not. found) self%basic%materials(i)%name = "Material_"//to_string(i) self%basic%materials(i)%name = trim(adjustl(self%basic%materials(i)%name)) key = join([key_material, phase]) call json%get(key, self%basic%materials(i)%phase, 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)%phase, 1, 4)) then call json%destroy() call error_message(905, c_opt=key) end if key = join([key_material, is_frozen]) call json%get(key, self%basic%materials(i)%is_frozen, found) call json%print_error_message(output_unit) if (.not. found) self%basic%materials(i)%is_frozen = .false. key = join([key_material, is_dispersed]) call json%get(key, self%basic%materials(i)%is_dispersed, found) call json%print_error_message(output_unit) if (.not. found) self%basic%materials(i)%is_dispersed = .false. end subroutine read_parameters_materials_basic