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