diff --git a/src/core/MOM.F90 b/src/core/MOM.F90 index 826bfd8892..06d8d11435 100644 --- a/src/core/MOM.F90 +++ b/src/core/MOM.F90 @@ -128,7 +128,7 @@ module MOM ! ODA modules use MOM_oda_driver_mod, only : ODA_CS, oda, init_oda, oda_end -use MOM_oda_driver_mod, only : set_prior_tracer, set_analysis_time, get_posterior_tracer +use MOM_oda_driver_mod, only : set_prior_tracer, set_analysis_time, apply_oda_tracer_increments ! Offline modules use MOM_offline_main, only : offline_transport_CS, offline_transport_init, update_offline_fields use MOM_offline_main, only : insert_offline_main, extract_offline_main, post_offline_convergence_diags @@ -445,11 +445,6 @@ subroutine step_MOM(forces, fluxes, sfc_state, Time_start, time_interval, CS, Wa h ! h : layer thickness (meter (Bouss) or kg/m2 (non-Bouss)) real :: I_wt_ssh - real, pointer, dimension(:,:,:) :: ha !< The layer thicknesses on the analysis grid - !! returned by call to get_posterior_tracer - type(thermo_var_ptrs), pointer :: tva !< A structure pointing to various thermodynamic variables - !! on the analysis grid returned by call to get_posterior_tracer - type(time_type) :: Time_local, end_time_thermo, Time_temp type(group_pass_type) :: pass_tau_ustar_psurf logical :: showCallTree @@ -799,8 +794,6 @@ subroutine step_MOM(forces, fluxes, sfc_state, Time_start, time_interval, CS, Wa call set_prior_tracer(CS%Time, G, GV, CS%h, CS%tv, CS%odaCS) ! call DA interface call oda(CS%Time,CS%odaCS) - ! update increments to model state if needed - call get_posterior_tracer(CS%Time, CS%odaCS,G, GV, ha, tva,increment=.true.) endif if (showCallTree) call callTree_waypoint("calling extract_surface_state (step_MOM)") @@ -1119,6 +1112,8 @@ subroutine step_MOM_thermo(CS, G, GV, u, v, h, tv, fluxes, dtdia, Time_end_therm call enable_averaging(dtdia, Time_end_thermo, CS%diag) + call apply_oda_tracer_increments(dtdia,G,tv,h,CS%odaCS) + if (update_BBL) then ! Calculate the BBL properties and store them inside visc (u,h). ! This is here so that CS%visc is updated before diabatic() when diff --git a/src/ocean_data_assim/MOM_oda_driver.F90 b/src/ocean_data_assim/MOM_oda_driver.F90 index 1cc45675f1..6fe553a234 100644 --- a/src/ocean_data_assim/MOM_oda_driver.F90 +++ b/src/ocean_data_assim/MOM_oda_driver.F90 @@ -70,7 +70,7 @@ module MOM_oda_driver_mod private public :: init_oda, oda_end, set_prior_tracer, get_posterior_tracer - public :: set_analysis_time, oda, save_obs_diff + public :: set_analysis_time, oda, save_obs_diff, apply_oda_tracer_increments #include @@ -557,5 +557,13 @@ subroutine save_obs_diff(filename,CS) return end subroutine save_obs_diff + subroutine apply_oda_tracer_increments(dt,G,tv,h,CS) + real, intent(in) :: dt ! the tracer timestep (seconds) + type(ocean_grid_type), intent(in) :: G !< ocean grid structure + type(thermo_var_ptrs), intent(inout) :: tv !< A structure pointing to various thermodynamic variables + real, dimension(SZI_(G),SZJ_(G),SZK_(G)), & + intent(in) :: h !< layer thickness (m or kg/m2) + type(odaCS), intent(inout) :: CS !< the data assimilation structure + end subroutine apply_oda_tracer_increments end module MOM_oda_driver_mod