From 78daba50fa991f5949f427c0e8d8001b9549c0b4 Mon Sep 17 00:00:00 2001 From: Robert Hallberg Date: Sun, 6 Apr 2025 07:30:08 -0400 Subject: [PATCH] *Restore PFv parentheses for symmetry with FMAs Restore the parentheses to the expressions for PFv in btloop_update_v so that the model will once again respect rotational symmetry when fused-multiply-adds are enabled. These parentheses were in the corresponding expressions until PR #845 to dev/gfdl when they were inadvertently omitted. This commit changes answers (and restores rotational symmetry) when fused-multiply-adds are enabled. --- src/core/MOM_barotropic.F90 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/MOM_barotropic.F90 b/src/core/MOM_barotropic.F90 index 20d0b25be2..6e873c6e30 100644 --- a/src/core/MOM_barotropic.F90 +++ b/src/core/MOM_barotropic.F90 @@ -3077,8 +3077,8 @@ subroutine btloop_update_v(dtbt, ubt, vbt, v_accel_bt, & do J=Js_v,Je_v ; do i=is_v,ie_v Cor_v(i,J) = -1.0*((amer(I-1,j) * ubt(I-1,j) + bmer(I,j) * ubt(I,j)) + & (cmer(I,j+1) * ubt(I,j+1) + dmer(I-1,j+1) * ubt(I-1,j+1))) - Cor_ref_v(i,J) - PFv(i,J) = ((eta_PF_BT(i,j)-eta_PF(i,j))*gtot_N(i,j) - & - (eta_PF_BT(i,j+1)-eta_PF(i,j+1))*gtot_S(i,j+1)) * & + PFv(i,J) = (((eta_PF_BT(i,j)-eta_PF(i,j))*gtot_N(i,j)) - & + ((eta_PF_BT(i,j+1)-eta_PF(i,j+1))*gtot_S(i,j+1))) * & dgeo_de * CS%IdyCv(i,J) enddo ; enddo !$OMP end do nowait @@ -3087,8 +3087,8 @@ subroutine btloop_update_v(dtbt, ubt, vbt, v_accel_bt, & do J=Js_v,Je_v ; do i=is_v,ie_v Cor_v(i,J) = -1.0*((amer(I-1,j) * ubt(I-1,j) + cmer(I,j+1) * ubt(I,j+1)) + & (bmer(I,j) * ubt(I,j) + dmer(I-1,j+1) * ubt(I-1,j+1))) - Cor_ref_v(i,J) - PFv(i,J) = ((eta_PF_BT(i,j)-eta_PF(i,j))*gtot_N(i,j) - & - (eta_PF_BT(i,j+1)-eta_PF(i,j+1))*gtot_S(i,j+1)) * & + PFv(i,J) = (((eta_PF_BT(i,j)-eta_PF(i,j))*gtot_N(i,j)) - & + ((eta_PF_BT(i,j+1)-eta_PF(i,j+1))*gtot_S(i,j+1))) * & dgeo_de * CS%IdyCv(i,J) enddo ; enddo !$OMP end do nowait