sc_iex_to_ig Subroutine

private subroutine sc_iex_to_ig(self, iex, ig)

Uses

Convert the extended domain index to ig

Type Bound

supercell_type

Arguments

Type IntentOptional Attributes Name
class(supercell_type), intent(in) :: self
integer, intent(in) :: iex
integer, intent(out) :: ig

Contents

Source Code


Source Code

  subroutine sc_iex_to_ig(self,iex,ig)
    use theta_grid, only: ntgrid
    implicit none
    class(supercell_type), intent(in) :: self
    integer, intent(in) :: iex
    integer, intent(out) :: ig
    integer :: iex_tmp, ifl
    !First get ifl
    call self%iex_to_ifl(iex,ifl)
    !Limit to 1 and self%nextend
    iex_tmp=iex-(ifl-1)*self%nextend
    
    if(iex_tmp==self%nextend) then
       ig=ntgrid
    else
       ig=-ntgrid+mod(iex_tmp-1,2*ntgrid)
    endif
  end subroutine sc_iex_to_ig