read_conditions_time_control_simulation_period Subroutine

subroutine read_conditions_time_control_simulation_period(self, json)

Load the time control parameters from the JSON file

Arguments

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

JSON parser


Calls

proc~~read_conditions_time_control_simulation_period~~CallsGraph proc~read_conditions_time_control_simulation_period read_conditions_time_control_simulation_period destroy destroy proc~read_conditions_time_control_simulation_period->destroy get get proc~read_conditions_time_control_simulation_period->get proc~error_message error_message proc~read_conditions_time_control_simulation_period->proc~error_message proc~join join proc~read_conditions_time_control_simulation_period->proc~join log_error log_error proc~error_message->log_error

Called by

proc~~read_conditions_time_control_simulation_period~~CalledByGraph proc~read_conditions_time_control_simulation_period read_conditions_time_control_simulation_period proc~read_conditions_time_control read_conditions_time_control proc~read_conditions_time_control->proc~read_conditions_time_control_simulation_period proc~inout_read_conditions inout_read_conditions proc~inout_read_conditions->proc~read_conditions_time_control interface~inout_read_conditions type_input%inout_read_conditions interface~inout_read_conditions->proc~inout_read_conditions proc~initialize_type_input type_input%initialize_type_input proc~initialize_type_input->interface~inout_read_conditions

Source Code

    subroutine read_conditions_time_control_simulation_period(self, json)
        !> Load the time control parameters from the JSON file
        implicit none
        class(type_input) :: self
        type(json_file), intent(inout) :: json !! JSON parser

        character(:), allocatable :: key
        logical :: found

        key = join([time_control, simulation_period, unit])
        call json%get(key, self%conditions%time_control%simulation_period%unit, found=found)
        if (.not. found) then
            call json%destroy()
            call error_message(904, c_opt=key)
        end if
        if (.not. any(valid_units(:) == self%conditions%time_control%simulation_period%unit)) then
            call json%destroy()
            call error_message(905, c_opt=key)
        end if

        key = join([time_control, simulation_period, start])
        call json%get(key, self%conditions%time_control%simulation_period%start, found=found)
        if (.not. found) then
            call json%destroy()
            call error_message(904, c_opt=key)
        end if

        key = join([time_control, simulation_period, end])
        call json%get(key, self%conditions%time_control%simulation_period%end, found=found)
        if (.not. found) then
            call json%destroy()
            call error_message(904, c_opt=key)
        else if (self%conditions%time_control%simulation_period%start >= self%conditions%time_control%simulation_period%end) then
            call json%destroy()
            call error_message(905, c_opt=key)
        end if

    end subroutine read_conditions_time_control_simulation_period