Skip to content

Commit

Permalink
Ice-shelf FMAs (NOAA-GFDL#729)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
alex-huth authored Oct 7, 2024
1 parent b240e7e commit f90b071
Show file tree
Hide file tree
Showing 2 changed files with 121 additions and 121 deletions.
8 changes: 4 additions & 4 deletions src/ice_shelf/MOM_ice_shelf.F90
Original file line number Diff line number Diff line change
Expand Up @@ -450,11 +450,11 @@ subroutine shelf_calc_flux(sfc_state_in, fluxes_in, Time, time_step_in, CS)
I_au = 0.0 ; if (asu1 + asu2 > 0.0) I_au = 1.0 / (asu1 + asu2)
I_av = 0.0 ; if (asv1 + asv2 > 0.0) I_av = 1.0 / (asv1 + asv2)
if (allocated(sfc_state%taux_shelf) .and. allocated(sfc_state%tauy_shelf)) then
taux2 = (asu1 * sfc_state%taux_shelf(I-1,j)**2 + asu2 * sfc_state%taux_shelf(I,j)**2 ) * I_au
tauy2 = (asv1 * sfc_state%tauy_shelf(i,J-1)**2 + asv2 * sfc_state%tauy_shelf(i,J)**2 ) * I_av
taux2 = (((asu1 * (sfc_state%taux_shelf(I-1,j)**2)) + (asu2 * (sfc_state%taux_shelf(I,j)**2)) ) * I_au)
tauy2 = (((asv1 * (sfc_state%tauy_shelf(i,J-1)**2)) + (asv2 * (sfc_state%tauy_shelf(i,J)**2)) ) * I_av)
endif
u2_av = (asu1 * sfc_state%u(I-1,j)**2 + asu2 * sfc_state%u(I,j)**2) * I_au
v2_av = (asv1 * sfc_state%v(i,J-1)**2 + asu2 * sfc_state%v(i,J)**2) * I_av
u2_av = (((asu1 * (sfc_state%u(I-1,j)**2)) + (asu2 * sfc_state%u(I,j)**2)) * I_au)
v2_av = (((asv1 * (sfc_state%v(i,J-1)**2)) + (asu2 * sfc_state%v(i,J)**2)) * I_av)

if ((taux2 + tauy2 > 0.0) .and. .not.CS%ustar_shelf_from_vel) then
if (CS%ustar_max >= 0.0) then
Expand Down
Loading

0 comments on commit f90b071

Please sign in to comment.