The main documentation of the Valid_State_Multi_Mesh Procedure contains additional explanation of this code listing.
function Valid_State_Multi_Mesh (Mesh) result(Valid) ! Input variables. ! Variable to be checked. type(Multi_Mesh_type), intent(in) :: Mesh ! Output variables. type(logical) :: Valid ! Logical state. ! Internal variables. !type(integer) :: NSlice ! Number of Values in a "slice" of the Mesh. !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ! Start out true. Valid = .true. ! Check for association of pointered internals. !Valid = Valid .and. ASSOCIATED(Mesh%One_Structure) !Valid = Valid .and. ASSOCIATED(Mesh%Many_Structure) !Valid = Valid .and. ASSOCIATED(Mesh%Many_of_One_Index) !if (.not.Valid) return ! Check for validity of internals. !VERIFY(NDimensions .eq. 1 .eqv. Shape .eq. "Segmented",5) !etc. Valid = Valid .and. Initialized(Mesh) !Valid = Valid .and. Valid_State(Mesh%A_Dimensionality) !Valid = Valid .and. Valid_State(Mesh%Dimensionality) Valid = Valid .and. Valid_State(Mesh%NDimensions) !Valid = Valid .and. Valid_State(Mesh%Many_Structure) !Valid = Valid .and. Valid_State(Mesh%Many_of_One_Index) Valid = Valid .and. Valid_State(Mesh%Name) !Valid = Valid .and. Valid_State(Mesh%One_Structure) !select case (Mesh%A_Dimensionality) !case (1) ! Valid = Valid .and. Valid_State(Mesh%Values1) !case (2) ! Valid = Valid .and. Valid_State(Mesh%Values2) !case (3) ! Valid = Valid .and. Valid_State(Mesh%Values3) !case (4) ! Valid = Valid .and. Valid_State(Mesh%Values4) !case (5) ! Valid = Valid .and. Valid_State(Mesh%Values5) !case (-1) ! Valid = Valid .and. Valid_State(Mesh%ValuesRR) !end select Valid = Valid .and. Valid_State(Mesh%Version) if (.not.Valid) return ! Checks on the validity of Mesh. !Valid = Valid .and. Mesh%A_Dimensionality == & ! Mesh%Dimensionality + Mesh%Many_of_One_Index%Dimensionality - 1 return end function Valid_State_Multi_Mesh