From f837dc59ba270a658c5f87d7210085789663e01e Mon Sep 17 00:00:00 2001 From: Andrew Shao Date: Thu, 13 Oct 2016 17:57:27 -0400 Subject: [PATCH] Answer changes were due to aggressive compiler optimizations on workstation. 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. --- src/core/MOM.F90 | 3 +-- src/parameterizations/vertical/MOM_diabatic_driver.F90 | 7 +++---- src/tracer/MOM_tracer_hor_diff.F90 | 6 +++--- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/core/MOM.F90 b/src/core/MOM.F90 index c9bbf647d4..74f8c1d90a 100644 --- a/src/core/MOM.F90 +++ b/src/core/MOM.F90 @@ -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 @@ -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, & diff --git a/src/parameterizations/vertical/MOM_diabatic_driver.F90 b/src/parameterizations/vertical/MOM_diabatic_driver.F90 index 88fceebd61..0ffc550558 100644 --- a/src/parameterizations/vertical/MOM_diabatic_driver.F90 +++ b/src/parameterizations/vertical/MOM_diabatic_driver.F90 @@ -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) @@ -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) @@ -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) diff --git a/src/tracer/MOM_tracer_hor_diff.F90 b/src/tracer/MOM_tracer_hor_diff.F90 index 9049072e7e..643404e670 100644 --- a/src/tracer/MOM_tracer_hor_diff.F90 +++ b/src/tracer/MOM_tracer_hor_diff.F90 @@ -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 @@ -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 @@ -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: "// &