Skip to content

Commit

Permalink
Fix for an OBC issue with mask_tables
Browse files Browse the repository at this point in the history
 - Without this, if part of your OBC is filled with land mask and
   if that land mask contains a masked out tile, you will generate
   a NaN from the phase speed calculation where h is negative in the
   halo neighbor of that masked tile.
  • Loading branch information
kshedstrom committed Dec 6, 2023
1 parent b54a72e commit cbbb16c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/MOM_open_boundary.F90
Original file line number Diff line number Diff line change
Expand Up @@ -3919,7 +3919,7 @@ subroutine update_OBC_segment_data(G, GV, US, OBC, tv, h, Time)
segment%Htot(I,j) = segment%Htot(I,j) + segment%h(I,j,k)
segment%dZtot(I,j) = segment%dZtot(I,j) + dz(i+ishift,j,k)
enddo
segment%Cg(I,j) = sqrt(GV%g_prime(1) * segment%dZtot(I,j))
segment%Cg(I,j) = sqrt(GV%g_prime(1) * max(0.0, segment%dZtot(I,j)))
enddo
else! (segment%direction == OBC_DIRECTION_N .or. segment%direction == OBC_DIRECTION_S)
allocate(normal_trans_bt(segment%HI%isd:segment%HI%ied,segment%HI%JsdB:segment%HI%JedB), source=0.0)
Expand All @@ -3933,7 +3933,7 @@ subroutine update_OBC_segment_data(G, GV, US, OBC, tv, h, Time)
segment%Htot(i,J) = segment%Htot(i,J) + segment%h(i,J,k)
segment%dZtot(i,J) = segment%dZtot(i,J) + dz(i,j+jshift,k)
enddo
segment%Cg(i,J) = sqrt(GV%g_prime(1) * segment%dZtot(i,J))
segment%Cg(i,J) = sqrt(GV%g_prime(1) * max(0.0, segment%dZtot(i,J)))
enddo
endif

Expand Down

0 comments on commit cbbb16c

Please sign in to comment.