H.2.3 Valid_State_Ortho_Diffusion Procedure

The main documentation of the Valid_State_Ortho_Diffusion Procedure contains additional explanation of this code listing.

  function Valid_State_Ortho_Diffusion (Diff_Term) result(Valid)

    ! Input variables.

    ! Variable to be checked.
    type(Ortho_Diffusion_type), intent(in) :: Diff_Term  

    ! Output variables.

    type(logical) :: Valid             ! Logical state.


    ! Start out true.

    Valid = .true.

    ! Check for association of pointered internals.

    Valid = Valid .and. ASSOCIATED(Diff_Term%Mesh)
    Valid = Valid .and. ASSOCIATED(Diff_Term%Structure)
    if (.not.Valid) return

    ! Check for validity of internals.

    Valid = Valid .and. Initialized(Diff_Term)
    Valid = Valid .and. Valid_State(Diff_Term%Coefficient)
    Valid = Valid .and. Valid_State(Diff_Term%Equation)
    Valid = Valid .and. Valid_State(Diff_Term%Extrapolation)
    Valid = Valid .and. Valid_State(Diff_Term%Locus)
    Valid = Valid .and. Valid_State(Diff_Term%Name)
    Valid = Valid .and. Valid_State(Diff_Term%NEquations)
    Valid = Valid .and. Valid_State(Diff_Term%Phi)
    if (.not.Valid) return

    ! Checks on the validity of Diff_Term.

    Valid = Valid .and. Diff_Term%Extrapolation /= zero
    Valid = Valid .and. &
            (Diff_Term%Equation .InInterval. (/ 1, Diff_Term%NEquations /))

  end function Valid_State_Ortho_Diffusion

Michael L. Hall