Convert the extended domain index to ic
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(supercell_type), | intent(in) | :: | self | |||
integer, | intent(in) | :: | iex | |||
integer, | intent(out) | :: | ic |
subroutine sc_iex_to_ic(self,iex,ic)
use theta_grid, only: ntgrid
implicit none
class(supercell_type), intent(in) :: self
integer, intent(in) :: iex
integer, intent(out) :: ic
integer :: ifl, iex_tmp
!First work out how many fields there are
call self%iex_to_ifl(iex,ifl)
!Ensure we're looking between 1 and self%nextend
iex_tmp=iex-(ifl-1)*self%nextend
ic=MIN(int((iex_tmp-1)/(2*ntgrid))+1,self%ncell)
end subroutine sc_iex_to_ic