| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(krn_t), | intent(inout) | :: | me | |||
| class(port_t), | intent(in) | :: | port1 | |||
| class(port_t), | intent(in) | :: | port2 | |||
| integer, | intent(in) | :: | col(:) |
relative indexes of the variables placed into global matrix |
||
| integer, | intent(in) | :: | row(:) |
relative indexes of the variables placed into global matrix |
||
| type(dbl_pointer_t), | intent(in) | :: | val(:) |
pointer to the value which should be placed into global matrix |
||
| type(dbl_pointer_t), | intent(out), | optional | :: | val_out(:) |
in case of overlapping matrix |
subroutine krn_coo_add_link(me,port1,port2,col,row,val,val_out) class(krn_t), intent(inout) :: me class(port_t), intent(in) :: port1, port2 integer, intent(in) :: col(:), row(:) !! relative indexes of the variables placed into global matrix type(dbl_pointer_t), intent(in) :: val(:) !! pointer to the value which should be placed into global matrix type(dbl_pointer_t), optional, intent(out) :: val_out(:) !! in case of overlapping matrix integer :: i type(FF_flux_port_t) :: FF_flux_port type(SS_flux_port_t) :: SS_flux_port if (.not.same_type_as(port1,FF_flux_port) .and. .not.same_type_as(port1,SS_flux_port)) then me%exp%coo_col(me%exp%idx:me%exp%idx+size(col)-1) = col + (port2%loc - 1) me%exp%coo_row(me%exp%idx:me%exp%idx+size(col)-1) = row + (port1%loc - 1) me%exp%coo_ptr(me%exp%idx:me%exp%idx+size(col)-1) = val me%exp%idx = me%exp%idx + size(val) end if if (present(val_out)) then val_out(1)%p => null() if (port1%can_be_shared .and. port2%can_be_shared) then do i=1,me%imp%idx if( me%imp%coo_col(i)==col(1)+(port2%loc-1) .and. & me%imp%coo_row(i)==row(1)+(port1%loc-1)) then val_out(:) = me%imp%coo_ptr(i:i+size(col)-1) return endif enddo endif endif me%imp%coo_col(me%imp%idx:me%imp%idx+size(col)-1) = col + (port2%loc - 1) me%imp%coo_row(me%imp%idx:me%imp%idx+size(col)-1) = row + (port1%loc - 1) me%imp%coo_ptr(me%imp%idx:me%imp%idx+size(col)-1) = val me%imp%idx = me%imp%idx + size(val) end subroutine krn_coo_add_link