diff --git a/config_src/solo_driver/MOM_driver.F90 b/config_src/solo_driver/MOM_driver.F90 index ed6f4826bd..6095761247 100644 --- a/config_src/solo_driver/MOM_driver.F90 +++ b/config_src/solo_driver/MOM_driver.F90 @@ -174,7 +174,7 @@ program MOM_main logical :: do_online ! If true, use the model in prognostic mode where ! the barotropic and baroclinic dynamics, thermodynamics, ! etc. are stepped forward integrated in time. - ! If false, the all of the above are bypassed with all + ! If false, then all of the above are bypassed with all ! fields necessary to integrate only the tracer advection ! and diffusion equation are read in from files stored from ! a previous integration of the prognostic model @@ -260,17 +260,18 @@ program MOM_main else Start_time = set_time(0,days=0) endif - + if (sum(date) >= 0) then ! In this case, the segment starts at a time fixed by ocean_solo.res segment_start_time = set_date(date(1),date(2),date(3),date(4),date(5),date(6)) Time = segment_start_time - call initialize_MOM(Time, param_file, dirs, MOM_CSp, segment_start_time) + ! Note the not before CS%d + call initialize_MOM(Time, param_file, dirs, MOM_CSp, segment_start_time, do_online_out = do_online) else ! In this case, the segment starts at a time read from the MOM restart file ! or left as Start_time by MOM_initialize. Time = Start_time - call initialize_MOM(Time, param_file, dirs, MOM_CSp) + call initialize_MOM(Time, param_file, dirs, MOM_CSp, do_online_out=do_online) endif fluxes%C_p = MOM_CSp%tv%C_p ! Copy the heat capacity for consistency. @@ -308,16 +309,7 @@ program MOM_main call get_param(param_file, mod, "DT_FORCING", time_step, & "The time step for changing forcing, coupling with other \n"//& "components, or potentially writing certain diagnostics. \n"//& - "The default value is given by DT.", units="s", default=dt) - - call get_param(param_file, mod, "DO_ONLINE", do_online, & - "If true, use the model in prognostic mode where\n"//& - "the barotropic and baroclinic dynamics, thermodynamics,\n"//& - "etc. are stepped forward integrated in time.\n"//& - "If false, the all of the above are bypassed with all\n"//& - "fields necessary to integrate only the tracer advection\n"//& - "and diffusion equation are read in from files stored from\n"//& - "a previous integration of the prognostic model", default=.true.) + "The default value is given by DT.", units="s", default=dt) if (.not. do_online) then call get_param(param_file, mod, "DT_OFFLINE", time_step, & "Time step for the offline time step") @@ -478,16 +470,17 @@ program MOM_main call disable_averaging(MOM_CSp%diag) if (do_online) then - if (fluxes%fluxes_used) then - call enable_averaging(fluxes%dt_buoy_accum, Time, MOM_CSp%diag) - call forcing_diagnostics(fluxes, state, fluxes%dt_buoy_accum, grid, & - MOM_CSp%diag, surface_forcing_CSp%handles) - call accumulate_net_input(fluxes, state, fluxes%dt_buoy_accum, grid, sum_output_CSp) - call disable_averaging(MOM_CSp%diag) - else - call MOM_error(FATAL, "The solo MOM_driver is not yet set up to handle "//& - "thermodynamic time steps that are longer than the coupling timestep.") - endif ; endif + if (fluxes%fluxes_used) then + call enable_averaging(fluxes%dt_buoy_accum, Time, MOM_CSp%diag) + call forcing_diagnostics(fluxes, state, fluxes%dt_buoy_accum, grid, & + MOM_CSp%diag, surface_forcing_CSp%handles) + call accumulate_net_input(fluxes, state, fluxes%dt_buoy_accum, grid, sum_output_CSp) + call disable_averaging(MOM_CSp%diag) + else + call MOM_error(FATAL, "The solo MOM_driver is not yet set up to handle "//& + "thermodynamic time steps that are longer than the coupling timestep.") + endif + endif diff --git a/src/core/MOM.F90 b/src/core/MOM.F90 index 25a6a6fc14..15c461fa58 100644 --- a/src/core/MOM.F90 +++ b/src/core/MOM.F90 @@ -201,7 +201,9 @@ module MOM !! set by calling the function useRegridding() from the !! MOM_regridding module. logical :: do_dynamics !< If false, does not call step_MOM_dyn_*. This is an - + !! undocumented run-time flag that is fragile. + logical :: do_online !< If false, step_tracers is called instead of step_MOM. + !! This is intended for running MOM6 in offline tracer mode real :: dt !< (baroclinic) dynamics time step (seconds) real :: dt_therm !< thermodynamics time step (seconds) logical :: thermo_spans_coupling !< If true, thermodynamic and tracer time @@ -464,10 +466,6 @@ subroutine step_MOM(fluxes, state, Time_start, time_interval, CS) eta_av, & ! average sea surface height or column mass over a timestep (meter or kg/m2) ssh ! sea surface height based on eta_av (meter or kg/m2) - real, dimension(SZIB_(CS%G),SZJ_(CS%G),SZK_(CS%G)) :: write_all_3du - real, dimension(SZI_(CS%G),SZJB_(CS%G),SZK_(CS%G)) :: write_all_3dv - real, dimension(SZI_(CS%G),SZJ_(CS%G),SZK_(CS%G)) :: write_all_3dt - real, allocatable, dimension(:,:) :: & tmp, & ! temporary 2d field zos, & ! dynamic sea lev (zero area mean) from inverse-barometer adjusted ssh (meter) @@ -711,7 +709,6 @@ subroutine step_MOM(fluxes, state, Time_start, time_interval, CS) fluxes%fluxes_used = .true. call cpu_clock_end(id_clock_diabatic) - write_all_3dt(:,:,:) = 1. if (CS%id_u_preale > 0) call post_data(CS%id_u_preale, u, CS%diag) if (CS%id_v_preale > 0) call post_data(CS%id_v_preale, v, CS%diag) if (CS%id_h_preale > 0) call post_data(CS%id_h_preale, h, CS%diag) @@ -1006,7 +1003,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, & @@ -1060,7 +1056,6 @@ subroutine step_MOM(fluxes, state, Time_start, time_interval, CS) ! Regridding/remapping is done here, at the end of the thermodynamics time step ! (that may comprise several dynamical time steps) ! The routine 'ALE_main' can be found in 'MOM_ALE.F90'. - write_all_3dt(:,:,:) = 1. if (CS%id_u_preale > 0) call post_data(CS%id_u_preale, u, CS%diag) if (CS%id_v_preale > 0) call post_data(CS%id_v_preale, v, CS%diag) if (CS%id_h_preale > 0) call post_data(CS%id_h_preale, h, CS%diag) @@ -1465,6 +1460,9 @@ subroutine step_tracers(fluxes, state, Time_start, time_interval, CS) integer :: IsdB, IedB, JsdB, JedB logical :: z_first, x_before_y + ! Fail out if do_online is true + if(CS%do_online) call MOM_error(FATAL,"DO_ONLINE=True when calling step_tracers") + ! Grid-related pointer assignments G => CS%G GV => CS%GV @@ -1541,7 +1539,7 @@ subroutine step_tracers(fluxes, state, Time_start, time_interval, CS) ! Do horizontal diffusion first (but only half of it), remainder will be applied after advection call tracer_hordiff(h_pre, CS%offline_CSp%dt_offline*0.5, CS%MEKE, CS%VarMix, G, GV, & - CS%tracer_diff_CSp, CS%tracer_Reg, CS%tv, do_online_flag=.false., read_khdt_x=khdt_x*0.5, & + CS%tracer_diff_CSp, CS%tracer_Reg, CS%tv, do_online_flag=CS%do_online, read_khdt_x=khdt_x*0.5, & read_khdt_y=khdt_y*0.5) do j=jsd,jed ; do i=isd,ied @@ -1843,13 +1841,14 @@ end subroutine step_tracers !> This subroutine initializes MOM. -subroutine initialize_MOM(Time, param_file, dirs, CS, Time_in) +subroutine initialize_MOM(Time, param_file, dirs, CS, Time_in, do_online_out) type(time_type), target, intent(inout) :: Time !< model time, set in this routine type(param_file_type), intent(out) :: param_file !< structure indicating paramater file to parse type(directories), intent(out) :: dirs !< structure with directory paths type(MOM_control_struct), pointer :: CS !< pointer set in this routine to MOM control structure type(time_type), optional, intent(in) :: Time_in !< time passed to MOM_initialize_state when !! model is not being started from a restart file + logical, optional, intent(out) :: do_online_out !< .false. if tracers are being run offline ! local type(ocean_grid_type), pointer :: G => NULL() ! A pointer to a structure with metrics and related @@ -1962,7 +1961,15 @@ subroutine initialize_MOM(Time, param_file, dirs, CS, Time_in) "If False, skips the dynamics calls that update u & v, as well as\n"//& "the gravity wave adjustment to h. This is a fragile feature and\n"//& "thus undocumented.", default=.true., do_not_log=.true. ) - + call get_param(param_file, "MOM", "DO_ONLINE", CS%do_online, & + "If false, use the model in prognostic mode where\n"//& + "the barotropic and baroclinic dynamics, thermodynamics,\n"//& + "etc. are stepped forward integrated in time.\n"//& + "If true, the all of the above are bypassed with all\n"//& + "fields necessary to integrate only the tracer advection\n"//& + "and diffusion equation are read in from files stored from\n"//& + "a previous integration of the prognostic model\n"//& + "NOTE: This option only used in the ocean_solo_driver.", default=.true.) call get_param(param_file, "MOM", "USE_REGRIDDING", CS%use_ALE_algorithm , & "If True, use the ALE algorithm (regridding/remapping).\n"//& "If False, use the layered isopycnal algorithm.", default=.false. ) @@ -1977,8 +1984,8 @@ subroutine initialize_MOM(Time, param_file, dirs, CS, Time_in) call get_param(param_file, "MOM", "THICKNESSDIFFUSE", CS%thickness_diffuse, & "If true, interface heights are diffused with a \n"//& "coefficient of KHTH.", default=.false.) - call get_param(param_file, "MOM", "`_FIRST", & - CS%thickness_diffuse_first, & + call get_param(param_file, "MOM", "THICKNESSDIFFUSE_FIRST", & + CS%thickness_diffuse_first, & "If true, do thickness diffusion before dynamics.\n"//& "This is only used if THICKNESSDIFFUSE is true.", & default=.false.) @@ -2545,9 +2552,14 @@ subroutine initialize_MOM(Time, param_file, dirs, CS, Time_in) cmor_long_name ="Sea Water Salinity") endif - call offline_transport_init(param_file, CS%offline_CSp, CS%diabatic_CSp, G, GV) - call register_diags_offline_transport(Time, CS%diag, CS%offline_CSp) - + ! If running in offline tracer mode, initialize the necessary control structure and + ! parameters + if(present(do_online_out)) do_online_out=CS%do_online + + if(.not. CS%do_online) then + call offline_transport_init(param_file, CS%offline_CSp, CS%diabatic_CSp%diabatic_aux_CSp, G, GV) + call register_diags_offline_transport(Time, CS%diag, CS%offline_CSp) + endif ! This subroutine initializes any tracer packages. new_sim = ((dirs%input_filename(1:1) == 'n') .and. & @@ -2850,7 +2862,7 @@ subroutine register_diags(Time, G, GV, CS, ADp) 'Layer Thickness before diabatic forcing', thickness_units, v_cell_method='sum') CS%id_e_predia = register_diag_field('ocean_model', 'e_predia', diag%axesTi, Time, & 'Interface Heights before diabatic forcing', 'meter') -! if (CS%diabatic_first .and. (.not. CS%adiabatic)) then + if (CS%diabatic_first .and. (.not. CS%adiabatic)) then CS%id_u_preale = register_diag_field('ocean_model', 'u_preale', diag%axesCuL, Time, & 'Zonal velocity before remapping', 'meter second-1') CS%id_v_preale = register_diag_field('ocean_model', 'v_preale', diag%axesCvL, Time, & @@ -2863,7 +2875,7 @@ subroutine register_diags(Time, G, GV, CS, ADp) 'Salinity before remapping', 'ppt') CS%id_e_preale = register_diag_field('ocean_model', 'e_preale', diag%axesTi, Time, & 'Interface Heights before remapping', 'meter') -! endif + endif if (CS%use_temperature) then CS%id_T_predia = register_diag_field('ocean_model', 'temp_predia', diag%axesTL, Time, & diff --git a/src/parameterizations/vertical/MOM_diabatic_aux.F90 b/src/parameterizations/vertical/MOM_diabatic_aux.F90 index cd478faa46..d7379f7a0e 100644 --- a/src/parameterizations/vertical/MOM_diabatic_aux.F90 +++ b/src/parameterizations/vertical/MOM_diabatic_aux.F90 @@ -839,7 +839,7 @@ subroutine applyBoundaryFluxesInOut(CS, G, GV, dt, fluxes, optics, h, tv, & ! Pen_SW_bnd and netMassOut netSalt, & ! surface salt flux ( g(salt)/m2 for non-Bouss and ppt*H for Bouss ) nonpenSW ! non-downwelling SW, which is absorbed at ocean surface - real, dimension(SZI_(G), SZK_(G)) :: h2d, T2d, hloss + real, dimension(SZI_(G), SZK_(G)) :: h2d, T2d real, dimension(SZI_(G), SZK_(G)) :: pen_TKE_2d, dSV_dT_2d real, dimension(max(optics%nbands,1),SZI_(G)) :: Pen_SW_bnd real, dimension(max(optics%nbands,1),SZI_(G),SZK_(G)) :: opacityBand @@ -894,7 +894,6 @@ subroutine applyBoundaryFluxesInOut(CS, G, GV, dt, fluxes, optics, h, tv, & do k=1,nz ; do i=is,ie h2d(i,k) = h(i,j,k) T2d(i,k) = tv%T(i,j,k) - hloss(i,k) = 0.0 do n=1,nsw opacityBand(n,i,k) = (1.0 / GV%m_to_H)*optics%opacity_band(n,i,j,k) enddo @@ -1010,7 +1009,6 @@ subroutine applyBoundaryFluxesInOut(CS, G, GV, dt, fluxes, optics, h, tv, & ! Update state hOld = h2d(i,k) ! Keep original thickness in hand h2d(i,k) = h2d(i,k) + dThickness ! New thickness - hloss(i,k) = dThickness if (h2d(i,k) > 0.0) then if (calculate_energetics .and. (dThickness > 0.)) then ! Calculate the energy required to mix the newly added water over diff --git a/src/parameterizations/vertical/MOM_diabatic_driver.F90 b/src/parameterizations/vertical/MOM_diabatic_driver.F90 index 2da02f34f2..0ffc550558 100644 --- a/src/parameterizations/vertical/MOM_diabatic_driver.F90 +++ b/src/parameterizations/vertical/MOM_diabatic_driver.F90 @@ -158,7 +158,7 @@ module MOM_diabatic_driver integer :: id_Tdif_z = -1, id_Tadv_z = -1, id_Sdif_z = -1, id_Sadv_z = -1 integer :: id_Tdif = -1, id_Tadv = -1, id_Sdif = -1, id_Sadv = -1 integer :: id_MLD_003 = -1, id_MLD_0125 = -1, id_MLD_user = -1, id_mlotstsq = -1 - integer :: id_subMLN2 = -1, id_brine_lay = -1, id_hloss_boundary + integer :: id_subMLN2 = -1, id_brine_lay = -1 integer :: id_diabatic_diff_temp_tend = -1 integer :: id_diabatic_diff_saln_tend = -1 @@ -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) @@ -331,7 +330,6 @@ subroutine diabatic(u, v, h, tv, fluxes, visc, ADp, CDp, dt, G, GV, CS) ! (H units = m for Bouss, kg/m^2 for non-Bouss). real :: dt_mix ! amount of time over which to apply mixing (seconds) real :: Idt ! inverse time step (1/s) - real, dimension(SZI_(G),SZJ_(G),SZK_(G)) :: write_all_3dt type(p3d) :: z_ptrs(7) ! pointers to diagnostics to be interpolated to depth integer :: num_z_diags ! number of diagnostics to be interpolated to depth @@ -777,7 +775,6 @@ subroutine diabatic(u, v, h, tv, fluxes, visc, ADp, CDp, dt, G, GV, CS) (0.5*(h(i,j,k-1) + h(i,j,k)) + h_neglect) eb(i,j,k-1) = eb(i,j,k-1) + Ent_int ea(i,j,k) = ea(i,j,k) + Ent_int -! eb(i,j,k-1) = ea(i,j,k) Kd_int(i,j,K) = Kd_int(i,j,K) + Kd_add_here ! for diagnostics @@ -1138,18 +1135,14 @@ subroutine diabatic(u, v, h, tv, fluxes, visc, ADp, CDp, dt, G, GV, CS) eatr(i,j,k) = eatr(i,j,k) + add_ent endif ; endif enddo ; enddo - - if (CS%useALEalgorithm) then - do i=is,ie ; eatr(i,j,1) = ea(i,j,1) ; enddo - else - do i=is,ie ; eatr(i,j,1) = ea(i,j,1) ; enddo - endif + do i=is,ie ; eatr(i,j,1) = ea(i,j,1) ; enddo + enddo 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) @@ -1192,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) @@ -1414,7 +1407,6 @@ subroutine diabatic(u, v, h, tv, fluxes, visc, ADp, CDp, dt, G, GV, CS) if (CS%id_Kd_salt > 0) call post_data(CS%id_Kd_salt, Kd_salt, CS%diag) if (CS%id_Kd_ePBL > 0) call post_data(CS%id_Kd_ePBL, Kd_ePBL, CS%diag) - write_all_3dt(:,:,:) = 1. if (CS%id_ea > 0) call post_data(CS%id_ea, ea, CS%diag) if (CS%id_eb > 0) call post_data(CS%id_eb, eb, CS%diag) @@ -1938,8 +1930,6 @@ subroutine diabatic_driver_init(Time, G, GV, param_file, useALEalgorithm, diag, 'Layer entrainment from above per timestep','meter') CS%id_eb = register_diag_field('ocean_model','eb',diag%axesTL,Time, & 'Layer entrainment from below per timestep', 'meter') - CS%id_hloss_boundary = register_diag_field('ocean_model','hloss_boundary',diag%axesTL,Time, & - 'Layer thickness lost/gained due to fluxes at the boundary', 'meter') CS%id_dudt_dia = register_diag_field('ocean_model','dudt_dia',diag%axesCuL,Time, & 'Zonal Acceleration from Diapycnal Mixing', 'meter second-2') CS%id_dvdt_dia = register_diag_field('ocean_model','dvdt_dia',diag%axesCvL,Time, & diff --git a/src/tracer/MOM_offline_control.F90 b/src/tracer/MOM_offline_control.F90 index 9702a9d258..74ae28565a 100644 --- a/src/tracer/MOM_offline_control.F90 +++ b/src/tracer/MOM_offline_control.F90 @@ -17,7 +17,7 @@ module MOM_offline_transport use MOM_shortwave_abs, only : optics_type use MOM_diag_mediator, only : post_data use MOM_forcing_type, only : forcing - use MOM_diabatic_driver, only : diabatic_CS + use MOM_diabatic_aux, only : diabatic_aux_CS implicit none @@ -205,7 +205,7 @@ end subroutine transport_by_files subroutine register_diags_offline_transport(Time, diag, CS) type(offline_transport_CS), pointer :: CS !< control structure for MOM - type(time_type), intent(in) :: Time !< current model time + type(time_type), intent(in) :: Time !< current model time type(diag_ctrl) :: diag @@ -227,13 +227,13 @@ subroutine register_diags_offline_transport(Time, diag, CS) end subroutine register_diags_offline_transport - ! Initializes the control structure for offline transport and reads in some of the + !> Initializes the control structure for offline transport and reads in some of the ! run time parameters from MOM_input - subroutine offline_transport_init(param_file, CS, diabatic_CSp, G, GV) + subroutine offline_transport_init(param_file, CS, diabatic_aux_CSp, G, GV) type(param_file_type), intent(in) :: param_file type(offline_transport_CS), pointer, intent(inout) :: CS - type(diabatic_CS), pointer, intent(in) :: diabatic_CSp + type(diabatic_aux_CS), pointer, intent(in) :: diabatic_aux_CSp type(ocean_grid_type), intent(in) :: G type(verticalGrid_type), intent(in) :: GV @@ -289,8 +289,10 @@ subroutine offline_transport_init(param_file, CS, diabatic_CSp, G, GV) if(.not. CS%fields_are_offset) CS%ridx_snap = CS%start_index ! Copy over parameters from other control structures - CS%evap_CFL_limit = diabatic_CSp%diabatic_aux_CSp%evap_CFL_limit - CS%minimum_forcing_depth = diabatic_CSp%diabatic_aux_CSp%minimum_forcing_depth + if(associated(diabatic_aux_CSp)) then + CS%evap_CFL_limit = diabatic_aux_CSp%evap_CFL_limit + CS%minimum_forcing_depth = diabatic_aux_CSp%minimum_forcing_depth + endif call callTree_leave("offline_transport_init") @@ -669,7 +671,7 @@ end subroutine distribute_residual_vh !! -# Repeat steps 1 and 2 !! -# Force a remapping to the stored layer thicknesses that correspond to the snapshot of !! the online model at the end of an accumulation interval -!! -3 Reset T/S and h to their stored snapshotted values to prevent model drift +!! -# Reset T/S and h to their stored snapshotted values to prevent model drift !! !! \section offline_evaluation Evaluating the utility of an offline tracer model !! How well an offline tracer model can be used as an alternative to integrating tracers online diff --git a/src/tracer/MOM_tracer_hor_diff.F90 b/src/tracer/MOM_tracer_hor_diff.F90 index b16497fa5c..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 @@ -119,18 +118,16 @@ subroutine tracer_hordiff(h, dt, MEKE, VarMix, G, GV, CS, Reg, tv, do_online_fla ! the distance between adjacent tracer points, in m2. Coef_x, & ! The coefficients relating zonal tracer differences ! to time-integrated fluxes, in m3 or kg. - Kh_u, & ! Tracer mixing coefficient at u-points, in m2 s-1. - write_all_2du ! Make sure that all the data gets written + Kh_u ! Tracer mixing coefficient at u-points, in m2 s-1. real, dimension(SZI_(G),SZJB_(G)) :: & khdt_y, & ! The value of Khtr*dt times the open face width divided by ! the distance between adjacent tracer points, in m2. Coef_y, & ! The coefficients relating meridional tracer differences ! to time-integrated fluxes, in m3 or kg. - Kh_v, & ! Tracer mixing coefficient at u-points, in m2 s-1. - write_all_2dv ! Make sure that all the data gets written + 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 @@ -145,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: "// & @@ -481,7 +479,6 @@ subroutine tracer_hordiff(h, dt, MEKE, VarMix, G, GV, CS, Reg, tv, do_online_fla call vchksum(Coef_y,"After tracer diffusion Coef_y", G%HI, haloshift=2) endif - write_all_2du = 1. ; write_all_2dv = 1. if (CS%id_khdt_x > 0) call post_data(CS%id_khdt_x, khdt_x, CS%diag) if (CS%id_khdt_y > 0) call post_data(CS%id_khdt_y, khdt_y, CS%diag)