Skip to content

Commit d0c6835

Browse files
kshedstromHallberg-NOAA
authored andcommitted
Adding back in the deallocate on some OBC arrays
1 parent 3a1fafc commit d0c6835

File tree

1 file changed

+31
-20
lines changed

1 file changed

+31
-20
lines changed

src/core/MOM_open_boundary.F90

Lines changed: 31 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -353,26 +353,26 @@ module MOM_open_boundary
353353
type(remapping_CS), pointer :: remap_h_CS=> NULL() !< ALE remapping control structure for
354354
!! thickness-based fields on segments
355355
type(OBC_registry_type), pointer :: OBC_Reg => NULL() !< Registry type for boundaries
356-
real, pointer :: rx_normal(:,:,:) !< Array storage for normal phase speed for EW radiation OBCs in units of
357-
!! grid points per timestep [nondim]
358-
real, pointer :: ry_normal(:,:,:) !< Array storage for normal phase speed for NS radiation OBCs in units of
359-
!! grid points per timestep [nondim]
360-
real, pointer :: rx_oblique_u(:,:,:) !< X-direction oblique boundary condition radiation speeds squared
361-
!! at u points for restarts [L2 T-2 ~> m2 s-2]
362-
real, pointer :: ry_oblique_u(:,:,:) !< Y-direction oblique boundary condition radiation speeds squared
363-
!! at u points for restarts [L2 T-2 ~> m2 s-2]
364-
real, pointer :: rx_oblique_v(:,:,:) !< X-direction oblique boundary condition radiation speeds squared
365-
!! at v points for restarts [L2 T-2 ~> m2 s-2]
366-
real, pointer :: ry_oblique_v(:,:,:) !< Y-direction oblique boundary condition radiation speeds squared
367-
!! at v points for restarts [L2 T-2 ~> m2 s-2]
368-
real, pointer :: cff_normal_u(:,:,:) !< Denominator for normalizing EW oblique boundary condition radiation
369-
!! rates at u points for restarts [L2 T-2 ~> m2 s-2]
370-
real, pointer :: cff_normal_v(:,:,:) !< Denominator for normalizing NS oblique boundary condition radiation
371-
!! rates at v points for restarts [L2 T-2 ~> m2 s-2]
372-
real, pointer :: tres_x(:,:,:,:) => Null() !< Array storage of tracer reservoirs for restarts,
373-
!! in unscaled units [conc]
374-
real, pointer :: tres_y(:,:,:,:) => Null() !< Array storage of tracer reservoirs for restarts,
375-
!! in unscaled units [conc]
356+
real, pointer :: rx_normal(:,:,:) => Null() !< Array storage for normal phase speed for EW radiation OBCs
357+
!! in units of grid points per timestep [nondim]
358+
real, pointer :: ry_normal(:,:,:) => Null() !< Array storage for normal phase speed for NS radiation OBCs
359+
!! in units of grid points per timestep [nondim]
360+
real, pointer :: rx_oblique_u(:,:,:) => Null() !< X-direction oblique boundary condition radiation speeds
361+
!! squared at u points for restarts [L2 T-2 ~> m2 s-2]
362+
real, pointer :: ry_oblique_u(:,:,:) => Null() !< Y-direction oblique boundary condition radiation speeds
363+
!! squared at u points for restarts [L2 T-2 ~> m2 s-2]
364+
real, pointer :: rx_oblique_v(:,:,:) => Null() !< X-direction oblique boundary condition radiation speeds
365+
!! squared at v points for restarts [L2 T-2 ~> m2 s-2]
366+
real, pointer :: ry_oblique_v(:,:,:) => Null() !< Y-direction oblique boundary condition radiation speeds
367+
!! squared at v points for restarts [L2 T-2 ~> m2 s-2]
368+
real, pointer :: cff_normal_u(:,:,:) => Null() !< Denominator for normalizing EW oblique boundary condition
369+
!! radiation rates at u points for restarts [L2 T-2 ~> m2 s-2]
370+
real, pointer :: cff_normal_v(:,:,:) => Null() !< Denominator for normalizing NS oblique boundary condition
371+
!! radiation rates at v points for restarts [L2 T-2 ~> m2 s-2]
372+
real, pointer :: tres_x(:,:,:,:) => Null() !< Array storage of tracer reservoirs for restarts,
373+
!! in unscaled units [conc]
374+
real, pointer :: tres_y(:,:,:,:) => Null() !< Array storage of tracer reservoirs for restarts,
375+
!! in unscaled units [conc]
376376
logical :: debug !< If true, write verbose checksums for debugging purposes.
377377
real :: silly_h !< A silly value of thickness outside of the domain that can be used to test
378378
!! the independence of the OBCs to this external data [Z ~> m].
@@ -2018,6 +2018,17 @@ subroutine open_boundary_dealloc(OBC)
20182018
if (allocated(OBC%segment)) deallocate(OBC%segment)
20192019
if (allocated(OBC%segnum_u)) deallocate(OBC%segnum_u)
20202020
if (allocated(OBC%segnum_v)) deallocate(OBC%segnum_v)
2021+
if (associated(OBC%rx_normal)) deallocate(OBC%rx_normal)
2022+
if (associated(OBC%ry_normal)) deallocate(OBC%ry_normal)
2023+
if (associated(OBC%rx_oblique_u)) deallocate(OBC%rx_oblique_u)
2024+
if (associated(OBC%ry_oblique_u)) deallocate(OBC%ry_oblique_u)
2025+
if (associated(OBC%rx_oblique_v)) deallocate(OBC%rx_oblique_v)
2026+
if (associated(OBC%ry_oblique_v)) deallocate(OBC%ry_oblique_v)
2027+
if (associated(OBC%cff_normal_u)) deallocate(OBC%cff_normal_u)
2028+
if (associated(OBC%cff_normal_v)) deallocate(OBC%cff_normal_v)
2029+
if (associated(OBC%tres_x)) deallocate(OBC%tres_x)
2030+
if (associated(OBC%tres_y)) deallocate(OBC%tres_y)
2031+
20212032
if (associated(OBC%rx_normal)) nullify(OBC%rx_normal)
20222033
if (associated(OBC%ry_normal)) nullify(OBC%ry_normal)
20232034
if (associated(OBC%rx_oblique_u)) nullify(OBC%rx_oblique_u)

0 commit comments

Comments
 (0)