Skip to content

Commit 8ddd0c1

Browse files
Hallberg-NOAAmarshallward
authored andcommitted
(*)Corrected OBC allocated tests in advect_y
Corrected two allocated tests for OBC-related arrays in advect_y, bringing them into conformity with what was already being done in advect_x. Given the nature of these changes, it seems likely that any case that would have worked before will give bitwise identical answers, but that segmentation faults might now be avoided in certain configurations using OBCs.
1 parent c8a6269 commit 8ddd0c1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/tracer/MOM_tracer_advect.F90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -967,7 +967,7 @@ subroutine advect_y(Tr, hprev, vhr, vh_neglect, OBC, domore_v, ntr, Idt, &
967967
(vhr(i,J,k) < 0.0) .and. (segment%direction == OBC_DIRECTION_N)) then
968968
vhh(i,J) = vhr(i,J,k)
969969
do m=1,ntr
970-
if (allocated(segment%tr_Reg%Tr(m)%t)) then
970+
if (allocated(segment%tr_Reg%Tr(m)%tres)) then
971971
flux_y(i,m,J) = vhh(i,J)*OBC%segment(n)%tr_Reg%Tr(m)%tres(i,J,k)
972972
else ; flux_y(i,m,J) = vhh(i,J)*OBC%segment(n)%tr_Reg%Tr(m)%OBC_inflow_conc ; endif
973973
enddo
@@ -990,7 +990,7 @@ subroutine advect_y(Tr, hprev, vhr, vh_neglect, OBC, domore_v, ntr, Idt, &
990990
(vhr(i,J,k) < 0.0) .and. (G%mask2dT(i,j+1) < 0.5)) then
991991
vhh(i,J) = vhr(i,J,k)
992992
do m=1,ntr
993-
if (allocated(segment%tr_Reg%Tr(m)%t)) then
993+
if (allocated(segment%tr_Reg%Tr(m)%tres)) then
994994
flux_y(i,m,J) = vhh(i,J)*segment%tr_Reg%Tr(m)%tres(i,J,k)
995995
else ; flux_y(i,m,J) = vhh(i,J)*segment%tr_Reg%Tr(m)%OBC_inflow_conc ; endif
996996
enddo

0 commit comments

Comments
 (0)