Skip to content

Commit f8e65ba

Browse files
authored
Fix frazil halo update bug when unallocated (#949)
If FRAZIL=False tv%frazil is not allocated but its halo might still be updated in post_diabatic_halo_updates, which will fail. If FRAZIL=True, no answers are changed. If FRAZIL=False, no answers from before this bug was introduced are changed.
1 parent c478543 commit f8e65ba

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/core/MOM.F90

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1966,7 +1966,8 @@ subroutine post_diabatic_halo_updates(CS, G, GV, US, u, v, h, tv)
19661966
call create_group_pass(pass_uv_T_S_h, h, G%Domain, halo=dynamics_stencil)
19671967
call do_group_pass(pass_uv_T_S_h, G%Domain, clock=id_clock_pass)
19681968

1969-
if ((.not.tv%frazil_was_reset) .and. CS%vertex_shear) call pass_var(tv%frazil, G%Domain, halo=1)
1969+
if (associated(tv%frazil) .and. (.not.tv%frazil_was_reset) .and. CS%vertex_shear) &
1970+
call pass_var(tv%frazil, G%Domain, halo=1)
19701971

19711972
! Update derived thermodynamic quantities.
19721973
if (allocated(tv%SpV_avg)) then

0 commit comments

Comments
 (0)