Changeset 41c5343


Ignore:
Timestamp:
12/15/10 18:20:30 (2 years ago)
Author:
Oleg Batrashev <ogbash@…>
Branches:
master, external, fix-prolong, refactor, refactor-subsolvers
Children:
609702e
Parents:
82697a3
git-author:
Oleg Batrashev <ogbash@…> (12/15/10 18:20:30)
git-committer:
Oleg Batrashev <ogbash@…> (12/15/10 18:20:30)
Message:

Sort values in sum_with_interf subroutine.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/solvers/subsolvers.F90

    r82697a3 r41c5343  
    2727  use DOUG_utils 
    2828  use Fact_class 
     29  use SpMtx_class 
     30  use SpMtx_arrangement 
    2931  implicit none 
    3032 
     
    4951contains 
    5052 
    51   subroutine sum_with_interf(nnz, val, indi, indj, & 
    52                              nnz_interf, val_interf, indi_interf, indj_interf, & 
    53                              snnz, sval, sindi, sindj) 
     53  subroutine sum_with_interf(nfreds, & 
     54       nnz, val, indi, indj, & 
     55       nnz_interf, val_interf, indi_interf, indj_interf, & 
     56       snnz, sval, sindi, sindj) 
    5457    implicit none 
    55     integer,intent(in) :: nnz 
     58    integer,intent(in) :: nnz, nfreds 
    5659    real(kind=rk),dimension(:) :: val 
    5760    integer,dimension(:) :: indi,indj 
     
    6366    integer,dimension(:) :: sindi,sindj 
    6467    integer :: i, ii 
     68    type(SpMtx) :: TmpA ! temporary sparse matrix to sort the entries 
    6569 
    6670    if (numprocs==1.or..not.present(nnz_interf)) then  
     
    7377      enddo 
    7478    else 
     79      TmpA = SpMtx_newInit(nnz,nrows=nfreds,indi=indi(1:nnz),indj=indj(1:nnz),val=val(1:nnz)) 
     80      call SpMtx_arrange(TmpA,sort=.true.) 
     81      indi(1:nnz) = TmpA%indi; indj(1:nnz) = TmpA%indj; val(1:nnz) = TmpA%val 
     82      call SpMtx_destroy(TmpA) 
     83       
    7584      i=1;ii=1 
    7685      snnz=0 
     
    974983      else !}{ 
    975984        ! the case of a single subdomain per processor: 
    976         call sum_with_interf(nnz, val, indi, indj, & 
    977                              nnz_interf, val_interf, indi_interf, indj_interf, & 
    978                              snnz, sval, sindi, sindj) 
     985        call sum_with_interf(nfreds, & 
     986             nnz, val, indi, indj, & 
     987             nnz_interf, val_interf, indi_interf, indj_interf, & 
     988             snnz, sval, sindi, sindj) 
    979989        nselind=nfreds 
    980990        selind(1:nselind)=(/ (i,i=1,nselind) /) 
     
    13611371        else !-} {- 
    13621372          ! the case of a single subdomain per processor: 
    1363           call sum_with_interf(nnz, val, indi, indj, & 
    1364                                nnz_interf, val_interf, indi_interf, indj_interf, & 
    1365                                snnz, sval, sindi, sindj) 
     1373          call sum_with_interf(nfreds, & 
     1374               nnz, val, indi, indj, & 
     1375               nnz_interf, val_interf, indi_interf, indj_interf, & 
     1376               snnz, sval, sindi, sindj) 
    13661377          nselind=nfreds 
    13671378          selind(1:nselind)=(/ (i,i=1,nselind) /) 
Note: See TracChangeset for help on using the changeset viewer.