sc_iex_to_dims Subroutine

private subroutine sc_iex_to_dims(self, iex, ig, ic, it, ifl)

Uses

Convert the extended domain index to ig, it and ifl

Type Bound

supercell_type

Arguments

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

Contents

Source Code


Source Code

  subroutine sc_iex_to_dims(self,iex,ig,ic,it,ifl)
    use theta_grid, only: ntgrid
    implicit none
    class(supercell_type), intent(in) :: self
    integer, intent(in) :: iex
    integer, intent(out) :: ig,ic,it,ifl

    !Get field index
    ifl=1+int((iex-1)/self%nextend)
    
    !Get cell and it index
    ic=min(self%ncell,1+int((iex-(ifl-1)*self%nextend-1)/(2*ntgrid)))
    it=self%cells(ic)%it_ind

    !Get ig index
    ig=-ntgrid+iex-(ifl-1)*self%nextend-1-2*ntgrid*(ic-1)
  end subroutine sc_iex_to_dims