Skip to content

Commit

Permalink
Another fix for DEBUG_OBC
Browse files Browse the repository at this point in the history
  • Loading branch information
kshedstrom committed Oct 31, 2023
1 parent 9a174ef commit 9bb4cd9
Showing 1 changed file with 15 additions and 27 deletions.
42 changes: 15 additions & 27 deletions src/core/MOM_open_boundary.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2210,23 +2210,19 @@ subroutine radiation_open_bdry_conds(OBC, u_new, u_old, v_new, v_old, G, GV, US,
real :: ry_new, ry_avg ! coefficients for radiation [nondim] or [L2 T-2 ~> m2 s-2]
real :: cff_new, cff_avg ! denominator in oblique [L2 T-2 ~> m2 s-2]
real, allocatable, dimension(:,:,:) :: &
rx_tang_rad, & ! The phase speed at u-points for tangential oblique OBCs
! in units of grid points per timestep [nondim],
! discretized at the corner (PV) points.
ry_tang_rad, & ! The phase speed at v-points for tangential oblique OBCs
! in units of grid points per timestep [nondim],
! discretized at the corner (PV) points.
rx_tang_obl, & ! The x-coefficient for tangential oblique OBCs [L2 T-2 ~> m2 s-2],
! discretized at the corner (PV) points.
ry_tang_obl, & ! The y-coefficient for tangential oblique OBCs [L2 T-2 ~> m2 s-2],
! discretized at the corner (PV) points.
cff_tangential, & ! The denominator for tangential oblique OBCs [L2 T-2 ~> m2 s-2],
! discretized at the corner (PV) points.
tres_tmpx, & ! Tracer reservoir at u-points array in rescaled units,
! like [S ~> ppt] for salinity.
tres_tmpy ! Tracer reservoir at v-points array in rescaled units,
! like [S ~> ppt] for salinity.
real :: eps ! A small velocity squared [L2 T-2 ~> m2 s-2]
rx_tang_rad, & ! The phase speed at u-points for tangential oblique OBCs
! in units of grid points per timestep [nondim],
! discretized at the corner (PV) points.
ry_tang_rad, & ! The phase speed at v-points for tangential oblique OBCs
! in units of grid points per timestep [nondim],
! discretized at the corner (PV) points.
rx_tang_obl, & ! The x-coefficient for tangential oblique OBCs [L2 T-2 ~> m2 s-2],
! discretized at the corner (PV) points.
ry_tang_obl, & ! The y-coefficient for tangential oblique OBCs [L2 T-2 ~> m2 s-2],
! discretized at the corner (PV) points.
cff_tangential ! The denominator for tangential oblique OBCs [L2 T-2 ~> m2 s-2],
! discretized at the corner (PV) points.
real :: eps ! A small velocity squared [L2 T-2 ~> m2 s-2]
type(OBC_segment_type), pointer :: segment => NULL()
integer :: i, j, k, is, ie, js, je, m, nz, n
integer :: is_obc, ie_obc, js_obc, je_obc
Expand Down Expand Up @@ -3321,20 +3317,12 @@ subroutine radiation_open_bdry_conds(OBC, u_new, u_old, v_new, v_old, G, GV, US,
haloshift=0, symmetric=sym, scale=1.0/US%L_T_to_m_s**2)
endif
if (OBC%ntr == 0) return
allocate(tres_tmpx(SZIB_(G),SZJ_(G),SZK_(GV)))
allocate(tres_tmpy(SZI_(G),SZJB_(G),SZK_(GV)))
if (.not. allocated (OBC%tres_x) .or. .not. allocated (OBC%tres_y)) return
do m=1,OBC%ntr
do k=1,nz ; do j=G%HI%jsd,G%HI%jed ; do I=G%HI%IsdB,G%HI%IedB
tres_tmpx(I,j,k) = OBC%tres_x(I,j,k,m)
enddo ; enddo ; enddo
do k=1,nz ; do J=G%HI%JsdB,G%HI%JedB ; do i=G%HI%isd,G%HI%ied
tres_tmpy(i,J,k) = OBC%tres_y(i,J,k,m)
enddo ; enddo ; enddo
write(var_num,'(I3.3)') m
call uvchksum("radiation_OBCs: OBC%tres_[xy]_"//var_num, tres_tmpx(:,:,:), tres_tmpy(:,:,:), G%HI, &
call uvchksum("radiation_OBCs: OBC%tres_[xy]_"//var_num, OBC%tres_x(:,:,:,m), OBC%tres_y(:,:,:,m), G%HI, &
haloshift=0, symmetric=sym, scale=1.0)
enddo
deallocate(tres_tmpx, tres_tmpy)
endif

end subroutine radiation_open_bdry_conds
Expand Down

0 comments on commit 9bb4cd9

Please sign in to comment.