Skip to content

Commit

Permalink
Answer changes were due to aggressive compiler optimizations on works…
Browse files Browse the repository at this point in the history
…tation. adding -fp-model precise and -fp-model source now leaves answers unchanged in a small suit of test cases. Some typos were fixed, but otherwise this code should work fine.
  • Loading branch information
Andrew Shao committed Oct 13, 2016
1 parent cb796e0 commit f837dc5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
3 changes: 1 addition & 2 deletions src/core/MOM.F90
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ module MOM
type(time_type) :: Z_diag_interval !< amount of time between calculating Z-space diagnostics
type(time_type) :: Z_diag_time !< next time to compute Z-space diagnostics
type(time_type), pointer :: Time !< pointer to ocean clock
real :: rel_time = 0.0 !< relative time (sec) sinc.e start of current execution
real :: rel_time = 0.0 !< relative time (sec) since start of current execution
real :: dtbt_reset_period !< The time interval in seconds between dynamic
!! recalculation of the barotropic time step. If
!! this is negative, it is never calculated, and
Expand Down Expand Up @@ -1002,7 +1002,6 @@ subroutine step_MOM(fluxes, state, Time_start, time_interval, CS)

call cpu_clock_begin(id_clock_tracer)

! Post fields used for offline tracer model
call advect_tracer(h, CS%uhtr, CS%vhtr, CS%OBC, CS%dt_trans, G, GV, &
CS%tracer_adv_CSp, CS%tracer_Reg)
call tracer_hordiff(h, CS%dt_trans, CS%MEKE, CS%VarMix, G, GV, &
Expand Down
7 changes: 3 additions & 4 deletions src/parameterizations/vertical/MOM_diabatic_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,7 @@ subroutine diabatic(u, v, h, tv, fluxes, visc, ADp, CDp, dt, G, GV, CS)
dSV_dS, & ! and salinity in m^3/(kg K) and m^3/(kg ppt).
cTKE, & ! convective TKE requirements for each layer in J/m^2.
u_h, & ! zonal and meridional velocities at thickness points after
v_h, & ! entrainment (m/s)
hloss_boundary ! Change in layer thickness because of freshwater fluxes at the surfac
v_h ! entrainment (m/s)

real, dimension(SZI_(G),SZJ_(G),CS%nMode) :: &
cn ! baroclinic gravity wave speeds (formerly cg1 - BDM)
Expand Down Expand Up @@ -1143,7 +1142,7 @@ subroutine diabatic(u, v, h, tv, fluxes, visc, ADp, CDp, dt, G, GV, CS)
if (CS%useALEalgorithm) then
! For passive tracers, the changes in thickness due to boundary fluxes has yet to be applied
! so hold should be h_orig
call call_tracer_column_fns(h_prebound, h, eatr, ebtr, fluxes, dt, G, GV, tv, &
call call_tracer_column_fns(h_prebound, h, ea, eb, fluxes, dt, G, GV, tv, &
CS%optics, CS%tracer_flow_CSp, CS%debug, &
evap_CFL_limit = CS%diabatic_aux_CSp%evap_CFL_limit, &
minimum_forcing_depth = CS%diabatic_aux_CSp%minimum_forcing_depth)
Expand Down Expand Up @@ -1186,7 +1185,7 @@ subroutine diabatic(u, v, h, tv, fluxes, visc, ADp, CDp, dt, G, GV, CS)
else
if (CS%useALEalgorithm) then
! For passive tracers, the changes in thickness due to boundary fluxes has yet to be applied
call call_tracer_column_fns(h_prebound, h, ea, eb, fluxes, dt, G, GV, tv, &
call call_tracer_column_fns(h_prebound, h, eatr, ebtr, fluxes, dt, G, GV, tv, &
CS%optics, CS%tracer_flow_CSp, CS%debug, &
evap_CFL_limit = CS%diabatic_aux_CSp%evap_CFL_limit, &
minimum_forcing_depth = CS%diabatic_aux_CSp%minimum_forcing_depth)
Expand Down
6 changes: 3 additions & 3 deletions src/tracer/MOM_tracer_hor_diff.F90
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ subroutine tracer_hordiff(h, dt, MEKE, VarMix, G, GV, CS, Reg, tv, do_online_fla
logical, optional :: do_online_flag
real, dimension(SZIB_(G),SZJ_(G)), optional, intent(in) :: read_khdt_x
real, dimension(SZI_(G),SZJB_(G)), optional, intent(in) :: read_khdt_y

logical :: do_online = .true.


real, dimension(SZI_(G),SZJ_(G)) :: &
Ihdxdy, & ! The inverse of the volume or mass of fluid in a layer in a
Expand All @@ -128,7 +127,7 @@ subroutine tracer_hordiff(h, dt, MEKE, VarMix, G, GV, CS, Reg, tv, do_online_fla
Kh_v ! Tracer mixing coefficient at u-points, in m2 s-1.

real :: max_CFL ! The global maximum of the diffusive CFL number.
logical :: use_VarMix, Resoln_scaled
logical :: use_VarMix, Resoln_scaled, do_online
integer :: i, j, k, m, is, ie, js, je, nz, ntr, itt, num_itts
real :: I_numitts ! The inverse of the number of iterations, num_itts.
real :: scale ! The fraction of khdt_x or khdt_y that is applied in this
Expand All @@ -143,6 +142,7 @@ subroutine tracer_hordiff(h, dt, MEKE, VarMix, G, GV, CS, Reg, tv, do_online_fla

is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = GV%ke

do_online = .true.
if (present(do_online_flag)) do_online = do_online_flag

if (.not. associated(CS)) call MOM_error(FATAL, "MOM_tracer_hor_diff: "// &
Expand Down

0 comments on commit f837dc5

Please sign in to comment.