wsweetspots Subroutine

public subroutine wsweetspots(sym, sdim, nfac, facs, npmax, LUN)

Writes out sweetspot core counts for a layout sym: character string label for each dimension sdim: size of each dimension nfac: #factors of each sdim facs(i,j): ith factor of jth dimension

Arguments

Type IntentOptional Attributes Name
character(len=3), intent(in), dimension(:) :: sym
integer, intent(in), dimension(:) :: sdim
integer, intent(in), dimension(:) :: nfac
integer, intent(in), dimension(:,:) :: facs
integer, intent(in) :: npmax
integer, optional :: LUN

Contents

Source Code


Source Code

  subroutine wsweetspots(sym,sdim,nfac,facs,npmax,LUN)
    implicit none
    character(3), dimension(:), intent(in):: sym
    integer, dimension(:), intent(in):: sdim, nfac
    integer, dimension(:,:), intent(in):: facs
    integer, intent(in):: npmax
    integer, optional:: LUN
    integer :: lout=6, npe, i, j, lcores, nfacs
    if (present(LUN)) lout=LUN
    nfacs=size(nfac)
    lcores=1
    write (lout, fmt="('  npe = ',i8,'  (',a,')')") 1,trim(sym(1))
    do i=1,nfacs
       do j=2,nfac(i)
          npe=facs(j,i)*lcores
          if (npe .gt. npmax) exit
          write (lout, fmt="('  npe = ',i8,'  (',a,')')") npe,trim(sym(i))
       enddo
       lcores=lcores*sdim(i)
    enddo
  end subroutine wsweetspots