Skip to content

Commit

Permalink
Avoids a SEGV when OBC are not in use with bi-harmonic friction
Browse files Browse the repository at this point in the history
- If OBC is not associated, the if expression could lead to a segmentation
  violation even when apply_OBC is false.
- No answer changes.
  • Loading branch information
adcroft committed Jul 28, 2017
1 parent f42c970 commit fccb7ae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/parameterizations/lateral/MOM_hor_visc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ subroutine horizontal_viscosity(u, v, h, diffu, diffv, MEKE, VarMix, G, GV, CS,
v0(i,J) = CS%IDXDY2v(i,J)*(CS%DY2q(I,J)*sh_xy(I,J) - CS%DY2q(I-1,J)*sh_xy(I-1,J)) - &
CS%IDX2dyCv(i,J)*(CS%DX2h(i,j+1)*sh_xx(i,j+1) - CS%DX2h(i,j)*sh_xx(i,j))
enddo ; enddo
if (apply_OBC .and. OBC%zero_biharmonic) then
if (apply_OBC) then; if (OBC%zero_biharmonic) then
do n=1,OBC%number_of_segments
I = OBC%segment(n)%HI%IsdB ; J = OBC%segment(n)%HI%JsdB
if (OBC%segment(n)%is_N_or_S .and. (J >= Jsq-1) .and. (J <= Jeq+1)) then
Expand All @@ -542,7 +542,7 @@ subroutine horizontal_viscosity(u, v, h, diffu, diffv, MEKE, VarMix, G, GV, CS,
enddo
endif
enddo
endif
endif; endif
endif

do j=Jsq,Jeq+1 ; do i=Isq,Ieq+1
Expand Down

0 comments on commit fccb7ae

Please sign in to comment.