From 9fc77673b4abd6e564b3e173d53449db1aa4eb50 Mon Sep 17 00:00:00 2001 From: Adam Nelson Date: Thu, 4 Apr 2013 15:13:30 -0400 Subject: [PATCH] Fixed a GNU 4.7.2 error with PETSCs MatSetVar, which expected a 1-D array and not a scalar. 4.6.3 let it pass just fine, oddly. --- src/cmfd_input.F90 | 8 ++++++-- src/cmfd_jacobian_operator.F90 | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/cmfd_input.F90 b/src/cmfd_input.F90 index 09a712ec22..d087a3b003 100644 --- a/src/cmfd_input.F90 +++ b/src/cmfd_input.F90 @@ -78,9 +78,13 @@ contains cmfd%egrid = (/0.0_8,20.0_8/) cmfd % indices(4) = 1 ! one energy group end if - + ! set global albedo - cmfd % albedo = mesh_ % albedo + if (associated(mesh_ % albedo)) then + cmfd % albedo = mesh_ % albedo + else + cmfd % albedo = (/1.0, 1.0, 1.0, 1.0, 1.0, 1.0/) + end if ! get acceleration map if (associated(mesh_ % map)) then diff --git a/src/cmfd_jacobian_operator.F90 b/src/cmfd_jacobian_operator.F90 index 2b1f1f12ce..b5532b66a7 100644 --- a/src/cmfd_jacobian_operator.F90 +++ b/src/cmfd_jacobian_operator.F90 @@ -250,7 +250,7 @@ contains call MatGetRow(ctx%loss%M, irow, ncols, cols, vals, ierr) ! set that row to Jacobian matrix - call MatSetValues(jac_prec, 1, irow, ncols, cols(1:ncols), vals, & + call MatSetValues(jac_prec, 1, (/irow/), ncols, cols(1:ncols), vals, & INSERT_VALUES, ierr) ! restore the row @@ -283,7 +283,7 @@ contains ! set values in last row of matrix if (rank == n_procs_cmfd - 1) then phi_tmp = -phi_tmp ! negate the transpose - call MatSetValues(jac_prec, 1, n, n, (/(k,k=0,n-1)/), phi_tmp, & + call MatSetValues(jac_prec, 1, (/n/), n, (/(k,k=0,n-1)/), phi_tmp, & INSERT_VALUES, ierr) call MatSetValue(jac_prec, n, n, ONE, INSERT_VALUES, ierr) end if