diff --git a/driver-mct/main/seq_nlmap_mod.F90 b/driver-mct/main/seq_nlmap_mod.F90 index a235a2e7e913..d89cd33255a6 100644 --- a/driver-mct/main/seq_nlmap_mod.F90 +++ b/driver-mct/main/seq_nlmap_mod.F90 @@ -252,7 +252,9 @@ subroutine sort_rowcols(m, idxs) arow = mct_sMat_indexIA(m, 'grow') acol = mct_sMat_indexIA(m, 'gcol') - allocate(idxs(nnz), v(nnz)) + allocate(idxs(nnz)) + if (nnz == 0) return + allocate(v(nnz)) maxrow = 0 do i = 1, nnz @@ -260,6 +262,7 @@ subroutine sort_rowcols(m, idxs) maxrow = max(maxrow, row) end do minrow = maxrow + mincol = m%data%iAttr(acol,1) do i = 1, nnz row = m%data%iAttr(arow,i) col = m%data%iAttr(acol,i)