Skip to content

Commit f90b071

Browse files
authored
Ice-shelf FMAs (#729)
* Fixes to preserve rotational symmetry when using Fused-multiply-adds Tested in ice-ocean mode and ice-shelf-only mode using ISOMIP and MISOMIP+, respectively * Added more parentheses to preserve rotational symmetry when using FMAs. Note that the changes here are to the MOM_ice_shelf_dynamics.F90 function 'quad_area', which is only called by the subroutine 'bilinear_shape_functions'; this subroutine is currently unused so that rotationally-consistent use of FMAs in both 'quad_area' and 'bilinear_shape_functions' has not been tested
1 parent b240e7e commit f90b071

File tree

2 files changed

+121
-121
lines changed

2 files changed

+121
-121
lines changed

src/ice_shelf/MOM_ice_shelf.F90

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -450,11 +450,11 @@ subroutine shelf_calc_flux(sfc_state_in, fluxes_in, Time, time_step_in, CS)
450450
I_au = 0.0 ; if (asu1 + asu2 > 0.0) I_au = 1.0 / (asu1 + asu2)
451451
I_av = 0.0 ; if (asv1 + asv2 > 0.0) I_av = 1.0 / (asv1 + asv2)
452452
if (allocated(sfc_state%taux_shelf) .and. allocated(sfc_state%tauy_shelf)) then
453-
taux2 = (asu1 * sfc_state%taux_shelf(I-1,j)**2 + asu2 * sfc_state%taux_shelf(I,j)**2 ) * I_au
454-
tauy2 = (asv1 * sfc_state%tauy_shelf(i,J-1)**2 + asv2 * sfc_state%tauy_shelf(i,J)**2 ) * I_av
453+
taux2 = (((asu1 * (sfc_state%taux_shelf(I-1,j)**2)) + (asu2 * (sfc_state%taux_shelf(I,j)**2)) ) * I_au)
454+
tauy2 = (((asv1 * (sfc_state%tauy_shelf(i,J-1)**2)) + (asv2 * (sfc_state%tauy_shelf(i,J)**2)) ) * I_av)
455455
endif
456-
u2_av = (asu1 * sfc_state%u(I-1,j)**2 + asu2 * sfc_state%u(I,j)**2) * I_au
457-
v2_av = (asv1 * sfc_state%v(i,J-1)**2 + asu2 * sfc_state%v(i,J)**2) * I_av
456+
u2_av = (((asu1 * (sfc_state%u(I-1,j)**2)) + (asu2 * sfc_state%u(I,j)**2)) * I_au)
457+
v2_av = (((asv1 * (sfc_state%v(i,J-1)**2)) + (asu2 * sfc_state%v(i,J)**2)) * I_av)
458458

459459
if ((taux2 + tauy2 > 0.0) .and. .not.CS%ustar_shelf_from_vel) then
460460
if (CS%ustar_max >= 0.0) then

0 commit comments

Comments
 (0)