compare_boundary Function

public function compare_boundary(bound_info, npts_loc_new, ids_loc_new, pts_loc_new, label) result(passed)

Uses

  • proc~~compare_boundary~~UsesGraph proc~compare_boundary compare_boundary decomp_2d decomp_2d proc~compare_boundary->decomp_2d module~modibm modibm proc~compare_boundary->module~modibm module~modmpi modmpi proc~compare_boundary->module~modmpi module~modibmdata modibmdata module~modibm->module~modibmdata mpi mpi module~modibm->mpi module~modmpi->mpi

Arguments

Type IntentOptional Attributes Name
type(bound_info_type), intent(in) :: bound_info
integer, intent(in) :: npts_loc_new
integer, intent(in) :: ids_loc_new(:)
integer, intent(in) :: pts_loc_new(:,:)
character(len=*), intent(in) :: label

Return Value logical


Called by

proc~~compare_boundary~~CalledByGraph proc~compare_boundary compare_boundary proc~tests_read_sparse_ijk tests_read_sparse_ijk proc~tests_read_sparse_ijk->proc~compare_boundary proc~execute_runmode_actions execute_runmode_actions proc~execute_runmode_actions->proc~tests_read_sparse_ijk program~udales uDALES program~udales->proc~execute_runmode_actions

Source Code

  function compare_boundary(bound_info, npts_loc_new, ids_loc_new, pts_loc_new, label) result(passed)
    use modmpi, only : myid
    use modibm, only : bound_info_type
    use decomp_2d, only : zstart, zend
    
    type(bound_info_type), intent(in) :: bound_info
    integer, intent(in) :: npts_loc_new
    integer, intent(in) :: ids_loc_new(:), pts_loc_new(:,:)
    character(len=*), intent(in) :: label
    logical :: passed
    integer :: m
    
    passed = .true.
    
    if (npts_loc_new /= bound_info%nbndptsrank) then
      write(*, '(A,I0,A,A,A)') 'FAIL on rank ', myid, ': ', trim(label), ' count mismatch'
      passed = .false.
      return
    end if
    
    do m = 1, bound_info%nbndptsrank
      if (ids_loc_new(m) /= bound_info%bndptsrank(m)) then
        write(*, '(A,I0,A,A,A)') 'FAIL on rank ', myid, ': ', trim(label), ' index mismatch'
        passed = .false.
        return
      end if
      if (pts_loc_new(m,1) /= bound_info%bndpts_loc(m,1) .or. &
          pts_loc_new(m,2) /= bound_info%bndpts_loc(m,2) .or. &
          pts_loc_new(m,3) /= bound_info%bndpts_loc(m,3)) then
        write(*, '(A,I0,A,A,A)') 'FAIL on rank ', myid, ': ', trim(label), ' coordinate mismatch'
        passed = .false.
        return
      end if
    end do
    
  end function compare_boundary