Initialise the members of the cell instance
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(cell_type), | intent(inout) | :: | self | |||
integer, | intent(in) | :: | ic | |||
integer, | intent(in) | :: | it | |||
integer, | intent(in) | :: | is | |||
integer, | intent(in) | :: | ik | |||
integer, | intent(in) | :: | nfield | |||
integer, | intent(in) | :: | nrow | |||
integer, | intent(in) | :: | nextend | |||
logical, | intent(in) | :: | ignore_boundary |
subroutine c_init(self, ic, it, is, ik, nfield, nrow, nextend, ignore_boundary)
use theta_grid, only: ntgrid
implicit none
class(cell_type), intent(in out) :: self
integer, intent(in) :: ic, it, is, ik, nfield, nrow, nextend
logical, intent(in) :: ignore_boundary
integer :: ifq
! Store basic cell properties
self%nrb = nfield
self%ic_ind = ic
self%it_ind = it
self%ignore_boundary = ignore_boundary
! Store parent properties
self%is_ind = is
self%ik_ind = ik
! Store related/derived properties
self%row_llim = 1
self%row_ulim = nrow
self%nrow = nrow
self%ncol = 2 * ntgrid
if (.not. ignore_boundary) self%ncol = self%ncol + 1
allocate (self%col_llim(nfield), self%col_ulim(nfield))
do ifq = 1, nfield
self%col_llim(ifq) = 1 + (ic - 1) + (2 * ntgrid) + (ifq - 1) * nrow
self%col_ulim(ifq) = self%col_llim(ifq) + self%ncol - 1
end do
self%ncol_tot = self%ncol * nfield
allocate (self%rb(self%nrb))
!Now make row block objects
do ifq = 1, nfield
call self%rb(ifq)%init(ifq, ic, it, is, ik, self%ncol, nextend)
end do
end subroutine c_init