Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(type_initial_local), | intent(inout) | :: | initial_condition | |||
type(json_file), | intent(inout) | :: | json |
JSON parser |
||
character(len=*), | intent(in) | :: | key_base |
Base key for the initial condition |
||
integer(kind=int32), | intent(in), | optional | :: | num_boundaries |
Number of boundaries for the initial condition |
subroutine read_conditions_initial_conditions_porosity(initial_condition, json, key_base, num_boundaries) implicit none type(type_initial_local), intent(inout) :: initial_condition type(json_file), intent(inout) :: json !! JSON parser character(*), intent(in) :: key_base !! Base key for the initial condition integer(int32), intent(in), optional :: num_boundaries !! Number of boundaries for the initial condition character(:), allocatable :: key logical :: found integer(int32) :: i key = join([key_base, type]) call json%get(key, initial_condition%type, found=found) if (.not. found) then call json%destroy() call error_message(904, c_opt=key) end if if (.not. any(valid_initial_condition_types(:) == initial_condition%type)) then call json%destroy() call error_message(905, c_opt=key) end if select case (initial_condition%type) case (valid_initial_condition_types(1)) ! uniform key = join([key_base, value]) call json%get(key, initial_condition%value, found=found) if (.not. found) then call json%destroy() call error_message(904, c_opt=key) end if case (valid_initial_condition_types(2)) ! laplace case (valid_initial_condition_types(3)) ! file key = join([key_base, field_name]) call json%get(key, initial_condition%field_name, found=found) if (.not. found) then call json%destroy() call error_message(904, c_opt=key) end if end select end subroutine read_conditions_initial_conditions_porosity