This routine sets the ID array in iwork
, indicating which components are differential
and which are algebraic.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | mx | |||
integer, | intent(in) | :: | my | |||
integer, | intent(in) | :: | ns | |||
integer, | intent(in) | :: | nsd | |||
integer, | intent(in) | :: | lid | |||
integer, | intent(inout) | :: | iwork(*) |
pure subroutine setid(mx, my, ns, nsd, lid, iwork) !! This routine sets the ID array in `iwork`, indicating which components are differential !! and which are algebraic. integer, intent(in) :: mx integer, intent(in) :: my integer, intent(in) :: ns integer, intent(in) :: nsd integer, intent(in) :: lid integer, intent(inout) :: iwork(*) integer :: i, i0, i00, jx, jy, nsdp1 nsdp1 = nsd + 1 do jy = 1, my i00 = mx*ns*(jy - 1) + lid do jx = 1, mx i0 = i00 + ns*(jx - 1) do i = 1, nsd iwork(i0 + i) = 1 end do do i = nsdp1, ns iwork(i0 + i) = -1 end do end do end do end subroutine setid