From d38da4e84e50ea701818c8abe3c804cbb83ec81a Mon Sep 17 00:00:00 2001 From: Eric Morway Date: Wed, 22 May 2024 13:37:56 -0700 Subject: [PATCH] skip writing of flow-ja-face when only one reach --- src/Utilities/BudgetTerm.f90 | 38 +++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/src/Utilities/BudgetTerm.f90 b/src/Utilities/BudgetTerm.f90 index 4dd332dc89f..2722d49abe9 100644 --- a/src/Utilities/BudgetTerm.f90 +++ b/src/Utilities/BudgetTerm.f90 @@ -205,24 +205,26 @@ subroutine save_flows(this, dis, ibinun, kstp, kper, delt, pertim, totim, & end do ! ! -- Write the header - call ubdsv06(kstp, kper, this%flowtype, & - this%text1id1, this%text2id1, & - this%text1id2, this%text2id2, & - ibinun, this%naux, this%auxtxt, & - nlist, 1, 1, nlist, & - iout, delt, pertim, totim) - ! - ! -- Write each entry - do i = 1, this%nlist - q = this%flow(i) - n1 = this%id1(i) - n2 = this%id2(i) - if (n1 <= 0 .or. n2 <= 0) cycle - call dis%record_mf6_list_entry(ibinun, n1, n2, q, & - this%naux, this%auxvar(:, i), & - olconv=this%olconv1, & - olconv2=this%olconv2) - end do + if (nlist > 0) then + call ubdsv06(kstp, kper, this%flowtype, & + this%text1id1, this%text2id1, & + this%text1id2, this%text2id2, & + ibinun, this%naux, this%auxtxt, & + nlist, 1, 1, nlist, & + iout, delt, pertim, totim) + ! + ! -- Write each entry + do i = 1, this%nlist + q = this%flow(i) + n1 = this%id1(i) + n2 = this%id2(i) + if (n1 <= 0 .or. n2 <= 0) cycle + call dis%record_mf6_list_entry(ibinun, n1, n2, q, & + this%naux, this%auxvar(:, i), & + olconv=this%olconv1, & + olconv2=this%olconv2) + end do + end if ! end subroutine save_flows