Skip to content

Commit

Permalink
new interface apply_oda_tracer_increments
Browse files Browse the repository at this point in the history
  • Loading branch information
MJHarrison-GFDL committed Apr 23, 2018
1 parent 6a4c369 commit a45a176
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
11 changes: 3 additions & 8 deletions src/core/MOM.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)")
Expand Down Expand Up @@ -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
Expand Down
10 changes: 9 additions & 1 deletion src/ocean_data_assim/MOM_oda_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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 <MOM_memory.h>

Expand Down Expand Up @@ -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

0 comments on commit a45a176

Please sign in to comment.