Skip to content

Commit

Permalink
(*)Corrected OBC allocated tests in advect_y
Browse files Browse the repository at this point in the history
  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.
  • Loading branch information
Hallberg-NOAA authored and marshallward committed Jul 20, 2022
1 parent c8a6269 commit 8ddd0c1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/tracer/MOM_tracer_advect.F90
Original file line number Diff line number Diff line change
Expand Up @@ -967,7 +967,7 @@ subroutine advect_y(Tr, hprev, vhr, vh_neglect, OBC, domore_v, ntr, Idt, &
(vhr(i,J,k) < 0.0) .and. (segment%direction == OBC_DIRECTION_N)) then
vhh(i,J) = vhr(i,J,k)
do m=1,ntr
if (allocated(segment%tr_Reg%Tr(m)%t)) then
if (allocated(segment%tr_Reg%Tr(m)%tres)) then
flux_y(i,m,J) = vhh(i,J)*OBC%segment(n)%tr_Reg%Tr(m)%tres(i,J,k)
else ; flux_y(i,m,J) = vhh(i,J)*OBC%segment(n)%tr_Reg%Tr(m)%OBC_inflow_conc ; endif
enddo
Expand All @@ -990,7 +990,7 @@ subroutine advect_y(Tr, hprev, vhr, vh_neglect, OBC, domore_v, ntr, Idt, &
(vhr(i,J,k) < 0.0) .and. (G%mask2dT(i,j+1) < 0.5)) then
vhh(i,J) = vhr(i,J,k)
do m=1,ntr
if (allocated(segment%tr_Reg%Tr(m)%t)) then
if (allocated(segment%tr_Reg%Tr(m)%tres)) then
flux_y(i,m,J) = vhh(i,J)*segment%tr_Reg%Tr(m)%tres(i,J,k)
else ; flux_y(i,m,J) = vhh(i,J)*segment%tr_Reg%Tr(m)%OBC_inflow_conc ; endif
enddo
Expand Down

0 comments on commit 8ddd0c1

Please sign in to comment.